Skip to content
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

fix(metrics)!: drop k8s.node.name attribute #3295

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changelog/3295.fixed.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix(metrics)!: drop k8s.node.name attribute
5 changes: 5 additions & 0 deletions deploy/helm/sumologic/conf/metrics/otelcol/processors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ resource:
key: k8s.container.name # add container in OpenTelemetry convention to unify configuration for Source processor
- action: delete
key: container # remove container to avoid duplication when attribute translation is enabled
- action: upsert
from_attribute: node
key: k8s.node.name # add container in OpenTelemetry convention to unify configuration for Source processor
- action: delete
key: node # remove container to avoid duplication when attribute translation is enabled
- action: upsert
from_attribute: service
key: prometheus_service
Expand Down
4 changes: 4 additions & 0 deletions docs/v4-migration-doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ require additional action.
- node_filesystem_avail_bytes
- node_filesystem_size_bytes

- Drop `k8s.node.name` attribute from metrics

The `node` attribute exists and has the same value, so this is superfluous.

- Truncating full name to 22 characters

Some Kubernetes objects, for example statefulsets, have a tight (63 characters) limit for their names. Because of that, we truncate the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ data:
key: k8s.container.name
- action: delete
key: container
- action: upsert
from_attribute: node
key: k8s.node.name
- action: delete
key: node
- action: upsert
from_attribute: service
key: prometheus_service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ data:
key: k8s.container.name
- action: delete
key: container
- action: upsert
from_attribute: node
key: k8s.node.name
- action: delete
key: node
- action: upsert
from_attribute: service
key: prometheus_service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ data:
key: k8s.container.name
- action: delete
key: container
- action: upsert
from_attribute: node
key: k8s.node.name
- action: delete
key: node
- action: upsert
from_attribute: service
key: prometheus_service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ data:
key: k8s.container.name
- action: delete
key: container
- action: upsert
from_attribute: node
key: k8s.node.name
- action: delete
key: node
- action: upsert
from_attribute: service
key: prometheus_service
Expand Down
3 changes: 0 additions & 3 deletions tests/integration/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ func GetMetricsFeature(expectedMetrics []string, metricsCollector MetricsCollect
expectedLabels = addCollectorSpecificMetricLabels(expectedLabels, releaseName, namespace, metricsCollector)
// drop some unnecessary labels
delete(expectedLabels, "prometheus_service")
delete(expectedLabels, "k8s.node.name")

return stepfuncs.WaitUntilExpectedMetricLabelsPresent(metricFilters, expectedLabels, waitDuration, tickDuration)(ctx, t, envConf)
},
Expand Down Expand Up @@ -169,7 +168,6 @@ func GetTelegrafMetricsFeature(expectedMetrics []string, metricsCollector Metric
expectedLabels = addCollectorSpecificMetricLabels(expectedLabels, releaseName, namespace, metricsCollector)

// drop some unnecessary labels
delete(expectedLabels, "k8s.node.name")
delete(expectedLabels, "prometheus_service")

return stepfuncs.WaitUntilExpectedMetricLabelsPresent(metricFilters, expectedLabels, waitDuration, tickDuration)(ctx, t, envConf)
Expand All @@ -187,7 +185,6 @@ func addCollectorSpecificMetricLabels(labels receivermock.Labels, releaseName st
}
prometheusLabels := receivermock.Labels{
"_collector": "kubernetes",
"k8s.node.name": internal.NodeNameRegex, // TODO: Remove this during the migration to v4
"instance": internal.IpWithPortRegex,
"prometheus_replica": fmt.Sprintf("prometheus-%s-.*-0", releaseName),
"prometheus": fmt.Sprintf("%s/%s-.*-prometheus", serviceMonitorNamespace, releaseName),
Expand Down