关于OpenTelementry一些思考

  1. 云栖社区>
  2. 阿里云存储服务>
  3. 博客>
  4. 正文

关于OpenTelementry一些思考

简志 2019-12-31 22:03:40 浏览6686
展开阅读全文

(未完待续)

image

image

image

image

image

image

image

Open Telemetry模块分解

  1. Collectors can communicate with various backends via exporters
  2. Configuration controls aggregation, batching, and processing
  3. In-proc exporters are easily replaceable to work with different backend
  4. SDK allows various extensions: sampling, filtering, enrichments
  5. OpenTelemetry SDK package can be completely replaced

image

最佳实践

Tracer:

  • Customer Attributes: Add custom properties for easier querying and differentiating telemetry.
  • Resource API: define resource attributes, which are distinct from regular attributes

    • Deployment name and location
    • App name and version
    • Hosting environment
    • Propagation:

      • use it as a metrics dimension or
      • attribute spans

OT视角的一种实现

jobsQueuedGauge := meter.NewFloat64Gauge("jobs_queued", metric.WithDescription("The number of jobs currently queued"))

err := tracer.WithSpan(ctx, "jobEnqueue", func(ctx context.Context) error { jobsTotal, err := jobQueue.Enqueue(job) if err != nil { return err } jobsQueuedGauge.Set(ctx, jobsTotal)

})

image

基于M3DB的一种实现

# HELP http_requests_total http_requests # TYPE http_requests_total counter http_requests_total{endpoint="/search",status_code="2xx"} 1725 # {trace_id="b096e71d..."} http_requests_total{endpoint="/search",status_code="4xx"} 4 # {trace_id=" 944a6d97..."} http_requests_total{endpoint="/search",status_code="5xx"} 27 # {trace_id="50785260..."} http_request_latency_bucket{endpoint="/search",le="0.1"} 7 # {trace_id=" 7f78deda..."}

image

支持采样机制

image

统一模型

Trace有Metric关系

image

数据表示上可以用Time + KeyValue方式融合

image

Metric与Trace、Log关联原理

  • 同一个时间段
  • 同一个实体Entity:例如通过Namespace,Location,Label等关联
  • (*)同一个TraceId

image

一种融合的观点

(待添加)

Reference

  • OpenTelemetry The First Release, What’s Next, and How to Get Involved - Morgan McLean, Google; Tristan Sloughter, Postmates; Sergey Kanzhelev, Microsoft; & Chris Kleinknecht, Google
  • Beyond Getting Started Using OpenTelemetry to Its Full Potential - Sergey Kanzhelev, Microsoft & Morgan McLean

网友评论

登录后评论
0/500
评论
简志
+ 关注
所属团队号: 阿里云存储服务