Skip to content

Add go-kit instrumentation library #456

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

Merged
merged 7 commits into from
Mar 5, 2021
Merged

Add go-kit instrumentation library #456

merged 7 commits into from
Mar 5, 2021

Conversation

sagikazarmark
Copy link
Contributor

@sagikazarmark sagikazarmark commented Nov 18, 2020

Fixes #434

Tasks

@sagikazarmark
Copy link
Contributor Author

sagikazarmark commented Nov 18, 2020

This PR is not ready yet: more tests and some examples are missing, but I wanted to submit the PR early so I can get some feedback.

I also wanted to ask: event recording does not seem to be implemented in the mock span. Is it on purpose? Thanks! Solved in 0.14.0

@sagikazarmark
Copy link
Contributor Author

Thanks for the review @matej-g

I think it's enough for me as a sanity check to finish the PR, so an approver can also review and merge it.

@sagikazarmark
Copy link
Contributor Author

sagikazarmark commented Dec 12, 2020

I was finally able to finish this PR: improved test coverage, added an example based on gorilla and updated the documentation.

I think it's ready to be merged.

What is the procedure for adding it to the registry?

Copy link
Contributor

@matej-g matej-g left a comment

Choose a reason for hiding this comment

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

Nice work @sagikazarmark, this PR looks complete to me now.

What is the procedure for adding it to the registry?

There is another repository for opentelemetry.io, there you can find the "registry" under https://github.com/open-telemetry/opentelemetry.io/tree/master/content/en/registry. Basically once this PR is merged, you can create a PR for that repository which will add a new entry, something like instrumentation-go-kit.md, to represent your instrumentation package. You can checkout the other registry entries as a reference to know what your .md file should include.

@sagikazarmark
Copy link
Contributor Author

Thanks @matej-g

I guess adding it to the registry is not a task for this PR, so I crossed it off.

@sagikazarmark
Copy link
Contributor Author

I've rebased the PR to use the latest version. Is there anything I can do to get this merged? I'd really like to avoid manually rebasing and updating the version. :)

@sagikazarmark
Copy link
Contributor Author

Happy new year everyone!

Friendly ping to see if we can get this merged before the next release. 🙂

Base automatically changed from master to main February 1, 2021 17:09
@MrAlias MrAlias requested a review from dashpole as a code owner February 1, 2021 17:09
@sagikazarmark
Copy link
Contributor Author

Hey folks,

Can someone merge this PR please? I'd really like to stop rebasing it, it's a waste of effort. It's been approved by three reviewers. What else do I have to do to get it merged?

Thanks!

@codecov
Copy link

codecov bot commented Feb 2, 2021

Codecov Report

Merging #456 (e23a072) into main (f82555b) will increase coverage by 0.1%.
The diff coverage is 85.0%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #456     +/-   ##
=======================================
+ Coverage   77.9%   78.1%   +0.1%     
=======================================
  Files         55      57      +2     
  Lines       2602    2664     +62     
=======================================
+ Hits        2029    2082     +53     
- Misses       443     451      +8     
- Partials     130     131      +1     
Impacted Files Coverage Δ
detectors/gcp/gce.go 7.3% <0.0%> (ø)
detectors/gcp/gke.go 0.0% <0.0%> (ø)
...ion/github.com/Shopify/sarama/otelsarama/option.go 100.0% <ø> (ø)
...ation/github.com/astaxie/beego/otelbeego/common.go 100.0% <ø> (ø)
...ation/google.golang.org/grpc/otelgrpc/grpctrace.go 58.3% <40.0%> (-8.4%) ⬇️
instrumentation/net/http/otelhttp/handler.go 72.6% <75.0%> (ø)
...entation/github.com/go-kit/kit/otelkit/endpoint.go 85.3% <85.3%> (ø)
...ion/google.golang.org/grpc/otelgrpc/interceptor.go 87.0% <87.5%> (ø)
exporters/metric/cortex/cortex.go 69.8% <94.4%> (ø)
detectors/aws/aws.go 84.6% <100.0%> (ø)
... and 24 more

Copy link
Contributor

@MrAlias MrAlias left a comment

Choose a reason for hiding this comment

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

Overall this looks good, thanks for the contribution. The blocking issues are the dependabot config change, upgrading to v0.18.0, and the RecordError question needs to be addressed.

Signed-off-by: Mark Sagi-Kazar <[email protected]>
Signed-off-by: Mark Sagi-Kazar <[email protected]>
Signed-off-by: Mark Sagi-Kazar <[email protected]>
Signed-off-by: Mark Sagi-Kazar <[email protected]>
Signed-off-by: Mark Sagi-Kazar <[email protected]>
Signed-off-by: Mark Sagi-Kazar <[email protected]>
@sagikazarmark
Copy link
Contributor Author

@MrAlias thanks for the review. I addressed most of it.

Regarding RecordError: it sets the status for the span and technically it's not correct for the intermediate errors. I guess we can use it since the status will be set by the final error anyway. I think the behavior of RecordError was somewhat different when I first submitted this PR, so there might have been some other reason as well.

@sagikazarmark
Copy link
Contributor Author

I changed it to use RecordError. Not fully convinced this is right though. I think semantically RecordError should only be called once for the terminal error (given it actually sets the status to error which might not always be desirable), but I could be wrong.

@MrAlias
Copy link
Contributor

MrAlias commented Mar 5, 2021

I changed it to use RecordError. Not fully convinced this is right though. I think semantically RecordError should only be called once for the terminal error (given it actually sets the status to error which might not always be desirable), but I could be wrong.

This might be something that needs to be clarified better. You are correct that the semantics of RecordError are hard to distinguish if it should be used here. Ultimately, the user of this instrumentation will want to send this telemetry to a backend that will need to understand the events that it receives. Sending these errors as events that are semantically tied to errors will provide the backend a chance to highlight these in helpful manner.

That said, OTel in general wanted to provide a better errors interface in the future so this is likely going to be improved.

Thanks for the contribution and patience!

@MrAlias MrAlias merged commit cc31f43 into open-telemetry:main Mar 5, 2021
@sagikazarmark sagikazarmark deleted the go-kit-instrumentation branch March 6, 2021 03:31
@sagikazarmark
Copy link
Contributor Author

Thanks for merging

plantfansam referenced this pull request in plantfansam/opentelemetry-go-contrib Mar 18, 2022
* make trace.TraceContext as default context propagator

* Update api/trace/trace_context_propagator.go

Co-Authored-By: Krzesimir Nowak <[email protected]>

* Update plugin/othttp/handler.go

* Update DefaultPropagator in plugin/{http,grpc}trace

* update DefaultPropagator as method instead of var

Co-authored-by: Krzesimir Nowak <[email protected]>
Co-authored-by: Rahul Patel <[email protected]>
@pellared pellared added this to the untracked milestone Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add instrumentation for github.com/go-kit/kit
6 participants