-
8000
-
Notifications
You must be signed in to change notification settings - Fork 131
Fetch cluster name from nodes labels #1815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1815 +/- ##
==========================================
+ Coverage 67.37% 67.72% +0.35%
==========================================
Files 222 224 +2
Lines 22702 22826 +124
==========================================
+ Hits 15295 15459 +164
+ Misses 6636 6589 -47
- Partials 771 778 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Super cool! One remark on potentially supporting ECS if it's possible and not too hard.
// don't need to rely on provider-specific APIs. | ||
// TODO: update with labels from other providers, or newer labels as long as specs are updated | ||
var clusterNameNodeLabels = []string{ | ||
"alpha.eksctl.io/cluster-name", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think this might work for AWS ECS on EC2? I guess in that case people will likely be using sidecars and it's less likely to be an issue. I'm not sure where you found these :), but there might be something for ECS too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it will work in ECS as this relies in the Kubernetes API. But actually this cluster name resolution is currently only performed on network metrics, inside Kubernetes clusters ( k8s.cluster.name attribute), so it has never worked on ECS.
I think we should expand cluster name resolution to app metrics and non-kubernetes environments. Will create an issue for it.
Fixes #1322
The OTEL contrib library seems broken/outdated, as it is relying on some non-existing maps to get the cluster metadata (related issue: open-telemetry/opentelemetry-collector-contrib#31300).
In the meanwhile, I realized that EKS already adds the cluster name as a Node label, so I added another simpler cluster name retrieving mechanism, based on Node labels, which will allow quickly expanding the functionality to any other cloud provider already using other labels for setting the cluster name.