> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.itential.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itential.com/_mcp/server.

# Monitoring

Itential Gateway participates in the same monitoring and observability stack as Itential Platform: Prometheus for metrics, and Loki or the Elastic Stack for centralized logs.

## Metrics endpoint

The gateway server exposes a `/metrics` endpoint in Prometheus text format. Point Prometheus directly at this endpoint to scrape Gateway's own metrics—no separate exporter required.

The endpoint runs on the gateway server, but it reports metrics for runner processes, not the server itself. It's served over HTTPS, and it doesn't require authentication.

Enable the endpoint in the gateway server configuration:

```
    [metrics]
    collection_enabled = true
    endpoint_enabled   = true
    listen_address     = '0.0.0.0'
    port               = 9091
```

`listen_address` and `port` control where the endpoint binds. With the settings above, scrape metrics at `https://<gateway-server-host>:9091/metrics`.

The endpoint exposes the following metrics:

* Go runtime and process stats (`go_*`, `process_*`)—garbage collection, memory, goroutines, open file descriptors, and CPU time
* Runner host resource usage (`cpu_usage_percent`, `memory_usage_bytes`, `disk_space_bytes`, `network_io_bytes`)
* Service execution (`service_run_count`, `service_completion_time_seconds`)—run counts and duration histograms per service, labeled by service `name` and `type`
* Virtual environment usage (`virtual_venv_count`, `virtual_venv_folder_size_bytes`)

Every metric carries `process`, `hostname`, and `cluster_id` labels.

See [Gateway metrics reference](/itential-platform/monitor/metrics-reference/gateway) for CPU, memory, and disk metrics on gateway nodes.

## Log file location

When Gateway runs as a server or runner, its log file is written to `/var/log/gateway/gateway.log`, owned by `itential:itential` with mode `0660`. See [Logging](/logging) for CLI-mode log locations and format options.

If you're deploying a log agent such as Alloy or Filebeat to collect this file, add the agent's user to the `itential` group. Without that group membership, the agent fails to tail the file without raising an error you'd notice right away.

## Loki job label

If you centralize logs with Loki and Alloy, label Gateway log streams `job="iag"`. This is the label used throughout Itential's Loki and Alloy label conventions and example LogQL queries.

## Learn more

The rest of the monitoring stack, including architecture, deployment, and configuration, is documented in the Itential Platform monitoring guide:

* [Monitoring overview](/itential-platform/monitor/monitor-itential) — concepts and how metrics and logs fit together
* [Exporters](/itential-platform/monitor/exporters) — Prometheus exporters, including how Gateway's job queue depth signals fleet capacity
* [Gateway metrics reference](/itential-platform/monitor/metrics-reference/gateway) — CPU, memory, and disk metrics for Gateway runner, server, and client nodes
* [Manage logs](/itential-platform/monitor/log/manage) — choosing between Loki and the Elastic Stack
* [Loki and Alloy deep dive](/itential-platform/monitor/log/loki-alloy) — deployment, configuration, and LogQL examples