Merge pull request 'feat: enable metrics' (#63) from feature/add-metrics into dev
Reviewed-on: freeleaps/freeleaps-service-hub#63
This commit is contained in:
commit
74d95503a0
@ -24,7 +24,7 @@ class AppSettings(BaseSettings):
|
||||
# Prometheus settings
|
||||
PROMETHEUS_ENDPOINT: str = "http://localhost:9090"
|
||||
|
||||
METRICS_ENABLED: bool = False
|
||||
METRICS_ENABLED: bool = True
|
||||
PROBES_ENABLED: bool = True
|
||||
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ SERVER_HOST=0.0.0.0
|
||||
SERVER_PORT=8009
|
||||
SERVICE_API_ACCESS_PORT=8009
|
||||
SERVICE_API_ACCESS_HOST=0.0.0.0
|
||||
|
||||
APP_NAME=1
|
||||
# starrocks settings
|
||||
STARROCKS_HOST=freeleaps-starrocks-cluster-fe-service.freeleaps-data-platform.svc
|
||||
STARROCKS_PORT=9030
|
||||
@ -17,3 +17,5 @@ BACKEND_LOG_FILE_NAME=metrics
|
||||
APPLICATION_ACTIVITY_LOG=metrics-activity
|
||||
|
||||
PROMETHEUS_ENDPOINT=http://localhost:9090
|
||||
|
||||
METRICS_ENABLED=True
|
||||
@ -1,13 +1,15 @@
|
||||
import logging
|
||||
from prometheus_fastapi_instrumentator import Instrumentator
|
||||
from common.config.app_settings import app_settings
|
||||
|
||||
from common.config.site_settings import site_settings
|
||||
|
||||
|
||||
def register(app):
|
||||
instrumentator = (
|
||||
Instrumentator().instrument(
|
||||
app,
|
||||
metric_namespace="freeleaps-mertics",
|
||||
metric_subsystem=app_settings.APP_NAME)
|
||||
metric_subsystem=site_settings.NAME)
|
||||
)
|
||||
|
||||
@app.on_event("startup")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user