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(metrics): use MetricDescriptor to determine aggregator #989 #1014

Conversation

vmarchaud
Copy link
Member

Currently the batcher interface define the following:

export abstract class Batcher {
  // [ ... ]
  abstract aggregatorFor(metricKind: MetricKind): Aggregator;
  // [ ... ]
}

Which is spec compliant but from a user perspective it only possible to use a specific aggregator for each kind of metricKind. Some might want to configure that on a more granular level using the metric name or labels for example.

The go implementation already use MetricDescriptor instead of MetricKind i believe for the same reason: https://github.com/open-telemetry/opentelemetry-go/blob/master/sdk/export/metric/metric.go#L100

More details here: #989 (comment)

@vmarchaud vmarchaud self-assigned this May 3, 2020
@vmarchaud vmarchaud added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 3, 2020
@codecov-io
Copy link

codecov-io commented May 3, 2020

Codecov Report

Merging #1014 into master will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1014   +/-   ##
=======================================
  Coverage   95.00%   95.00%           
=======================================
  Files         212      212           
  Lines        8806     8806           
  Branches      796      796           
=======================================
  Hits         8366     8366           
  Misses        440      440           
Impacted Files Coverage Δ
packages/opentelemetry-metrics/src/Metric.ts 96.87% <ø> (ø)
...ckages/opentelemetry-metrics/src/export/Batcher.ts 100.00% <100.00%> (ø)
packages/opentelemetry-metrics/test/Meter.test.ts 99.35% <100.00%> (ø)

Copy link
Member

@legendecas legendecas left a comment

Choose a reason for hiding this comment

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

👍 PR-wise looks fine. But this doesn't explain the best practice to determine an aggregator for a metric too (depends on specific label keys or pattern of name doesn't seem to be cool). Maybe open-telemetry/oteps#89 is the right solution.

@vmarchaud
Copy link
Member Author

@legendecas Will do a quick example in a seperate PR. You are right, this system would be replaced by the View API later on

@mayurkale22 mayurkale22 merged commit 16ae2a7 into open-telemetry:master May 4, 2020
@mayurkale22 mayurkale22 added the enhancement New feature or request label May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants