Skip to content

Initial version of supporting metrics in MoP#17

Merged
yosrixp merged 1 commit intomainfrom
metrics
Apr 2, 2026
Merged

Initial version of supporting metrics in MoP#17
yosrixp merged 1 commit intomainfrom
metrics

Conversation

@yosrixp
Copy link
Copy Markdown
Collaborator

@yosrixp yosrixp commented Apr 2, 2026

MCP OAuth Proxy: application metrics (mop_*)

Instrumentation: Custom OpenTelemetry Metrics via GlobalOpenTelemetry.getMeter("mcp-oauth-proxy") in OauthProxyMetrics (Quarkus quarkus.otel.metrics.enabled). Counters, histograms (explicit second buckets), and an up/down gauge for in-flight HTTP; export follows the app’s OTLP pipeline into Chronosphere / Prometheus-style series (mop_*_total, mop_*_seconds_bucket / _sum / _count).

Coverage: HTTP 4xx/5xx and aggregate errors; token path (issuance, auth-code / refresh / client-credentials grants, authorize redirect); UserInfo requests and duration; E2E token exchange and per-step exchange latency; upstream HTTP latency; retries; dynamic client registration; OIDC discovery; cross-region Dynamo auth-code fallback (triggered / exhausted) and cross-region Dynamo failures; auth-code validation failures (PKCE, binding, replay, etc.).

Labels: Shared dimensions include oauth_provider, oauth_client, oauth_grant_type, outcome, routes, HTTP status, exchange_step, upstream_endpoint, regions for fallback, etc. OauthProviderLabel / OauthClientLabel normalize blanks to unknown and canonicalize known IdPs; TelemetryProviderResolver maps RFC 8707 resource URIs to the same provider semantics as token exchange (e.g. auth-code validation metrics). TelemetryJaxrsFilter ties HTTP error metrics to request context (route, provider, client). MetricsRegionProvider supplies primary region for relevant series.

Bootstrap: On startup, zero samples register selected instruments so empty label combinations appear in backends where needed (with follow-ups so token issuance does not emit an all-empty series).

Signed-off-by: yosrixp <yosrixp@yahoo.com>
@yosrixp yosrixp merged commit 5deee40 into main Apr 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants