Search code examples
tracestackdrivergoogle-cloud-platform

Adding Service and Version to custom stackdriver trace api


I am using https://github.com/GoogleCloudPlatform/google-cloud-go/tree/master/trace to send custom traces to Stackdriver Trace from GCP. All these traces end up without a service or version. How do you add that information using the trace api ?

Is there a way to add the serviceContext in trace.NewClient or the span ?

EDIT : The first answer helps but the Stackdriver UI does not show these unless they are GAE( or internal apps). Mine is a standlone Go app.

stackdriver ui


Solution

  • You can add these two labels to the span you're creating:

    trace.cloud.google.com/gae/app/module trace.cloud.google.com/gae/app/version