Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Cloud Trace Stacktrace Field Support #193

Open
skhatri0 opened this issue Jan 15, 2021 · 0 comments
Open

Google Cloud Trace Stacktrace Field Support #193

skhatri0 opened this issue Jan 15, 2021 · 0 comments

Comments

@skhatri0
Copy link

Feature

The current SpanTranslator in the zipkin-translation-stackdriver project does not have any way to set the StackTrace object in the Span. I would like to set an attribute on the zipkin span called /stacktrace and fill it with a protobuf TextFormat encoding of the stacktrace.
Then the SpanTranslator would deserialize the TextFormat stacktrace into a com.google.devtools.cloudtrace.v2.StackTrace object (via TextFormat.parse) and attach it to the com.google.devtools.cloudtrace.v2.Span object. It would also make sure not to set a raw String label on the span for /stacktrace. Once the trace is sent, the "Call Stack" section on the span would appear on the trace in the Stackdriver UI. It is a bit cumbersome to have to encode and then decode the Stacktrace, but the zipkin Span API does not appear to support attaching binary data to a span. This may be a breaking change if anyone uses the /stacktrace attribute for something else, but there are some ways to safeguard against that.

Rationale

I have JDBC tracing enabled (via spring-boot-datasource-decarator), and it is useful when diagnosing performance issues to find out what path of code is causing the database call. In general it can help anyone understand how remote activity is invoked in an application.

Example Scenario

  1. Tracing is performed on a call which accesses a database.
  2. The database call takes a while and the developer has no idea which code path makes the database call.
  3. Developer adds stack trace into each span in their application (via Brave SpanHandler)
  4. Capture new trace
  5. Look inside a traced request in stackdriver, and then see the call stack. Here is a page with an example of what it would look like inside stackdriver trace UI (see Call Stack section): https://cloud.google.com/trace/docs/trace-labels
  6. Developer identifies code path and makes necessary optimizations to it.

Prior Art

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant