-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add metrics endpoint to edr api (#170)
* Add metrics endpoint to edr api * Add metrics folder to unit dockerfile * Update dev_req * Recompiled with python3.11 * Recompiled with python3.11
- Loading branch information
1 parent
4ebfd56
commit 0f08e47
Showing
7 changed files
with
65 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from fastapi import FastAPI | ||
from prometheus_client import CollectorRegistry | ||
from prometheus_client import multiprocess | ||
from prometheus_fastapi_instrumentator import Instrumentator | ||
|
||
|
||
def add_metrics(app: FastAPI): | ||
registry = CollectorRegistry() | ||
multiprocess.MultiProcessCollector(registry) | ||
|
||
instrumentator = Instrumentator(excluded_handlers=[".*admin.*", "/metrics", "/health"]) | ||
instrumentator.add() | ||
instrumentator.instrument(app).expose(app, include_in_schema=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ geojson-pydantic~=1.0 | |
aiocached~=0.3.0 | ||
jinja2~=3.1 | ||
isodate~=0.6.1 | ||
prometheus-fastapi-instrumentator~=7.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0f08e47
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API Unit Test Coverage Report
API Unit Test Coverage Summary