Comments (2)
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.
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)
- Running custom metrics in background HOT 5
- Inprogress requests causes duplicated prometheus timeseries error
- labels on highr bucket default metrics
- Having metrics values even with no endpoints activity HOT 1
- Not full metrics list HOT 1
- FastAPI app with many routers HOT 3
- Instrumentator middleware includes BackgroundTask duration in http request latency metrics HOT 1
- How to properly initialize modified_status when throwing exception
- Default metrics are gone when adding a custom instrumentation HOT 3
- Allow for custom dynamic labels on default metrics HOT 1
- Remove FastAPI in favor of Starlette HOT 3
- Upgrade fastapi version to support >100.0 HOT 5
- Metrics disappear when setting PROMETHEUS_MULTIPROC_DIR HOT 1
- Security Concern HOT 3
- Inprogress metrics ignore namespace and subsystem
- Setting the `PROMETHEUS_MULTIPROC_DIR` is not mentioned in the docs
- Instrument latency without streaming duration HOT 1
- FastAPI ^0.110 and on_event HOT 2
- Incorrect http_requests_total with multiple Middleware HOT 3
- trio / anyio support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prometheus-fastapi-instrumentator.