But when I go to /actuator/prometheus endpoint, all metrics except the temporal ones are showing up. Can someone please help identify if I am missing something? My workers come up and I am able to run workflows no problem.
@Bean
public TemporalOptionsCustomizer<WorkflowServiceStubsOptions.Builder>
customServiceStubsOptions() {
return new TemporalOptionsCustomizer<>() {
@Nonnull
@Override
public WorkflowServiceStubsOptions.Builder customize(
@Nonnull WorkflowServiceStubsOptions.Builder optionsBuilder) {
PrometheusMeterRegistry registry = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
StatsReporter reporter = new MicrometerClientStatsReporter(registry);
Map<String, String> mp = ImmutableMap.of("ojha", "ojha");
// set up a new scope, report every 1 seconds
Scope scope =
new RootScopeBuilder()
.tags(mp)
.reporter(reporter)
.reportEvery(com.uber.m3.util.Duration.ofSeconds(1));
optionsBuilder.setMetricsScope(scope);
return optionsBuilder;
}
};
}
I don’t see any error reported in the logs. I followed the examples in temporal-java-samples project, and I do not see any metric specific configuration, or anything which is different than what I have in my project above.
We have spring boot sample that shows how to config actuator and sdk metrics if that helps. If you use temporal-spring-boot-starter there is i think no need for your to set up custom WorkflowServiceStubs and metrics scope, its done for you via application config. Note the samples use SpringBoot 2
Thanks @tihomir … yeah I am already configuring my project with temporal-spring-boot-starter, and I compared my project with the sample provided, perhaps I am missing something very basic, but I do not see any difference. If I remove the custom WorkflowServiceStubs I have, still nothing shows up on prometheus endpoint. I will next try with spring boot 2, just to make sure its not a spring boot 3 thing, but I would really appreciate if someone in the community could (if they have time) glance through the repo I have added to see if I am making a mistake. Even the library versions are same as the one in samples.
Update:
I just tried with spring boot 2 (same version in samples) as well, same result… Even tried switching between JDK 11 and 17 just to make sure
// portion of build.gradle
plugins {
id 'java'
id 'org.springframework.boot' version '2.7.13'
id 'io.spring.dependency-management' version '1.1.0'
id 'com.diffplug.spotless' version '6.19.0'
}
group = 'dev.gauravojha'
version = '0.0.1-SNAPSHOT'
java {
sourceCompatibility = JavaVersion.VERSION_1_8
}
just to confirm with this you mean you do not see any metrics that start with “temporal_” on the http://localhost:8080/actuator/prometheus endpoint? What do you see instead?
copied springboot TemporalOptionsConfigconfig class into my branch, and removed the earlier Bean config I was doing. Same result
I have a feeling i am missing out on a very basic config somewhere, but the repo is already stripped down to a very minimal codebase, so comparing with the samples repo 1:1, I am unable to see what I am missing out on
Am facing the same issue too. I don’t see temporal metrics, everything else is coming.
We are using temporal spring boot autoconfigure module. I have added the config, not sure what am I missing.