Skip to content

Add support for calculate new metric translator #644

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 4 commits into from
Aug 5, 2020
Merged

Add support for calculate new metric translator #644

merged 4 commits into from
Aug 5, 2020

Conversation

pmcollins
Copy link
Member

@pmcollins pmcollins commented Aug 4, 2020

Description: Adds a translator so you can divide the value of one int metric with another. It produces a third metric which is a clone of the first metric, but has a float value that is the quotient of the first and second metric. Additionally, this change adds a rule to the default SFx rules that uses the new translator to produce a memory utilization value.

Link to tracking Issue: Not sure if one exists yet in GitHub

Testing: Unit tests were added to test both the divide metric functionality and the SFx rule that uses that functionality.

Documentation: Added inline.

@codecov
Copy link

codecov bot commented Aug 4, 2020

Codecov Report

Merging #644 into master will increase coverage by 15.22%.
The diff coverage is 95.31%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #644       +/-   ##
===========================================
+ Coverage   71.09%   86.32%   +15.22%     
===========================================
  Files          14      195      +181     
  Lines         602    10696    +10094     
===========================================
+ Hits          428     9233     +8805     
- Misses        150     1131      +981     
- Partials       24      332      +308     
Flag Coverage Δ
#integration 71.09% <ø> (ø)
#unit 86.15% <95.31%> (?)

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

Impacted Files Coverage Δ
...xporter/signalfxexporter/translation/translator.go 96.33% <95.31%> (ø)
exporter/awsxrayexporter/xray_client.go 68.00% <0.00%> (ø)
exporter/awsxrayexporter/conn.go 51.87% <0.00%> (ø)
exporter/awsxrayexporter/translator/sql.go 100.00% <0.00%> (ø)
receiver/receivercreator/receiver.go 73.80% <0.00%> (ø)
...etricstransformprocessor/operation_update_label.go 100.00% <0.00%> (ø)
receiver/kubeletstatsreceiver/runnable.go 100.00% <0.00%> (ø)
exporter/signalfxexporter/dpclient.go 90.47% <0.00%> (ø)
exporter/sentryexporter/factory.go 88.88% <0.00%> (ø)
exporter/honeycombexporter/honeycomb.go 84.89% <0.00%> (ø)
... and 177 more

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 ea019fc...8c71824. Read the comment docs.

Copy link
Member

@dmitryax dmitryax left a comment

Choose a reason for hiding this comment

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

Overall looks good. Just one suggestion

@dmitryax
Copy link
Member

dmitryax commented Aug 4, 2020

Since memory.utilization is expected in percents, could you add a multiply_float rule after this one?

@dmitryax
Copy link
Member

dmitryax commented Aug 4, 2020

could you please cover the invalid input to increase the coverage?

@pmcollins pmcollins marked this pull request as ready for review August 5, 2020 12:39
@pmcollins pmcollins requested a review from a team August 5, 2020 12:39
@pmcollins pmcollins changed the title WIP Add support for divide_metrics translator Add support for calculate new metric translator Aug 5, 2020
@dmitryax
Copy link
Member

dmitryax commented Aug 5, 2020

@bogdandrutu @tigrannajaryan can we merge this?

@bogdandrutu bogdandrutu merged commit 19d45a5 into open-telemetry:master Aug 5, 2020
@pmcollins pmcollins deleted the memory-utilization branch August 21, 2020 16:03
dyladan referenced this pull request in dynatrace-oss-contrib/opentelemetry-collector-contrib Jan 29, 2021
Certain functions had V2 suffixes where it was necessary to have one.
Even without a sufix they have different signature than equally-named
old functions and thus the compiler can clearly distinguish between
structs which implement the old of V2 interfaces.

Removing the suffixes results in cleaner and more readable code.
Some type names still have to use V2 suffix for now otherwise the
names would conflict with existing old type names.

Thanks, Jay for the hint.
ljmsc referenced this pull request in ljmsc/opentelemetry-collector-contrib Feb 21, 2022
codeboten pushed a commit that referenced this pull request Nov 23, 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