Ensure telemetry attribute population logic is consistent across all components and follows established standards. When implementing telemetry features like resource attributes, baggage headers, or tracing configurations, use the same business logic and attribute naming conventions throughout the codebase.
Key requirements:
Example of consistent attribute population:
// Use the same logic across components
func resourceAttributes(proxy *Proxy) *otlpcommon.KeyValueList {
return &otlpcommon.KeyValueList{
Values: []*otlpcommon.KeyValue{
// Use OpenTelemetry semantic convention constants
otelKeyValue(otelsemconv.K8SClusterNameKey, proxy.Metadata.ClusterID.String()),
otelKeyValue(otelsemconv.K8SNamespaceNameKey, proxy.ConfigNamespace),
otelKeyValue(otelsemconv.K8SPodNameKey, podName),
otelKeyValue(otelsemconv.ServiceNameKey, proxy.XdsNode.Cluster),
},
}
}
This approach prevents inconsistencies that can lead to fragmented telemetry data and ensures compliance with industry standards, making the observability system more reliable and interoperable.
Enter the URL of a public GitHub repository