-
Notifications
You must be signed in to change notification settings - Fork 992
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
Allow create events outside of an observation scope #5487
Comments
How would you like that instrumented? Is it a counter? If that's the case you can create the counter without using the Observation API. |
Correct, I already have counters for that. I was wondering if I could use the micrometer-observation abstraction api instead of using metrics directly. Searching at your repo I saw the following @jonatan-ivanov comment #3247 (comment) :
I do no know if you have had a second thought about it and if you think it would be valuable. |
The Observation API alone sort of allows this but this was never an intended usage that's why the tracing handler blows up. Also, if you use the
Right now events are tied to Observations. I'm not sure how to untie them since actions that react to these events are in
Please give us real-world scenarios like this, it helps us to understand the problem better and come-up with solutions. The state changes of circuit breakers happen when you execute something through the circuit breaker, right? If so, they should be part of an Observation already (a started one). If this is not the case and you have a circuit breaker that changes its state let's say after some time even if it was not used, to me that's more like a "gauge" scenario. |
It was two years ago but I think "A real-life example I can think of" part of what I wrote was about Counter names and tags not about the Observation-less events. For those, I think what I wrote back then:
is somewhat similar to what I wrote above:
In my mind, it would look like something like this: eventPublisher.publish(CustomEvent.of("test"));
[...]
class CustomEventListener implements EventListener<CustomEvent> {
@Override
public void onEvent(CustomEvent event) {
// counter.increment();
}
} But this is already possible with a bunch of libraries/frameworks, including Spring, Reactor, etc. (see: https://www.baeldung.com/spring-events) Summary: fixing the tracing handler should be possible but in order to reimplement a pub-sub library we need justification. |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open. |
Please describe the feature request.
Currently the observation api only allows to create events when an observation has been started. If you try to create it without starting it, the following error appears:
It would be nice to have the feature to create an event which is not coupled to an observation (or at least an observation started).
Rationale
I understand the motivation of having an event (let's say) "attached" to an observation. It is a good approach to notice "events" which happen somewhere inside of what you are "observing". For example, the GrpcServerEvents happen inside of a Grpc communication. However, in my opinion, there are other kind of events which could have sense to be isolated from an observation scope.
For example, a real world scenario would be to instrument circuit breaker's state change.
The text was updated successfully, but these errors were encountered: