Observability
What ulex exposes for monitoring: health, status, rate-limit headers, request and correlation ids, the audit log, webhook deliveries, directory sync runs, auth attempts, metrics names, and the alerts worth having.
#The three signals
| Signal | Where | Answers |
|---|---|---|
| Health | GET /health, GET /environments/prod/health | is it up, and which dependency is slow |
| Audit | GET /audit-events, GET /audit-events/export | what happened, who did it, is the log intact |
| Outcome | auth_attempt, directory_sync, webhook_delivery, deployment | did the thing the caller asked for actually work |
Health tells you the service is up. Audit tells you what was done. Outcome tells you whether it worked. You need all three; they fail independently and often only together do they explain an outage.
#Health and status
curl -sS https://ulexid.com/api/v1/health | jq{
"healthy": true,
"environment": "prod",
"version": "2025.9.1",
"region": "us-east-2",
"uptime_seconds": 841233,
"checks": [
{ "name": "api", "status": "pass", "latency_ms": 11 },
{ "name": "dynamodb", "status": "pass", "latency_ms": 3 },
{ "name": "kms", "status": "pass", "latency_ms": 7 },
{ "name": "queue", "status": "pass", "latency_ms": 2 },
{ "name": "directory_sync", "status": "pass", "latency_ms": 41 }
]
}curl -sS https://ulexid.com/api/v1/status | jq{
"status": "healthy",
"environment": "prod",
"version": "2025.9.1",
"region": "us-east-2",
"degradations": []
}{
"status": "degraded",
"environment": "prod",
"version": "2025.9.1",
"region": "us-east-1",
"degradations": [
{ "component": "directory_sync", "since": "2026-09-29T13:02:00.000Z", "impact": "scheduled polls are running up to 40 minutes late; manual syncs and inbound SCIM are unaffected" },
{ "component": "webhook_delivery", "since": "2026-09-29T12:18:00.000Z", "impact": "delivery attempts are queued but not dispatched; no events lost" }
]
}status | Meaning | Liveness probe | Readiness probe |
|---|---|---|---|
healthy | all checks pass | 200 | 200 |
degraded | a non-critical check is failing | 200 | 200 |
unavailable | not serving | 503 | 503 |
Both endpoints are unauthenticated and unrate-limited. A probe must not need a credential, and a probe must never be the thing that gets rate-limited.
#Request tracing
Every response carries:
x-ulex-request-id: req_01M3PSW9R0175NAW62NYR403R8
x-ulex-correlation-id: onboard-acme-2026-09-29
x-ratelimit-limit: 1000
x-ratelimit-remaining: 847
x-ratelimit-reset: 1790693172| Header | Direction | Use |
|---|---|---|
X-Ulex-Request-Id | request | one value per call. Stored on the audit event, the auth_attempt, the webhook_delivery, and the log line |
X-Ulex-Correlation-Id | request | one value per logical job, shared across retries, services, and agents |
Idempotency-Key | request | dedupe a write for 24 h. Not a tracing id |
# One logical job, many calls, one correlation id.
JOB="onboard-acme-$(date +%Y-%m-%d)"
for call in org domain connection user member; do
curl -sS -X POST "$BASE/…" -H "$AUTH" -H "$JSON" \
-H "X-Ulex-Correlation-Id: $JOB" \
-H "X-Ulex-Request-Id: req_$(uuidgen)" \
--data-binary @"payloads/$call.json"
done# Everything that job touched, in order.
curl -sS -G "$BASE/audit-events" -H "$AUTH" \
--data-urlencode "correlation_id=$JOB" --data-urlencode 'order=asc' \
| jq -r '.data[] | "\(.timestamp) \(.action) \(.outcome) \(.target.id) \(.request_id)"'1790693112 organization.created success org_01M3PSV8HGTKQFCAYF9GDWGN3C req_9f3c1a7b-…
1790693113 domain.verified success dom_01M3PSVCEGK9H35GZJK25HN08D req_2d4e6f8a-…
1790693114 connection.activated success con_01M3PSVAG0QFJG99R0M5DXSR5A req_0b2c4d6e-…
1790693115 user.created success usr_01M3PSV9GRT8GQGEG686AR1W9S req_8f0a2c4e-…
1790693115 organization_membership.created success mem_01M3PSVDDRC5YN00BRZ8E7CNMT req_6e8a0c2e-…#Auth attempts
Every login, successful or not.
curl -sS -G "$BASE/connections/$CON_ID/auth-attempts?limit=20" -H "$AUTH" | jq '.data[] | {outcome, stage, error_code, duration_ms, started_at}'{
"id": "job_01M3PSVQ68YGZREJKDVZSMQ64T",
"object": "auth_attempt",
"connection_id": "con_01M3PSVAG0QFJG99R0M5DXSR5A",
"organization_id": "org_01M3PSV8HGTKQFCAYF9GDWGN3C",
"strategy": "mock_sso",
"outcome": "success",
"stage": "complete",
"user_id": "usr_01M3PSV9GRT8GQGEG686AR1W9S",
"error_code": null,
"duration_ms": 214,
"ip_hash": "sha256:9c2e4a6b8d0f…",
"correlation_id": "onboard-acme-2026-09-29",
"started_at": "2026-09-29T14:45:12.000Z",
"finished_at": "2026-09-29T14:45:12.000Z"
}stage | Where it died |
|---|---|
initiated | the request was rejected before any redirect |
redirected | the IdP would not accept the AuthnRequest, or the callback never arrived |
callback | the assertion or code arrived and was rejected |
validated | the assertion verified; now mapping to a user |
provisioned | JIT creation or linking failed |
mfa | waiting on a second factor |
complete | done |
A failure at redirected is an IdP-side configuration problem. A failure at callback is a signature, Destination, or clock problem. A failure at provisioned is a allow_create or join-policy problem. The stage tells you which team owns it.
ip_hash is a salted SHA-256, never the raw address.
#Directory sync runs
curl -sS -G "$BASE/directories/$DIR_ID/syncs?limit=10" -H "$AUTH" | jq '.data[] | {state, trigger, stats, error, finished_at}'{
"id": "job_01M3PSWQ68YGZREJKDVZSMQ64T",
"object": "directory_sync",
"directory_id": "dir_01M3PSVBF8038RK2MW2N263Q2B",
"state": "succeeded",
"trigger": "scheduled",
"stats": { "users_created": 0, "users_updated": 3, "users_deactivated": 1, "users_failed": 0, "groups_synced": 4 },
"error": null,
"started_at": "2026-09-29T14:45:00.000Z",
"finished_at": "2026-09-29T14:45:04.000Z"
}Alert on state: "partial" even though it is not failed. users_failed > 0 means people are missing.
#Webhook deliveries
curl -sS -G "$BASE/webhooks/$WHK_ID/deliveries?status=failed&limit=20" -H "$AUTH" | jq '.data[] | {event, attempt, response_status, error, next_attempt_at}'Alert on failure_count climbing on a single endpoint, not on individual failures — a retry is supposed to fail sometimes.
#Audit log
curl -sS -G "$BASE/audit-events" -H "$AUTH" \
--data-urlencode 'action_prefix=authentication.' \
--data-urlencode 'outcome=failure' \
--data-urlencode 'since=2026-09-29T00:00:00.000Z' \
--data-urlencode 'limit=200' | jq '.data | group_by(.error_code) | map({code: .[0].error_code, n: length})'[
{ "code": "access_denied", "n": 41 },
{ "code": "mfa_required", "n": 12 },
{ "code": "saml_signature_invalid", "n": 3 }
]That single query tells you whether you have a permissions problem, an MFA rollout, or a certificate to rotate.
#Metrics
ulex publishes these as Prometheus metrics on GET /metrics on the internal port (not through the public API), namespaced ulex_.
| Metric | Type | Labels | Watch for |
|---|---|---|---|
ulex_requests_total | counter | env, method, route, status | a status class changing shape |
ulex_request_duration_seconds | histogram | env, route | p99 creeping up |
ulex_rate_limited_total | counter | env, bucket | sustained, not spiky |
ulex_mcp_tool_invocations_total | counter | env, tool, outcome | one tool dominating |
ulex_mcp_tool_duration_seconds | histogram | env, tool | a slow tool |
ulex_auth_attempts_total | counter | env, strategy, outcome, stage | outcome="failure" by stage |
ulex_auth_duration_seconds | histogram | env, strategy | upstream IdP latency |
ulex_sessions_active | gauge | env | an unexplained drop |
ulex_tokens_issued_total | counter | env, grant_type | refresh_token spikes = a loop bug |
ulex_directory_sync_runs_total | counter | env, provider, state | state="partial" |
ulex_directory_sync_duration_seconds | histogram | env, provider | poll time creeping up |
ulex_webhook_deliveries_total | counter | env, event, status | status="dead_lettered" |
ulex_webhook_failure_count | gauge | env, webhook_id | approaching 8 |
ulex_audit_events_total | counter | env, category, outcome | outcome="denied" |
ulex_deployments_total | counter | env, state | state="failed" |
ulex_deployment_duration_seconds | histogram | env | |
ulex_kms_operations_total | counter | env, operation | a KMS latency alarm |
ulex_lambda_concurrent_executions | gauge | env | throttling |
#Alerts
| Alert | Condition | Severity | Why |
|---|---|---|---|
| Availability | status == "unavailable" for 2 min | page | nothing works |
| Auth failure spike | rate(ulex_auth_attempts_total{outcome="failure"}[5m]) > 50 and > 5× the 7-day baseline | page | either an outage or a credential compromise |
| SAML signature failures | any saml_signature_invalid | page | a certificate expired upstream |
| SCIM failures | any directory.sync_failed for 30 min | ticket | directory is stale |
| Webhook endpoint near disable | ulex_webhook_failure_count >= 6 | ticket | about to go dark |
| JWKS cache misses | ulex_jwks_cache_miss_total > 100/min | ticket | a consumer is not caching |
| Token endpoint saturation | ulex_rate_limited_total{bucket="token"} > 0 for 5 min | ticket | a refresh loop |
| Deploy failures | ulex_deployments_total{state="failed"} > 0 | ticket | |
| KMS latency | p99 > 250 ms | ticket | envelope encryption is on the hot path |
outcome="denied" in the audit log | any sustained rise | ticket | a permissions regression |
Alert on the ratio, not the count. A tenant with 50,000 users will have more authentication.failed than one with 50, and both can be normal. Ratio against a baseline of the same tenant over the same hour of the week.
#What ulex deliberately does not emit
- Prometheus metrics on the public API.
/metricsis on the internal port. A public metrics endpoint hands an attacker your route names, your latency percentiles, and your traffic shape. - Traces per request.
X-Ulex-Request-Idand the audit log give you correlation without the cost. OpenTelemetry sampling is available on the enterprise plan. - Raw PII in any telemetry.
ip_hashandactor_hashare salted SHA-256.user_agentis truncated to 512 characters. Nothing emits an email address.
#Dashboards
Four panels answer every question you will be asked.
Availability — sum by (env) (rate(ulex_requests_total{status=~"5.."}[5m])) and ulex_request_duration_seconds{quantile="0.99"}.
Login health — sum by (strategy, outcome) (rate(ulex_auth_attempts_total[5m])) and the same by stage for failures.
Provisioning — ulex_directory_sync_runs_total by state, and ulex_webhook_deliveries_total by status.
Agent footprint — sum by (tool) (rate(ulex_mcp_tool_invocations_total[15m])) and ulex_mcp_tool_invocations_total{outcome="error"}. This one is how you find out that a fleet of agents is polling something in a loop.