GithubHelp home page GithubHelp logo

Comments (6)

JordiMartinezVicent avatar JordiMartinezVicent commented on August 17, 2024 2

@jonatan-ivanov I have just created the following issue #5301

from micrometer.

ceremo avatar ceremo commented on August 17, 2024 1

It works for me, cancellations in webflux are defined using connectionAborted.

from micrometer.

ttddyy avatar ttddyy commented on August 17, 2024

Observing the behavior of cancel, it seems the status code doesn't change even if the request is canceled.
Instead, the ServiceCall#isCancelled returns true for canceled requests.

So, I'm inclined to add GrpcServerObservationContext#isCancelled, which becomes a low cardinality tag, to indicate whether the request has been canceled or not, then keep the existing status code unchanged.

from micrometer.

JordiMartinezVicent avatar JordiMartinezVicent commented on August 17, 2024

Hi @marcingrzejszczak @ttddyy

With the soluction provided, it creates a new event with status cancelled but it could be useful to add the cancel information to the GrpcServerObservationContext which is used to retrieve the timer metric.

The same behavior is resolved in webflux adding a boolean at ServerRequestObservationContext

from micrometer.

jonatan-ivanov avatar jonatan-ivanov commented on August 17, 2024

You mean you simply want this info added to the context even if it is not used here so that you can create an ObservationFilter or an ObservationHandler and use it?

Or do you want the instrumentation also add a low cardinality key-value about the fact of the cancellation (that can also mean removing the event)?

Either case, could you create a new issue and explain what you want and how you want to use this information?

I think right now you can hack this: it's not great but you can create an ObservationHandler that receives the cancellation event (onEvent) method and reacts to that (e.g.: sets a field/keyvalue on the context, etc).

from micrometer.

JordiMartinezVicent avatar JordiMartinezVicent commented on August 17, 2024

You mean you simply want this info added to the context even if it is not used here so that you can create an ObservationFilter or an ObservationHandler and use it?

Or do you want the instrumentation also add a low cardinality key-value about the fact of the cancellation (that can also mean removing the event)?

I think that both would be helpful. On the one hand, we want to differentiate that the timer metric generated has been cancelled. And on the other hand, we have a custom GrpcServerObservationConvention to add extra information, which would be helpful to know if the request has been cancelled.

And yes, at least in our case, the event would have no sense.

Either case, could you create a new issue and explain what you want and how you want to use this information?

Perfect!

I think right now you can hack this: it's not great but you can create an ObservationHandler that receives the cancellation event (onEvent) method and reacts to that (e.g.: sets a field/keyvalue on the context, etc).

I will explore it, thanks for the suggestion!

from micrometer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.