otel-instrumentation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOpenTelemetry Instrumentation with Kopai
使用Kopai进行OpenTelemetry埋点
Guide for instrumenting applications with OpenTelemetry SDK and validating telemetry locally using Kopai.
本指南介绍如何使用OpenTelemetry SDK为应用程序埋点,并通过Kopai在本地验证遥测数据。
Quick Reference
快速参考
bash
undefinedbash
undefinedStart 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
undefinednpx @kopai/cli traces search --service my-service --json
npx @kopai/cli logs search --service my-service --json
npx @kopai/cli metrics discover --json
undefinedRules
规则说明
1. Setup (CRITICAL)
1. 环境搭建(关键)
- - Start Kopai Backend
setup-backend - - Configure Environment
setup-environment
- - 启动Kopai后端
setup-backend - - 配置环境变量
setup-environment
2. Language SDKs (HIGH)
2. 多语言SDK(重要)
- - Node.js Instrumentation
lang-nodejs - - Python Instrumentation
lang-python - - Go Instrumentation
lang-go - - Java Instrumentation
lang-java - - .NET Instrumentation
lang-dotnet - - Ruby Instrumentation
lang-ruby - - PHP Instrumentation
lang-php - - Rust Instrumentation
lang-rust - - Erlang/Elixir Instrumentation
lang-erlang - - C++ Instrumentation
lang-cpp
- - Node.js 埋点
lang-nodejs - - Python 埋点
lang-python - - Go 埋点
lang-go - - Java 埋点
lang-java - - .NET 埋点
lang-dotnet - - Ruby 埋点
lang-ruby - - PHP 埋点
lang-php - - Rust 埋点
lang-rust - - Erlang/Elixir 埋点
lang-erlang - - C++ 埋点
lang-cpp
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. 问题排查(中等)
- - No Data Received
troubleshoot-no-data - - Missing Spans
troubleshoot-missing-spans - - Missing Attributes
troubleshoot-missing-attrs - - Wrong Port
troubleshoot-wrong-port
Read for details.
rules/<rule-name>.md- - 未接收到数据
troubleshoot-no-data - - 缺失Span
troubleshoot-missing-spans - - 缺失属性
troubleshoot-missing-attrs - - 端口错误
troubleshoot-wrong-port
查看 获取详细说明。
rules/<rule-name>.mdReferences
参考资料
- cli-reference - Kopai CLI command reference
- otel-docs - OpenTelemetry documentation links
- cli-reference - Kopai CLI 命令参考
- otel-docs - OpenTelemetry 文档链接