-
Notifications
You must be signed in to change notification settings - Fork 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
Avoid global publishing alignment in OTLP registry #3794
Avoid global publishing alignment in OTLP registry #3794
Conversation
ecc9671
to
7aafc4a
Compare
...ns/micrometer-registry-otlp/src/main/java/io/micrometer/registry/otlp/OtlpMeterRegistry.java
Show resolved
Hide resolved
...ns/micrometer-registry-otlp/src/main/java/io/micrometer/registry/otlp/OtlpMeterRegistry.java
Show resolved
Hide resolved
🛠 Lift Auto-fixSome of the Lift findings in this PR can be automatically fixed. You can download and apply these changes in your local project directory of your branch to review the suggestions before committing.1 # Download the patch
curl https://lift.sonatype.com/api/patch/github.com/micrometer-metrics/micrometer/3794.diff -o lift-autofixes.diff
# Apply the patch with git
git apply lift-autofixes.diff
# Review the changes
git diff Want it all in a single command? Open a terminal in your project's directory and copy and paste the following command: curl https://lift.sonatype.com/api/patch/github.com/micrometer-metrics/micrometer/3794.diff | git apply Once you're satisfied, commit and push your changes in your project. Footnotes |
7aafc4a
to
ac07a3d
Compare
...eter-registry-otlp/src/test/java/io/micrometer/registry/otlp/OtlpDeltaMeterRegistryTest.java
Show resolved
Hide resolved
...eter-registry-otlp/src/test/java/io/micrometer/registry/otlp/OtlpDeltaMeterRegistryTest.java
Show resolved
Hide resolved
...ns/micrometer-registry-otlp/src/main/java/io/micrometer/registry/otlp/OtlpMeterRegistry.java
Outdated
Show resolved
Hide resolved
@lenin-jaganathan I rebased this to |
In general, I still think it'd be best to extend StepMeterRegistry instead of copying all of this over to get the behavior that is already provided by StepMeterRegistry. |
@shakuzen I am really not comfortable with doing this change by extending StepMeterRegistry. This will result in an incorrect relationship, which will say OTLP is a StepRegistry which it is not. Below is the Javadoc for StepMeterRegistry,
However, code duplication also smells equally bad. And we also have #3773 which will most probably have the same code duplication issues. However, I am up for making the PollService and RollOverService as has-a relationship to avoid this duplication. cc: @jonatan-ivanov |
I'm not really keen on extending
if (meterPollingService != null && isCumulative()) {
this.meterPollingService.shutdownNow();
this.meterPollingService = null;
}
I think another option is to make |
@jonatan-ivanov did you try something like, PollService{ And then, StepMeterRegistry will have a has-a relationship with PollService and Otlp can also have that in the case of DeltaFlavour. I can try this, but I will be out on vacation soon(by the end of this week maybe), so not sure if I can try this before the next release. I also want to fix some of the broken behaviors in SignalFxRegistry too so I bet I will not have enough time to try these things. But just adding them as an idea. |
6c8dc80
to
dc3cdda
Compare
@lenin-jaganathan I haven't tried it. I think the Not in this PR but I think we have a bigger issue: we should be able to inject Max and Histogram. Once we can do that My plan is to make changes in this release that have minimal user impact (basically how these PRs are right now) so that we can continue working on this and fix it properly without breaking changes. Have fun on your vacation! :) |
Co-authored-by: Jonatan Ivanov <jonatan.ivanov@gmail.com>
dc3cdda
to
0e72263
Compare
This applies gh-3750 for the OtlpDelta flavor. This is more of copying some of the code from StepMeterRegistry for now as this will be critical for the right functionality.
References: