AGENT SKILL
opentelemetry
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-06-24
- Stars
- ★ 67
- Forks
- 24
02 资源文件 46
- 参考文档PORT_NOTES.md1.7 KB
- 参考文档references/analysis-framework.md7.3 KB
- 参考文档references/base-prompt.md1.1 KB
- 参考文档references/layouts/bento-grid.md851 B
- 参考文档references/layouts/binary-comparison.md1.2 KB
- 参考文档references/layouts/bridge.md907 B
- 参考文档references/layouts/circular-flow.md759 B
- 参考文档references/layouts/comic-strip.md847 B
- 参考文档references/layouts/comparison-matrix.md893 B
- 参考文档references/layouts/dashboard.md776 B
- 参考文档references/layouts/dense-modules.md3.6 KB
- 参考文档references/layouts/funnel.md821 B
- 参考文档references/layouts/hierarchical-layers.md1.2 KB
- 参考文档references/layouts/hub-spoke.md865 B
- 参考文档references/layouts/iceberg.md884 B
- 参考文档references/layouts/isometric-map.md833 B
- 参考文档references/layouts/jigsaw.md844 B
- 参考文档references/layouts/linear-progression.md1.2 KB
- 参考文档references/layouts/periodic-table.md774 B
- 参考文档references/layouts/story-mountain.md815 B
- 参考文档references/layouts/structural-breakdown.md1.1 KB
- 参考文档references/layouts/tree-branching.md913 B
- 参考文档references/layouts/venn-diagram.md825 B
- 参考文档references/layouts/winding-roadmap.md799 B
- 参考文档references/structured-content-template.md5.4 KB
- 参考文档references/styles/aged-academia.md990 B
- 参考文档references/styles/bold-graphic.md920 B
- 参考文档references/styles/chalkboard.md2.2 KB
- 参考文档references/styles/claymation.md654 B
- 参考文档references/styles/corporate-memphis.md612 B
- 参考文档references/styles/craft-handmade.md1.4 KB
- 参考文档references/styles/cyberpunk-neon.md625 B
- 参考文档references/styles/hand-drawn-edu.md2.6 KB
- 参考文档references/styles/ikea-manual.md572 B
- 参考文档references/styles/kawaii.md653 B
- 参考文档references/styles/knolling.md584 B
- 参考文档references/styles/lego-brick.md574 B
- 参考文档references/styles/morandi-journal.md2.2 KB
- 参考文档references/styles/origami.md607 B
- 参考文档references/styles/pixel-art.md562 B
- 参考文档references/styles/pop-laboratory.md2.1 KB
- 参考文档references/styles/retro-pop-grid.md2.1 KB
- 参考文档references/styles/storybook-watercolor.md703 B
- 参考文档references/styles/subway-map.md591 B
- 参考文档references/styles/technical-schematic.md983 B
- 参考文档references/styles/ui-wireframe.md596 B
03 SKILL.md 正文
OpenTelemetry
Overview
OpenTelemetry (OTel) is the unified observability standard for instrumenting applications with traces, metrics, and logs. It supports auto-instrumentation across Node.js, Python, Java, and Go, and exports telemetry to backends like Jaeger, Grafana, Datadog, and Honeycomb through a flexible Collector pipeline.
Instructions
- When adding tracing, create spans with meaningful names, set span kinds (
CLIENT,SERVER,PRODUCER,CONSUMER), add business-relevant attributes, and use W3C Trace Context for propagation. - When adding metrics, choose the right instrument type: Counter for monotonic values, Histogram for distributions like latency, UpDownCounter for fluctuating values, and Gauge for point-in-time readings.
- When setting up auto-instrumentation, use the language-specific packages (
@opentelemetry/auto-instrumentations-node,opentelemetry-instrumentationfor Python, etc.) to capture HTTP, database, and messaging spans without code changes. - When configuring the OTel Collector, define pipelines with receivers (OTLP, Prometheus), processors (batch, memory_limiter, tail_sampling), and exporters (OTLP, Jaeger, Datadog) in the collector config.
- When deploying Collectors, choose sidecar mode for per-pod collection, agent mode for per-node, or gateway mode for centralized processing.
- When setting resource attributes, always include
service.name,service.version, anddeployment.environment, and use cloud/container resource detectors for infrastructure metadata. - When naming attributes, follow OTel semantic conventions (
http.request.method,db.system,messaging.system) instead of inventing custom names.
Examples
Example 1: Add distributed tracing to a Node.js microservice
User request: "Instrument my Express API with OpenTelemetry tracing"
Actions:
- Install
@opentelemetry/auto-instrumentations-nodeand OTLP exporter - Configure SDK with service name, version, and
BatchSpanProcessor - Set up OTLP exporter pointing to the Collector endpoint
- Add custom spans with business attributes for key operations
Output: An auto-instrumented Express API sending traces to the OTel Collector with correlated spans across services.
Example 2: Set up an OTel Collector pipeline
User request: "Configure an OTel Collector to receive traces and export to Grafana Tempo"
Actions:
- Define OTLP gRPC receiver in the Collector config
- Add batch processor and memory_limiter for production safety
- Configure Tempo exporter with endpoint and authentication
- Wire the traces pipeline: receiver -> processor -> exporter
Output: A Collector config file routing traces from applications to Grafana Tempo with batching and memory protection.
Guidelines
- Always set
service.nameandservice.versionas resource attributes. - Use semantic conventions for attribute names; never invent custom names when a standard exists.
- Configure
BatchSpanProcessorin production, notSimpleSpanProcessor, to avoid blocking the application. - Set
memory_limiterprocessor on the Collector to prevent OOM crashes. - Sample in production:
TraceIdRatioBased(0.1)captures 10% of traces, sufficient for most services. - Add custom attributes to spans for business context (
user.tier,feature.flag,order.total). - Never log sensitive data in span attributes (PII, secrets, tokens).