agentleFS
LunarCommandLunarCommand/claude-skills/skills/hyperdx/SKILL.md

hyperdx

Skill1 starsChanged 3 months agoMITView on GitHub

Query and read logs and traces from HyperDX using Lucene syntax via the bundled hdx_query.sh CLI. Use this skill whenever the user asks to search logs, fetch errors, debug a service, investigate incidents, check log output, inspect traces, or look up anything in HyperDX — even if they don't say "HyperDX" explicitly. Trigger on phrases like "check the logs", "show me errors from", "what's happening with service X", "look up logs for", "any 500s recently", "show me the traces", or "what does HyperDX say about". Always use this skill when log querying or incident investigation is involved. IMPORTANT: always query logs by running the bundled hdx_query.sh script — never attempt to query HyperDX via curl, the API directly, or any other method.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If a required value (mode, API key, container) is missing from .agent.env, ask the user to add it before proceeding.

    line 67
  2. Very specific:

    Before running the script, read .agent.env and apply this logic:

    line 75
  3. Very specific:

    If HYPERDX_MODE is missing, ask the user to add it before proceeding.

    line 87
  4. Distinctive:

    If the rule is present, run the script directly and do not ask for approval.

    line 103
  5. Distinctive:

    If every call prompts, the rule is simply absent.

    line 104

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

HyperDX Log Querying

MANDATORY: Always use hdx_query.sh to query logs and traces. Do not use curl, raw API calls, or any other method — even if it seems simpler. If the script fails, fix the script — do not work around it.

Three failures are environment, not bugs — do not edit the script for these:

What you seeWhat it means
Missing required command: <x> (exit 127)A dependency is absent. Tell the user to install it. The script is fine.
command not found: hdx_query.shThe skill's bin/ is not on PATH — the plugin is disabled, or the session started before it was installed. Ask the user to enable it and run /reload-plugins, or restart. Do not substitute an absolute path.
A permission prompt on every callThe allowlist is not installed. That is setup, not failure — see Permissions below.

Anything else that fails is a real defect: fix the script rather than working around it.

hdx_query.sh ships in this skill's bin/ directory, which is on the Bash tool's PATH whenever the skill is installed. Invoke it by bare name — never by an absolute path. The bare form is the only spelling that works on both install routes, and it is what the permission rule matches.

The script supports two modes: cloud (HyperDX REST API) and local (ClickHouse via docker exec into a local HyperDX container).


Per-Project Configuration (.agent.env)

Each project should have the following in its .agent.env file at the project root:

HYPERDX_MODE: local # or: cloud
OTEL_SERVICE_NAME: your-service-name
HYPERDX_LOCAL_API_KEY: your-personal-api-key
HYPERDX_CONTAINER: hdx-local
  • HYPERDX_LOCAL_API_KEY is the Personal API Key from HyperDX account settings — not the Ingestion API Key.
  • HYPERDX_CONTAINER is the Docker container name for local mode (default: hdx-local). Omit if using cloud mode only.
  • OTEL_SERVICE_NAME is the default service to filter on. Multi-service projects (e.g. a pipeline + an API) instead define one key per service — OTEL_SERVICE_NAME_<SERVICE> (e.g. OTEL_SERVICE_NAME_PIPELINE, OTEL_SERVICE_NAME_API). When those are present, pick the key matching what you're querying and pass it as -s; omit -s to sweep all services. Treat the bare OTEL_SERVICE_NAME as optional in that case.

If a required value (mode, API key, container) is missing from .agent.env, ask the user to add it before proceeding. The service name is optional — without one, query without -s (all services).


Mode Detection (read this before every query)

Before running the script, read .agent.env and apply this logic:

if HYPERDX_MODE == "local"
    → add --local --container <HYPERDX_CONTAINER>
    → do NOT pass --api-key or --url
else (HYPERDX_MODE == "cloud" or not set)
    → pass --api-key <HYPERDX_LOCAL_API_KEY>
    → do NOT pass --local

Never guess the mode — always derive it from HYPERDX_MODE in .agent.env. If HYPERDX_MODE is missing, ask the user to add it before proceeding.


Permissions

This script is meant to be pre-approved, via this rule:

Bash(hdx_query.sh:*)

That rule is not installed by either install route — it lives in the toolkit's project-files/.claude/settings.json template and the user merges it into a project's .claude/settings.json (or their user settings) themselves. So:

  • If the rule is present, run the script directly and do not ask for approval.
  • If every call prompts, the rule is simply absent. Say so once and continue — that is unfinished setup, not a malfunctioning skill, and not a reason to reach for curl.

Note the rule approves the command name. It matches whatever PATH resolves hdx_query.sh to, which is why the name is unusual enough not to collide.

Dependencies: curl and jq (both standard on most dev machines). Local mode also requires docker.


Arguments

FlagShortDefaultDescription
--query-q(required)Lucene query term. Repeat for multiple terms — they are OR'd together. Never use shell-escaped quotes inside a single value.
--service-sOTEL_SERVICE_NAME to filter by
--api-key-kHyperDX Personal API key (cloud mode, read from .agent.env)
--minutes-t5How many minutes to look back
--limit-l10Max log lines to return
--urlhttps://api.hyperdx.ioHyperDX base URL (cloud mode)
--localoffQuery local ClickHouse instead of cloud API
--containerhdx-localDocker container name (local mode)
--tablelogslogs or traces (local mode only)

Multi-term Queries

Pass each search term as its own --query flag. The script OR's them together automatically — no shell quote escaping needed:

# DO THIS
hdx_query.sh --query "request completed" --query "job finished" --query "status:500"

# NOT THIS — triggers shell obfuscation warning in Claude Code
hdx_query.sh --query "\"request completed\" OR \"job finished\""

Lucene Field Reference

Lucene fieldCloud (HyperDX)Local logsLocal traces
level:error✓→ SeverityText—
service:name✓→ ServiceName→ ServiceName
TraceId:xxx✓→ TraceId→ TraceId
SpanName:xxx✓—→ SpanName
"free text"✓→ Body ILIKE→ SpanName ILIKE
field:value✓→ LogAttributes map→ SpanAttributes map

Local mode matches field:value exactly and case-sensitively (it builds col = 'value'). SeverityText is stored lowercase, so use level:warn / level:error / level:info — level:WARN matches nothing. When unsure of a field's stored values, drop the filter and grep Body with free text instead.


Workflow

  1. Read .agent.env — extract the service name(s) (OTEL_SERVICE_NAME, or per-service OTEL_SERVICE_NAME_<SERVICE> keys), HYPERDX_LOCAL_API_KEY, and HYPERDX_CONTAINER. For a multi-service project, pick the key matching what you're querying; omit -s to sweep all services.
  2. Determine mode — use --local if the user is debugging a local run; use cloud (default) for deployed services.
  3. Construct the query — use one --query flag per term, never escape quotes inside a single flag value.
  4. Run the script — default to --minutes 5 --limit 10 for quick checks.
  5. Interpret output — summarize patterns, highlight repeated errors, suggest next steps.
  6. Iterate — broaden query or increase --minutes / --limit if needed.

Common Patterns

Cloud — quick error check:

hdx_query.sh \
  -k "your-key" -s "your-service" -q "level:error"

Cloud — multi-term OR search:

hdx_query.sh \
  -k "your-key" -s "your-service" \
  --query "request completed" \
  --query "job finished" \
  -t 30 -l 50

Local — recent logs:

hdx_query.sh \
  --local --container hdx-local -s "your-service" \
  -q "level:error" -t 10 -l 20

Local — trace lookup:

hdx_query.sh \
  --local --table traces -s "your-service" \
  -q "TraceId:abc123"

Local — self-hosted URL:

hdx_query.sh \
  -k "your-key" -q "level:error" --url http://localhost:8080

Error Handling

ErrorLikely causeFix
No API key foundMissing from .agent.envAdd HYPERDX_LOCAL_API_KEY
Error: UnauthorizedWrong key type (Ingestion vs Personal)Use Personal API Key from account settings
ClickHouse error: docker exec failedContainer not running or wrong nameCheck docker ps and HYPERDX_CONTAINER in .agent.env
No logs found matching...Query too narrow or wrong time windowBroaden query or increase --minutes
HTTP Error: ...API-side issueCheck HyperDX status / try again

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.