spring-cloud / spring-cloud/spring-cloud-gateway

Micrometer tags should follow the recommended naming convention

Open
#3,434 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
Java
Stars
4.9k
Forks
3.5k
Avg merge
20h 57m
Merged PRs (30d)
8

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate GatewayHttpTagsProvider and GatewayRouteTagsProvider and inspect how their Micrometer tag names are defined and consumed. Read the linked Micrometer naming guidance, then determine how compatibility for existing dashboards should be handled; done means the tags follow lowercase dot notation with the agreed migration behavior covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
observability-sre
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.