Abstraction for metrics and tracing#634
Merged
slinkydeveloper merged 7 commits intocloudevents:masterfrom Jan 7, 2021
Merged
Conversation
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
a8412ba to
3ce0094
Compare
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
n3wscott
reviewed
Jan 7, 2021
|
|
||
| func NewHTTPReceiveHandler(ctx context.Context, p *thttp.Protocol, fn interface{}) (*EventReceiver, error) { | ||
| invoker, err := newReceiveInvoker(fn) | ||
| invoker, err := newReceiveInvoker(fn, noopObservabilityService{}) |
Member
There was a problem hiding this comment.
We should get ahead of this and add a observability.Get() that defaults to noopObservabilityService here and everywhere else. We can do this as a follow up but it should happen before we cut
Member
Author
There was a problem hiding this comment.
sure, let's stabilize in a followup. There is some code in opencensus that can be eventually get removed too
n3wscott
reviewed
Jan 7, 2021
| // The WithTimeNow, and WithUUIDs client options are also applied to the | ||
| // client, all outbound events will have a time and id set if not already | ||
| // present. | ||
| func NewDefault(opts ...http.Option) (Client, error) { |
Member
There was a problem hiding this comment.
I wonder if we should deprecate this method and comment how to get the same result with client.NewHTTP and then alias that to cloudevents.NewHTTPClient
Fixed integration test Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
This was referenced Jan 7, 2021
Member
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The goal of this PR is to introduce an abstraction to remove from the core sdk module the dependencies over metrics and tracing. Part of #619
Content of this PR:
ObservabilityServiceBreaking changes:
Users of metrics and tracing will have to modify their code to support this change. Now they won't need to use
client.NewObservableandhttp.NewObservable, but they'll must use the observability service and the http protocol factory from the opencensus packageDeprecated (and short-circuited functions):
Removed functions:
ObsEncodeandObsDecodeDistributedTracingExtensionwhich were exposing opencensus types (which were implementing the distributed tracing extension in the wrong way https://github.com/cloudevents/spec/blob/v1.0.1/extensions/distributed-tracing.md#using-the-distributed-tracing-extension)Signed-off-by: Francesco Guardiani francescoguard@gmail.com