-
Notifications
You must be signed in to change notification settings - Fork 57
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
create spans directly using protobuf structures #175
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
otel-cli was always a problem child user of opentelemetry-go. From the very start the otelclicarrier.go file was working around intentional limitations in the SDK. This set of changes moves otel-cli to directly create spans using the protocol buffer structures from OTLP, and then sends them along using the opentelemetry-collector backend. It doesn't look like this reduced dependencies significantly, which is expected since the OTel SDK is mostly defensive coding to make API use consistent.
Unit tests are clean. Functional tests aren't passing yet. Will work on that more tomorrow. |
Looks like the previous code was wrong anyways. It didn't make sense to me to have the ignoreEnv option checked before setting current span to traceparent so I removed it. Test passes now.
I think this was doing the wrong thing before.
This should have broken before! The example config set traceparent required and a carrier file that doesn't exist so it should not have worked. The test broke when the bug in otel-cli was fixed.
Added commented out detectors too. Those should probably be off by default and some options provided to turn them on. At least need a way to turn them off for testing.
This makes it possible to implement prior behavior in --tp-print cases by passing the span down to propagation functions. I'm not convinced this is worth preserving but want to get everything running without changing tests too much.
tobert
commented
Mar 14, 2023
@@ -375,7 +375,7 @@ var suites = []FixtureSuite{ | |||
WithTraceparentIgnoreEnv(true). | |||
WithTraceparentPrint(true). | |||
WithTraceparentPrintExport(true). | |||
WithTraceparentRequired(true). | |||
WithTraceparentRequired(false). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was a bug that this didn't break before. The example TP file wasn't ever available, so --tp-required wasn't working right in this case. It's fixed in this PR so the test broke.
Moved some helpers to the protobuf_span.go along with the tests. Mostly code organization but also some renames and additional tests to firm things up.
Refactored id generators to accept a config instead of using the global, which meant moving id generation to WithConfig which makes more sense anyways.
This was referenced May 4, 2023
Closed
tobert
pushed a commit
that referenced
this pull request
May 22, 2023
As predicted, this was straightforward after #175 :)
tobert
added a commit
that referenced
this pull request
May 23, 2023
* add span options to status command Useful to test the new --force-span-id and --force-trace-id options. * add --force-trace-id and --force-span-id and test As predicted, this was straightforward after #175 :) * correct option names in comments * match json key names to command line flags
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
otel-cli was always a problem child user of opentelemetry-go. From the very start the otelclicarrier.go file was working around intentional limitations in the SDK. This set of changes moves otel-cli to directly create spans using the protocol buffer structures from OTLP, and then sends them along using the opentelemetry-collector backend.
It doesn't look like this reduced dependencies significantly, which is expected since the OTel SDK is mostly defensive coding to make API use consistent.
Somewhat inspired by #173, which may be doable through the SDK, but this makes features like that request a breeze.