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

introduction of View and first version of LabelsProessor #2800

Closed

Conversation

as-polyakov
Copy link
Contributor

  • Added View as a wrapper around AggregatorFactory and LabelsProcessorFactory
  • Added LabelsProcessor interfaces

Copy link
Member

@bogdandrutu bogdandrutu left a comment

Choose a reason for hiding this comment

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

Initial feedback about the new interfaces

import io.opentelemetry.api.metrics.common.Labels;
import io.opentelemetry.context.Context;

public class NoopLabelsProcessor implements LabelsProcessor {
Copy link
Member

Choose a reason for hiding this comment

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

what about we make create return "nullable" value, and return null by default? That way we know if no processor is installed and we can optimize more in the accumulator (not even retrieving the current context, etc).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not so sure about this one. Having nulls in public methods is usually considered an anti pattern, I do understand though that we have this call on a critical path for every metric recording. Seems like getting current context is pretty lightweight - just pulling it from thread local most of the time. Unless you insist I would avoid null's. If you do insist I am happy to change though

Copy link
Member

Choose a reason for hiding this comment

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

you are correct, probably we need to expose just the noop instance, so at least we can do the trick if we want to compare with noop reference which should be same as comparing with null.

@codecov
Copy link

codecov bot commented Feb 17, 2021

Codecov Report

Merging #2800 (aeb5ea0) into main (339bbb8) will increase coverage by 0.13%.
The diff coverage is 78.37%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #2800      +/-   ##
============================================
+ Coverage     89.50%   89.64%   +0.13%     
- Complexity     2613     2637      +24     
============================================
  Files           308      312       +4     
  Lines          8446     8481      +35     
  Branches        855      856       +1     
============================================
+ Hits           7560     7603      +43     
+ Misses          616      614       -2     
+ Partials        270      264       -6     
Impacted Files Coverage Δ Complexity Δ
.../sdk/metrics/processor/BaggageLabelsProcessor.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
.../sdk/metrics/processor/LabelsProcessorFactory.java 33.33% <33.33%> (ø) 1.00 <1.00> (?)
...opentelemetry/sdk/metrics/AbstractAccumulator.java 100.00% <100.00%> (ø) 3.00 <1.00> (+1.00)
...io/opentelemetry/sdk/metrics/SdkMeterProvider.java 100.00% <100.00%> (ø) 11.00 <1.00> (ø)
.../sdk/metrics/SynchronousInstrumentAccumulator.java 84.21% <100.00%> (+1.35%) 8.00 <1.00> (ø)
...ava/io/opentelemetry/sdk/metrics/ViewRegistry.java 95.00% <100.00%> (ø) 10.00 <5.00> (ø)
...try/sdk/metrics/processor/NoopLabelsProcessor.java 100.00% <100.00%> (ø) 2.00 <2.00> (?)
...n/java/io/opentelemetry/sdk/metrics/view/View.java 100.00% <100.00%> (ø) 2.00 <2.00> (?)
...metry/sdk/extension/resources/ProcessResource.java 78.94% <0.00%> (-3.91%) 5.00% <0.00%> (+1.00%) ⬇️
.../java/io/opentelemetry/sdk/resources/Resource.java 85.45% <0.00%> (-3.64%) 16.00% <0.00%> (ø%)
... and 14 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 339bbb8...aeb5ea0. Read the comment docs.

This was referenced Mar 1, 2021
@jkwatson
Copy link
Contributor

jkwatson commented Mar 5, 2021

do we still need this PR now that the others have been merged?

@as-polyakov
Copy link
Contributor Author

as-polyakov commented Mar 5, 2021 via email

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