Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Spring spring-cloud-gcp-starter-metrics should autoconfigure labels #2447

Open
Alos opened this issue Jun 22, 2020 · 3 comments
Open

Spring spring-cloud-gcp-starter-metrics should autoconfigure labels #2447

Alos opened this issue Jun 22, 2020 · 3 comments

Comments

@Alos
Copy link

Alos commented Jun 22, 2020

Is your feature request related to a problem? Please describe.
Without this feature, all metrics generated by your application are mapped to global and use your GCP project_id as the project making it impossible to get correct metrics if you have more than one application running in a project. (For example I have lots of microservices running in my GKE cluster)

Describe the solution you'd like
Ideally Spring Cloud GCP should auto tag/label the metrics using the spring.application.name among other properties of the service so that metrics can be grouped and filtered.

Describe alternatives you've considered
Writting my own implementation of the MicrometerStackdriverConfig or using:

 @Bean
  MeterRegistryCustomizer<StackdriverMeterRegistry> commonTags() {
    return (registry) -> registry.config().commonTags("microservice", "test-service");
  }

Additional context
https://cloud.google.com/monitoring/api/resources

@elefeint
Copy link
Contributor

This may belong in Spring Cloud GCP, or it might belong in Spring Boot's StackdriverMetricsExportAutoConfiguration. Need to see if any other metrics systems provide these conveniences.

For posterity, this is another actuator way to specify common tags through properties:

spring.application.name=my-application
management.metrics.tags.application=${spring.application.name}

@elefeint
Copy link
Contributor

NB: need to look into how to configure Resource Type; the default one is Global.

@eddumelendez
Copy link
Contributor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants