Skip to content
This repository was archived by the owner on Dec 23, 2023. It is now read-only.

Open Tracestate API for custom info propagation #1465

Open
AlexanderWert opened this issue Sep 21, 2018 · 3 comments
Open

Open Tracestate API for custom info propagation #1465

AlexanderWert opened this issue Sep 21, 2018 · 3 comments

Comments

@AlexanderWert
Copy link

AlexanderWert commented Sep 21, 2018

Please answer these questions before submitting a bug report.

What version of OpenCensus are you using?

0.16.1

What JVM are you using (java -version)?

1.8

What did you do?

We are building a monitoring agent based on OpenCensus.
Consider the example that service A calls a service B.
For the use case of conditional metric reporting (on the recipient side of the request) the monitoring code of the receiver (in this case service B) needs to know who was the caller.
This needs to be transparent / generic, as this should not affect the API of the services.

What did you expect to see?

Is there currently a way to propagate additional information together with the trace / span information?
I see there is a class "Tracestate" which, however, does not provide a way of adding/writing information through the OpenCensus API.
Are there any plans to open the API of Tracestate to allow adding or editing Entries to the Tracestate?
Can we help with this by providing a pull request?

Thank you!

Cheers,
Alex

@songy23
Copy link
Contributor

songy23 commented Sep 21, 2018

Hi @AlexanderWert

I see there is a class "Tracestate" which, however, does not provide a way of adding/writing information through the OpenCensus API.

Are there any plans to open the API of Tracestate to allow adding or editing Entries to the Tracestate?

Currently we don't support setting Tracestate when building a Span. There's a TODO for adding support for it:

// TODO(bdrutu): Handle tracestate correctly not just propagate.

Can we help with this by providing a pull request?

Sure, contributions are very welcome :)

For the use case of conditional metric reporting (on the recipient side of the request) the monitoring code of the receiver (in this case service B) needs to know who was the caller.
This needs to be transparent / generic, as this should not affect the API of the services.

Have you considered using Tag propagation? It's a very common use case to propagate caller as a tag on the wire.

@falenn
Copy link

falenn commented Mar 20, 2019

@songy23, Like @AlexanderWert, I would like to add custom tracking info to tracestate, however, I'm afraid this would violate the intent of the spec.

I just requested clarification w3c/trace-context#264.

What do you all think?

@songy23
Copy link
Contributor

songy23 commented Mar 20, 2019

As per Yuri's response in w3c/trace-context#264 (comment), tracestate only carries the information on tracing library rather than the applications, so probably adding custom info to it is not an expected use case. /cc @bogdandrutu kindly correct me if I'm wrong.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants