-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Remove Meter.RecordBatch functionality, not specified in the specs #2449
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2449 +/- ##
=======================================
- Coverage 76.3% 76.1% -0.3%
=======================================
Files 173 173
Lines 12010 11939 -71
=======================================
- Hits 9168 9089 -79
- Misses 2597 2604 +7
- Partials 245 246 +1
|
d10e2c3
to
2c3f448
Compare
2c3f448
to
f83fb84
Compare
Signed-off-by: Bogdan Drutu <[email protected]>
f83fb84
to
d5f3b92
Compare
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.
Should we also give BatchObserver the same treatment?
func benchmarkBatchRecord8Labels(b *testing.B, numInst int) { | ||
const numLabels = 8 | ||
ctx := context.Background() | ||
fix := newFixture(b) | ||
labs := makeLabels(numLabels) | ||
var meas []sdkapi.Measurement | ||
|
||
for i := 0; i < numInst; i++ { | ||
inst := fix.meterMust().NewInt64Counter(fmt.Sprintf("int64.%d.sum", i)) | ||
meas = append(meas, inst.Measurement(1)) | ||
} | ||
|
||
b.ResetTimer() | ||
|
||
for i := 0; i < b.N; i++ { | ||
fix.accumulator.RecordBatch(ctx, labs, meas...) | ||
} | ||
} |
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 looks like RecordBatch is a form of optimization that was taken. The alternatives seem to be calling Record N times for different synchronous instruments, and Observing() N Async instruments ina BatchObserver.
Could we please get a replacement benchmark to show the performance difference using these cases?
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.
As long as it is a major part of the API: new method/function on Meter + new method/function on all the instruments this needs to be in the specification in order for this to be compliant, so not sure why I need to do this.
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.
Also, I will send a separate PR for the BatchObserver.
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 understand the reason why we might not want to have to support this specific API, but there is a use case here. Specifically "As a User I would like to record a number of metrics at once.", I just want to make sure that the performance of this use case hasn't degraded.
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.
Beyond simply "record a bunch of metrics at once", it's also "record a bunch of metrics that come from an expensive operation without performing that operation once per metric".
I think that regardless what is in the spec we have agreed that SIGs can choose to have more API surface than required and this may be a situation where we choose to do so. The decision to add this capability was not taken lightly and I don't think the decision to remove it should be either. I'd like to have this discussed at the Go SIG and definitely want input from @jmacd, who helped define the initial need for this capability and its implementation.
@MadVikingGod I will in a followup PR. One change per PR to make reviews easier. |
👍 for this approach. |
Agreed. It is difficult for us to evaluate changes presented in isolation and without any discussion of what they are attempting to achieve, why, and how they relate to other pending changes. |
@Aneurysm9 I think this change is very descriptive, it removes an undefined functionality in the specification. What more context do you need? I fail to understand, since this does not add a "partial" implementation or anything. I think a good question is why just this? The answer is this is the first API that I saw and was not specified. |
@Aneurysm9 you have the issue, does that explain the motivation? |
@MadVikingGod can you provide clear comment on how to unblock this? Since we discussed the followup of BatchObserver, is anything else blocking this? |
There are two things that I would want.
|
I disagree with this, under opentelemetry SIG projects we should not start adding random APIs that may block future progress of the project. I would like to ask the @open-telemetry/technical-committee about this because I think this is misunderstood. OpenTelemetry does want the SIGs to model the APIs (abstractions, concepts) that specs define in a language specific way, but I don't believe that OpenTelemetry allows SIGs to define new abstractions/concepts. |
There is a fine line to walk here: we don't want language implementations to end up polluting API namespace in a way that makes future additions to the spec difficult/impossible to implement in that language, but we also don't want to prevent implementations to do necessary language-specific improvements and optimizations. This likely largely depends on what we consider polluting the API and what we consider necessary improvements. Ideally we want to have clear guidelines around this, although I suspect in many situations it may need to be decided on a case by case basis and is going to be fairly subjective. |
Not sure it helps this discussion much, but we're ALSO looking at prototyping |
@jsuereth Having it as a prototype is fine, but needs to be marked accordingly (comments or package name, etc.) But as you said, Java is looking to do a prototype, if this will be completely different in Java probably is not good as we aim for consistent abstractions/semantics. |
Is this superseded by #2557? |
Closing due to this being based on the old API. |
Updates #2462
Signed-off-by: Bogdan Drutu [email protected]