Explorar el Código

more generic counter name

Rodja Trappe hace 1 año
padre
commit
57d9478540
Se han modificado 1 ficheros con 2 adiciones y 3 borrados
  1. 2 3
      prometheus.py

+ 2 - 3
prometheus.py

@@ -15,8 +15,8 @@ def start_monitor(app: FastAPI) -> None:
     except ModuleNotFoundError:
     except ModuleNotFoundError:
         logging.info('Prometheus not installed, skipping monitoring')
         logging.info('Prometheus not installed, skipping monitoring')
         return
         return
-      
-    visits = prometheus_client.Counter('nicegui_page_visits', 'Number of real page visits',
+
+    visits = prometheus_client.Counter('page_visits', 'Number of real page visits',
                                        ['path', 'session', 'origin'])
                                        ['path', 'session', 'origin'])
 
 
     class PrometheusMiddleware(BaseHTTPMiddleware):
     class PrometheusMiddleware(BaseHTTPMiddleware):
@@ -36,4 +36,3 @@ def start_monitor(app: FastAPI) -> None:
         prometheus_client.start_http_server(9062)
         prometheus_client.start_http_server(9062)
 
 
     app.add_middleware(PrometheusMiddleware)
     app.add_middleware(PrometheusMiddleware)
-