-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add support for Distributed Tracing extension #355
Comments
/cc @piecioshka |
@cardil good catch!
To be clear, expectations for the SDKs do not require that this be implemented. https://github.com/cloudevents/spec/blob/master/SDK.md#technical-requirements But I agree - it would be good. |
This issue is stale because it has been open 30 days with no activity. |
@cardil I've been thinking about this, and I wonder how you see this in practical usage. In the spec, the example given is,
Receiving an event message like this in the SDK would result in a const event = HTTP.toEvent(headers, body);
console.log(event.traceparent); // 00-0af7651916cd43dd8448eb211c80319c-b9c7c989f97918e1-01 Producing an event, that includes this information is similarly straightforward. const event = new CloudEvent({ source: '/example', type: 'tracer', traceparent: '00-0af7651916cd43dd8448eb211c80319c-b9c7c989f97918e1-01' });
const message = HTTP.binary(event);
console.log(message.headers); // should include a 'ce-traceparent: 00-0af7651916cd43dd8448eb211c80319c-b9c7c989f97918e1-01' header Looking at the spec, I'm not sure there is anything else for us to support. Is there some specific behavior that you had in mind? |
If what we have already is sufficient to consider the Distributed Tracing extension supported, we should add this to the README.md and maybe provide an example. |
Awesome. I think we can easily resolve this issue with just writing those examples above in documentation. |
I assume |
I think if both of those are supported, we should write those in documentation as examples, and maybe also add a unit test to make sure this behavior will be kept. |
Yes - it behaves just as any extension. A |
@lance Looking at Golang implementation it seems like more than just passing those extensions should be done: https://github.com/cloudevents/sdk-go/blob/8ff3fbc/v2/client/client_observed.go#L48-L57 |
@cardil I have started a thread in the CNCF Slack to discuss what exactly is expected for the distributed tracing extension in terms of SDK support. https://cloud-native.slack.com/archives/CCXF3CBL1/p1606776741094000 |
@cardil the golang implementation was done before the latest changes to the specification. The goal of the extension is not to carry the actual tracing informations (aka the actual traceparent), but the historic one. For more details, look here: https://github.com/cloudevents/spec/blob/master/extensions/distributed-tracing.md#using-the-distributed-tracing-extension If you need to carry the tracing informations, you must not use the distributed tracing extension but you should use the usual http specs for that (eg the w3c trace context spec) |
So is the actual action item here just adding docs? That is sort of what i got from skimming this thread |
I think so, yes |
Docs with code examples |
This issue is stale because it has been open 30 days with no activity. |
This issue is stale because it has been open 30 days with no activity. |
@lance I think this issue is complete? Anything else this issue is waiting on? |
Well, I think it would probably be good to document how a user adds traces to an event. Do you think we should just close this issue and open another one? Maybe just changing the title to something like "Document support for distributed tracing". 🤷 |
In terms of how a user uses this: A user should be able to add the HTTP header |
They'd add it as I believe this would just show up as an extension attribute naturally. We already have a test for a random extension here, which is essentially the same thing, just not using sdk-javascript/test/integration/message_test.ts Lines 299 to 300 in f7b2840
|
This issue is stale because it has been open 30 days with no activity. |
Is your feature request related to a problem? Please describe.
A Distributed Tracing Extension is part of the specification. Javascript SDK should support it.
Describe the solution you would like to see
An implementation of Distributed Tracing should be implemented in similar way as it is done for Go and Java SDK's.
The text was updated successfully, but these errors were encountered: