[metricbeat] Add state_job metricset#26479
Conversation
Add a Metricbeat metricset for Kubernetes Job resources.
| // Add owner information provided by the "kube_job_owner" InfoMetric. | ||
| "owner_kind": p.Label("owner.kind"), | ||
| "owner_name": p.Label("owner.name"), | ||
| "owner_is_controller": p.Label("owner.is_controller"), |
There was a problem hiding this comment.
This could, in theory, be a proper boolean, but I wasn't sure how to cast it down here in the Labels section, where BooleanMetric can't be used (as far as I can tell).
Any tips? OK to leave it as a "boolean string", maybe?
There was a problem hiding this comment.
Since we don't just have true/false but it can also be <none> I think we are OK with a "boolean string".
There was a problem hiding this comment.
Cool, thanks. Would you normally store the exact "<none>" string from KSM, or should I translate it to "none" or similar?
There was a problem hiding this comment.
We could "cook" it a little bit and convert it to "none" but I think keeping as is work too. I'm more into leaving it as what we get from the original source.
So need to change :).
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
|
Fixed a couple of errors detected by CI. I haven't been able to get the integtests running locally, sorry about that, |
|
Pinging @elastic/integrations (Team:Integrations) |
deploy/kubernetes/elastic-agent-standalone/elastic-agent-standalone-daemonset-configmap.yaml
Show resolved
Hide resolved
| - name: is_controller | ||
| type: keyword | ||
| description: > | ||
| Owner is controller ("true" or "false") |
There was a problem hiding this comment.
It can be also <none>, or this value is just omitted?
There was a problem hiding this comment.
You're quite right. <none> is a possibility. I hadn't seen it because I had been testing with CronJobs.
Fixed in 618705f.
| // Add owner information provided by the "kube_job_owner" InfoMetric. | ||
| "owner_kind": p.Label("owner.kind"), | ||
| "owner_name": p.Label("owner.name"), | ||
| "owner_is_controller": p.Label("owner.is_controller"), |
There was a problem hiding this comment.
Since we don't just have true/false but it can also be <none> I think we are OK with a "boolean string".
|
Thanks for checking this out @ChrsMark, and for the keen observations. |
ChrsMark
left a comment
There was a problem hiding this comment.
lgtm! Thanks for adding this!
Let's wfg now.
MichaelKatsoulis
left a comment
There was a problem hiding this comment.
lgtm. Thanks @Jarpy !
|
Thank you both! We have big things planned for our fleet monitoring after this is in. :D
I don't know what that is, but I'm going to assume it's a good thing. ;) As a guest here, I'm not sure if I should hit "merge", or you would prefer to. I also don't know your backport workflow. So I must ask for a just a little more of your time and help, cheers. Jenkins, test this please, becuase it looks like the last build stalled on Auditbeat at: |
|
Jenkins, retest this please (?) |
|
Triggered rerun from the Jenkins UI. |
|
Hey @Jarpy sorry for stalling cause of the CI, wfg (== waitForGreen) took longer... This will hit 7.15 and hence the I will merge it now and take take care of merging the backport PR too. Thanks again and feel free to reach out to us while you are working on your monitoring solution cause dogfooding is always valuable! |
(cherry picked from commit 24c07b2)
(cherry picked from commit 24c07b2) # Conflicts: # metricbeat/docs/fields.asciidoc # metricbeat/module/kubernetes/fields.go
…stage-failed-within-same-build * upstream/master: (36 commits) Revert "[CI] fight the flakiness with some retry option in the CI only for the Pull Requests (elastic#26617)" (elastic#26704) Packaging: linux/armv7 is not supported (elastic#26706) Cyberarkpas: Link to official docs on how to setup TLS (elastic#26614) Make network_direction, registered_domain and convert processors compatible with ES older than 7.13.0 (elastic#26676) Disable armv7 packaging (elastic#26679) [Heartbeat] use --params flag for synthetics (elastic#26674) Update dependent package to avoid downloading a suspicious file (elastic#26406) [mergify] set title and allow bp in any direction (elastic#26648) Fix memory leak in SQL helper when database is not available (elastic#26607) [CI] fight the flakiness with some retry option in the CI only for the Pull Requests (elastic#26617) [mergify] automate PRs that change the backport rules (elastic#26641) [Metricbeat] Add Airflow module in xpack (elastic#26220) chore: add-backport-next (elastic#26620) [metricbeat] Add state_job metricset (elastic#26479) CI: jenkins labels are less time consuming now (elastic#26613) [MetricBeat] [AWS] Fix aws metric tags with resourcegroupstaggingapi paginator (elastic#26385) (elastic#26443) Move openmetrics module to oss (elastic#26561) Skip flaky test TestFilestreamMetadataUpdatedOnRename (elastic#26609) [filebeat][fortinet] Use default add_locale for fortinet.firewall (elastic#26524) Enroll proxy settings (elastic#26514) ...
Add a Metricbeat metricset for Kubernetes Job resources.
What does this PR do?
Adds a
state_jobmetricset to the Metricbeat Kubernetes module. Follows the established pattern of consuming Kube State Metrics output.Why is it important?
Enables monitoring and alerting for Kubernetes Jobs.
Checklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.How to test this PR locally