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

Support custom trace propagation format in ocgrpc #838

Open
ashi009 opened this Issue Jul 19, 2018 · 10 comments

Comments

Projects
None yet
5 participants
@ashi009
Copy link

ashi009 commented Jul 19, 2018

The default ocgrpc handler assumes all incoming trace span context will be passed in binary format using grpc-trace-bin key in metadata.

In many cases, the calling application may use a different trace propagation format, eg. x-cloud-trace-context for GCP.

There should be a way to add additional support to other propagation formats.

A proposed approach is that:

  • add a new interface in trace/propagation package:

    type GRPCFormat interface {
      SpanContextFromMetadata(metadata.MD) (sc trace.SpanContext, ok bool)
      SpanContextToMetadata(trace.SpanContext, metadata.MD)
    }
  • add option to ocgrpc.ServerHandler to specify the parent span extraction preference

  • add option to ocgrpc.ClientHandler to specify the span propagation preference

@ramonza

This comment has been minimized.

Copy link
Contributor

ramonza commented Jul 19, 2018

/cc @rakyll

@ashi009

This comment has been minimized.

Copy link
Author

ashi009 commented Jul 19, 2018

@ashi009 ashi009 changed the title FR: Support custom trace propagation format in ocgrpc Support custom trace propagation format in ocgrpc Jul 23, 2018

@odeke-em

This comment has been minimized.

Copy link
Member

odeke-em commented Aug 20, 2018

Thank you for filing this issue @ashi009 and welcome to OpenCensus, sorry for the radio silence too. Perhaps this issue is a superset of #666?

@ashi009

This comment has been minimized.

Copy link
Author

ashi009 commented Aug 21, 2018

@odeke-em Apparently yes. Though the issues are from different backgrounds, the solution is actually the same.

@rakyll

This comment has been minimized.

Copy link
Member

rakyll commented Aug 21, 2018

/cc @bogdandrutu to decide on this topic.

@vvakame

This comment has been minimized.

Copy link

vvakame commented Feb 6, 2019

Hi, I & My company have interesting in this topics.
now, We are using DataDog library in our services. not OpenCensus.
But I want to start using OpenCensus.

My plan is

  • use OpenCensus + DataDog exporter in some services gradually
    • We need to use DataDog's propagation format
  • use OpenCensus + DataDog exporter in all services!
    • We can switch into grpc-trace-bin
    • We need to be able to accept both format for a while
  • We can choose favorite exporter!
    • e.g. DataDog + StackDriver Tracing

Can I implement and send a pull request?

@vvakame

This comment has been minimized.

Copy link

vvakame commented Feb 14, 2019

@bogdandrutu can we talk about this topic?

@odeke-em

This comment has been minimized.

Copy link
Member

odeke-em commented Feb 14, 2019

Hello @vvakame, on a side track about what you've mentioned in #838 (comment)

We've been working on the OpenCensus Agent https://opencensus.io/agent https://github.com/census-instrumentation/opencensus-service and given that you'd like to switch to using OpenCensus, the Agent will soon support receiving traffic that was intended for Datadog and other backends and then you can export it out whichever way. I am haven't yet worked on the Datadog receiver, but if you are interested and enthusiastic about it, I can make this a top priority and work on shipping out the Datadog receiver. Please feel free to instead migrate this specific conversation to census-instrumentation/opencensus-service#358 and census-instrumentation/opencensus-service#384.

Thank you.

@vvakame

This comment has been minimized.

Copy link

vvakame commented Feb 14, 2019

thanks. We don't use OpenCensus agent yet. I'll read that document and make conversation with my co-worker.

@vvakame

This comment has been minimized.

Copy link

vvakame commented Feb 15, 2019

@odeke-em I have a question.
OpenCensus agent is agent, not proxy. (is it right?)

Our microservices will be mixed about use OpenCensus agent or not(-yet).
I want to know that Can OpenCensus agent works fine under mixed environment?

for example
client: A microservice(use OC agent)
server: B microservice(use DataDog only)
those services communicate by gRPC.
If A called B's method. OC agent & collector can't construct single trace.
because OC agent can't modify gRPC's metadata. can't make relation between A's span to B's span on DataDog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.