netdata-instrumentation

Use when adding OpenTelemetry instrumentation to application code that will report to Netdata. Covers SDK setup, resource attributes, auto-instrumentation, and patterns for Node.js, Python, Java, Go, .NET, Ruby, and PHP. Emits metrics and logs via OTLP gRPC to Netdata. Traces are not yet supported by Netdata; use an alternative trace backend until Q2 2026.

netdata/skills6 installsApache-2.0Synced Aug 22

Works with

Claude CodeCursorCodex CLIGitHub CopilotGemini CLI
---
name: netdata-instrumentation
description: Use when adding OpenTelemetry instrumentation to application code that will report to Netdata. Covers SDK setup, resource attributes, auto-instrumentation, and patterns for Node.js, Python, Java, Go, .NET, Ruby, and PHP. Emits metrics and logs via OTLP gRPC to Netdata. Traces are not yet supported by Netdata; use an alternative trace backend until Q2 2026.
license: Apache-2.0
---

# Netdata instrumentation

This skill adds OpenTelemetry instrumentation to application code that
will export metrics (and, where the SDK is mature enough, logs) to
Netdata over OTLP/gRPC.

## When to use this skill

- The user is adding observability to a service for the first time.
- The user wants to replace a vendor SDK (Datadog, New Relic, Dynatrace)
  with OpenTelemetry.
- The user is wiring auto-instrumentation into an existing service.
- The user wants to know what resource attributes Netdata's dashboard
  and MCP tools rely on.
- The user is choosing between SDK-level and Collector-level exporting.

## Key facts

- Export protocol: OTLP/gRPC on the Netdata OTLP port (default 4317).
- Signals: metrics and logs are accepted. Traces are not yet accepted by
  Netdata (planned Q2 2026). If the service only needs traces, send them
  to Jaeger, Tempo, or an external vendor; do not configure a trace
  exporter pointed at Netdata.
- Resource attributes that matter:
  - `service.name` (required by OTel). Netdata groups charts by this.
  - `service.version`. Used in dashboards and alert rules.
  - `deployment.environment` (or `deployment.environment.name` in the
    newer semconv). Lets the MCP tools filter by env.
  - `host.name`. Filled by most SDKs automatically.
- Prefer auto-instrumentation where it exists (Node.js, Python, Java,
  .NET, Ruby). Hand-code only for Go and PHP, where auto-instrumentation
  is immature or not yet stable.
- Metrics default to delta temporality in many SDKs; Netdata accepts
  both delta and cumulative. Pick cumulative for gauges and sums when
  the backend will be swapped later.
- Environment variables control the exporter without code changes:
  - `OTEL_SERVICE_NAME`
  - `OTEL_EXPORTER_OTLP_ENDPOINT` (scheme + host + port, e.g.
    `http://netdata.example.internal:4317`)
  - `OTEL_RESOURCE_ATTRIBUTES` (comma-separated key=value list)
  - `OTEL_EXPORTER_OTLP_PROTOCOL=grpc` (be explicit; some SDKs default
    to `http/protobuf`)

## Step-by-step

1. Pick the language rule that matches the service. See [References](#references).
2. Install the OTel packages with the versions listed in that rule.
3. Copy the minimal SDK init into the service's startup path. In
   Node.js/Python this is typically a `-r`/`--import` preload; in Java
   it is the Java agent jar; in Go/Ruby/.NET/PHP it is an in-process
   call before the first work happens.
4. Set the environment variables above. The endpoint must use `http://`
   (or `https://` with TLS) and port 4317. Do not put `/v1/metrics` on
   the URL; that is the OTLP/HTTP path and the gRPC exporter does not
   want it.
5. Deploy. Generate some traffic. Verify metrics arrived (see
   [Verification](#verification)).
6. If metrics render in Netdata with unhelpful dimension names, add a
   mapping file. See `skills/netdata-otel-setup/rules/metric-mapping.md`.

## Common mistakes

- Using the HTTP exporter (`exporter-otlp-http`, port 4318) against
  Netdata. Netdata accepts gRPC only.
- Forgetting to set `service.name`. Without it, charts group under an
  "unknown_service" bucket and look broken.
- Setting both the SDK endpoint and the Collector endpoint to the same
  Netdata URL. Pick one export path: SDK to Netdata, or SDK to
  Collector to Netdata. Double export doubles the sample count.
- Calling `shutdown()` in the wrong place. Async SDKs need a chance to
  flush on SIGTERM; a blind `process.exit(0)` loses the last batch.
- Enabling trace exporting against Netdata. The gRPC connection will
  succeed but the traces are silently dropped.
- Hardcoding the endpoint in source. Use the env var. Let ops move the
  endpoint without a code change.

## Choosing SDK export vs Collector export

Two deployment shapes:

- **SDK -> Netdata directly**: simplest. The SDK's OTLP gRPC
  exporter opens a connection to Netdata. Fine for single-service
  setups or dev environments. The downside is that every service
  carries its own export config and retry logic.
- **SDK -> Collector -> Netdata**: a local (DaemonSet or sidecar)
  Collector intercepts the SDK's OTLP output, adds enrichment
  (Kubernetes metadata, cluster name, etc.), and forwards to
  Netdata. The SDK points at `http://localhost:4317` or
  `http://$HOST_IP:4317`; the Collector handles the real
  destination, TLS, and retries.

Production-shape defaults:

- Single-service or dev: SDK -> Netdata directly.
- Kubernetes, multi-team: SDK -> DaemonSet Collector -> Netdata
  Parent.
- Long-lived serverless / Lambda: SDK -> Netdata directly; the
  Collector lifecycle does not fit a request-scoped runtime.

## Verification

Run an MCP query against the Netdata instance that is supposed to be
receiving the traffic. See the MCP integration skill for the full
transport setup; here is the minimum check:

```bash
# From a shell where the agent with MCP access is configured:
# list_metrics filtered by service name
```

Or via the HTTP API for a quick check without an MCP client:

```bash
curl -s 'http://NETDATA_HOST:19999/api/v2/contexts' \
  | jq --arg svc "$OTEL_SERVICE_NAME" \
       '.contexts | to_entries[] | select(.key | contains($svc))'
```

A non-empty result means at least one metric from the service arrived
within the last few minutes. For the canonical working instrumentation,
see [`tests/e2e/sample-apps/`](../../tests/e2e/sample-apps/) in this repo.

## References

- [`rules/nodejs.md`](./rules/nodejs.md)
- [`rules/python.md`](./rules/python.md)
- [`rules/java.md`](./rules/java.md)
- [`rules/go.md`](./rules/go.md)
- [`rules/dotnet.md`](./rules/dotnet.md)
- [`rules/ruby.md`](./rules/ruby.md)
- [`rules/php.md`](./rules/php.md)
- OpenTelemetry semconv: https://opentelemetry.io/docs/specs/semconv/
- Netdata OTel integration: https://learn.netdata.cloud/docs/collecting-metrics/opentelemetry/opentelemetry-metrics

More SEO & Marketing skills

ai-video-generation

skills-101/superpowers

Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0, HappyHorse 1.0, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, reference-to-video, video editing, lipsync, avatar animation, video upscaling, foley sound. Use for: social media videos, marketing content, explainer videos, product demos, AI avatars. Triggers: video generation, ai video, text to video, image to video, veo, animate image, video from image, ai animation, video generator, generate video, t2v, i2v, ai video maker, create video with ai, runway alternative, pika alternative, sora alternative, kling alternative, seedance, happyhorse

394.9k

ai-image-generation

skills-101/superpowers

Generate AI images with GPT-Image-2, FLUX, Gemini, Grok, Seedream, Reve and 50+ models via inference.sh CLI. Models: GPT-Image-2, FLUX Dev LoRA, FLUX.2 Klein LoRA, Gemini 3 Pro Image, Grok Imagine, Seedream 4.5, Reve, ImagineArt. Capabilities: text-to-image, image-to-image, inpainting, LoRA, image editing, upscaling, text rendering. Use for: AI art, product mockups, concept art, social media graphics, marketing visuals, illustrations. Triggers: flux, image generation, ai image, text to image, stable diffusion, generate image, ai art, midjourney alternative, dall-e alternative, text2img, t2i, image generator, ai picture, create image with ai, generative ai, ai illustration, grok image, gemini image, gpt image, openai image, chatgpt image

394.6k

ai-avatar-video

skills-101/superpowers

Create AI avatar and talking head videos via inference.sh CLI. Recommended: P-Video-Avatar (fastest, cheapest, built-in TTS). Also: OmniHuman, Fabric, PixVerse. Audio: Inworld TTS-2 (100+ languages, emotion steering for characters), ElevenLabs, Kokoro. Capabilities: audio-driven avatars, text-to-avatar, lipsync videos, talking head generation, virtual presenters, UGC content. Use for: AI presenters, explainer videos, virtual influencers, dubbing, marketing videos, UGC ads, gaming avatars, NPC dialogue. Triggers: ai avatar, talking head, lipsync, avatar video, virtual presenter, ai spokesperson, audio driven video, heygen alternative, synthesia alternative, talking avatar, lip sync, video avatar, ai presenter, digital human, ugc, ugc video, ugc ad, avatar ugc

394.5k

← All SEO & Marketing skills

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY