otel-instrumentation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OpenTelemetry Instrumentation with Kopai

使用Kopai进行OpenTelemetry埋点

Guide for instrumenting applications with OpenTelemetry SDK and validating telemetry locally using Kopai.
本指南介绍如何使用OpenTelemetry SDK为应用程序埋点,并通过Kopai在本地验证遥测数据。

Quick Reference

快速参考

bash
undefined
bash
undefined

Start backend

Start backend

npx @kopai/app start
npx @kopai/app start

Configure app

Configure app

export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 export OTEL_SERVICE_NAME=my-service
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 export OTEL_SERVICE_NAME=my-service

Validate telemetry

Validate telemetry

npx @kopai/cli traces search --service my-service --json npx @kopai/cli logs search --service my-service --json npx @kopai/cli metrics discover --json
undefined
npx @kopai/cli traces search --service my-service --json npx @kopai/cli logs search --service my-service --json npx @kopai/cli metrics discover --json
undefined

Rules

规则说明

1. Setup (CRITICAL)

1. 环境搭建(关键)

  • setup-backend
    - Start Kopai Backend
  • setup-environment
    - Configure Environment
  • setup-backend
    - 启动Kopai后端
  • setup-environment
    - 配置环境变量

2. Language SDKs (HIGH)

2. 多语言SDK(重要)

  • lang-nodejs
    - Node.js Instrumentation
  • lang-python
    - Python Instrumentation
  • lang-go
    - Go Instrumentation
  • lang-java
    - Java Instrumentation
  • lang-dotnet
    - .NET Instrumentation
  • lang-ruby
    - Ruby Instrumentation
  • lang-php
    - PHP Instrumentation
  • lang-rust
    - Rust Instrumentation
  • lang-erlang
    - Erlang/Elixir Instrumentation
  • lang-cpp
    - C++ Instrumentation
  • lang-nodejs
    - Node.js 埋点
  • lang-python
    - Python 埋点
  • lang-go
    - Go 埋点
  • lang-java
    - Java 埋点
  • lang-dotnet
    - .NET 埋点
  • lang-ruby
    - Ruby 埋点
  • lang-php
    - PHP 埋点
  • lang-rust
    - Rust 埋点
  • lang-erlang
    - Erlang/Elixir 埋点
  • lang-cpp
    - C++ 埋点

3. Validation (HIGH)

3. 验证操作(重要)

  • validate-traces
    - Validate Traces
  • validate-logs
    - Validate Logs
  • validate-metrics
    - Validate Metrics
  • validate-traces
    - 验证追踪数据
  • validate-logs
    - 验证日志数据
  • validate-metrics
    - 验证指标数据

4. Troubleshooting (MEDIUM)

4. 问题排查(中等)

  • troubleshoot-no-data
    - No Data Received
  • troubleshoot-missing-spans
    - Missing Spans
  • troubleshoot-missing-attrs
    - Missing Attributes
  • troubleshoot-wrong-port
    - Wrong Port
Read
rules/<rule-name>.md
for details.
  • troubleshoot-no-data
    - 未接收到数据
  • troubleshoot-missing-spans
    - 缺失Span
  • troubleshoot-missing-attrs
    - 缺失属性
  • troubleshoot-wrong-port
    - 端口错误
查看
rules/<rule-name>.md
获取详细说明。

References

参考资料

  • cli-reference - Kopai CLI command reference
  • otel-docs - OpenTelemetry documentation links
  • cli-reference - Kopai CLI 命令参考
  • otel-docs - OpenTelemetry 文档链接