AdvancedObservability

Observability and Integrations

Set up monitoring and connect Bloqr AI to external tools for visibility into blocked requests and system behavior. Learn how to export metrics, logs, and alerts.

Overview

Bloqr Systems helps you see what the filter blocks, why it blocks it, and how the system behaves over time. This page gives you a starter-kit setup for exporting metrics, shipping logs, and wiring alerts into your existing tools.

Use this guide as a template you can adapt to your own stack. The examples below are generic by design so you can replace endpoints, tokens, and field names with the conventions used in your environment.

Bloqr AI™—Secure, observable AI protection and filtering.

If you are setting up observability for the first time, start with metrics and request logs before adding alert routing.

What you can observe

Enable metrics export

Turn on request counters and latency histograms first so you can measure baseline behavior.

Forward structured logs

Include a request ID, policy outcome, and action taken so you can trace each event end to end.

Connect alerting

Route spikes in blocked traffic or error rates to the team that owns the integration.

Add external providers

Integrate Sentry, Prometheus, or a custom sink once the core data flow is stable.

Metrics and logs

You should expose the same event in both metrics and logs so you can move from trend analysis to root cause analysis without changing tools. Metrics answer how often and how fast; logs answer what happened for a specific request.

A practical baseline includes counters for allowed and blocked requests, a histogram for request latency, and a log record for each decision. Keep labels stable and low-cardinality so your dashboards remain fast and readable.

Example event payload

{
  "timestamp": "2026-10-26T12:30:45Z",
  "request_id": "req_01JZ8Y7Q9K6V4F2B3A8M",
  "service": "assistant-gateway",
  "policy": "default-ai-filter",
  "action": "blocked",
  "reason": "sensitive-data-detected",
  "latency_ms": 18
}

Suggested metric names

MetricTypePurpose
bloqr_requests_totalCounterTotal requests evaluated by the filter
bloqr_requests_blocked_totalCounterRequests blocked by policy
bloqr_request_latency_msHistogramEnd-to-end evaluation time
bloqr_policy_matches_totalCounterNumber of times a rule matched
bloqr_provider_errors_totalCounterExport or delivery errors

Sentry integration

Sentry works well when you want exception visibility for integration failures, SDK errors, or unexpected response handling. A common pattern is to capture operational errors only, while keeping policy decisions in metrics and logs.

Use Sentry for questions like these:

  • Did the exporter fail to deliver an event?
  • Did an upstream integration return an invalid payload?
  • Did a client-side hook throw during enrichment?
import * as Sentry from "@sentry/node";

Sentry.init({
dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
environment: "production",
});

export function reportBloqrError(error, context) {
Sentry.withScope((scope) => {
  scope.setTag("integration", "bloqr-observability");
  scope.setContext("bloqr", context);
  Sentry.captureException(error);
});
}

If you already use Sentry for application errors, add a dedicated tag such as bloqr-observability so you can filter these events quickly.

Prometheus support

Prometheus is a strong fit when you need dashboards, alert rules, and long-term operational trends. Export counters and histograms from your service, then scrape them through your existing Prometheus setup.

Keep your labels focused. Good labels are things like environment, policy, and action. Avoid request-specific values in labels because they can explode cardinality and slow down queries.

Example Prometheus exposition

# HELP bloqr_requests_total Total requests evaluated by Bloqr AI
# TYPE bloqr_requests_total counter
bloqr_requests_total{environment="production",policy="default-ai-filter",action="allowed"} 18432
bloqr_requests_total{environment="production",policy="default-ai-filter",action="blocked"} 982

# HELP bloqr_request_latency_ms Evaluation latency in milliseconds
# TYPE bloqr_request_latency_ms histogram
bloqr_request_latency_ms_bucket{le="5"} 1200
bloqr_request_latency_ms_bucket{le="10"} 8600
bloqr_request_latency_ms_bucket{le="25"} 18100
bloqr_request_latency_ms_sum 204312
bloqr_request_latency_ms_count 19414

Example scrape configuration

scrape_configs:
  - job_name: "bloqr-ai"
    metrics_path: /metrics
    static_configs:
      - targets:
          - "observability-service.example.internal:9100"

Custom observability providers

If you already use Datadog, OpenTelemetry, Splunk, or another internal platform, you can forward the same core signals to your preferred destination. The pattern stays the same: normalize the event, enrich it once, and fan it out to each destination.

Use a custom provider when you need one of these:

  • A vendor-specific ingestion API
  • Internal routing rules for compliance
  • Custom field mapping for existing dashboards
  • Regional storage or retention controls

Provider comparison

Provider typeBest forWhat to send
SentryException trackingErrors, stack traces, tags
PrometheusMetrics and alertingCounters, gauges, histograms
Custom HTTP sinkInternal platformsStructured events and traces
OpenTelemetry collectorUnified observabilityMetrics, logs, and traces

Implementation examples

import express from "express";

const app = express();

app.post("/bloqr/events", express.json(), (req, res) => {
const event = {
request_id: req.body.request_id,
policy: req.body.policy,
action: req.body.action,
reason: req.body.reason,
timestamp: new Date().toISOString(),
};

console.log(JSON.stringify(event));
res.status(202).json({ accepted: true });
});

app.listen(3000, () => {
console.log("Observability endpoint listening on port 3000");
});

Security and operational guidance

Do not send secrets, API credentials, or raw prompt content to third-party observability tools unless your policy explicitly allows it. Prefer redacted fields, hashed identifiers, and a minimal event payload.

Good operating practices

  • Use a stable request_id across logs, metrics, and alerts.
  • Redact user input before export when the content may contain sensitive data.
  • Add sampling for high-volume allow events if your dashboard does not need every record.
  • Keep dashboards simple so operators can answer questions quickly.
  • Test alert routing in a staging environment before enabling production paging.

Advanced questions

Use separate labels or separate projects for development, staging, and production. This keeps alerts meaningful and prevents noisy test traffic from affecting real dashboards.

Next steps

Start with a single metrics stream, then add logs and alerts once the numbers look stable. After that, connect your preferred provider and validate that blocked requests appear in the tools your team already uses.