-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
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.
Thank you for this PR @jarpy, looks great already! I left some comments, let me know what you think!
deploy/kubernetes/elastic-agent-standalone/elastic-agent-standalone-daemonset-configmap.yaml
Outdated
Show resolved
Hide resolved
- name: is_controller | ||
type: keyword | ||
description: > | ||
Owner is controller ("true" or "false") |
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.
It can be also <none>
, or this value is just omitted?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
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! Thanks for adding this!
Let's wfg now.
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. 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_job
metricset 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.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally