mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-04 18:25:22 +03:00
wip
This commit is contained in:
parent
6594882b95
commit
cb24625fb3
@ -6,7 +6,8 @@ import logging
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import subprocess as sp
|
import subprocess as sp
|
||||||
from prometheus_client import REGISTRY, generate_latest
|
from prometheus_client import REGISTRY, generate_latest, make_wsgi_app
|
||||||
|
from werkzeug.middleware.dispatcher import DispatcherMiddleware
|
||||||
import pytz
|
import pytz
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
@ -36,7 +37,8 @@ from frigate.config import FrigateConfig
|
|||||||
from frigate.const import CLIPS_DIR, MAX_SEGMENT_DURATION, RECORD_DIR
|
from frigate.const import CLIPS_DIR, MAX_SEGMENT_DURATION, RECORD_DIR
|
||||||
from frigate.models import Event, Recordings
|
from frigate.models import Event, Recordings
|
||||||
from frigate.object_processing import TrackedObject
|
from frigate.object_processing import TrackedObject
|
||||||
from frigate.prometheus_exporter import FrigateCollector
|
from frigate.prometheus_exporter import setupRegistry
|
||||||
|
|
||||||
from frigate.stats import stats_snapshot
|
from frigate.stats import stats_snapshot
|
||||||
from frigate.util import (
|
from frigate.util import (
|
||||||
clean_camera_user_pass,
|
clean_camera_user_pass,
|
||||||
@ -85,6 +87,10 @@ def create_app(
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
app.wsgi_app = DispatcherMiddleware(app.wsgi_app, {
|
||||||
|
"/metrics": make_wsgi_app(registry=setupRegistry())
|
||||||
|
})
|
||||||
|
|
||||||
return app
|
return app
|
||||||
|
|
||||||
|
|
||||||
@ -824,7 +830,7 @@ def stats():
|
|||||||
return jsonify(stats)
|
return jsonify(stats)
|
||||||
|
|
||||||
|
|
||||||
@bp.route("/metrics")
|
@bp.route("/metrics2")
|
||||||
def metrics():
|
def metrics():
|
||||||
|
|
||||||
return generate_latest()
|
return generate_latest()
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
from prometheus_client import CollectorRegistry
|
from prometheus_client import CollectorRegistry
|
||||||
from prometheus_client.metrics_core import GaugeMetricFamily
|
from prometheus_client.metrics_core import GaugeMetricFamily
|
||||||
from requester import Requester
|
|
||||||
|
from frigate.requester import Requester
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def setupRegistry():
|
def setupRegistry():
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user