Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@Timed based metrics are not propagated by Spring Cloud GCP #3628

Open
Alos opened this issue Mar 4, 2025 · 0 comments
Open

@Timed based metrics are not propagated by Spring Cloud GCP #3628

Alos opened this issue Mar 4, 2025 · 0 comments
Assignees
Labels
priority: p2 type: bug Something isn't working

Comments

@Alos
Copy link
Contributor

Alos commented Mar 4, 2025

Describe the bug

Adding a @Timed annotation in a Spring Cloud GCP project does not always propagates its metrics back into Google Cloud Metrics or GCPs Trace UI.

Sample

Annotating methods with @Timed("test-cat-event") should publish this metric to GCP's Cloud Metrics.

@Timed("test-cat-event")
  @Scheduled(
      fixedDelayString = "5",
      timeUnit = TimeUnit.MINUTES)
  public void doTheThing() throws InterruptedException {
    log.info("[doTheThing] Doing the thing...");
    Thread.sleep(7000); // Pause execution
    log.info("[doTheThing] Done!");
  }

The metric is exposed correctly on the actuator /metrics endpoint and I can see metrics working when I run the project locally. However, the metrics are not exposed when running inside of GKE.

Minimal project to reproduce:
https://github.com/Alos/spring-cloud-gcp-metrics-issue

@jinseopkim0 jinseopkim0 self-assigned this Mar 4, 2025
@blakeli0 blakeli0 added the type: bug Something isn't working label Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants