[CONTP-1569] Add KSM labels_as_tags / annotations_as_tags / tags to CRD#2937
[CONTP-1569] Add KSM labels_as_tags / annotations_as_tags / tags to CRD#2937
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2937 +/- ##
==========================================
+ Coverage 40.69% 41.00% +0.31%
==========================================
Files 321 324 +3
Lines 28413 29152 +739
==========================================
+ Hits 11563 11955 +392
- Misses 16015 16332 +317
- Partials 835 865 +30
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 14 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
🎯 Code Coverage (details) 🔗 Commit SHA: bab3433 | Docs | Datadog PR Page | Give us feedback! |
b8a4a37 to
8c34275
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c3427579b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
drichards-87
left a comment
There was a problem hiding this comment.
Left some suggestions from Docs and approved the PR.
e32a677 to
4e4f0c6
Compare
First split-out of CONTP-1569 (Operator <-> Helm chart parity). Adds three KubeStateMetricsCoreFeatureConfig fields that write into the KSM check instance YAML: - LabelsAsTags (map[string]map[string]string): per-resource-kind label->tag mapping. - AnnotationsAsTags (map[string]map[string]string): per-resource-kind annotation->tag mapping. - Tags ([]string): static tags applied to all KSM metrics; emitted via YAML encoder so values containing colons, slashes, or other YAML-special characters are quoted safely. Introduces a small writeYAMLBlock helper in configmap.go used by all three sites. No RBAC changes, no collector list changes, no behavior change on upgrade for users who don't set any of the three new fields. Sub-task of CONTP-1446. Follow-up PRs will add CollectSecretMetrics and CollectConfigMaps (those touch RBAC and have an upgrade-reconcile note).
4e4f0c6 to
bab3433
Compare
Adds three additive fields to
KubeStateMetricsCoreFeatureConfigthat emit into the KSM check-instance YAML.labelsAsTagsmap[string]map[string]stringnillabels_as_tags:in check instance)annotationsAsTagsmap[string]map[string]stringniltags[]stringnilIntroduces a small
writeYAMLBlockhelper inconfigmap.goused by all three emission sites. No RBAC changes, no collector-list changes, no behavior change on upgrade for users who do not set any of the three new fields — the rendered ConfigMap is byte-identicalto today's output when the new fields are unset.
Example
DatadogAgent CR using the three new fields alongside the existing
collectCrMetrics:Rendered KSM check instance (
datadog-kube-state-metrics-core-configConfigMap, new sections only — rest ofinstances[0]is byte-identical to today's output):Notes
labelsAsTags/annotationsAsTagsmatches the Helm chart (helm charts/charts/datadog/values.yaml) exactly so users can copy values between the two configs.