Skip to content

Conversation

zeitlinger
Copy link
Member

@zeitlinger zeitlinger commented Sep 10, 2025

Fixes #1548

PrometheusNaming changes were incompatible - so deprecating instead and create e new PrometheusNames

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger requested a review from fstab September 10, 2025 15:39
@zeitlinger zeitlinger self-assigned this Sep 10, 2025
* replaced with underscores in Prometheus exposition formats. However, if metrics are exposed in
* OpenTelemetry format the dots are retained.
*/
public class PrometheusNames {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a name we could use that has a more drastic contrast to PrometheusNaming? Or maybe even PrometheusNamingV2? while reviewing I got confused as to which is which a few times

Copy link
Member Author

@zeitlinger zeitlinger Sep 11, 2025

Choose a reason for hiding this comment

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

yeah - that seems to be the hardest part

  • PrometheusUnicodeNaming
  • same name but different package
  • sanitizer interface: PrometheusNaming.UNICODE.sanitize(..)

}
}

public static boolean needsEscaping(String name, EscapingScheme scheme) {
Copy link
Contributor

Choose a reason for hiding this comment

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

just want to double check that all the public methods in this class are intentionally public?

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch - and I also moved it to NameEscaper

I'm a bit hesitant to add internal classes now - since it would be potentially a breaking change
Alternatively, only new classes as internal classes - but that might make it look like the other classes are all public - which they are not.

zeitlinger and others added 3 commits September 11, 2025 11:10
…odel/snapshots/PrometheusNamesTest.java

Co-authored-by: Jay DeLuca <jaydeluca4@gmail.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
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

Successfully merging this pull request may close these issues.

: does not get converted to _
2 participants