Aembit Edge Prometheus-compatible metrics
Aembit Edge Components (Agent Controller, Agent Proxy, Agent Injector) expose Prometheus-compatible metrics so you can monitor each component and troubleshoot issues from your existing observability tooling.
Prometheus configuration
Section titled “Prometheus configuration”Aembit exposes Prometheus-compatible metrics in Kubernetes and Virtual Machine deployments. The following sections describe configuration steps for each deployment model. You can use any observability tool that scrapes Prometheus-compatible metrics.
Configuring Prometheus (Kubernetes)
Section titled “Configuring Prometheus (Kubernetes)”The following steps show an example of how to configure a “vanilla” Prometheus instance in a Kubernetes cluster. Depending on your Kubernetes cluster configuration, you may need to perform a different set of steps to configure Prometheus for your cluster.
-
Open a terminal window in your environment and run the following command.
kubectl edit configmap prometheus-server -
Edit the
prometheus.yamlconfiguration file by adding the following code snippet before thekubernetes-podssection:Terminal window - honor_labels: truejob_name: kubernetes-pods-aembitkubernetes_sd_configs:- role: podrelabel_configs:- action: keepregex: truesource_labels:- __meta_kubernetes_pod_annotation_aembit_io_metrics_scrape- action: replaceregex: (.+)source_labels:- __meta_kubernetes_pod_annotation_aembit_io_metrics_pathtarget_label: __metrics_path__- action: replaceregex: (\d+);(([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4})replacement: "[$2]:$1"source_labels:- __meta_kubernetes_pod_annotation_aembit_io_metrics_port- __meta_kubernetes_pod_iptarget_label: __address__- action: replaceregex: (\d+);((([0-9]+?)(\.|$)){4})replacement: $2:$1source_labels:- __meta_kubernetes_pod_annotation_aembit_io_metrics_port- __meta_kubernetes_pod_iptarget_label: __address__- action: labelmapregex: __meta_kubernetes_pod_label_(.+)- action: replacesource_labels:- __meta_kubernetes_namespacetarget_label: namespace- action: replacesource_labels:- __meta_kubernetes_pod_nametarget_label: pod- action: dropregex: Pending|Succeeded|Failed|Completedsource_labels:- __meta_kubernetes_pod_phase- action: replacesource_labels:- __meta_kubernetes_pod_node_nametarget_label: nodeThe example code block allows Prometheus to automatically detect Aembit annotations and scrape Agent Proxy metrics.
-
Save your changes in the
prometheus.yamlconfiguration file.
Kubernetes annotations
Section titled “Kubernetes annotations”Agent Controller and Agent Proxy come with standard Prometheus annotations, enabling Prometheus to automatically discover and scrape metrics from these Aembit Edge Components.
Since Agent Proxy runs as part of the Client Workload, which may already expose Prometheus metrics and have its own annotations, Aembit introduces a dedicated set of annotations. Add these annotations to Client Workload pods without conflicting with existing annotations.
Aembit automatically adds the following annotations to the Client Workload where Agent Proxy runs:
aembit.io/metrics-scrape- Default value istrue.aembit.io/metrics-path- Default value is/metrics.aembit.io/metrics-port- Default value is9099. This is a default metrics port used by Agent Proxy to expose metrics.
You may override these annotations, aembit.io/metrics-port to adjust metrics port on Agent Proxy.
Helm variables
Section titled “Helm variables”The following Helm variables turn metrics on or off:
- agentController.metrics.enabled
- agentInjector.metrics.enabled
- agentProxy.metrics.enabled
Configuring Prometheus (Virtual Machine)
Section titled “Configuring Prometheus (Virtual Machine)”Configure metrics scraping by editing /etc/prometheus/prometheus.yml.
Replace example.vm.local:port with Agent Controller and Agent Proxy VM hostname and the port on which each metrics
server listens. For Agent Controller, set the port to 9090. For Agent Proxy, set the port to 9099.
scrape_configs: - job_name: 'vm-monitoring' static_configs: - targets: ['example.vm.local:<port>']Virtual Machine environment variables
Section titled “Virtual Machine environment variables”Pass these environment variables to Agent Controller installer to manage metrics functionality.
- AEMBIT_METRICS_ENABLED - enabled for both Agent Controller and Agent Proxy
- AEMBIT_METRICS_PORT - available only for Agent Proxy, not Agent Controller. The self-hosted MCP Identity Gateway accepts this variable on its own installer. See MCP Identity Gateway environment variables.
Aembit Edge Prometheus metrics
Section titled “Aembit Edge Prometheus metrics”Aembit Edge Components expose Prometheus-compatible metrics that you can view in any observability tool that scrapes Prometheus-compatible metrics.
The following sections list the Prometheus-compatible metrics that Aembit Edge Components expose, along with the labels you can use to filter results and drill down into specific data.
Agent Proxy metrics
Section titled “Agent Proxy metrics”Agent Proxy exposes the following Prometheus-compatible metrics.
-
aembit_agent_proxy_incoming_connections_total- The total number of incoming connections (connections established from a Client Workload to Agent Proxy).- labels:
application_protocol:http,snowflake,postgres,redshift,mysql,redis,oracleDatabase,unspecifiedresource_set_id(optional):<resource_set_id>client_workload_id(optional):<client_workload_id>server_workload_id(optional):<server_workload_id>
- labels:
-
aembit_agent_proxy_active_incoming_connections- The number of active incoming connection (connections established from a Client Workload to Agent Proxy).- labels:
application_protocol:http,snowflake,postgres,redshift,mysql,redis,oracleDatabase,unspecifiedresource_set_id(optional):<resource_set_id>client_workload_id(optional):<client_workload_id>server_workload_id(optional):<server_workload_id>
- labels:
-
aembit_agent_proxy_credential_injections_total- The total number of credentials injected by Agent Proxy.- labels:
application_protocol:http,snowflake,postgres,redshift,mysql,redis,oracleDatabase,unspecified- success:
success,failure.
- labels:
-
aembit_agent_proxy_token_expiration_unix_timestamp- The expiration timestamp for Aembit Agent Proxy Token (to access Aembit Cloud). -
aembit_agent_proxy_aembit_cloud_connection_status- The current connection status between Agent Proxy and Aembit Cloud. If the connection is up, the result is “1” (Connected). If the status is down, the result is “0” (Disconnected). -
aembit_agent_proxy_credentials_cached_entries_total- The total number of unexpired credentials cached by Agent Proxy.- labels:
resource_set_id(optional):<resource_set_id>
- labels:
-
aembit_agent_proxy_directives_cached_entries_total- The total number of unexpired directives cached by Agent Proxy.- labels:
resource_set_id(optional):<resource_set_id>
- labels:
-
version- Agent Proxy version.- labels:
- component:
aembit_agent_proxy - version:
version: <version>
- component:
- labels:
-
process_cpu_second_total- The amount of CPU seconds used by Agent Proxy. This value could be more than the wall clock time if Agent Proxy used more than one core. This metric is useful in conjunction withmachine_cpu_coresto calculate CPU % usage.- labels:
- component:
aembit_agent_proxy - hostname:
hostname: <hostname>
- component:
- labels:
-
machine_cpu_cores- The number of CPU cores available to Agent Proxy.- labels:
- component:
aembit_agent_proxy - hostname:
hostname: <hostname>
- component:
- labels:
-
process_memory_usage_bytes- The amount of memory (in bytes) used by Agent Proxy.- labels:
- component:
aembit_agent_proxy - hostname:
hostname: <hostname>
- component:
- labels:
Agent Controller metrics
Section titled “Agent Controller metrics”Agent Controller exposes the following Prometheus-compatible metrics.
-
aembit_agent_controller_token_expiration_unix_timestamp- The expiration timestamp for Aembit Agent Controller Token (to access Aembit Cloud). -
aembit_agent_controller_access_token_requests_total- The number of Agent Controller requests to get access token (for Agent Controller use).- label
- Result:
success,failure Agent_Controller_Id:<AgentControllerID>
- Result:
- label
-
aembit_agent_controller_proxy_token_requests_total- The number of Agent Proxy requests received by the Agent Controller to get access token.- labels
- Result: success,
failure Agent_Controller_Id(optional):<AgentControllerID>
- Result: success,
- labels
-
aembit_agent_controller_registration_status- Agent Controller registration status. Status can be either:0(Not Registered) or1(Registered).- labels
Agent_Controller_Id(optional):<AgentControllerID>
- labels
-
version- Agent Controller version.- labels
- component:
aembit_agent_controller - version:
<version>
- component:
- labels
Agent Injector metrics
Section titled “Agent Injector metrics”Agent Injector exposes the following Prometheus-compatible metrics.
-
aembit_injector_pods_seen_total- The number of pods processed by Agent Injector. -
aembit_injector_pods_injection_total- The number of pods that received injected Aembit Edge Components.- label
success: “success” or “failure”
- label
MCP Identity Gateway metrics
Section titled “MCP Identity Gateway metrics”The MCP Identity Gateway exposes a Prometheus-compatible metrics endpoint for integration with observability tools.
Endpoint
The metrics endpoint is available at /metrics on a configurable port (default 9091).
To override the port, set AEMBIT_METRICS_PORT during installation.
See MCP Identity Gateway environment variables for details.
The default port is 9091 to avoid a collision with the Agent Controller, which exposes its metrics on port 9090 on the same host.
Process and runtime metrics
| Metric | Type | Labels | Description |
|---|---|---|---|
machine_cpu_cores | gauge | component, hostname | Number of physical CPU cores on the host running MCP Identity Gateway |
version | gauge | component, version | MCP Identity Gateway version |
process_cpu_seconds_total | counter | component, hostname | CPU seconds consumed by the MCP Identity Gateway process |
process_memory_usage_bytes | gauge | component, hostname | Memory consumed by the MCP Identity Gateway process (bytes) |
aembit_event_batch_size | histogram | none | Workload events in each batch MCP Identity Gateway sent to Aembit Cloud successfully. A failed send records nothing. Each batch holds one Aembit Tenant’s events, and one series combines the batches of every Aembit Tenant. AEMBIT_EVENT_MAX_SEND_BATCH sets the largest batch |
aembit_event_batch_oversize_total | counter | none | Batches of workload events that Aembit Cloud rejected as too large. MCP Identity Gateway then sends a smaller batch, or drops the event when the batch held one |
aembit_event_oversize_dropped_total | counter | none | Workload events that MCP Identity Gateway dropped because Aembit Cloud rejected each one as too large to accept on its own |
Session metrics
| Metric | Type | Labels | Description |
|---|---|---|---|
aembit_mcp_gateway_sessions_created_total | counter | tenant_id | MCP sessions the Gateway created since it started |
aembit_mcp_gateway_sessions_active | gauge | tenant_id | MCP sessions that are open. The Gateway recomputes this value from the session store on an interval, so it can lag the true count |
aembit_mcp_gateway_session_cleanup_last_run_timestamp_seconds | gauge | none | Unix timestamp of the last completed session cleanup run, for the whole process. A value that stops advancing means the cleanup task stopped |
Request processing metrics
| Metric | Type | Labels | Description |
|---|---|---|---|
aembit_mcp_gateway_mcp_requests_processed_total | counter | tenant_id, method, outcome | MCP requests the Gateway processed |
aembit_mcp_gateway_mcp_request_duration_seconds | histogram | tenant_id, method | Time the Gateway spent processing an MCP request, excluding time spent waiting on MCP servers |
aembit_mcp_gateway_tool_output_schema_validations_total | counter | tenant_id, outcome | Completed tool results, by the result of the output schema check. blocked means the result didn’t match its tool’s output schema and the client received error -32004 instead |
Fanout requests always report success here
For a request the Gateway fans out to your MCP servers, it builds the client response itself, whatever the upstream
servers return.
Those requests count as outcome="success" in aembit_mcp_gateway_mcp_requests_processed_total.
To see upstream health, use aembit_mcp_gateway_upstream_mcp_server_fanout_workloads_failed_total against
aembit_mcp_gateway_upstream_mcp_server_fanout_workloads_total.
Upstream MCP server metrics
| Metric | Type | Labels | Description |
|---|---|---|---|
aembit_mcp_gateway_upstream_mcp_server_http_requests_total | counter | tenant_id, method, outcome | HTTP requests to upstream MCP servers, including requests MCP Identity Gateway refused to send |
aembit_mcp_gateway_upstream_mcp_server_credential_injections_total | counter | tenant_id, method, outcome | Requests to upstream MCP servers, by what happened to the credential the Access Policy configures. MCP Identity Gateway counts a request before it sends it, so the count includes requests it answers itself and requests that fail before they reach the MCP server |
aembit_mcp_gateway_upstream_mcp_server_mcp_responses_total | counter | tenant_id, method, outcome, protocol_version | MCP protocol responses received from upstream servers. Counts only requests whose aembit_mcp_gateway_upstream_mcp_server_http_requests_total outcome is success |
aembit_mcp_gateway_upstream_mcp_server_response_bytes | histogram | tenant_id, method | Size in bytes of each HTTP response body received from an upstream server. Recorded whatever the status code, so an oversized error page is as visible as an oversized success body |
aembit_mcp_gateway_upstream_mcp_server_fanout_timeouts_total | counter | tenant_id, method, outcome | Upstream workloads that timed out during a fanout request |
aembit_mcp_gateway_upstream_mcp_server_fanout_duration_seconds | histogram | tenant_id, method | Time a fanout request took across all its upstream workloads |
aembit_mcp_gateway_upstream_mcp_server_fanout_workloads_total | counter | tenant_id, method | Upstream workloads that fanout requests attempted |
aembit_mcp_gateway_upstream_mcp_server_fanout_workloads_failed_total | counter | tenant_id, method | Upstream workloads that failed within a fanout request, through a transport error, a timeout, a non-2xx status, or an MCP-level error. A failed count equal to the attempted count means the upstream fleet was down for that method |
aembit_mcp_gateway_upstream_mcp_server_sessions_restored_count_total | counter | tenant_id, outcome | MCP client sessions MCP Identity Gateway looked up in its session store. error means the store had no session for the ID or the lookup failed |
aembit_mcp_gateway_upstream_mcp_server_sessions_reinitialized_count_total | counter | tenant_id, outcome | Upstream sessions re-established after the upstream session expired |
Authentication and Content Security metrics
| Metric | Type | Labels | Description |
|---|---|---|---|
aembit_mcp_gateway_auth_failures_total | counter | tenant_id, reason | Inbound requests the Gateway rejected at the authentication layer. Expired and invalid tokens are normal background traffic; a sustained rate, or a spike in audience_mismatch, is worth investigating |
aembit_mcp_gateway_jwks_refresh_attempts_total | counter | tenant_id, outcome | JWKS load and refresh attempts |
aembit_mcp_gateway_aidr_guard_decisions_total | counter | tenant_id, outcome | CrowdStrike AIDR scan decisions |
Session store and health metrics
| Metric | Type | Labels | Description |
|---|---|---|---|
aembit_mcp_gateway_session_store_operations_total | counter | operation, outcome, reason | Session store operations |
aembit_mcp_gateway_session_store_operation_duration_seconds | histogram | operation, outcome, reason | Time a session store operation took |
aembit_mcp_gateway_readiness_probe_flaps_total | counter | probe | Times a readiness probe went from healthy to unhealthy, for the whole process. The Gateway counts a flap after the probe crosses its consecutive-failure threshold, which is the point where the instance leaves the load balancer rotation |
Label values
| Label | Applies to | Values |
|---|---|---|
component | machine_cpu_cores, version, process_cpu_seconds_total, and process_memory_usage_bytes | aembit_mcp_gateway |
hostname | machine_cpu_cores, process_cpu_seconds_total, and process_memory_usage_bytes | The hostname of the machine running MCP Identity Gateway |
version | The version metric | MCP Identity Gateway build version, such as 1.34.5733 |
tenant_id | Every metric with a tenant_id label | Your Aembit Tenant ID |
method | Every metric with a method label | The MCP method name, such as initialize, tools/list, or tools/call |
outcome | Every metric with an outcome label, except where noted | success or error |
outcome | aembit_mcp_gateway_aidr_guard_decisions_total | scanned, fail_open, or fail_closed |
outcome | aembit_mcp_gateway_upstream_mcp_server_fanout_timeouts_total | timeout |
outcome | aembit_mcp_gateway_tool_output_schema_validations_total | valid, blocked, or unchecked |
outcome | aembit_mcp_gateway_upstream_mcp_server_http_requests_total | success, auth_error, http_client_error, http_server_error, unreachable, blocked_request, blocked_response, timeout, or other_error. success means the MCP server answered, including with an MCP error. auth_error means the MCP server returned HTTP 401, 403, or 407, http_client_error means any other HTTP 4xx, and http_server_error means HTTP 5xx. unreachable means MCP Identity Gateway could not resolve or connect to the MCP server. blocked_request means MCP Identity Gateway refused to send the request. blocked_response means it refused the response, such as a response over its size limit or one that failed a Content Security or output schema check. timeout means the MCP server did not answer in time |
outcome | aembit_mcp_gateway_upstream_mcp_server_mcp_responses_total | success, execution_error, handshake_error, or protocol_error. execution_error means the MCP server accepted the request and the work failed, such as a tool call that returned an error or a task that failed. handshake_error means MCP Identity Gateway could not open an MCP session with the MCP server, including when the MCP server supports no compatible protocol version. protocol_error means any other MCP error, such as a JSON-RPC error |
protocol_version | aembit_mcp_gateway_upstream_mcp_server_mcp_responses_total | The MCP protocol version the session negotiated, such as 2025-11-25. other means a version MCP Identity Gateway does not recognize, and not_available means no session negotiated one |
outcome | aembit_mcp_gateway_upstream_mcp_server_sessions_reinitialized_count_total | success, error, or auth_error. auth_error means MCP Identity Gateway had no credential for the MCP server |
outcome | aembit_mcp_gateway_upstream_mcp_server_credential_injections_total | injected, failed, not_supported, or not_configured. failed includes a request that received only part of the credential. not_supported means the request went without the credential, because MCP Identity Gateway cannot inject it the way the Access Policy configures. not_configured means the Access Policy injects no credential |
reason | aembit_mcp_gateway_auth_failures_total | missing_header, audience_mismatch, invalid_token, or token_expired_during_listen |
reason | Session store metrics | none, not_found, or store_error |
operation | Session store metrics | save, get, delete, or count |
probe | aembit_mcp_gateway_readiness_probe_flaps_total | cloud or session_store |
Histogram metrics expose _bucket, _count, and _sum series under the metric names in these tables.
Scraping configuration
Configure Prometheus to scrape the metrics endpoint:
scrape_configs: - job_name: 'aembit-mcp-gateway' static_configs: - targets: ['<gateway-host>:9091']Replace <gateway-host> with your MCP Identity Gateway hostname or IP address.