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
|
||||
py-vapid == 1.9.*
|
||||
pywebpush == 2.0.*
|
||||
# alpr
|
||||
pyclipper == 1.3.*
|
||||
shapely == 2.0.*
|
||||
prometheus-client == 0.21.*
|
||||
|
||||
@ -37,6 +37,9 @@ from frigate.util.services import (
|
||||
)
|
||||
from frigate.version import VERSION
|
||||
|
||||
from prometheus_client import generate_latest, CONTENT_TYPE_LATEST
|
||||
from fastapi.responses import Response
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@ -145,9 +148,9 @@ def config(request: Request):
|
||||
config["model"]["colormap"] = config_obj.model.colormap
|
||||
|
||||
for detector_config in config["detectors"].values():
|
||||
detector_config["model"]["labelmap"] = (
|
||||
request.app.frigate_config.model.merged_labelmap
|
||||
)
|
||||
detector_config["model"][
|
||||
"labelmap"
|
||||
] = request.app.frigate_config.model.merged_labelmap
|
||||
|
||||
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.util import stats_snapshot
|
||||
from frigate.types import StatsTrackingTypes
|
||||
from frigate.stats.prometheus import update_metrics
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
from typing import Dict
|
||||
|
||||
from prometheus_client import (
|
||||
CONTENT_TYPE_LATEST,
|
||||
Counter,
|
||||
Gauge,
|
||||
Histogram,
|
||||
Info,
|
||||
generate_latest,
|
||||
CONTENT_TYPE_LATEST,
|
||||
)
|
||||
from typing import Dict
|
||||
|
||||
# System metrics
|
||||
SYSTEM_INFO = Info("frigate_system", "System information")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user