Skip to content

Cloud Trace does not display error span status description #1039

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

Open
genevieveluyt opened this issue May 23, 2025 · 4 comments
Open

Cloud Trace does not display error span status description #1039

genevieveluyt opened this issue May 23, 2025 · 4 comments
Labels
Blocked This issue or pull request is waiting on something else, and isn't actionable right now bug Something isn't working priority: p3

Comments

@genevieveluyt
Copy link

genevieveluyt commented May 23, 2025

We use SetStatus to set spans to "error" and use the description to include the error message.

Example:

"go.opentelemetry.io/otel/trace"
"go.opentelemetry.io/otel/codes"

span := trace.SpanFromContext(ctx)
span.SetStatus(codes.Error, "My error message")

According to docs

// SetStatus sets the status of the Span in the form of a code and a
// description, provided the status hasn't already been set to a higher
// value before (OK > Error > Unset). The description is only included in a
// status when the code is for an error.

The span correctly shows as an error span in Cloud Trace , but I can't seem to find the description.

Image

It would be very useful for debugging if the status description was visible in the trace!

@genevieveluyt genevieveluyt changed the title Cloud Trace does not display error span description Cloud Trace does not display error span status description May 23, 2025
@dashpole
Copy link
Contributor

Looks like we are sending the status.Description as the "Message". I'll pass this feedback on to the trace team.

@dashpole
Copy link
Contributor

sp.Status = &statuspb.Status{Code: int32(codepb.Code_UNKNOWN), Message: s.Status().Description}

@dashpole dashpole added bug Something isn't working priority: p3 Blocked This issue or pull request is waiting on something else, and isn't actionable right now labels May 30, 2025
@dashpole
Copy link
Contributor

Are you sending traces using the OTLP exporter, or are you using the google cloud exporter?

@genevieveluyt
Copy link
Author

Hi @dashpole , thanks for looking into this! I believe I am using the google cloud exporter. Here is my trace setup code, running on Cloud Run:

import (
    "cloud.google.com/go/compute/metadata"
    texporter "github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace"
    "go.opentelemetry.io/otel/sdk/resource"
    "go.opentelemetry.io/otel/sdk/trace"
)

proj, err := metadata.ProjectIDWithContext(ctx)
exporter, err = texporter.New(texporter.WithProjectID(proj))
res, err := resource.New(ctx, resource.WithAttributes(semconv.ServiceNameKey.String("my-service")))
tp := trace.NewTracerProvider(trace.WithBatcher(exporter), trace.WithResource(res))
otel.SetTracerProvider(tp)

Please let me know if you need any more info!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked This issue or pull request is waiting on something else, and isn't actionable right now bug Something isn't working priority: p3
Projects
None yet
Development

No branches or pull requests

2 participants