dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.93k stars 480 forks source link

Don't pass meter descriptions as units #6448

Closed gansb closed 1 month ago

gansb commented 1 month ago

Description

When publishing as prometheus metrics the kafka gauge metrics are exported as

# TYPE messaging_kafka_consumer_queue_message_count_Number of ops (callbacks, events, etc) waiting in queue for application to serve with rd_kafka_poll() gauge
# UNIT messaging_kafka_consumer_queue_message_count_Number of ops (callbacks, events, etc) waiting in queue for application to serve with rd_kafka_poll() Number of ops (callbacks, events, etc) waiting in queue for application to serve with rd_kafka_poll()
messaging_kafka_consumer_queue_message_count_Number of ops (callbacks, events, etc) waiting in queue for application to serve with rd_kafka_poll()

This may be because the description is passed as a unit.

Fixes #6447

Checklist

gansb commented 1 month ago

@dotnet-policy-service agree

mitchdenny commented 1 month ago

@samsp-msft @JamesNK

JamesNK commented 1 month ago

Looks like a cut and dried bug. Second argument is unit, not description.

https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.metrics.meter.createcounter?view=net-8.0#system-diagnostics-metrics-meter-createcounter-1(system-string-system-string-system-string)

davidfowl commented 1 month ago

Does this need to be backported?

JamesNK commented 1 month ago

@gansb Thanks for the fix!

@eerhardt Can you manage getting this backported to 9.0?

davidfowl commented 1 month ago

/backport to release/9.0

github-actions[bot] commented 1 month ago

Started backporting to release/9.0: https://github.com/dotnet/aspire/actions/runs/11492020195