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.

opencensus-ext-requests usage with google-cloud-logging shows too many trace requests and slows down the application.

See original GitHub issue

Hi all, Background: I use Stackdriver to log messages and to store trace from my application. The application is hosted in GKE. The app uses Python 3.7 and the below libraries 'google-cloud-logging==1.15.0', 'google-cloud-trace==0.23.0', 'opencensus==0.7.10', 'opencensus-ext-stackdriver==0.7.2', 'opencensus-ext-requests==0.7.3', 'opencensus-ext-httplib==0.7.3'

I see traces of the below set of requests being traced multiple times and it is slowing down the application, as traces of all these requests are being uploaded to Stackdriver. As shown below, a simple api which just logs to Stackdriver and no other task itself is taking 9000+ms, which is very slow. The below set seem to be repeated multiple times. image image

Analysis: I guessed these traces came from URL requests happening within google-cloud-logging library and tried blacklisting by doing the below, but it did not help.

execution_context.set_opencensus_attr(
    'blacklist_hostnames',
    ['http://metadata.google.internal./computeMetadata/v1/', 'localhost', '127.0.0.1']
)
config_integration.trace_integrations(['requests'])

Request: I am reaching out for help from anyone to ignore tracing these requests i believe is happening within google-cloud-logging library. Thanks for any help in advance.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

github_iconTop Results From Across the Web

Quickstart: Trace app latency by using Cloud Trace
Create a trace by sending an HTTP request to the sample application. Use the Cloud Trace interface to view the latency information of...
Read more >
Google Cloud Trace, Debug, Error Reporting | by Hil Liao
Recently, I have the chance to build 2 Cloud Run services that use Google Cloud Trace, Debug, Error reporting, and logging. Logging comes...
Read more >
Newest 'google-cloud-trace' Questions - Stack Overflow
I am using Stackdriver Trace to monitor the delays of some microservices, but am having some issues in making all the round trip...
Read more >
Use Stackdriver Logging and Stackdriver Trace for Cloud ...
On this page · Introduction · Setup and requirements · Self-paced environment setup · Cloud Shell · Deploy a simple Cloud Function ·...
Read more >
Tracing and Profiling - Managing Your Google Cloud ...
Cloud Trace shows you which requests take the longest to run. Once you've determined which requests might need to be optimized, you can...
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