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

feat: Add Sentry Exporter #565

Merged
merged 3 commits into from
Jul 29, 2020
Merged

Conversation

AbhiPrasad
Copy link
Member

Description:

This PR adds an exporter for Sentry (https://sentry.io/). I've tried my best to match the formatting and functionality of the other exporters, but please let me know if there is something I am missing.

Currently Sentry Exporter only supports exporting traces.

Testing:

I've written unit tests for 85% code coverage. I've also provided a demo repo that was used for more extensive testing - https://github.com/AbhiPrasad/opentelemetry-collector-sentry-demo

Documentation:

I've added a README in accordance with the exporters, as well as some documentation detailing the OpenTelemetry -> Sentry transformation.

@AbhiPrasad AbhiPrasad requested a review from a team as a code owner July 27, 2020 12:07
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jul 27, 2020

CLA Check
The committers are authorized under a signed CLA.

@project-bot project-bot bot added this to In progress in Collector Jul 27, 2020
@codecov
Copy link

codecov bot commented Jul 27, 2020

Codecov Report

Merging #565 into master will decrease coverage by 0.07%.
The diff coverage is 85.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #565      +/-   ##
==========================================
- Coverage   86.30%   86.22%   -0.08%     
==========================================
  Files         191      195       +4     
  Lines       10388    10607     +219     
==========================================
+ Hits         8965     9146     +181     
- Misses       1099     1128      +29     
- Partials      324      333       +9     
Flag Coverage Δ
#integration 71.09% <ø> (ø)
#unit 86.05% <85.84%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
exporter/sentryexporter/transport.go 31.57% <31.57%> (ø)
exporter/sentryexporter/factory.go 88.88% <88.88%> (ø)
exporter/sentryexporter/sentry_exporter.go 90.85% <90.85%> (ø)
exporter/sentryexporter/utils.go 100.00% <100.00%> (ø)
exporter/signalfxexporter/dimensions/requests.go 84.48% <0.00%> (-8.63%) ⬇️
receiver/carbonreceiver/transport/tcp_server.go 65.71% <0.00%> (-1.91%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7f972a4...8a669f1. Read the comment docs.

@AbhiPrasad AbhiPrasad force-pushed the sentryexporter branch 5 times, most recently from eecc5c7 to eec7a40 Compare July 27, 2020 15:57
Copy link
Contributor

@pjanotti pjanotti left a comment

Choose a reason for hiding this comment

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

Hi @AbhiPrasad, I can review the general structure and add some information but it will be good to get someone from Sentry to review the part of organizing spans in transactions and the translation itself.

exporter/sentryexporter/README.md Outdated Show resolved Hide resolved
exporter/sentryexporter/README.md Show resolved Hide resolved

sentrySpan := convertToSentrySpan(otelSpan, library, resourceTags)

// If a span is a root span, we consider it the start of a Sentry transaction.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not familiar with the transaction concept it will be good if someone from Sentry reviews this part.

Copy link
Member Author

Choose a reason for hiding this comment

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

We've reviewed this in our own repo. See the PRs from: getsentry/opentelemetry-collector-contrib@master...getsentry:backup/sentryexporter

cc @rhcarvalho @bruno-garcia for another double check.

exporter/sentryexporter/factory.go Outdated Show resolved Hide resolved
)

// canonicalCodes maps OpenTelemetry span codes to Sentry's span status.
// See numeric codes in https://godoc.org/github.com/open-telemetry/opentelemetry-proto/gen/go/trace/v1#Status_StatusCode.
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the heads up. Do you think I should remove the functionality to read span.status then in anticipation of the change?

Copy link
Contributor

Choose a reason for hiding this comment

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

It is fine to remove it later, we may do it whole sale.

@AbhiPrasad AbhiPrasad force-pushed the sentryexporter branch 2 times, most recently from 828a0ab to 9ed61e1 Compare July 29, 2020 14:50
Copy link
Contributor

@rhcarvalho rhcarvalho left a comment

Choose a reason for hiding this comment

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

I'm vouching for this from the Sentry side.

Copy link

@dashed dashed left a comment

Choose a reason for hiding this comment

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

I also vouch for this 👍

Copy link
Member

@bruno-garcia bruno-garcia left a comment

Choose a reason for hiding this comment

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

Great work @AbhiPrasad !

:shipit:

We've discussed changes as they were landing in the fork.
There we considered also the trade-offs and limitations (mainly due to the lack of support to individual span ingestion).

Happy to get this in and looking forward to get some feedback.

Copy link
Contributor

@pjanotti pjanotti left a comment

Choose a reason for hiding this comment

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

LGTM

Collector automation moved this from In progress to Reviewer approved Jul 29, 2020
@pjanotti pjanotti merged commit 925787d into open-telemetry:master Jul 29, 2020
Collector automation moved this from Reviewer approved to Done Jul 29, 2020
dyladan referenced this pull request in dynatrace-oss-contrib/opentelemetry-collector-contrib Jan 29, 2021
* Update README.md

* Update processor/README.md

Co-Authored-By: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>

* Update processor/README.md

Co-Authored-By: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>

* Update processor/README.md

Co-Authored-By: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>

Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
ljmsc referenced this pull request in ljmsc/opentelemetry-collector-contrib Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Collector
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants