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: Export MinMaxLastSumCountAggregator metrics to the collector as Summary #1320

Merged
merged 14 commits into from
Aug 4, 2020

Conversation

davidwitten
Copy link
Member

This references issue #1294.

After discussing with OpenTelemetry Go, they use the SummaryDataPoint whenever the MinMaxLastSumCountAggregator is used. They set the 0th percentile as the min, and the 100th percentile as the max.

So, I added the MetricDescriptorType Summary and created a function to add a Summary Point to the collector.

I also changed the testing code to return test metrics from a function rather than being constants, because I was running into an issue that the metrics were just being shallow-copied and different tests were affecting one another.

@codecov
Copy link

codecov bot commented Jul 16, 2020

Codecov Report

Merging #1320 into master will increase coverage by 0.05%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1320      +/-   ##
==========================================
+ Coverage   93.72%   93.77%   +0.05%     
==========================================
  Files         149      149              
  Lines        4317     4322       +5     
  Branches      880      880              
==========================================
+ Hits         4046     4053       +7     
+ Misses        271      269       -2     
Impacted Files Coverage Δ
...lemetry-exporter-collector/src/transformMetrics.ts 83.87% <100.00%> (+3.18%) ⬆️

Copy link
Member

@dyladan dyladan 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 thanks!

Copy link
Member

@obecny obecny left a comment

Choose a reason for hiding this comment

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

lgtm, just few minor things

@dyladan
Copy link
Member

dyladan commented Aug 4, 2020

@open-telemetry/javascript-approvers This has been around a while, please review so it may be merged

@dyladan dyladan added the enhancement New feature or request label Aug 4, 2020
@dyladan dyladan changed the title feat: Added Summary Data Points to the Collector feat: Export Summary metrics to the collector Aug 4, 2020
@dyladan dyladan changed the title feat: Export Summary metrics to the collector feat: Export MinMaxLastSumCountAggregator metrics to the collector as Summary Aug 4, 2020
@davidwitten
Copy link
Member Author

Fixed a flaky test in sdk-node

@dyladan
Copy link
Member

dyladan commented Aug 4, 2020

@davidwitten how does that fix the flaky test? It looks like you only switched out an async for a callback.

@davidwitten
Copy link
Member Author

davidwitten commented Aug 4, 2020

@dyladan I can change it back, I just got a message in the Node8 test that I should add a done statement. It seems like it's fine now, but before it was timing out in one test in sdk-node

@dyladan
Copy link
Member

dyladan commented Aug 4, 2020

The issue is that the test timed out. Adding a "done" statement is a suggestion of something you may have forgotten. In this case, it doesn't make the test less likely to time out.

@dyladan
Copy link
Member

dyladan commented Aug 4, 2020

You're correct the test is flaky, but it is outside the scope of this PR. Please remove that change and I will merge this. I'm looking into the flaky test in another PR.

@davidwitten
Copy link
Member Author

@dyladan Ok sounds good thanks! Just reverted the change

@dyladan dyladan merged commit 1be50d7 into open-telemetry:master Aug 4, 2020
@dyladan dyladan linked an issue Aug 6, 2020 that may be closed by this pull request
@davidwitten davidwitten deleted the summary branch August 6, 2020 20:41
jonahrosenblum pushed a commit to jonahrosenblum/opentelemetry-js that referenced this pull request Aug 8, 2020
… Summary (open-telemetry#1320)

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
obecny added a commit that referenced this pull request Aug 17, 2020
* feat: graceful shutdown for tracing and metrics

* fix: wording in test case

* fix: typo

* fix meterprovider config to use bracket notation

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>

* fix meterprovider config to use bracket notation

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>

* fix: add callbacks to shutdown methods

* fix: merge conflict

* simplify meter shutdown code

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>

* fix: fix one-liner

* private function name style fix

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>

* fix: naming of private member variables

* fix: graceful shutdown now works in browser

* fix: window event listener will trigger once

* fix: modify global shutdown helper functions

* fix: remove callback from remove listener args

* fix: change global shutdown function names and simplify functionality

* fix: add rest of function refactoring and simplification

* fix: remove unintended code snippet

* fix: refactor naming of listener cleanup function and fix sandbox issue

* fix: make global shutdown cleanup local

* fix: change interval of MeterProvider collection to ensure it does not trigger through clock

* chore: removing _cleanupGlobalShutdownListeners

* fix: remove unnecesary trace provider member function

* Removing default span attributes (#1342)

* refactor(opentelemetry-tracing): removing default span attributes

Signed-off-by: Aravin Sivakumar <aravinarjunn@gmail.com>

* refactor(opentelemetry-tracing): removing default span attributed from tracer object

Signed-off-by: Aravin Sivakumar <aravinarjunn@gmail.com>

* refactor(opentelemetry-tracing): removing accidental add to package.json

Signed-off-by: Aravin Sivakumar <aravinarjunn@gmail.com>

* refactor(opentelemetry-tracing): removing redundant test and fixing suggestions by Shawn and Daniel

Signed-off-by: Aravin Sivakumar <aravinarjunn@gmail.com>

* feat: add baggage support to the opentracing shim (#918)

Co-authored-by: Mayur Kale <mayurkale@google.com>

* Add nodejs sdk package (#1187)

Co-authored-by: Naseem <naseemkullah@gmail.com>
Co-authored-by: legendecas <legendecas@gmail.com>
Co-authored-by: Mark Wolff <mrw00010@gmail.com>
Co-authored-by: Matthew Wear <matthew.wear@gmail.com>

* feat: add OTEL_LOG_LEVEL env var (#974)

* Proto update to latest to support arrays and maps (#1339)

* chore: 0.10.0 release proposal (#1345)

* fix: add missing grpc-js index (#1358)

* chore: 0.10.1 release proposal (#1359)

* feat(api/context-base): change compile target to es5 (#1368)

* Feat: Make ID generator configurable (#1331)

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>

* fix: require grpc-js instead of grpc in grpc-js example (#1364)

Co-authored-by: Bartlomiej Obecny <bobecny@gmail.com>

* chore(deps): update all non-major dependencies (#1371)

* chore: bump metapackage dependencies (#1383)

* chore: 0.10.2 proposal (#1382)

* fix: remove unnecesary trace provider member function

* refactor(metrics): distinguish different aggregator types (#1325)

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>

* Propagate b3 parentspanid and debug flag (#1346)

* feat: Export MinMaxLastSumCountAggregator metrics to the collector as Summary (#1320)

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>

* feat: Collector Metric Exporter for the Web (#1308)

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>

* Fix issues in TypeScript getting started example code (#1374)

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>

* chore: deploy canary releases (#1384)

* fix: protos pull

* fix: address marius' feedback

* chore: deleting removeAllListeners from prometheus, fixing tests, cleanu of events when using shutdown notifier

* fix: add documentation and cleanup code

* fix: remove async label from shutdown and cleanup test case

* fix: update controller collect to return promise

* fix: make downsides of disabling graceful shutdown more apparent

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Bartlomiej Obecny <bobecny@gmail.com>
Co-authored-by: Aravin <34178459+aravinsiva@users.noreply.github.com>
Co-authored-by: Ruben Vargas Palma <ruben.vp8510@gmail.com>
Co-authored-by: Mayur Kale <mayurkale@google.com>
Co-authored-by: Naseem <naseemkullah@gmail.com>
Co-authored-by: legendecas <legendecas@gmail.com>
Co-authored-by: Mark Wolff <mrw00010@gmail.com>
Co-authored-by: Matthew Wear <matthew.wear@gmail.com>
Co-authored-by: Naseem <naseem@transit.app>
Co-authored-by: Mark Wolff <mark.wolff@microsoft.com>
Co-authored-by: Cong Zou <32532612+EdZou@users.noreply.github.com>
Co-authored-by: Reginald McDonald <40721169+reggiemcdonald@users.noreply.github.com>
Co-authored-by: WhiteSource Renovate <bot@renovateapp.com>
Co-authored-by: srjames90 <srjames@lightstep.com>
Co-authored-by: David W <dwitt12345@gmail.com>
Co-authored-by: Mick Dekkers <mickdekkersnl@gmail.com>
pichlermarc pushed a commit to dynatrace-oss-contrib/opentelemetry-js that referenced this pull request Dec 15, 2023
…en-telemetry#1320)

* fix(instrumentation-amqplib): move `@types/amqplib` into dev deps

* refactor(instrumentation-amqplib): vendor in types into internal-types

* refactor(instrumentation-amqplib): revert prettier formatting

* refactor(instrumentation-amqplib): add code comments for vendoring

* refactor(instrumentation-amqplib): delete unused file + run lint fixer

* refactor(instrumentation-amqplib): fix ts eslint errorsOC

* refactor(instrumentation-amqplib): fix lint

---------

Co-authored-by: Amir Blum <amirgiraffe@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Summary Data Point Support to the Exporter Collector
5 participants