mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-19 09:27:06 +03:00
Add prometheus metrics
This commit is contained in:
parent
238e3ab3fc
commit
fe1d27381b
@ -49,7 +49,4 @@ openai == 1.51.*
|
|||||||
# push notifications
|
# push notifications
|
||||||
py-vapid == 1.9.*
|
py-vapid == 1.9.*
|
||||||
pywebpush == 2.0.*
|
pywebpush == 2.0.*
|
||||||
# alpr
|
|
||||||
pyclipper == 1.3.*
|
|
||||||
shapely == 2.0.*
|
|
||||||
prometheus-client == 0.21.*
|
prometheus-client == 0.21.*
|
||||||
|
|||||||
@ -37,6 +37,9 @@ from frigate.util.services import (
|
|||||||
)
|
)
|
||||||
from frigate.version import VERSION
|
from frigate.version import VERSION
|
||||||
|
|
||||||
|
from prometheus_client import generate_latest, CONTENT_TYPE_LATEST
|
||||||
|
from fastapi.responses import Response
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -145,9 +148,9 @@ def config(request: Request):
|
|||||||
config["model"]["colormap"] = config_obj.model.colormap
|
config["model"]["colormap"] = config_obj.model.colormap
|
||||||
|
|
||||||
for detector_config in config["detectors"].values():
|
for detector_config in config["detectors"].values():
|
||||||
detector_config["model"]["labelmap"] = (
|
detector_config["model"][
|
||||||
request.app.frigate_config.model.merged_labelmap
|
"labelmap"
|
||||||
)
|
] = request.app.frigate_config.model.merged_labelmap
|
||||||
|
|
||||||
return JSONResponse(content=config)
|
return JSONResponse(content=config)
|
||||||
|
|
||||||
|
|||||||
@ -14,6 +14,8 @@ from frigate.const import FREQUENCY_STATS_POINTS
|
|||||||
from frigate.stats.prometheus import update_metrics
|
from frigate.stats.prometheus import update_metrics
|
||||||
from frigate.stats.util import stats_snapshot
|
from frigate.stats.util import stats_snapshot
|
||||||
from frigate.types import StatsTrackingTypes
|
from frigate.types import StatsTrackingTypes
|
||||||
|
from frigate.stats.prometheus import update_metrics
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
from typing import Dict
|
|
||||||
|
|
||||||
from prometheus_client import (
|
from prometheus_client import (
|
||||||
CONTENT_TYPE_LATEST,
|
|
||||||
Counter,
|
Counter,
|
||||||
Gauge,
|
Gauge,
|
||||||
|
Histogram,
|
||||||
Info,
|
Info,
|
||||||
generate_latest,
|
generate_latest,
|
||||||
|
CONTENT_TYPE_LATEST,
|
||||||
)
|
)
|
||||||
|
from typing import Dict
|
||||||
|
|
||||||
# System metrics
|
# System metrics
|
||||||
SYSTEM_INFO = Info("frigate_system", "System information")
|
SYSTEM_INFO = Info("frigate_system", "System information")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user