Token导航 LogoToken导航TokenDH.com
前端设计敏感数据github未标认证来源可访问许可证需确认审计通过

tracekit-distributed-tracingTracekit 分布式追踪

Agent Skill

tracekit-distributed-tracing 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

294

周安装

8

GitHub Stars

1

下载量

65
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:tracekit-distributed-tracing(Tracekit 分布式追踪)
来源仓库:https://github.com/tracekit-dev/tracekit-for-ai
仓库路径:skills/tracekit-distributed-tracing
安装命令:
npx skills add https://github.com/tracekit-dev/tracekit-for-ai --skill tracekit-distributed-tracing
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/tracekit-dev/tracekit-for-ai --skill tracekit-distributed-tracing

简介

用于处理 GitHub 仓库、Issue 和 Pull Request 协作信息。

  • 适合围绕代码变更或协作事项进行整理时使用。
  • 可结合来源仓库和原始 README 继续核验具体用法。
  • 安装命令:npx skills add https://github.com/tracekit-dev/tracekit-for-ai --skill tracekit-distributed-tracing
  • 建议确认权限范围和是否执行命令后再使用

SKILL.md

TraceKit Distributed Tracing

Auth Bootstrap

Do not tell the user to go sign up, log in separately, or manually create an API key before setup. First check for existing TraceKit auth. If ~/.tracekitconfig does not contain the production profile or TRACEKIT_API_KEY is missing, apply the tracekit-auth skill first. Use ./scripts/run-tracekit-auth.sh status to check, then guide the user through the TraceKit email verification flow with register and verify. That flow signs the user into an existing account for that email or creates the account automatically, then saves the returned credentials for the rest of the setup.

When To Use

Use this skill when the user asks to:

  • Connect traces across services
  • Set up frontend-to-backend tracing
  • Configure distributed tracing
  • Set up trace propagation between microservices
  • See the full request flow across services
  • View the unified waterfall for a request
  • Correlate frontend and backend performance
  • Trace requests through microservices
  • Debug latency across multiple services

Non-Negotiable Rules

  1. Never hardcode API keys in code. Always use TRACEKIT_API_KEY env var.
  2. Always use W3C Trace Context (traceparent header) for propagation - never proprietary headers.
  3. Always verify traces connect across services in the unified waterfall view before considering setup complete.
  4. Always configure tracePropagationTargets in the frontend SDK to limit which outbound requests get trace headers. This prevents leaking trace context to third-party APIs.

Prerequisites

  • At least two TraceKit SDKs must be installed - one frontend and one or more backend, or multiple backend services.
  • Each service must have its own unique serviceName configured in SDK init.
  • If only one SDK is installed, complete the other SDK skills first:

- Frontend: tracekit-browser-sdk, tracekit-react-sdk, tracekit-vue-sdk, etc. - Backend: tracekit-node-sdk, tracekit-go-sdk, tracekit-python-sdk, etc.

  • Browser SDK or framework wrapper must have tracePropagationTargets configured (see Step 2).

Detection

Before applying this skill, detect the project setup:

  1. Scan for multiple TraceKit SDKs across the project or monorepo.
  2. Frontend detection: Check package.json for @tracekit/browser, @tracekit/react, @tracekit/vue, @tracekit/angular, @tracekit/nextjs, or @tracekit/nuxt.
  3. Backend detection: Check go.mod for github.com/Tracekit-Dev/go-sdk, requirements.txt for tracekit-apm, package.json for @tracekit/node-apm, composer.json for tracekit/php-apm, pom.xml for tracekit-core, .csproj for TraceKit.AspNetCore, or Gemfile for tracekit.
  4. If only frontend found, suggest completing a backend SDK skill first.
  5. If only backend found, suggest completing a browser SDK or framework wrapper skill first.
  6. If both found, proceed with distributed tracing setup.

Step 1: Understand W3C Trace Context

Distributed tracing works by passing trace context between services via HTTP headers. TraceKit uses the W3C Trace Context standard, which is compatible with OpenTelemetry, Jaeger, Zipkin, and other observability tools.

How It Works

  1. Every traced request carries a traceparent header with the format: traceparent: 00-<trace-id>-<span-id>-<flags> Example: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01
  2. When a frontend makes an API call, the browser SDK injects the traceparent header into the outbound request.
  3. When a backend receives the request, the backend SDK extracts the traceparent header and continues the same trace.
  4. Each service creates child spans under the same trace ID, forming a tree of operations.
  5. TraceKit collects all spans with the same trace ID and renders them in the unified waterfall view - showing timing, dependencies, and service boundaries.

Why W3C Trace Context

  • Industry standard - works across vendors and languages
  • No vendor lock-in - switch observability backends without changing propagation
  • Supported natively by all TraceKit SDKs
  • Compatible with OpenTelemetry exporters if you use them alongside TraceKit

Step 2: Configure Frontend Trace Propagation

In your frontend SDK init, configure tracePropagationTargets to specify which backend URLs should receive trace headers.

TraceKit.init({
  apiKey: process.env.TRACEKIT_API_KEY,
  serviceName: 'my-react-app',
  tracePropagationTargets: [
    'api.yourapp.com',           // production API
    /^https:\/\/api\./,          // regex: any api.* subdomain
    'localhost:3001',            // development backend
    'localhost:8080',            // development Go service
  ],
});

What tracePropagationTargets Does

  • Only requests matching these patterns get traceparent and tracestate headers injected.
  • Requests to non-matching URLs (third-party APIs, CDNs, analytics) do not get trace headers.
  • Default behavior (if not set): same-origin requests only.
  • Security: This prevents leaking internal trace context to external services. Always configure this explicitly.

Pattern Matching

  • String patterns match as substrings: 'api.yourapp.com' matches https://api.yourapp.com/users.
  • Regex patterns provide full control: /^https:\/\/api\./ matches only HTTPS API subdomains.
  • Include both production and development URLs if you want traces in local development.

Step 3: Configure Backend Trace Extraction

Each TraceKit backend SDK automatically extracts traceparent from incoming requests when the SDK middleware is registered. No additional configuration is needed if you followed the SDK skill setup.

Verify Middleware Is Registered

Distributed tracing requires the SDK middleware to be registered before route handlers. Verify for your backend:

Node.js (Express):

const app = express();
// TraceKit middleware must be first
app.use(TraceKit.Handlers.requestHandler());
app.use(TraceKit.Handlers.tracingHandler());
// Then your routes
app.get('/api/users', (req, res) => { /* ... */ });

Node.js (Fastify):

// Register TraceKit plugin before routes
fastify.register(require('@tracekit/node-apm').fastifyPlugin);

Go (Gin):

r := gin.Default()
// TraceKit middleware must be before routes
r.Use(sdk.GinMiddleware())
r.GET("/api/users", handleUsers)

Go (Echo):

e := echo.New()
// TraceKit middleware must be before routes
e.Use(sdk.EchoMiddleware())
e.GET("/api/users", handleUsers)

Python (Django):

# settings.py  - TraceKit middleware should be early in the list
MIDDLEWARE = [
    'tracekit.integrations.django.TracekitMiddleware',
    # ... other middleware
]

Python (FastAPI):

from tracekit.integrations.fastapi import TracekitMiddleware
app = FastAPI()
app.add_middleware(TracekitMiddleware)

If middleware is registered correctly, the backend SDK will automatically extract traceparent from incoming requests and create child spans under the same trace.

Step 4: Multi-Service Propagation

When one backend service calls another backend service, trace context must also be propagated. Use the TraceKit-instrumented HTTP client instead of the raw standard library client.

Node.js (Backend-to-Backend)

const { tracekit } = require('@tracekit/node-apm');

// Use tracekit.fetch  - auto-injects traceparent into outbound requests
const response = await tracekit.fetch('http://go-service:8080/api/data');
const data = await response.json();

Go (Backend-to-Backend)

// Use tracekit.HTTPClient  - auto-injects traceparent into outbound requests
resp, err := tracekit.HTTPClient.Get("http://python-service:5000/api/data")
if err != nil {
    sdk.CaptureException(err)
    return
}
defer resp.Body.Close()

Python (Backend-to-Backend)

import tracekit

# Use tracekit.requests  - auto-injects traceparent into outbound requests
response = tracekit.requests.get("http://node-service:3001/api/data")
data = response.json()

Key principle: Always use the TraceKit-instrumented HTTP client for outbound requests between your own services. The raw http.Get(), fetch(), or requests.get() will not propagate trace context.

Step 5: Concrete Multi-Service Example

Walk through a complete distributed trace across three services.

Scenario: React Frontend -> Node.js API -> Go Microservice

Architecture:

  • React frontend (port 3000) - user-facing UI
  • Node.js API (port 3001) - API gateway, handles auth and routing
  • Go microservice (port 8080) - user data service, queries database

Request flow:

  1. User clicks "Load Users" in React app - the React SDK creates a browser span.
  2. React app calls fetch('/api/users') - the browser SDK injects traceparent into the request headers (because localhost:3001 is in tracePropagationTargets).
  3. Node.js API receives the request - the Node SDK extracts traceparent, creates a child span under the same trace ID.
  4. Node.js API calls the Go microservice - using tracekit.fetch('http://localhost:8080/users'), which injects traceparent into the outbound request.
  5. Go microservice receives the request - the Go SDK extracts traceparent, creates a child span.
  6. Go microservice queries the database - the SDK creates a database span under the Go service span.
  7. Response flows back - each service closes its spans as responses return.

All spans share the same trace ID, forming a complete tree of the request lifecycle.

Unified Waterfall View

Navigate to https://app.tracekit.dev/traces, find the trace, and click to open the waterfall:

Service              Timeline                                    Duration
---------------------------------------------------------------------------
React Frontend       |========================================|   420ms
  fetch /api/users   |  ====================================  |   380ms
Node.js API          |    ================================    |   360ms
  GET /api/users     |    ============================        |   300ms
  validate-auth      |    ====                                |    40ms
Go Microservice      |        ========================        |   240ms
  GET /users         |        ========================        |   240ms
  db.Query           |          ==================            |   180ms

Each row represents a service. Child spans are indented. The timeline shows exactly where time is spent - in this example, 180ms of the total 420ms is database query time in the Go microservice.

Step 6: Verification

After configuring distributed tracing, verify end-to-end:

  1. Make a request from your frontend that hits at least 2 backend services.
  2. Navigate to https://app.tracekit.dev/traces.
  3. Find the trace - filter by service name or sort by recency.
  4. Click to open the unified waterfall view.
  5. Verify all services appear as separate rows with their own spans.
  6. Verify span timing shows the full request lifecycle with correct parent-child relationships.
  7. Click any span to see its service name, operation name, duration, and metadata (tags, HTTP status, etc.).

If services are missing from the waterfall, see Troubleshooting below.

Step 7: Custom Span Context

Add business context to distributed traces so you can search and filter by meaningful attributes.

Frontend Tags

// Set user context  - propagates to all frontend spans
TraceKit.setTag('user.id', userId);
TraceKit.setTag('user.plan', 'enterprise');

// Set tags on a specific transaction
const transaction = TraceKit.startTransaction({ name: 'checkout' });
transaction.setTag('cart.items', itemCount);

Backend Tags

// Node.js  - add request context
tracekit.setTag('order.id', orderId);
tracekit.setTag('tenant.id', tenantId);
// Go  - add request context
span := sdk.GetCurrentSpan(ctx)
span.SetTag("order.id", orderID)
span.SetTag("tenant.id", tenantID)
# Python  - add request context
tracekit.set_tag('order.id', order_id)
tracekit.set_tag('tenant.id', tenant_id)

Tags are searchable in the TraceKit dashboard. Use them to find traces for specific users, orders, tenants, or any business entity.

Troubleshooting

Traces not connecting across services

  • Check tracePropagationTargets: Ensure the frontend SDK config includes the backend URL. If the backend URL is not matched, no traceparent header is sent.
  • Check CORS configuration: The backend must allow traceparent and tracestate in Access-Control-Allow-Headers: // Express CORS example app.use(cors({origin: 'http://localhost:3000', allowedHeaders: ['Content-Type', 'Authorization', 'traceparent', 'tracestate'],})); // Gin CORS example config:= cors.DefaultConfig() config.AllowHeaders = append(config.AllowHeaders, "traceparent", "tracestate") r.Use(cors.New(config))
  • Check browser DevTools: Open the Network tab, find the API request, and check if traceparent appears in the request headers. If missing, the URL is not in tracePropagationTargets.

Missing backend spans

  • Check SDK middleware is registered: The middleware must be added before route handlers (see Step 3).
  • Check backend is sending data: Visit https://app.tracekit.dev/traces and filter by the backend service name. If no traces appear at all, the backend SDK init may have an issue.
  • Check TRACEKIT_API_KEY is set: Each backend service needs its own API key configured.

CORS errors in browser console

  • Access-Control-Allow-Headers must include traceparent: The traceparent header is a custom header, so CORS preflight must explicitly allow it.
  • Access-Control-Allow-Origin must match: Ensure the frontend origin is allowed by the backend CORS config.
  • **Do not use * for credentials:** If your frontend sends cookies or auth headers, Access-Control-Allow-Origin cannot be * - use the explicit origin.

Only seeing one service in the waterfall

  • Check each service has a unique serviceName: If two services share the same name, their spans will be grouped together and appear as one service.
  • Check both services are sending to the same TraceKit project: If services use different API keys for different projects, traces will not be correlated.
  • Check the trace ID: In the dashboard, click a trace and verify the trace ID. Then filter by that trace ID - all spans should appear regardless of service.

Trace waterfall shows gaps

  • Network latency: Gaps between a parent span ending and a child span starting indicate network time. This is normal for distributed systems.
  • Async operations: If a service processes requests asynchronously, the response may return before all child operations complete. Use await or synchronous patterns for operations that should appear in the waterfall.
  • Clock skew: If services run on different machines with unsynchronized clocks, spans may appear slightly out of order. Use NTP to synchronize clocks across your infrastructure.

Frontend spans appear but backend spans do not

  • This usually means traceparent is being sent but the backend is not extracting it. Verify the backend SDK middleware is registered (Step 3).
  • Check backend logs for TraceKit initialization errors.
  • Test with curl: Send a request with a manual traceparent header to the backend and check if a trace appears: curl -H "traceparent: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01" \ http://localhost:3001/api/users

Next Steps

Once distributed tracing is working across services, consider:

  • Code Monitoring - Set live breakpoints on traced requests to capture production state without redeploying (see tracekit-code-monitoring skill)
  • Alerts - Alert on cross-service latency or error propagation patterns (see tracekit-alerts skill)
  • Releases - Track which release introduced a latency regression visible in traces (see tracekit-releases skill)

References

  • Distributed tracing docs: https://app.tracekit.dev/docs/distributed-tracing
  • W3C Trace Context spec: https://www.w3.org/TR/trace-context/
  • Dashboard: https://app.tracekit.dev
  • See also: tracekit-browser-sdk, tracekit-node-sdk, tracekit-go-sdk skills for single-service setup

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.98%
按下载量换算24

Claude

28.62%
按下载量换算19

Cursor

20.35%
按下载量换算13

Gemini CLI

9.9%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills