bytedtrace-knowledge

Query BytedTrace metrics and integrate the Go SDK for distributed tracing.

Updated Apr 30, 2026
One-click install
npx skills add https://github.com/yuezhen-huang/my-bytedance-skillhub --skill bytedtrace-knowledge-yuezhen-huang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bytedtrace-knowledge
Source: https://github.com/yuezhen-huang/my-bytedance-skillhub/tree/main/bytedtrace-knowledge
Command: npx skills add https://github.com/yuezhen-huang/my-bytedance-skillhub --skill bytedtrace-knowledge-yuezhen-huang

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Engineers struggle to find the right BytedTrace metric names, tags, and SDK APIs when monitoring QPS, latency, and error rates or adding custom spans and metrics to their services. ## Core Features & Use Cases - Metrics Query Guide: Explains the 4-segment metric format (bytedtrace.sdk.<family>.<suffix>) with ready-to-use query patterns for server QPS, client latency P99, and log event rates. - Go SDK Usage: Covers Tracer initialization, Span/Event/Metrics APIs, metrics pre-registration, span inheritance (in-process and cross-process via Inject/Extract), and post-sampling. - Framework Integration Matrix: Lists minimum versions for kitex, hertz, ginex, MySQL, Redis, Kafka, TOS, ByteES, FaaS, and more across Go, Java, C++, Python, Rust, and Node.js. - Use Case: You want to monitor your PSM's downstream call latency. Look up the client span metric bytedtrace.sdk.span.client.latency.us.pct99 with _psm and _to_service tags, then verify your kitex version meets the integration minimum. ## Quick Start Ask how to query the P99 latency and QPS metrics for your PSM using BytedTrace.

Frequently Asked Questions about bytedtrace-knowledge

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query QPS and latency metrics for my PSM in BytedTrace?

Use the server span metrics `bytedtrace.sdk.span.server.rate` for QPS and `bytedtrace.sdk.span.server.latency.us.pct99` for P99 latency, filtered by the `_psm` tag. For outbound calls, use the client span equivalents with `_to_service`.

How do I add custom spans and metrics with the BytedTrace Go SDK?

Call `bytedTrace.StartCustomSpan` with `EnableEmitSpanMetrics` to emit metrics, and pre-register custom metrics via `RegisterCustomMetric` during Init. Tags must be registered in order and cannot be omitted or empty.

Which frameworks support BytedTrace integration automatically?

Supported frameworks include kitex (>=v1.1.12), hertz (>=v0.5.0), ginex (>=v1.7.0), kite, and kitc for Go, plus components for Java, C++, Python, Rust, and Node.js. Integrated frameworks create and propagate spans automatically without manual SDK initialization.

Does BytedTrace work with MySQL, Redis, and Kafka clients?

Yes, with minimum versions: Go mysql-driver >=v1.2.1, goredis >=v5.2.0, sarama >=v1.4.1, and kafka-client >=v1.0.9. You must pass context through calls like `gormDB.Context(ctx)` or `redisClient.WithContext(ctx)` for trace propagation.

Why are my custom span metrics not showing up in BytedTrace?

Custom spans do not emit metrics by default; you must pass the `EnableEmitSpanMetrics` option when starting the span. Also verify metrics were pre-registered at Init time with matching tag order.

How do I propagate BytedTrace spans across processes?

Use `bytedTrace.Inject` with a TextMap carrier on the upstream side and `bytedTrace.Extract` on the downstream side, then start the server span with `bytedTrace.ChildOf(spanCtx)`. Frameworks usually handle this automatically via headers.