Closed sanyaj22 closed 2 weeks ago
Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the support guidelines, we prefer to use GitHub issues for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.
Also, Micrometer 1.11.0 does not have OSS support anymore, please consider to upgrade: https://micrometer.io/support/ If you decide to post this to Stack Overflow please make sure your question is clear and the code is formatted, I have a hard time to read the description of this issue.
Describe the bug Timer metrics - not able to see _seconds_count and _seconds_sum metrics, _max metric is getting scrap
Environment production micro meter 1.11.0
I need to calculate response time(avg, p99) of an api and i have implemented like this
package com.groww.payouts.util;
import io.micrometer.core.instrument.MeterRegistry; import io.micrometer.core.instrument.Tag; import io.micrometer.core.instrument.Timer; import io.micrometer.core.instrument.distribution.DistributionStatisticConfig; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component;
import java.sql.Time; import java.util.Arrays; import java.util.Collections; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.TimeUnit;
@Component @Slf4j public class MetricUtil {
} package com.groww.payouts.config;
import io.micrometer.core.instrument.MeterRegistry; import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.Timer; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile;
import java.util.Optional;
@Configuration public class OtelMetricsConfig { @Bean @ConditionalOnClass(name = "io.opentelemetry.javaagent.OpenTelemetryAgent") public MeterRegistry otelRegistry() { Optional otelRegistry = Metrics.globalRegistry.getRegistries().stream()
.filter(r -> r.getClass().getName().contains("OpenTelemetryMeterRegistry"))
.findAny();
otelRegistry.ifPresent(Metrics.globalRegistry::remove);
return otelRegistry.orElse(null);
}
}
the issue here is I am not able to see response_time_yes_seconds_count or response_time_yes_seconds_sum metric but response_time_yes_max is getting scrap . i am doing anything wrong