
cx-profiling
Query Coralogix continuous-profiling data with the cx profiling CLI — find which services use the most CPU or memory, which profile types a service has, what profiles can be filtered by, when usage spiked and which pod or version caused it, and which code paths and functions a service spends its CPU or memory on (flame graphs). Use when the user asks "which services use the most CPU", "top memory consumers", "what is service X spending CPU on", "hot functions", "flame graph for a service", "why is this service using so much CPU", "memory allocations by function", "CPU spike by pod", "which version increased CPU", "continuous profiling", "profiling data", or wants to explore profiles of a service. For how much CPU or memory a service or pod uses and whether it is saturated, use cx-service-catalog instead.
- Installs
- 128
- Last 24h
- +76
- Trending rank
- #2391
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/coralogix/cx-cli --skill cx-profiling- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads cx-profiling automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Profiling Skill
Use this skill to answer continuous-profiling questions — which services
burn the most CPU or memory, and which functions inside a service are
responsible — via the Coralogix profiling API. Requires the
profiles.cpu-profiles:Read permission.
CLI Commands
| Command | Purpose | Key flags |
|---|---|---|
cx profiling services | Profiled services ranked by CPU+wall seconds (cpu) or allocated+heap bytes (memory) | --category (required), --environment, --limit (default 20, max 100), --offset, --include-time-series |
cx profiling metadata <service> | A service's language and which profile types have data | - |
cx profiling filters <service> | Label keys a service's profiles can be filtered by, with their values | --profile-type (required), --filter, --max-values-per-key (default 50) |
cx profiling metrics <service> | One profile type's usage over time, split by service, pod, or any label; highest totals first | --profile-type (required), --sum-by (default service), --max-buckets (default 60), --limit (default 10), --filter |
cx profiling flame-graph <service> | Decoded flame graph plus the top functions by self value | --profile-type (required), --filter, --top-functions (default 20), --min-node-ratio (default 0.01), --max-depth, --show-kernel |
- All commands are read-only and support
-o json/-o toon. - Every command takes
--start/--end(defaultnow-1h/now):now,now-1h-style relative expressions, or ISO-8601 timestamps. --profile-typeis one ofcpu,wall,memory-allocation-bytes,memory-allocation-objects,memory-heap-bytes,memory-heap-objects(case-insensitive;MEMORY_HEAP_BYTESalso works). Checkmetadatafirst — only types withhas_data: truereturn anything.--filteris repeatable and filters AND together:key=v1,v2(any of the values),key!=v1,v2(none of them),key:exists,key:not-exists. Discover keys and values withfilters.services --environmentmatchesdeployment.environment.name; it is the only filter the services ranking honors.servicespages through the ranking: when a page is full the CLI prints the--offsetto use next. Time series are omitted unless--include-time-seriesis passed.flame-graphcan take ~40 s on large services; don't set a short--http-timeout.
Investigation Workflow
-
Find the heavy services (skip if the user named one):
cx profiling services --category cpu --limit 10 -o json cx profiling services --category memory --environment <env> --limit 10 -o json -
Check which profile types exist for the service:
cx profiling metadata <service> -o json -
See what you can filter or split by (pods, versions, environments, ...):
cx profiling filters <service> --profile-type cpu -o json -
Find when usage changed and who caused it — split by
podor a label key from step 3:cx profiling metrics <service> --profile-type cpu --sum-by pod --limit 5 -o json cx profiling metrics <service> --profile-type cpu --sum-by service.version --start now-24h -o json -
Find the code responsible — start with the top functions, then the tree:
cx profiling flame-graph <service> --profile-type cpu --top-functions 10 -o json | jq '.top_functions' cx profiling flame-graph <service> --profile-type cpu --filter k8s.pod.name=<pod> \ --min-node-ratio 0.05 --max-depth 20 -o json
Reading the Output
- Services:
cpurows carrytotal_cpu_seconds/total_wall_seconds;memoryrows carrytotal_memory_allocations_bytes/total_heap_bytes.last_activeis epoch seconds. - Metrics:
seriesis ranked bytotal(sum of the bucket totals) and trimmed to--limit;total_seriesis how many the server returned.unitisseconds,bytes, orobjectsdepending on the profile type. - Flame graph:
top_functionssums self value per function+file across the whole tree, so it is unaffected by tree trimming.treenodes carryfunction,file,line,self,total,self_percent,total_percent, andchildren(sorted by total, highest first).omitted_subtreescounts nodes dropped by--min-node-ratio/--max-depth. The server already prunes nodes under 0.1% of the total. Frames with no symbol show as their address orunknown.warnings(e.g.maxBytes) mean the server stopped reading profiles early, so the graph covers part of the range.
Key Principles
- Rank first, drill down second —
servicesandmetricsare cheap;flame-graphis the expensive call, so narrow the service, profile type, time range, and filters before asking for one. - Large trees are big — a deep stack (Java, Scala) can produce hundreds of
KB of JSON. Raise
--min-node-ratioor set--max-depthfor the tree, or read just.top_functions. - Self vs total — high
selfmeans the function itself is hot; hightotalwith lowselfmeans the cost is in what it calls. - Empty results are not errors — a service with no data for the chosen
profile type or range returns empty series or a zero-total graph; re-check
metadataand widen--start. - No profiling data — if
metadatashows no profile type withhas_data: true, the service is not profiled. Do not look for other service names: answer fromcx-service-catalogorcx-telemetry-querying(how much CPU or memory, when, which pod) and say that function-level detail needs profiling enabled for that service. - Multi-profile fan-out works on every subcommand: repeat
-p <profile>; results are tagged withprofilewhen more than one is given.
Related Skills
cx-service-catalog— RED metrics (latency, errors) for the same services; correlate a latency regression with a CPU spike found here.cx-telemetry-querying— pivot to logs, spans, or PromQL metrics for a service or pod surfaced by profiling (cx logs,cx spans,cx metrics).cx-infra— host and container health when a hot pod points to an infrastructure problem.
FAQ
What does the cx-profiling skill do?
Query Coralogix continuous-profiling data with the cx profiling CLI — find which services use the most CPU or memory, which profile types a service has, what profiles can be filtered by, when usage spiked and which pod or version caused it, and which code paths and functions a service spends its CPU or memory on (flame graphs). Use when the user asks "which services use the most CPU", "top memory consumers", "what is service X spending CPU on", "hot functions", "flame graph for a service", "why is this service using so much CPU", "memory allocations by function", "CPU spike by pod", "which version increased CPU", "continuous profiling", "profiling data", or wants to explore profiles of a service. For how much CPU or memory a service or pod uses and whether it is saturated, use cx-service-catalog instead.
How do I install cx-profiling?
Run npx skills add https://github.com/coralogix/cx-cli --skill cx-profiling in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/cx-profiling/ (personal) or .claude/skills/cx-profiling/ (project).
Which AI agents can use cx-profiling?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is cx-profiling safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains cx-profiling?
It is published by coralogix in coralogix/cx-cli. It has 128 recorded installs.
More from coralogix/cx-cli
cx-telemetry-querying
coralogix/cx-cli
Use this skill for any question involving telemetry data: "investigate an issue", "debug a problem", "find out why something is slow", "check error rates", "analyze user behavior", "understand a production incident", "query telemetry data", "look at logs", "search logs", "find errors", "find stack traces", "filter by severity", "check traces", "examine spans", "investigate request latency", "debug service-to-service calls", "look up a trace ID", "analyze RUM data", "query rum.events", "check frontend performance", "frontend errors", "Core Web Vitals", "JavaScript exceptions", "query metrics", "check CPU usage", "run a PromQL query", "check error rate", "look up a metric", "check memory usage", "how do I write a DataPrime query", "DataPrime syntax", or wants to answer questions using observability data from logs, metrics, traces, RUM, or APM.
cx-search-dashboard
coralogix/cx-cli
This skill should be used when the user asks to "find a dashboard", "search dashboards", "does a dashboard exist for X", "find widgets that query Y", "which dashboards use this field", "find a dashboard about errors", "look up dashboards by description", "search for existing monitoring dashboards", "find widgets that reference a field", or wants to discover existing Coralogix dashboards or widgets using natural-language or field-based search.
coralogix-docs
coralogix/cx-cli
Search and read official Coralogix platform documentation using cx docs search and cx docs fetch. Use when the user asks how Coralogix features work, how to configure or use the UI, set up integrations (OpenTelemetry, agents, collectors, webhooks), manage API keys, explore spans/traces/logs in the product, configure alerts/SLOs/dashboards, or needs authoritative product docs — not live tenant telemetry.
cx-alerts
coralogix/cx-cli
This skill should be used when the user asks to "manage alerts", "create alert", "list alerts", "delete alert", "check alert status", "enable alert", "disable alert", "investigate firing alerts", "check which alerts are active", "find alerting rules", "set up an alert", "configure alerting", "mute an alert", "silence an alert", "see alert definitions", "check alert priority", or wants to manage Coralogix alert definitions using the cx CLI.
cx-cli
coralogix/cx-cli
This skill should be used whenever the user runs any cx command, uses the cx CLI, Coralogix CLI, or mentions cx in the context of Coralogix observability. This skill provides cross-cutting concerns like update notifications that apply to all cx commands.
cx-observability-setup
coralogix/cx-cli
Use this skill when the user asks to "set up monitoring", "configure observability", "onboard new service", "create saved view", "set up notifications", "configure webhook", "set up Slack integration", "outgoing webhook", "automation action", "webhook for alerts", "create view", "saved view", "view folder", "organize dashboards", "install integration", "configure extension", "contextual data", "connect external service", "create notification connector", "set up email alerts", "configure PagerDuty", "notification routing", "deploy extension", "test webhook", "notification preset", "test notification", "webhook actions", or wants to set up, configure, or manage the observability stack for a service or team.
Popular other skills
hyperframes-cli
heygen-com/hyperframes
The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - plus reading its JSON and recovering from build or render failures.
triage
mattpocock/skills
Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.
ask-matt
mattpocock/skills
Ask which skill or flow fits your situation. A router over the skills in this repo.
to-questionnaire
mattpocock/skills
Turn a decision you can't fully answer into a questionnaire for someone else to fill in.
loop-me
mattpocock/skills
Grill me about specs for the workflows I want to build, within this workspace.