question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CPU Hovers at 20-30% after OpenCensus has been added to a GCP AppEngine Flex service

See original GitHub issue

Please answer these questions before submitting a bug report.

What version of OpenCensus are you using?

0.12.2

What JVM are you using (java -version)?

8

What did you do?

If possible, provide a recipe for reproducing the error. Include OpenCensus library in our build.gradle:

    compile "io.opencensus:opencensus-api:0.12.2"
    compile "io.opencensus:opencensus-exporter-trace-stackdriver:0.12.2"
    runtime "io.opencensus:opencensus-impl:0.12.2"

In Spring Boot using GCP AppEngine Flexible, we’ve defined a class to initialize the stackdriver exporter.

package com.jda.starter.utils.tracing;

import com.jda.starter.Application;

import io.opencensus.exporter.trace.stackdriver.StackdriverTraceConfiguration;
import io.opencensus.exporter.trace.stackdriver.StackdriverTraceExporter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Profile;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

import java.io.IOException;

@Component
@Profile(Application.Profiles.PRODUCTION)
public class OpenCensusExporterInitializer {

  private static final Logger LOGGER = LoggerFactory.getLogger(OpenCensusExporterInitializer.class);

  @EventListener(ContextRefreshedEvent.class)
  public void contextRefreshedEvent(ContextRefreshedEvent event) {
    initialize();
  }

  private void initialize() {
    try {
      StackdriverTraceExporter.createAndRegister(StackdriverTraceConfiguration.builder().build());
    } catch (IOException exception) {
      LOGGER.warn("Could not initialize OpenCensus export to Stackdriver");
    }
  }
}

What did you expect to see?

CPU to be close to 0 utilization when no traffic takes place.

What did you see instead?

CPU hovering between 20-30% once OpenCesus has been added to a service

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:23 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
solatiscommented, Jun 9, 2018

I just ran into this issue as well, but not using AppEngine. Using VisualVM I saw that the crulpit was the OpenCensus.Disruptor-0 thread, so that confirms the investigation into Disruptor in this issue report.

Switching to -lite addresses the issue. Using 0.14 with the stackdriver exporter.

0reactions
bogdandrutucommented, Nov 21, 2018

@steveniemitz see discussion in #1599 as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

See raw diff - Hugging Face
... + "榮": 2027, + "構": 2028, + "樊": 2029, + "標": 2030, + "模": 2031, ... + "conver": 4662, + "##iss": 4663,...
Read more >
Tag list (ranking) [the most recent 1-year / upper ... - Karatos
Overall ranking; tag name; number of articles ranking; Asking the number of rank; followers number of rank 1;Python;1;2;1 2;JavaScript;2;1;2 3;Ruby;4;3;10
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found