-
Notifications
You must be signed in to change notification settings - Fork 96
Initial OpenCensus Agent Exporter implementation #128
Conversation
The OpenCensus Agent Exporter conforms to the Exporter interface, receiving spans as they complete, adding them to a buffer, and sending the spans from the buffer to the agent over a grpc stream. OpenCensus proto files have been included, as well as types for the required agent proto files. A series of adapters have been written to adapt from the @opencensus/core internal span representation to the proto definitions. Grpc streams are monitored for any disconnect and attempt to reconnect if possible, utilizing a backoff strategy provided by the grpc client. The exporter also listens to the Config stream, which recieves configuration updates from the agent. Specifically, the current tracer sampler is updated to either a ProbabilitySampler or ConstantSampler. The RateLimitingSampler option is currently a no-op and has no effect on the tracer sampler.
This is the initial implementation of the agent exporter for issue #124. I will follow this up with a test suite (in this same PR) in a few days, but wanted to at least start the conversation. There are a few call out items here that I’d like some thoughts on. /cc @kjin
/cc @songy23
I’m sure I’ll have more questions, but those should get us started! |
Thanks @justindsmith for getting a PR ready in such a short time 👍
Make sense to me, please file a tracking issue on moving the gen-files to OpenCensus-Proto, similar to census-instrumentation/opencensus-python#318.
Note that
FYI in Java data model, we have two optional fields hasRemoteParent and childSpanCount in
Defer the answer to @kjin since I'm not quite familiar with the Node encoding implementation.
Sorry I'm bit lost here - are you talking about
I think it makes sense to make it configurable by users. Note that in Go-Agent-Exporter we have an option for using |
Sure thing!
Oops! Yeah, I meant
Ok cool. I'll follow that model then.
I'll take a look at those implementations and see what I can do, but might leave them as default for the time being. Thanks for the quick replies! |
Oh yes that PR is only about
Sounds good to me :) |
- Add unit testing of exporter and adapters. - Ability to pass in a credentials to use for the grpc client connection. - Move from `grpc-tools` to `google-proto-files`. The `grpc-tools` included a lot of unnecessary dependencies, we only need the google proto files. - Added `remoteParent` to `sameProcessAsParentSpan` property, which flips the remoteParent boolean. Note that the `remoteParent` defaults to `false` and is NOT being set by any instrumentation today. - General cleanup.
Updated the review to add unit tests and some other clean-up items. This PR is ready for a full review. Here's from the commit:
|
Thanks for the contribution! Taking a look now |
I agree that this can happen as future work. Thanks for the heads up.
Sounds good. Sort of tangentially related, but I believe it would be better if a handle to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks great 👍 added a few suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The OpenCensus Agent Exporter conforms to the Exporter interface, receiving
spans as they complete, adding them to a buffer, and sending the spans from
the buffer to the agent over a grpc stream.
OpenCensus proto files have been included, as well as types for the required
agent proto files. A series of adapters have been written to adapt from the
@opencensus/core internal span representation to the proto definitions.
Grpc streams are monitored for any disconnect and attempt to reconnect if
possible, utilizing a backoff strategy provided by the grpc client.
The exporter also listens to the Config stream, which recieves configuration
updates from the agent. Specifically, the current tracer sampler is updated
to either a ProbabilitySampler or ConstantSampler. The RateLimitingSampler
option is currently a no-op and has no effect on the tracer sampler.