Issues with Prometheus scraping metrics from a Spring Boot application due to missing labels
I'm using Spring Boot 2.5.4 with Micrometer to expose application metrics, and I've configured Prometheus to scrape these metrics. However, I'm encountering an issue where some metrics are being scraped without the expected labels, leading to confusion when analyzing the data in Grafana. I set up my application with the following configuration in `application.yml`: ```yaml management: metrics: export: prometheus: enabled: true ``` I've also created a custom metric like this: ```java import io.micrometer.core.instrument.MeterRegistry; import io.micrometer.core.instrument.Tags; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class CustomMetrics { @Autowired public CustomMetrics(MeterRegistry registry) { registry.counter("custom_metric", Tags.of("status", "success")); } } ``` When I check the metrics endpoint at `/actuator/prometheus`, I see the `custom_metric` counter, but it appears without the `status` label: ``` # HELP custom_metric Counter for custom metrics # TYPE custom_metric counter custom_metric 1.0 ``` I've tried adding the label directly in the counter definition, but it still doesn't show up when Prometheus scrapes it. I've also confirmed that the Prometheus configuration correctly points to my application, and I can see other metrics that do have labels. Is there something I'm missing in the Micrometer setup, or do I need to adjust the way I'm registering the counter? Any insights would be appreciated! Could this be a known issue? Thanks in advance!