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: add span status code/description cli and env var #111

Merged
merged 2 commits into from
Oct 5, 2022

Conversation

ericmustin
Copy link
Contributor

@ericmustin ericmustin commented Aug 6, 2022

Summary

Follow up to #27 , which was quite out of date so i'm closing it.

This pr adds --status-code, OTEL_CLI_STATUS_CODE, status-code and --status-description, OTEL_CLI_STATUS_DESCRIPTION, status-description Cli Argument, Env var, and config key, respectively, for setting a span status's code and description.

An important note is that description will only be set if the span status code is an error, which conforms to the specification

https://github.com/open-telemetry/opentelemetry-specification/blob/480a19d702470563d32a870932be5ddae798079c/specification/trace/api.md#set-status

There's a few rough edges, in that this doesn't get respected for clievents ( didnt seem necessary) and execCmd stuffs (i figure that was handled by the --fail option). Also, I didn't include a shorthand syntax for either CLI arg, since they have to be single letter, and c was taken already, and it just kinda felt like it'd become a bikeshed for very little value so i dropped it.

But i figure this is a good starting point, and since the older PR had fallen out of date, i wanted to at least implement the feedback that was added on there. I have pretty limited bandwidth but happy to fix anything up if needed here

Copy link
Contributor

@ahayworth ahayworth left a comment

Choose a reason for hiding this comment

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

LGTM

case "error":
return codes.Error
default:
return codes.Unset
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to warn here I suppose, but it's not blocking or anything.

@spuliaiev-sfdc
Copy link

@tobert Any plans to merge it in?

@tobert
Copy link
Collaborator

tobert commented Oct 4, 2022 via email

@tobert tobert self-requested a review October 5, 2022 16:26
Copy link
Collaborator

@tobert tobert left a comment

Choose a reason for hiding this comment

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

Great work! I appreciate the thoroughness of the PR, and accompanying tests :)

I'm in the process of migrating machines so I might take a bit to release, but I will get it done soon.

@tobert tobert merged commit e48e468 into equinix-labs:main Oct 5, 2022
@ericmustin
Copy link
Contributor Author

@tobert no worries, thank you for circling back to this and also for this repo in general, good stuff!

@spuliaiev-sfdc
Copy link

@tobert Any plans to release the tool with the status flag? Thank you!

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.

4 participants