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

Allow for setting metrics descriptions #67

Open
lsunsi opened this issue Nov 6, 2023 · 2 comments
Open

Allow for setting metrics descriptions #67

lsunsi opened this issue Nov 6, 2023 · 2 comments

Comments

@lsunsi
Copy link

lsunsi commented Nov 6, 2023

Feature Request

Motivation

Opentelemetry (and the rust crate) allow for setting descriptions to metrics, as seen in https://docs.rs/opentelemetry/0.20.0/opentelemetry/metrics/struct.InstrumentBuilder.html#method.with_description for example. It's just a handy feature that generates both code documentation and complementary information to the metric.

It'd be nice to allow this possibility via tracing-opentelemetry, so users using this API won't be limited. The same goes for .with_unit as well!

Proposal

Maybe it could work with specially named properties like we have with "otel.name", maybe on metric events a "otel.description" property or something.

Alternatives

I didn't think of anything

@ymgyt
Copy link
Contributor

ymgyt commented Nov 7, 2023

I need this feature too.
My question in adding this feature is that the current api allows multiple metrics to be output from a single tracing event.

for example

tracing::info!(
  counter.request_count = 1,
  histgram.request_duration = 500,
  otel.description = "...",
);

How should we handle otel.description in such a case?

@lsunsi
Copy link
Author

lsunsi commented Nov 7, 2023

This is a great question, I haven't thought of it. Maybe it could use the name of the counter?

tracing::info!
  counter.request_count = 1,
  histgram.request_duration = 500,
  otel.request_count.description = "...",
  otel.request_duration.description = "..."
);

Just throwing out ideas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants