-
Notifications
You must be signed in to change notification settings - Fork 852
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
Add AllLabels Batcher and install default Barcher for Counters #831
Conversation
sdk/src/main/java/io/opentelemetry/sdk/metrics/AbstractBoundInstrument.java
Outdated
Show resolved
Hide resolved
sdk/src/main/java/io/opentelemetry/sdk/metrics/BoundRegistry.java
Outdated
Show resolved
Hide resolved
sdk/src/main/java/io/opentelemetry/sdk/metrics/AbstractBoundInstrument.java
Outdated
Show resolved
Hide resolved
sdk/src/main/java/io/opentelemetry/sdk/metrics/AbstractBoundInstrument.java
Outdated
Show resolved
Hide resolved
sdk/src/main/java/io/opentelemetry/sdk/metrics/BoundRegistry.java
Outdated
Show resolved
Hide resolved
sdk/src/main/java/io/opentelemetry/sdk/metrics/BoundRegistry.java
Outdated
Show resolved
Hide resolved
f912b33
to
68c76f6
Compare
sdk/src/main/java/io/opentelemetry/sdk/metrics/BoundRegistry.java
Outdated
Show resolved
Hide resolved
sdk/src/main/java/io/opentelemetry/sdk/metrics/AbstractBoundInstrument.java
Outdated
Show resolved
Hide resolved
a11d370
to
fc4fcf1
Compare
Codecov Report
@@ Coverage Diff @@
## master #831 +/- ##
============================================
+ Coverage 82.3% 82.68% +0.38%
- Complexity 839 845 +6
============================================
Files 111 111
Lines 2882 2934 +52
Branches 253 257 +4
============================================
+ Hits 2372 2426 +54
+ Misses 399 397 -2
Partials 111 111
Continue to review full report at Codecov.
|
8728040
to
a756728
Compare
15984ec
to
da8de26
Compare
sdk/src/main/java/io/opentelemetry/sdk/metrics/AbstractInstrumentWithBinding.java
Outdated
Show resolved
Hide resolved
sdk/src/main/java/io/opentelemetry/sdk/metrics/AbstractInstrumentWithBinding.java
Outdated
Show resolved
Hide resolved
da8de26
to
b719a6d
Compare
33e845d
to
d93ffa3
Compare
sdk/src/main/java/io/opentelemetry/sdk/metrics/AggregatorMap.java
Outdated
Show resolved
Hide resolved
private final Resource resource; | ||
private final InstrumentationLibraryInfo instrumentationLibraryInfo; | ||
private final AggregatorFactory aggregatorFactory; | ||
private final Map<Map<String, String>, Aggregator> aggregatorMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use LabelSetSdk
as the key to this map, since it has a well-defined equals/hashcode via autovalue.
b004484
to
1361d42
Compare
c31878c
to
3871f6a
Compare
Signed-off-by: Bogdan Cristian Drutu <[email protected]>
@jkwatson PTAL, after this PR is merged we have Counters working :) |
public final List<MetricData> completeCollectionCycle() { | ||
List<Point> points = new ArrayList<>(aggregatorMap.size()); | ||
long epochNanos = clock.now(); | ||
for (Map.Entry<Map<String, String>, Aggregator> entry : aggregatorMap.entrySet()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's a risk of a ConcurrentModificationException happening during this iteration, since the map can be mutated during this method call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is guaranteed that only one thread calls into a Batcher collection at a time by the collectLock in the AbstractInstrumentWithBindings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a comment in here to that effect. thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A comment about thread safety, and this should be good to start playing with!
Signed-off-by: Bogdan Cristian Drutu <[email protected]>
3871f6a
to
22bd1e7
Compare
@jkwatson done |
Please feel free to file issues or PRs against the code merged here. |
…telemetry#831) * Bound registry work in progress Signed-off-by: Bogdan Cristian Drutu <[email protected]> * Add comment about protecting a collection cycle by a lock Signed-off-by: Bogdan Cristian Drutu <[email protected]>
No description provided.