Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Conversation

@hectorhdzg
Copy link
Member

Use suppress_instrumentation added in Span processors

@hectorhdzg hectorhdzg requested a review from lzchen as a code owner March 23, 2020 20:58
count = dependency_map.get("count", 0)
dependency_map["count"] = count + 1
# Only collect request metric if sent from non-exporter thread
if context.get_value("suppress_instrumentation") is None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we need to set supress_instrumentation in the context for exporter threads?

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 don't need to add it in the exporter, SpanProcessor will add it before calling the exporter

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems only SimpleExportSpanProcessor does this? What about the other SpanProcessors? And what about surpressing instrumentation for the metrics exporter as well? Also, are we going to ignore dependency calls that happen during the same time as export?

Copy link
Member Author

Choose a reason for hiding this comment

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

BatchExportSpanProcessor also add this, you are totally right this need to be taken care of in OT repo for Metrics, and I'm not sure how we can ensure this applies to all SpanProcessors, maybe a topic for OT SIG meeting

Copy link
Member Author

Choose a reason for hiding this comment

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

Created issue in OT to track this
open-telemetry/opentelemetry-python#524

Copy link
Contributor

Choose a reason for hiding this comment

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

If OT does not have this, any point in having this PR merged? It also does not address the issue of dependency calls being made at the same time the export is being called.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure I understand the issue you mention, the point for merging this here is to address the issue for Spans, so we don't send metrics for internal calls to Breeze, the code in Azure repo would not be affected once issue is resolved in OT so once Metrics add correct flag this will be automatically working here. If you think there are big issues with this flag it would be good to bring it up in OT repo because HTTP request ext is heavily relying on this

Copy link
Contributor

Choose a reason for hiding this comment

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

What I am referring to is, this mechanism for using suppress_instrumentation does not cover the use case of when a http request call is made DURING exporting (that's not from the exporter itself). With that being said, IF we are still going with the suppress_instrumentation route to address this problem, you are correct that we don't have to change anything in this repo. I would add a comment here indicating that it is contigent on changes in the OT repo.

@codecov-io
Copy link

codecov-io commented Mar 24, 2020

Codecov Report

Merging #61 into master will decrease coverage by 0.12%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #61      +/-   ##
==========================================
- Coverage   98.40%   98.27%   -0.13%     
==========================================
  Files          13       13              
  Lines         751      753       +2     
  Branches       96       97       +1     
==========================================
+ Hits          739      740       +1     
  Misses          9        9              
- Partials        3        4       +1     
Impacted Files Coverage Δ
...zure_monitor/auto_collection/dependency_metrics.py 97.50% <80.00%> (-2.50%) ⬇️

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 3c9f024...d89b590. Read the comment docs.

Copy link
Contributor

@lzchen lzchen left a comment

Choose a reason for hiding this comment

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

Looks good. I would add a comment.

@hectorhdzg hectorhdzg merged commit 2f6073e into microsoft:master Mar 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants