Commit 116056a5 authored by Carlos Natalino's avatar Carlos Natalino
Browse files

Aligning Prometheus metrics to the layout used by TFS.

parent c2e49098
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -43,19 +43,19 @@ LOGGER = logging.getLogger(__name__)
METRICS_POOL = MetricsPool('OpticalAttackDetector', 'RPC')

DETECTION_RESPONSE_TIME = Histogram(
    "OPTICAL_ATTACK_DETECTOR_INFERENCE_RESPONSE_TIME",
    "tfs_opticalattackdetector_inference_response_time",
    "Time taken by the inference component to reply"
)
MONITORING_RESPONSE_TIME = Histogram(
    "OPTICAL_ATTACK_DETECTOR_MONITORING_RESPONSE_TIME",
    "tfs_opticalattackdetector_monitoring_response_time",
    "Time taken by the monitoring component to reply"
)
MITIGATION_RESPONSE_TIME = Histogram(
    "OPTICAL_ATTACK_DETECTOR_MITIGATION_RESPONSE_TIME",
    "tfs_opticalattackdetector_mitigation_response_time",
    "Time taken by the attack mitigator to reply"
)
CACHE_RESPONSE_TIME = Histogram(
    "OPTICAL_ATTACK_DETECTOR_CACHE_RESPONSE_TIME",
    "tfs_opticalattackdetector_cache_response_time",
    "Time taken by the cache to reply"
)

+4 −4
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ MAX_NUMBER_WORKERS = int(
# Create a metric to track time spent and requests made.
# TODO: adjust histogram buckets to more realistic values
LOOP_TIME = Histogram(
    "OPTICAL_ATTACK_MANAGER_loop_seconds",
    "tfs_opticalattackmanager_loop_seconds",
    "Time taken by each security loop",
    buckets=(
        1.0,
@@ -113,17 +113,17 @@ LOOP_TIME = Histogram(
)

CURRENT_SERVICES = Gauge(
    "OPTICAL_ATTACK_MANAGER_active_services",
    "tfs_opticalattackmanager_active_services",
    "Active optical services currently in the network",
)

NUMBER_WORKERS = Gauge(
    "OPTICAL_ATTACK_MANAGER_number_workers",
    "tfs_opticalattackmanager_number_workers",
    "Number of workers being used by the loop",
)

DESIRED_MONITORING_INTERVAL = Gauge(
    "OPTICAL_ATTACK_MANAGER_desired_monitoring_interval",
    "tfs_opticalattackmanager_desired_monitoring_interval",
    "Desired loop monitoring interval",
)