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

Separate context propagation into separate layers (otep-66) #399

Closed
wants to merge 0 commits into from

Conversation

MikeGoldsmith
Copy link
Member

This is a draft PR to incorporate the changes in otep-66, specifically breaking context propagation into separate layers.

namespace OpenTelemetry.Api.Baggage
{
public abstract class BaggageContext
{ }

Choose a reason for hiding this comment

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

  1. why this abstraction is needed? Is there an existing .NET primitive that could be used instead? IEnumerable or Dictionary?
  2. Does it have to be a class?
  3. Why it does not have GEt/Set/Remove/Clear and we need a manager for that? This does not seem like a .NET friendly API

{
public abstract string GetEntry(BaggageContext context, string key);

public abstract BaggageContext SetEntry(BaggageContext context, string key, string value);

Choose a reason for hiding this comment

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

is it going to create a new BaggageContext or update one passed in the argument? If former, it seems inefficient. If latter, this should be changes to the method on BaggageContext


namespace OpenTelemetry.Api.Baggage
{
public abstract class BaggageManagerBase

Choose a reason for hiding this comment

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

why do we need this class?

namespace OpenTelemetry.Api.Correlations
{
public class CorrelationContext
{ }

Choose a reason for hiding this comment

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

same concerns as for the BaggageContext


public abstract BaggageContext ClearEntries(BaggageContext context);

public abstract HttpInjectorBase GetHttpInjector();

Choose a reason for hiding this comment

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

Is there a requirement to propagate extractors/injectors through the manager class? Could it be done as a constructor argument to adapters instead?

How extractor/injections are going to be set up by users? On the tracer/meter factory?

Copy link

@lmolkova lmolkova left a comment

Choose a reason for hiding this comment

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

Can you please provide some scenarios (in C# or pseudo-code) how this classes are going to be used and configured:

  • who configures them
  • where: Tracer/MeterFactory, somewhere else?
  • who uses them: adapters, users.
  • How they are going to be used

This would really help with API design/review

@MikeGoldsmith
Copy link
Member Author

Thanks for the initial review @lmolkova. This is not complete yet and I just wanted to push something so show it's in progress - that's why I set the PR as draft.

The work I've done so far in the above commits are trying to stitch together what's been done in Go & Java and will be refactored to better suit OTel .NET in the coming days.

@lmolkova lmolkova added the pkg:OpenTelemetry.Api Issues related to OpenTelemetry.Api NuGet package label Jan 7, 2020
Yun-Ting pushed a commit to Yun-Ting/opentelemetry-dotnet that referenced this pull request Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:OpenTelemetry.Api Issues related to OpenTelemetry.Api NuGet package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants