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

StackdriverStatsExporter.createAndRegister takes 10 seconds #2090

Open
rockwotj opened this issue Jan 3, 2022 · 1 comment
Open

StackdriverStatsExporter.createAndRegister takes 10 seconds #2090

rockwotj opened this issue Jan 3, 2022 · 1 comment
Labels

Comments

@rockwotj
Copy link

rockwotj commented Jan 3, 2022

Please answer these questions before submitting a bug report.

What version of OpenCensus are you using?

0.28.3

What JVM are you using (java -version)?

11.0.13

What did you do?

If possible, provide a recipe for reproducing the error.

The following line of code is taking 10 seconds to execute, and the document suggests running this on the main thread at startup. This delay is causing K8S to kill the pods before they startup.

StackdriverStatsExporter.createAndRegister(
                StackdriverStatsConfiguration.builder()
                    .setMetricNamePrefix("custom.googleapis.com/<redacted>/")
                    .build()
            )

Additional context

Add any other context about the problem here.

We're running on GKE using distroless-java docker images

@rockwotj rockwotj added the bug label Jan 3, 2022
@mickykurniawan
Copy link

mickykurniawan commented Jan 27, 2022

In my case, sometimes it took 5 minutes.

    @EventListener(ApplicationPreparedEvent.class)
    private void initializeOpenCensusCore() {
            StackdriverStatsExporter.createAndRegister(StackdriverStatsConfiguration.builder()
                    .setExportInterval(Duration.fromMillis(EXPORT_INTERVAL))
                    .build());
...

build.gradle

    compile 'io.opencensus:opencensus-api:0.30.0'
    compile 'io.opencensus:opencensus-exporter-stats-stackdriver:0.30.0'
    runtime 'io.opencensus:opencensus-impl:0.30.0'
java -version
openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment Homebrew (build 11.0.12+0)
OpenJDK 64-Bit Server VM Homebrew (build 11.0.12+0, mixed mode)

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

2 participants