Skip to content

Micrometer tags should follow the recommended naming convention #3434

Open
@sonallux

Description

@sonallux

Is your feature request related to a problem? Please describe.

Currently the Tags created by the default Spring Cloud Gateway GatewayTagsProvider do not follow the recommended naming convention by micrometer. The Tags are currently defined in camel case but the micrometer documention recommendes:

We recommend that you follow the same lowercase dot notation described for meter names when naming tags. Using this consistent naming convention for tags allows for better translation into the respective monitoring system’s idiomatic naming schemes.

The following tags are currently not following the convention:

  • From GatewayHttpTagsProvider: httpStatusCode and httpMethod
  • From GatewayRouteTagsProvider: routeId and routeUri

This is not very intuitive, because as far as I have seen, all other Spring Projects use the recommended naming convention.

Describe the solution you'd like
The micrometer tags created by Spring Cloud Gateway follow the naming convention and use lowercase dot notation.

I know that changing this is a breaking change and break peoples dashboards, alerting and/or automation. But maybe one can introduce a property to switch the naming of the tags. At first the default value will stay camel case and with the next major version the default is switched to lowercase dot notation.

Describe alternatives you've considered

I think it might be also possible to write a custom MeterFilter to rename the tags from camel case to lowercase dot notation. But I have not looked into this.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions