Code Monkey home page Code Monkey logo

Comments (2)

lpravda avatar lpravda commented on August 12, 2024 1

Hi @trallnag , thanks a lot for reaching back that quickly!

I'll try to think of decoupling the problem from request/response workflow and see if any of the attempts would work.

The documentation for background task is available from here: https://fastapi.tiangolo.com/tutorial/background-tasks/ Let me know if I could provide you with some other use case.

from prometheus-fastapi-instrumentator.

trallnag avatar trallnag commented on August 12, 2024

Hey @lpravda, it sounds like this is not something that can be covered by this project. As you have pointed out it is really only usable for request/response workflows where the response represents the "end" of the task you are interested to instrument. So in your case I'd probably do the instrumentation myself either completely uncoupled from the FastAPI endpoint or extract path info from the request and use that info in combination with custom instrumentation

I wonder if there are other options / existing libraries available for this. But I cannot think of any. Maybe in the future OpenTelemetry initiative will this easy and many different small packages redundant.

Can you post an example or a link that shows using BackgroundTask? It is new to me

from prometheus-fastapi-instrumentator.

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.