Skip to main content

Observability

Flux automatically instruments every SDK call with traces, metrics, and structured logs. You get visibility into auth events, flag evaluations, billing checks, and usage — without adding a single line of telemetry code.

What’s Auto-Instrumented

Every SDK operation produces:

  • Traces — distributed spans for auth verification, flag evaluation, entitlement checks, and usage recording, including latency and success/failure status
  • Metrics — counters and histograms for request rates, error rates, and evaluation latency, broken down by operation type and organization
  • Structured logs — timestamped event records for sign-ins, MFA challenges, org membership changes, plan upgrades, and flag overrides

All telemetry is tagged with org_id, user_id (where applicable), and sdk_version.

Querying Traces

The Observability dashboard provides a trace explorer with filtering by time range, operation type, org, and user. Click any trace to see the full span tree with timing breakdowns.

You can also export traces to your own backend — see OpenTelemetry Export below.

Custom Metrics

Record application-level metrics alongside Flux’s built-in telemetry:

use flux_sdk::Flux;

let flux = Flux::init("your-api-key");

flux.metrics().increment("checkout.completed", &[
    ("org_id", org.id.as_str()),
    ("plan", plan.name.as_str()),
])?;

flux.metrics().histogram("checkout.duration_ms", duration_ms, &[
    ("org_id", org.id.as_str()),
])?;

Custom metrics appear in the same dashboard alongside Flux’s built-in counters and are queryable with the same filters.

Alerts

Set threshold-based alerts from the Observability dashboard — for example, alert when error rate on auth.verify_session exceeds 1% over a 5-minute window. Alerts deliver to Slack, PagerDuty, or any webhook endpoint.

OpenTelemetry Export

Flux emits OTLP-compatible telemetry. Configure an export endpoint from the Observability settings to forward traces and metrics to Datadog, Honeycomb, Grafana Cloud, or any OTLP-compatible backend.

No SDK changes are needed — export configuration is managed server-side.

Next Steps