How to access the Metric Data which is getting generated using java SDK


How can we access the temporal data which is generating the Metrics. I am trying to access the Metric using Java SDK by using this link How to enable Metrics Support using JAVA SDK


1 Like

You need to do something like this:

    new WorkflowServiceStubsImpl(null, WorkflowServiceStubsOptions

Inside the metric Scope you need to create a
import com.uber.m3.tally.StatsReporter so it can connect to your statsD or other metrics client

public static Scope getStatsDMetricScope(String environment) {
        StatsDClient statsDClient =
                new NonBlockingStatsDClient(
                        environment /* metrics prefix */,
                        "" /* statsD server hostname */,
                        8125 /* statsD port */);
        StatsReporter statsReporter = new StatsDReporter(statsDClient);
        return new RootScopeBuilder()
1 Like