Thanks to visit codestin.com
Credit goes to github.com

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

Implement standard metrics for http dependency telemetry #125

Merged
merged 5 commits into from
Oct 5, 2020

Conversation

lzchen
Copy link
Contributor

@lzchen lzchen commented Oct 5, 2020

Part of #123

Adds the custom properties to a telemetry processor that runs every time a http dependency telemetry is exported.
Implementation taken from the App Insights Dot net SDK.

@lzchen lzchen requested a review from hectorhdzg as a code owner October 5, 2020 16:11
@codecov-commenter
Copy link

codecov-commenter commented Oct 5, 2020

Codecov Report

Merging #125 into master will decrease coverage by 0.04%.
The diff coverage is 91.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #125      +/-   ##
==========================================
- Coverage   93.00%   92.96%   -0.05%     
==========================================
  Files          21       21              
  Lines        1201     1236      +35     
  Branches      149      153       +4     
==========================================
+ Hits         1117     1149      +32     
  Misses         56       56              
- Partials       28       31       +3     
Impacted Files Coverage Δ
...nitor/src/azure_monitor/export/metrics/__init__.py 96.34% <91.66%> (-3.66%) ⬇️

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 132024c...5adc77f. Read the comment docs.

if point.name == "http.client.duration":
point.name = "Dependency duration"
point.kind = protocol.DataPointType.AGGREGATION.value
properties["_MS.MetricId"] = "dependencies/duration"
Copy link
Member

Choose a reason for hiding this comment

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

Looks like we are getting more AI properties like this one and others, it would be good to have them somewhere as constants to avoid bugs regarding typos

Copy link
Contributor Author

@lzchen lzchen Oct 5, 2020

Choose a reason for hiding this comment

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

Moving AI properties to a constants file I feel implies that they are a "global" accessible variable. These properties are only relevant to standard metric implementation and so should exist only in that scope (within the metrics file). Perhaps it will be more suitable at the top of the module as constants, but until there are other implementations in other files related to standard metrics, or multiple uses for the constants, I don't see this as much of an improvement.

Copy link
Member

Choose a reason for hiding this comment

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

This is not blocking comment, is up to you to handle this, having the constants in the top of the file let you quickly realize we are using these and in case something change is easier to update

properties["Dependency.Success"] = "True"
except ValueError:
pass
# TODO: Check other properties if url doesn't exist
Copy link
Member

Choose a reason for hiding this comment

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

What kind of other properties?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lzchen lzchen merged commit 2fc7e10 into microsoft:master Oct 5, 2020
@lzchen lzchen deleted the metrics branch October 5, 2020 22:55
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