OpenTelemetry(OTel)正成为构建可观测性功能的新标准。1根据最新指南,产品开发者可以通过集成OpenTelemetry,使用户能够将日志、追踪和指标导出到任何兼容的后端系统。1
OpenTelemetry定义了四种核心信号类型:日志、追踪、指标和配置文件,其中配置文件于2026年3月26日进入公开Alpha阶段。1对于自托管软件,建议通过预装OpenTelemetry并暴露配置标志来支持OTLP导出;云平台则可通过"遥测通道"或"可观测性目的地"功能让客户自行配置导出目标。1
在实践应用中,业界已有多个成熟案例。Kuma通过MeshAccessLog、MeshTrace和MeshMetric策略支持三种信号的完整导出。1Keycloak仅需单一启动标志即可指向Collector端点:--telemetry-endpoint=http://my-otel-endpoint:4317 --telemetry-protocol=grpc。1Heroku则支持按信号级别的精细配置,如heroku telemetry:add --signals traces,metrics,logs。1
与传统轮询API相比,OTLP推送模式具有明显优势,包括近实时交付、更低的用户维护成本、更好的数据结构化和元数据保留。1指南建议采用标准OTEL环境变量(如OTEL_EXPORTER_OTLP_ENDPOINT)并支持per-signal路由模式,以提升产品的互操作性。1
OpenTelemetry has established four signal types for observability data: logs, traces, metrics, and profiles, with profiles entering public alpha on March 26, 2026.1 A comprehensive guide on integrating OpenTelemetry into self-hosted and cloud-based products demonstrates how vendors can enable users to export their observability data to any compatible backend system.1
For self-hosted software, the recommended approach involves pre-installing OpenTelemetry and exposing configuration flags that allow users to route data to their preferred destinations.1 Cloud platforms should implement telemetry channels or observability destination features, granting customers direct control over export targets.1 The guide illustrates these patterns through multiple real-world implementations: Kuma supports all three signal types via MeshAccessLog, MeshTrace, and MeshMetric policies; Keycloak requires only a single startup flag pointing to a collector endpoint (--telemetry-endpoint=http://my-otel-endpoint:4317 --telemetry-protocol=grpc); and Heroku enables per-signal configuration through commands like heroku telemetry:add --signals traces,metrics,logs.1
The OTLP push model is recommended over traditional polling APIs, offering near-real-time data delivery, reduced maintenance burden for end users, better structured data handling, and improved metadata preservation.1 Implementing standard OTEL environment variables such as OTEL_EXPORTER_OTLP_ENDPOINT and adopting the OTEL_EXPORTER_OTLP__ENDPOINT pattern further supports per-signal routing flexibility.1
评论
还没有评论,欢迎留下第一条。