eclipse/microprofile-metrics

MicroProfile Metrics [5.1.2] Enable Tag name to conform to the OpenTelemetry Semantic Conventions for GenAI Metrics attribute names.

Closed this issue ยท 6 comments

As part of the recent development of smallrye-llm I've included Generative AI Metrics using microprofile-metrics-api.

However, the org.eclipse.microprofile.metrics.Tag class only accept names that passes the following regular expression:

The tag name, must match the regex [a-zA-Z_][a-zA-Z0-9_]*.

Can we revisit the regular expression as it won't accept the attribute mentioned on the OpenTelemetry page?

Thanks.

  • By checking this box I attest that all TCK requirements have been met, including any compatibility rules.

Hi @TheEliteGentleman , should smallrye-llm use MP Telemetry instead of MP Metrics? MP Metrics is now a standalone spec and MP Telemetry (which includes metrics) is now part of the MP umbrella.

On top of that, the Prometheus data model indicates that labels need to follow that regex pattern. https://prometheus.io/docs/concepts/data_model/

On top of that, the Prometheus data model indicates that labels need to follow that regex pattern. https://prometheus.io/docs/concepts/data_model/

Fair enough. It seems that the regular expression needs updating on the Tag class. The doc seems to include a colon (:) in the regexp.

[a-zA-Z_:][a-zA-Z0-9_:]*

Hi @TheEliteGentleman , should smallrye-llm use MP Telemetry instead of MP Metrics? MP Metrics is now a standalone spec and MP Telemetry (which includes metrics) is now part of the MP umbrella.

Interesting. ๐Ÿค” Let me investigate further. ๐Ÿ™๐Ÿพ

On top of that, the Prometheus data model indicates that labels need to follow that regex pattern. https://prometheus.io/docs/concepts/data_model/

Fair enough. It seems that the regular expression needs updating on the Tag class. The doc seems to include a colon (:) in the regexp.

[a-zA-Z_:][a-zA-Z0-9_:]*

That rule applies to the metric names.

Tags/Labels follow the rules listed out in the Metric labels section below.

Ok, it seems I've overlooked the Telemetry Meter instrumentation. It provide metrics that can record values with attributes, instead of Tags.

Sorry for the misunderstanding. I'll close this as a no-fix (works as intended).