Skip to main content

Bridge API

The Bridge exposes HTTP endpoints for health monitoring, Prometheus metrics, and runtime configuration management. Base URL: http://logclaw-bridge:8080 Dashboard proxy: /api/bridge/*

Health Check

GET /health
Returns the health status of all Bridge threads and connections.

Response

{
  "status": "ok",
  "threads": {
    "etl": "running",
    "anomaly": "running",
    "indexer": "running",
    "lifecycle": "running"
  },
  "kafka": "connected",
  "opensearch": "connected"
}
FieldTypeDescription
statusstringOverall status: ok or error
threadsobjectStatus of each processing thread
kafkastringKafka connection status
opensearchstringOpenSearch connection status

Prometheus Metrics

GET /metrics
Returns Prometheus-format metrics for monitoring and alerting.

Metrics

MetricTypeLabelsDescription
logclaw_bridge_etl_consumed_totalcounterKafka messages (batches) consumed from raw-logs
logclaw_bridge_etl_records_received_totalcounterIndividual OTLP log records unpacked and flattened
logclaw_bridge_etl_produced_totalcounterEnriched documents written to enriched-logs
logclaw_bridge_anomalies_detected_totalcounterAnomalies detected by the Z-score engine
logclaw_bridge_opensearch_indexed_totalcounterDocuments successfully indexed into OpenSearch
logclaw_bridge_opensearch_errors_totalcounterOpenSearch indexing errors

Example Response

# HELP logclaw_bridge_etl_consumed_total Kafka messages consumed
# TYPE logclaw_bridge_etl_consumed_total counter
logclaw_bridge_etl_consumed_total 47

# HELP logclaw_bridge_etl_records_received_total OTLP log records received
# TYPE logclaw_bridge_etl_records_received_total counter
logclaw_bridge_etl_records_received_total 12450

# HELP logclaw_bridge_etl_produced_total Enriched documents produced
# TYPE logclaw_bridge_etl_produced_total counter
logclaw_bridge_etl_produced_total 12450

# HELP logclaw_bridge_anomalies_detected_total Anomalies detected
# TYPE logclaw_bridge_anomalies_detected_total counter
logclaw_bridge_anomalies_detected_total 3
etl_consumed_total counts Kafka messages (batches), while etl_records_received_total counts individual log records. A single Kafka message can contain hundreds of OTLP log records. Use etl_records_received_total for accurate log volume tracking.

Get Configuration

GET /config
Returns the current runtime configuration.

Response

{
  "anomalyThreshold": 2.5,
  "windowSize": 50,
  "kafkaBrokers": "logclaw-kafka-kafka-bootstrap:9093",
  "rawTopic": "raw-logs",
  "enrichedTopic": "enriched-logs",
  "opensearchEndpoint": "https://logclaw-opensearch:9200"
}

Update Configuration

PATCH /config
Update runtime configuration dynamically. Changes take effect immediately without restart.

Request Body

{
  "anomalyThreshold": 3.0,
  "windowSize": 100
}
FieldTypeDescription
anomalyThresholdnumberZ-score threshold for anomaly detection (default: 2.5)
windowSizeintegerSliding window size for anomaly calculation (default: 50)

Response

{
  "status": "ok",
  "config": {
    "anomalyThreshold": 3.0,
    "windowSize": 100
  }
}
Runtime config changes are not persisted across pod restarts. For permanent changes, update the Helm values and redeploy.