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
I need a way to specify pod/namespace/node as otel attributes from env vars
OTEL_RESOURCE_ATTRIBUTES will not work for k8s with dynamic values, because k8s can't map(k=v).join(',') required attributes. It should be separate envs
I can do it manually, but may be i can get a better solution
// Use default resourcelet resource = Resource::from_detectors(Duration::from_secs(0),vec![Box::new(SdkProvidedResourceDetector),
Box::new(EnvResourceDetector::new()),
])// Merge with custom or write own ResourceDetector.merge(&Resource::new(vec![
opentelemetry_semantic_conventions::resource::K8S_POD_NAME.string(std::env::var("K8S_POD_NAME")?),
opentelemetry_semantic_conventions::resource::K8S_NAMESPACE_NAME.string("K8S_NAMESPACE_NAME"),
opentelemetry_semantic_conventions::resource::K8S_NODE_NAME.string("K8S_NODE_NAME"),
]));
The text was updated successfully, but these errors were encountered:
I need a way to specify pod/namespace/node as otel attributes from env vars
OTEL_RESOURCE_ATTRIBUTES
will not work for k8s with dynamic values, because k8s can't map(k=v).join(',') required attributes. It should be separate envsI can do it manually, but may be i can get a better solution
The text was updated successfully, but these errors were encountered: