-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
feat: Add systemd (unit) receiver #37169
base: main
Are you sure you want to change the base?
feat: Add systemd (unit) receiver #37169
Conversation
This also refactors the `scrape` function somewhat.
Signed-off-by: Pieter Lexis <pieter.lexis@tomtom.com>
|
@@ -4,8 +4,172 @@ status: | |||
class: receiver | |||
stability: | |||
development: [metrics] | |||
distributions: [] | |||
distributions: [contrib] |
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.
no it's not in contrib yet, please remove for now
- active_state | ||
- sub_state | ||
systemd.unit.restarts: | ||
description: Amount of time the unit was restarted this boot |
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.
the unit {restarts}
doesn't match the description
unit: "{system_state}" | ||
attributes: | ||
- systemd_version | ||
- system_state |
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.
no that doesn't really work, you are sending a metric but only care for its attribute. You cannot make the unit match the attribute name.
The value of the metric must itself be meaningful, or just send 1
if you're just going to create a time series with the attributes.
- systemd_version | ||
- system_state | ||
- architecture | ||
- virtualization |
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.
I would disable those 2 attributes by default
gauge: | ||
value_type: int | ||
unit: "{jobs}" | ||
systemd.installed_jobs: |
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.
is installed jobs the right name? How about systemd.jobs.total
?
monotonic: true | ||
value_type: int | ||
unit: "{jobs}" | ||
systemd.failed_jobs: |
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.
systemd.failed_jobs: | |
systemd.jobs.failed: |
enabled: false | ||
gauge: | ||
value_type: int | ||
unit: "{active_state}" |
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.
What value are we reporting?
attributes: | ||
- load_state | ||
- active_state | ||
- sub_state |
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 might create high cardinality as your metric will have changing attribute values, creating multiple time series.
@atoulme I'll fix the issues mentioned somewhere the coming week |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
@atoulme I have some problems with rebasing. Is there a guide somewhere where there are some descriptions on how to fix the gomod files, builder-config etc.? |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Description
This PR adds an initial systemd unit receiver, as requested in #33532.
I would describe the receiver a very early alpha, but usable.
Comments are welcome.
Link to tracking issue
Fixes #33532
Testing
This receiver has had some light testing and for this config:
it outputs this as metrics:
Apart from that, there are several go tests of the scraper.