开放遥测模型上下文协议(MCP)服务器
OpenTetry MCP服务器使LLM能够有效地使用OpenTetry堆栈。
MCP使用 收集器模式模块 用于收集器配置验证。
https://github.com/user-attachments/assets/af56cda4-9ab0-4c93-969e-a2ee7b9f0480
安装并运行
go install github.com/pavolloffay/opentelemetry-mcp-server@latest
opentelemetry-mcp-server --protocol http --addr 0.0.0.0:8080
# or docker run --rm -it -p 8080:8080 ghcr.io/pavolloffay/opentelemetry-mcp-server:latest --protocol http --addr 0.0.0.0:8080
claude mcp add --transport=http otel http://localhost:8080/mcp --scope user功能
目前,MCP服务器提供了配置OpenTetry收集器的工具。 工具为每个收集器组件返回严格的JSON模式,以确保配置正确。
完整的工具列表可以在 工具.
未来工作/路线图
- 使LLM能够理解/配置数据收集器正在接收的数据。
- (资源)属性和值是什么? - 它可以帮助LLM编写特定于给定组织的PII(过滤)规则。
- 使LLM能够了解哪些工作负载正在发送遥测数据。
- 使LLM能够了解每个工作负载发送的数据量。
- 启用LLM以根据收集的数据调整采样配置。
- 启用LLM以根据收集的数据卷调整存储大小。
- 启用LLM以验证OpenTetry转换语言。
仪器仪表
- 启用LLM以正确输入仪器代码。
- 启用LLM标识未检测的代码(例如应检测的RPC框架)。
- 启用LLM以识别显式添加的高基数属性。
- 启用LLM以识别显式添加的PII属性。
- 启用LLM以根据遥测数据修复代码库中的问题。
其他OpenTetry MCP服务器
- https://github.com/mottibec/otelcol-mcp-收集器配置
- https://github.com/shiftyp/otel-mcp-server-数据分析,需要OpenSearch
- https://github.com/austinlparker/otel-mcp-config,数据分析
- https://github.com/liatrio-labs/otel-instrumentation-mcp-仪器仪表
https://github.com/austinlparker/otel-mcp
docker run --rm -it -v $(pwd)/collector.yaml:/tmp/collector.yaml:Z pavolloffay/otelcol-with-mcp:0.1 --config
claude mcp add --transport=http otelcol http://localhost:9999/mcp --scope user此MCP服务器被实现为收集器扩展和连接器,提供数据的实时视图。
有一个工具可以获取收集器配置,以及内置在收集器中并执行验证的每个组件的模式。
返回的架构不完整,并且不包含字段解释和类型。
● OTLP Receiver Schema
Component Type: otlpKind: receiverConfig Type: *otlpreceiver.Config
Schema Structure
{
"protocols": {
"grpc": null,
"http": null
}
}
Current Configuration (with defaults)
{
"protocols": {
"grpc": {
"endpoint": "0.0.0.0:4317",
"keepalive": {
"enforcement_policy": {},
"server_parameters": {}
},
"read_buffer_size": 524288,
"transport": "tcp"
},
"http": {
"cors": null,
"endpoint": "0.0.0.0:4318",
"idle_timeout": 0,
"keep_alives_enabled": true,
"logs_url_path": "/v1/logs",
"metrics_url_path": "/v1/metrics",
"read_header_timeout": 0,
"tls": null,
"traces_url_path": "/v1/traces",
"write_timeout": 0
}
}
}