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 support for OT ValueRecorder #130

Conversation

TigerHe7
Copy link
Contributor

Fixes: #129

Changes

  • Adds support for exporting ValueRecorder distribution metrics
  • Tested use of ValueRecorder manually on a personal GCP project
  • Updated unit tests

Feedback Request

  • The transformValueType function needs the metric.aggregator.toPoint().value to disambiguate between Distribution/Histogram data types. Please let me know if you think this should be passed down to transformValueType in a different manner than shown.

@codecov
Copy link

codecov bot commented Jul 28, 2020

Codecov Report

Merging #130 into master will increase coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #130      +/-   ##
==========================================
+ Coverage   95.29%   95.36%   +0.06%     
==========================================
  Files          11       11              
  Lines         340      345       +5     
  Branches       68       70       +2     
==========================================
+ Hits          324      329       +5     
  Misses         16       16              
Impacted Files Coverage Δ
...emetry-cloud-monitoring-exporter/src/monitoring.ts 87.20% <100.00%> (+0.15%) ⬆️
...lemetry-cloud-monitoring-exporter/src/transform.ts 98.97% <100.00%> (+0.04%) ⬆️

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 e122116...b1e52cb. Read the comment docs.

function transformValueType(valueType: OTValueType): ValueType {
if (valueType === OTValueType.DOUBLE) {
function transformValueType(valueType: OTValueType, point: OTPoint): ValueType {
if (isDistributionValue(point.value) || isHistogramValue(point.value)) {
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 JS SDK, but looking through this code, isDistribution() will be true for ValueRecorder. Is that right?

I'm confused because transformValue() will then throw on L242.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's correct. I've opened a separate PR to address the support for Distribution and Histogram type metrics to be exported here: #125

When testing with those changes, I've gotten the ValueRecorder to correctly export.

@nicolasgere
Copy link

Who is responsible of merging that?

@aabmass
Copy link
Contributor

aabmass commented Sep 30, 2020

This PR needs to be updated and it should take a minor change to send LastValue

@aabmass
Copy link
Contributor

aabmass commented Feb 1, 2021

The OTel metrics specification still hasn't decided what default aggregator will be used for ValueRecorder. It's looking like it will be "some histogram sketch" (e.g. DDSketch) which will produce fancy histograms. Since this will be changing, closing this PR.

@aabmass aabmass closed this Feb 1, 2021
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.

Add support for Histogram
3 participants