prometheus-fastapi-instrumentator | Instrument your FastAPI app | Analytics library
kandi X-RAY | prometheus-fastapi-instrumentator Summary
kandi X-RAY | prometheus-fastapi-instrumentator Summary
A configurable and modular Prometheus Instrumentator for your FastAPI. Install prometheus-fastapi-instrumentator from PyPI. Here is the fast track to get started with a preconfigured instrumentator:.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Calculate the total size of each request
- Build the label attribute names
- Creates a decorator for the HTTP latency
- Summarize response size bytes
- Generate a metric for each request
- Calculate the metric size of each request
prometheus-fastapi-instrumentator Key Features
prometheus-fastapi-instrumentator Examples and Code Snippets
Community Discussions
Trending Discussions on prometheus-fastapi-instrumentator
QUESTION
I am using the prometheus-fastapi-instrumentator
package to expose my custom metrics but they don't seem to be picked up by DataDog.
I'm experiencing a lot of trouble getting DataDog to scrape my Counter
metrics. Additionally, Histogram
buckets don't seem to be going through as distribution metrics.
Does anyone have any clue as to what the issue could be?
Here is my monitoring.py file: https://github.com/rileyhun/fastapi-ml-example/blob/main/app/core/monitoring.py
Reproducible Example:
...ANSWER
Answered 2021-Oct-23 at 19:24Is the datadog-agent configured to pull your metrics or are you pushing metrics to dogstatsd?
If the datadog-agent is pulling, make sure you follow the instructions here https://docs.datadoghq.com/integrations/guide/prometheus-host-collection/:
The instructions above have more detail, but what you're generally doing is:
- Make sure your server returns the prometheus metrics at an endpoint. You may want to expose this using a different port that is kept internal.
- Enable the openmetrics integration by adding the config to the agent so it knows that it needs to pull prometheus metrics from the endpoint you exposed in the above step. If you have a kubernetes setup then this configuration specified on the application end, usually through the
Deployment
resource inspec.template.metadata.annotations
which would look something like:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install prometheus-fastapi-instrumentator
You can use prometheus-fastapi-instrumentator like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page