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

feat(server): add support for span status #3029

Merged
merged 2 commits into from
Aug 4, 2023
Merged

Conversation

schoren
Copy link
Collaborator

@schoren schoren commented Aug 4, 2023

This PR adds support for span status. The status code and description are added as attributes, similar to what we do for span time properties.

As a mean to test the feature, we now set a span status of error on the resource manager when an error happens.

Changes

  • add new span attrributes for span status code and description
  • set span status to error on resource manager when needed
  • add a trace-based tests for the feature

Fixes

Checklist

  • tested locally
  • added new dependencies
  • updated the docs
  • added a test

@schoren schoren linked an issue Aug 4, 2023 that may be closed by this pull request
Comment on lines +21 to +22
TracetestMetadataFieldStatusCode string = "tracetest.span.status_code"
TracetestMetadataFieldStatusDescription string = "tracetest.span.status_description"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are the new attribute keys

Comment on lines +551 to +553
span := trace.SpanFromContext(ctx)
span.RecordError(err)
span.SetStatus(codes.Error, err.Error())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@schoren schoren merged commit f2b1e4c into main Aug 4, 2023
30 checks passed
@schoren schoren deleted the support-span-status branch August 4, 2023 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for Span Status
3 participants