Skip to content

Azure Monitor Exporter: treat UNSPECIFIED span kind as INTERNAL #844

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

Conversation

frigus02
Copy link
Member

@frigus02 frigus02 commented Aug 28, 2020

Description:

The Azure Monitor exporter translates spans to different objects depending on the span kind. It currently returns an error if the span kind is set to UNSPECIFIED. This makes sense, because we don't know how to translate those spans.

However this can cause problems when trying to get 3rd party applications to participate in the distributed tracing. One example is NGINX, which supports OpenTracing through the nginx-opentracing plugin. However it does not report a span kind, which means spans reported by NGINX are not exported to Azure Monitor.

This changes the Azure Monitor exporter to treat unspecified span kinds as INTERNAL. While this is not perfect, it does at least report some data for these spans.

@pcwiese Does this change make sense for you? What was the original reason to return an error for unspecified span kind?

Testing:

Added unit test to check that spans with unspecified span kind are treated like internal spans.

The Azure Monitor exporter translates spans to different objects
depending on the span kind. It used to return an error if the span kind
is set to UNSPECIFIED. This makes sense, because we don't know how to
translate those spans.

However this can cause problems when trying to get 3rd party
applications to participate in the distributed tracing. One example is
NGINX, which supports OpenTracing through the nginx-opentracing plugin.
However it does not report a span kind, which means spans reported by
NGINX are not exporter to Azure Monitor.

This changes the Azure Monitor exporter to treat unspecified span kinds
as INTERNAL. While this is not perfect, it does at least report some
data for these spans.
@frigus02 frigus02 requested a review from a team August 28, 2020 16:44
@codecov
Copy link

codecov bot commented Aug 28, 2020

Codecov Report

Merging #844 into master will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #844      +/-   ##
==========================================
+ Coverage   88.17%   88.25%   +0.08%     
==========================================
  Files         232      232              
  Lines       12404    12404              
==========================================
+ Hits        10937    10947      +10     
+ Misses       1114     1108       -6     
+ Partials      353      349       -4     
Flag Coverage Δ
#integration 72.00% <ø> (ø)
#unit 88.07% <100.00%> (+0.08%) ⬆️

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

Impacted Files Coverage Δ
exporter/azuremonitorexporter/trace_to_envelope.go 97.93% <100.00%> (+1.76%) ⬆️
receiver/carbonreceiver/transport/tcp_server.go 67.61% <0.00%> (+1.90%) ⬆️
...eiver/awsxrayreceiver/internal/udppoller/poller.go 100.00% <0.00%> (+2.17%) ⬆️

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 4db9452...cd0d3c3. Read the comment docs.

@pcwiese
Copy link
Contributor

pcwiese commented Aug 28, 2020

I'm good with this change because I'm struggling with this exact problem myself with nginx! I made this decision based on how I read the spec. For HTTP, gRPC, Database calls, etc. SpanKind is definitely required, but for other types possibly not yet hard to tell.

@pjanotti pjanotti merged commit 3e87cfa into open-telemetry:master Aug 29, 2020
@frigus02 frigus02 deleted the azure-exporter-unspecified-spankind branch August 29, 2020 09:33
dyladan referenced this pull request in dynatrace-oss-contrib/opentelemetry-collector-contrib Jan 29, 2021
Translation was replicated from existing jaeger -> OC -> internal logic.
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
None yet
Development

Successfully merging this pull request may close these issues.

3 participants