Fix missing Metricbeat events when kube-state-metrics denylists *_created and reduce ProcessMetrics CPU#51255
Conversation
🤖 GitHub commentsJust comment with:
|
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services) |
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
…hub.com:MichaelKatsoulis/beats into fix/ksm-state-service-storageclass-event-anchor
…hub.com:MichaelKatsoulis/beats into fix/ksm-state-service-storageclass-event-anchor
|
@orestisfl Can I have a review on this one ? |
TL;DRThe failing Buildkite step only exposes Remediation
Investigation detailsRoot CauseInconclusive from the available log data. The prefetched Buildkite log ends with only the module-level failure summary, not the CockroachDB assertion/error output. The changed PR code is in That collector path fetches Prometheus families directly in Evidence
Verification
Follow-upIf the retry fails again, the next actionable data is the CockroachDB JSON/XML test artifact rather than the top-level Buildkite log. What is this? | From workflow: PR Buildkite Detective Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
|
/test |
|
@Mergifyio backport 9.4 9.3 8.19 |
✅ Backports have been createdDetails
|
…ated and reduce ProcessMetrics CPU (#51255) (#51411) * Fix missing Metricbeat events when kube-state-metrics denylists *_created * add changelog * linter error * Reduce CPU in ProcessMetrics by hoisting Flatten out of inner loop * linter error * add inline comment about dedup key metrics (cherry picked from commit a84fb68) Co-authored-by: Michalis Katsoulis <michaelkatsoulis88@gmail.com>
…ated and reduce ProcessMetrics CPU (#51255) (#51410) * Fix missing Metricbeat events when kube-state-metrics denylists *_created * add changelog * linter error * Reduce CPU in ProcessMetrics by hoisting Flatten out of inner loop * linter error * add inline comment about dedup key metrics (cherry picked from commit a84fb68) Co-authored-by: Michalis Katsoulis <michaelkatsoulis88@gmail.com>
…ated and reduce ProcessMetrics CPU (#51255) (#51409) * Fix missing Metricbeat events when kube-state-metrics denylists *_created * add changelog * linter error * Reduce CPU in ProcessMetrics by hoisting Flatten out of inner loop * linter error * add inline comment about dedup key metrics (cherry picked from commit a84fb68) Co-authored-by: Michalis Katsoulis <michaelkatsoulis88@gmail.com>
Proposed commit message
1. Fix missing state_service and state_storageclass events on OpenShift
When kube-state-metrics is configured with
--metric-denylist=.*_created(default on OpenShift), these metricsets produce zero events because
kube_service_created/kube_storageclass_createdare the onlyevent-anchoring metrics in their mappings.
Promote InfoMetric data to standalone events in the Prometheus helper
when no event-creating metrics produce results, so label metadata from
_infoand_spec_typegauges is not silently dropped.2. Reduce CPU usage in ProcessMetrics InfoMetric merging
mapstr.Flatten()was called inside the innereventsloop for everyinfoMetric, re-allocating and re-traversing the same map on every
iteration. Moved the Flatten() call outside the inner events loop so it runs once per infoMetric instead of once per infoMetric × event combination.
Benchmark results (state_container-like workload):
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration files./changelog/fragmentsusing the changelog tool.Related issues