You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// A representation of an exemplar, which is a sample input measurement.// Exemplars also hold information about the environment when the measurement// was recorded, for example the span and trace ID of the active span when the// exemplar was recorded.messageExemplar {
// The set of key/value pairs that were filtered out by the aggregator, but// recorded alongside the original measurement. Only key/value pairs that were// filtered out by the aggregator should be includedrepeatedopentelemetry.proto.common.v1.KeyValuefiltered_attributes=7;
// Labels is deprecated and will be removed soon.// 1. Old senders and receivers that are not aware of this change will// continue using the `filtered_labels` field.// 2. New senders, which are aware of this change MUST send only// `filtered_attributes`.// 3. New receivers, which are aware of this change MUST convert this into// `filtered_labels` by simply converting all int64 values into float.//// This field will be removed in ~3 months, on July 1, 2021.repeatedopentelemetry.proto.common.v1.StringKeyValuefiltered_labels=1 [deprecated = true];
// time_unix_nano is the exact time when this exemplar was recorded//// Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January// 1970.fixed64time_unix_nano=2;
// The value of the measurement that was recorded. An exemplar is// considered invalid when one of the recognized value fields is not present// inside this oneof.oneofvalue {
doubleas_double=3;
sfixed64as_int=6;
}
// (Optional) Span ID of the exemplar trace.// span_id may be missing if the measurement is not recorded inside a trace// or if the trace is not sampled.bytesspan_id=4;
// (Optional) Trace ID of the exemplar trace.// trace_id may be missing if the measurement is not recorded inside a trace// or if the trace is not sampled.bytestrace_id=5;
}
指标关联Trace
exemplar机制
prometheus
prometheus主要是采用 exemplars 的机制在 metrics 中带上额外的信息。通过metrics的接口可以同事暴露exemplar
https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#exemplars-1
注入方式
otlp
otlp在协议中有Exemplar字段 可以在指标上报时将被采样的span跟指标关联.otlp-SDK是自动进行注入的,因为trace-log-metric 三者共享同样的otlp-context,所以可以不必要进行手工关联
prometheus存储方式(tjg使用该方式)
https://github.com/prometheus/prometheus/pull/6635/files
prometheus 实现了一种环形连续内存的结构来存储 exemplar,并实现了对应的查询接口
日志关联Trace
日志关联Trace 比较简单 只要在打印日志的时候获取到链路的TraceId和spanId 就可以关联Trace和单条日志了
最终清洗入库并标记trace_id和span_id即可实现联动
监控存储exemplar
由于influxdb目前不支持exemplar入库,所以基于现有存储结构监控可以使用ES进行exemplar存储,避免高基线问题
修改如下
The text was updated successfully, but these errors were encountered: