-
Notifications
You must be signed in to change notification settings - Fork 201
No Trace output when running example with Logging Exporter #1387
Comments
Hi @briantq , please note that in Java FYI there's one issue about making the exporting interval configurable (#1304), and one for adding a flushing for exporting (census-instrumentation/opencensus-specs#126). |
@briantq By default, OpenCensus provides a probabilistic sampler that will trace once in every 10,000 requests (https://github.com/census-instrumentation/opencensus-java/blob/master/api/src/main/java/io/opencensus/trace/config/TraceParams.java#L50). You can set a custom probablistic sampler, prefer to always sample or not sample at all. There are two ways to set samplers:
I will create a PR to add this into examples. |
Combining both of those did output the trace information. Thank you @mayurkale22 and @songy23! In addition to adding the Sampler to the example, you probably want to include the delay also. While I have you, I was running this example to try to validate some code I was writing on Google App Engine and exporting to StackDriver through the exporter. None of my traces were coming through (https://stackoverflow.com/questions/52033621/opencensus-not-show-traces-on-google-app-engine-in-stack-driver). I did overwrite the Sampler to set it to sample always, but was not seeing any of my traces in StackDriver. I am wondering if there might be an issue with the timeout... I can definitely open a new issue (since it is a different problem), but if one of you guys knew off hand, I would save the extra time triaging new issues. |
@briantq Could you try running the code example on your local workstation and see if the traces were successfully uploaded to Stackdriver Trace? We'd like to see if this issue is specific to GAE. Potential reasons I can think of:
|
@songy23 Should I open another issue to discuss or should we continue here? Do you have a code example for Google App Engine? If I understand correctly, Google App Engine simplifies the configuration for StackDriver, though I have tried it both with and without specifying the project. I also checked to make sure the Trace API was enabled for the project. Additionally, I am seeing RCP calls to CloudDatastore and such so believe OpenCensus CAN write to the project. Maybe there is something with the multithreaded nature not flushing the span prior to the end of the request? If that is the case, I am curious how the Google Cloud SDK creates spans that show up in StackDriver. |
That would be better, please open a new issue on this and we can continue discussion there.
I'm not quite familiar with GAE configuration, though I think the exporting should work the same way with default RPC calls. Or maybe it's because you're interacting with the appengine context "com.google.apphosting.api.CloudTrace" (not supported yet, see #989)? |
Closing - the GAE-Stackdriver Trace issue is tracked in #1391. |
Please answer these questions before submitting a bug report.
What version of OpenCensus are you using?
0.15
What JVM are you using (
java -version
)?1.8.0_162
What did you do?
If possible, provide a recipe for reproducing the error.
I am running the MultiSpansTracing.java example. I am using the logging exporter.
`
io.opencensus
opencensus-api
${opencensus.version}
What did you expect to see?
When I ran the project, I expected to see some indication in System.out to denote entering/leaving/or general interaction with the span or annotations that were referenced in code.
What did you see instead?
System.out was empty.
This could be my misunderstanding of OpenCensus but it seems that using the Logging exporter should write trace information into System.out. If that is not the expected output location, please let me know.
The text was updated successfully, but these errors were encountered: