Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

gRpc client stats are not populated, additional configuration required #2080

Open
iggyzap opened this issue Jul 29, 2021 · 0 comments
Open
Labels

Comments

@iggyzap
Copy link

iggyzap commented Jul 29, 2021

Please answer these questions before submitting a bug report.

What version of OpenCensus are you using?

    <properties>
        <io.grpc.version>1.35.0</io.grpc.version>
        <java.version>11</java.version>
        <opencensus.version>0.28.3</opencensus.version>
    </properties>

What JVM are you using (java -version)?

openjdk version "11.0.9" 2020-10-20
OpenJDK Runtime Environment (build 11.0.9+11-alpine-r0)
OpenJDK 64-Bit Server VM (build 11.0.9+11-alpine-r0, mixed mode)

What did you do?

If possible, provide a recipe for reproducing the error.

  1. Configure opencensus instrumentation as described here:
    a. https://opencensus.io/guides/grpc/java/#instrumenting-the-client
    b. https://opencensus.io/zpages/java/#1
  2. When app starts and does few grpc exchanges, hit prometheus endpoint
  3. Observe only help for metrics
  4. Hit zPages endpoing
  5. Observe empty page

What did you expect to see?

Some stats related to invoked grpc methods

What did you see instead?

Just helptext for possible stats

Additional context

To enable stats following dependency needs to be included:

           <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-census</artifactId>
            <version>${io.grpc.version}</version>
        </dependency>

Also following code snipped needs to be added for gRpc stats to be gathered, when configuring managed channel

           ManagedChannelBuilder<?> builder = ManagedChannelBuilder
                .forAddress(serverUrl, port)
                .keepAliveTime(keepAliveMinutes, TimeUnit.MINUTES)
                
                .intercept(InternalCensusStatsAccessor.getClientInterceptor(true, true, true));
           return builder.build().
                

Even with changes from above, zPages still do not contain information about grpc invocations.

@iggyzap iggyzap added the bug label Jul 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant