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

Context Propagation: use simpler words and better examples #5677

Open
SrinivasuluCB opened this issue Nov 24, 2024 · 6 comments
Open

Context Propagation: use simpler words and better examples #5677

SrinivasuluCB opened this issue Nov 24, 2024 · 6 comments
Labels
help wanted Extra attention is needed sig:spec

Comments

@SrinivasuluCB
Copy link

URL

https://opentelemetry.io/docs/concepts/context-propagation/

Description

Still there is room for using the simple words and better examples

@SrinivasuluCB
Copy link
Author

Still there is room for using the simple words and better examples.

@svrnm svrnm changed the title [Page feedback]: ADD A SUMMARY OF YOUR FEEDBACK HERE Context Propagation: use simpler words and better examples Nov 25, 2024
@svrnm
Copy link
Member

svrnm commented Nov 25, 2024

thank you for your feedback @SrinivasuluCB

@svrnm svrnm added the help wanted Extra attention is needed label Nov 25, 2024
@jdougan
Copy link

jdougan commented Dec 10, 2024

In general, anything to do with Contexts is super confusing, even after having read some of the sdk impmentations. maybe concrete examples with nothing implicit.

@svrnm
Copy link
Member

svrnm commented Dec 11, 2024

In general, anything to do with Contexts is super confusing, even after having read some of the sdk impmentations. maybe concrete examples with nothing implicit.

thanks for the additional feedback, @jdougan

@svrnm svrnm added the sig:spec label Dec 11, 2024
@jdougan
Copy link

jdougan commented Dec 12, 2024

Thinking about it some more, a skeletal implementation in C89 (or something at a similar semantic level), where you have to implement contexts manually and pass them around explicitly would probably give a better idea of the desired data flow.

/* C89 implementation */

// initialized elsewhere
TracerProvider tpRoot;

void exampleApiCall(ApiResult *apiResult)
{
	// fns have output on the left of the empty comment, input on the
	// right.
	Tracer tr;
	Context trCtx, innerCtx, outerCtx;
	Span spanOuter, spanInner;
	ApiQuery apiQuery;

	getTracer(&tr, &trCtx,/**/ &tp, "example:ApiCall:");

	startSpan(&spanOuter, &outerCtx,/**/ &trCtx, "outer-span-apicall");

	setupApiCall(&apiquery, "queryString", &outerCtx);

	startSpan(&spanInner, &innerCtx,/**/ &outSpanCtx, "inner-span-apicall");

	someApiCall(apiResult, /**/ apiQuery, &innerCtx);

	endSpan(&spanInner);
	cleanupSpan(&spanInner);

	teardownApiCall(&apiQuery, /**/ &outerCtx);

	endSpan(&spanOuter);
	cleanupSpan(&spanOuter);

	cleanupTracer(&tr);
}

@svrnm
Copy link
Member

svrnm commented Dec 12, 2024

We have some example code in the language specific documentation, e.g.

https://opentelemetry.io/docs/languages/js/propagation/#manual-context-propagation

We could copy from that, or link to it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed sig:spec
Projects
Status: No status
Development

No branches or pull requests

3 participants