Skip to content
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

write_prometheus plugin: Use the unit field to create metric names. #4220

Merged
merged 3 commits into from
Dec 29, 2023

Conversation

octo
Copy link
Member

@octo octo commented Dec 29, 2023

Reference: https://opentelemetry.io/docs/specs/otel/compatibility/prometheus_and_openmetrics/#metric-metadata-1

ChangeLog: Write Prometheus plugin: Units are appended to metric family names if available.

@octo octo requested a review from a team as a code owner December 29, 2023 16:00
@collectd-bot collectd-bot added this to the 6.0 milestone Dec 29, 2023
@octo octo added this to In progress in collectd 6 via automation Dec 29, 2023
Copy link
Contributor

@eero-t eero-t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine!

@octo octo merged commit ad5b7ea into collectd:collectd-6.0 Dec 29, 2023
24 checks passed
collectd 6 automation moved this from In progress to Done Dec 29, 2023
Copy link
Contributor

@eero-t eero-t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I did review, I looked only at how the code works, and did not think about how it maps the units. Here are late comments on latter.

Comment on lines +77 to +80
.name = "system.processes.created",
.type = METRIC_TYPE_COUNTER,
.want = "system_processes_created_total",
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't think about this too much to be honest. I simply grabbed the table from https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/pkg/translator/prometheus and implemented it. I think it's a good start to iterate from.

I don't know how common it is for metric names to end in _created. If this is a problem, I'm sure we can deal with it when it pops up.

src/write_prometheus.c Show resolved Hide resolved
src/write_prometheus.c Show resolved Hide resolved
@eero-t
Copy link
Contributor

eero-t commented Jan 2, 2024

Sounds reasonable. Items could be left unresolved as reminders, or you can resolve them if you do not think that necessary.

@octo octo deleted the 6/write_prometheus branch January 3, 2024 17:59
@octo octo added the Feature label Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
collectd 6
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants