Description
Component(s)
processor/k8sattributes
Is your feature request related to a problem? Please describe.
When using the k8sattributes
processor, I shouldn't need to declare any attributes manually. I still need to manually specify k8s.cluster.name
as the processor doesn't support it yet.
There is no standard API to get the cluster name, but GKE and EKS make it easy to detect. We should support this in the processor and provide k8s.cluster.name
where possible.
Describe the solution you'd like
For GKE, See: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/deb9aa441dc7d2b0fd5ec11b41c934a1e93134fd/detectors/node/opentelemetry-resource-detector-gcp/src/detectors/GcpDetector.ts#L81 (it gets it from curl http://metadata/computeMetadata/v1/instance/attributes/cluster-name -H "Metadata-Flavor: Google"
)
For EKS see: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/deb9aa441dc7d2b0fd5ec11b41c934a1e93134fd/detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEksDetector.ts#L86 (it gets it from the cert name on kubernetes.default.svc
, iiuc)
Describe alternatives you've considered
No response
Additional context
No response