# Prometheus Proxy > Prometheus Proxy enables Prometheus to scrape metrics from endpoints behind firewalls while preserving the native pull-based model. It uses a persistent gRPC connection initiated from inside the firewall, so only outbound access is needed from the agent side. The system has two components: a **proxy** that runs alongside Prometheus (outside the firewall) and an **agent** that runs alongside monitored services (inside the firewall). Prometheus scrapes the proxy as if it were the real endpoint; the proxy forwards the request to the agent over gRPC; the agent scrapes the actual metrics endpoint and returns the response. Every page of the documentation is also served as Markdown, with its code examples in place: add `index.md` to a page's URL, as in https://prometheus-proxy.com/embedded-agent/index.md. https://prometheus-proxy.com/llms.txt is this file with a link to each page's Markdown, and https://prometheus-proxy.com/llms-full.txt is every page but the demos' in one file. ## Links - [Documentation](https://prometheus-proxy.com/) - [GitHub Repository](https://github.com/pambrose/prometheus-proxy) - [Release Notes](https://github.com/pambrose/prometheus-proxy/blob/master/RELEASE_NOTES.md) - [Upgrading](https://prometheus-proxy.com/upgrading/index.md): what each release changed for a standalone proxy and agent - [Upgrading an Embedded Agent](https://prometheus-proxy.com/embedded-upgrading/index.md): what each release changed for code that embeds the agent - [Security Policy (reporting vulnerabilities)](https://github.com/pambrose/prometheus-proxy/blob/master/SECURITY.md) - [KDoc API Reference](https://prometheus-proxy.com/kdocs/) - [CLI Reference](https://prometheus-proxy.com/cli-reference/index.md): every option, its environment variable, its config key, and its default - [Maven Central](https://central.sonatype.com/artifact/com.pambrose/prometheus-proxy) - [Docker Images: pambrose/prometheus-proxy](https://hub.docker.com/r/pambrose/prometheus-proxy) - [Docker Images: pambrose/prometheus-agent](https://hub.docker.com/r/pambrose/prometheus-agent) ## How It Works ``` Prometheus --> proxy's scrape port (:8080) / --> the agent serving , over its gRPC connection to the proxy's agent port (:50051) --> the agent scrapes the path's target --> back the same way to Prometheus ``` - **The proxy** runs outside the firewall, beside Prometheus. Prometheus scrapes it on port 8080 at one path per target; agents connect to it on port 50051 (gRPC). Its dashboard, off by default, is on port 8094. - **The agent** runs inside the firewall, beside the services it scrapes, and needs only outbound access to the proxy. It registers a path for each target it's given, scrapes the target when the proxy asks, and sends back the result. It runs on its own (a JAR, Docker, Homebrew, or a Helm chart) or embedded in a JVM app. Its own dashboard, off by default, is on port 8095. ## Choosing How to Run the Agent | The app or service | Run | Its settings | |----------------------------------------|-------------------------------------------------------------------------------------------|---------------------------------------------------------------------| | Any service, in any language | A standalone agent: `prometheus-agent.jar`, `pambrose/prometheus-agent:4.9.0`, Homebrew, or the `charts/prometheus-agent` Helm chart | A HOCON config file of `agent.pathConfigs`, options, and environment variables | | A JVM app you build | The embedded agent, `com.pambrose:prometheus-proxy:4.9.0`, with `embeddedAgent { }` (Kotlin) or `EmbeddedAgentConfig.builder()` (Java) | The builder's typed methods and `fromEnvironment()` | | A Ktor app | The Ktor plugin, `com.pambrose:prometheus-proxy-ktor:4.9.0`, `install(PrometheusProxyAgent)` | `prometheus-proxy.agent` in the app's config file, and the install block | | A Spring Boot app | The Spring Boot starter, `com.pambrose:prometheus-proxy-spring-boot-starter:4.9.0` | The `prometheus-proxy.agent.*` properties, and a customizer bean | The proxy always runs standalone. Pages: [Embedded Agent](https://prometheus-proxy.com/embedded-agent/index.md), [Ktor Plugin](https://prometheus-proxy.com/ktor-plugin/index.md), [Spring Boot Starter](https://prometheus-proxy.com/spring-boot-starter/index.md), [Embedded Agent API](https://prometheus-proxy.com/embedded-api/index.md), and [Agent Configuration](https://prometheus-proxy.com/configuration/agent/index.md) for a standalone agent. ## Rules for Writing Code and Config - **Requirements.** Java 17 or later. A Kotlin app that embeds the agent compiles with Kotlin 2.4 or later. An app that embeds the agent needs protobuf-java 4.36.2 or later, kotlinx-coroutines 1.11.0 or later, and the Prometheus Java client 1.7.0 or later; the agent refuses to start below the last two, naming each. Spring Boot 4.0 and 4.1 set both below that: set the `kotlin-coroutines.version` property to `1.11.0` and `prometheus-client.version` to `1.10.0`. Spring Boot 4.2 or later needs neither. - **Use only settings that exist.** A config key the agent or proxy doesn't know has no effect. Each logs a WARN at startup for such a key in its own section, naming the nearest setting: ` isn't a setting, so it has no effect; did you mean ?`. Take keys from the [Agent Configuration](https://prometheus-proxy.com/configuration/agent/index.md), [Proxy Configuration](https://prometheus-proxy.com/configuration/proxy/index.md), and [CLI Reference](https://prometheus-proxy.com/cli-reference/index.md) pages, and in an embedded agent prefer the builder's typed methods to `setting(key, value)`. - **Prometheus scrapes the proxy, one job per path.** The target is the proxy's scrape port, and `metrics_path` is the path the agent registered, with a leading slash: ```yaml scrape_configs: - job_name: 'my-app' metrics_path: '/my_app_metrics' static_configs: - targets: ['proxy-host.example.com:8080'] ``` With the proxy's service discovery on (`--sd_enabled`), one `http_sd_configs` job at `http://proxy-host.example.com:8080/discovery` finds every path. Scrape a pair of proxies for failover with `static_configs`, never `http_sd_configs`: a standby proxy's empty discovery list makes Prometheus delete the targets. - **A path** can't hold whitespace, a control character, `?`, or `#`: the proxy refuses it, and the agent refuses to start with one in its `pathConfigs`. One agent serves each path: a second agent of the same auth identity that registers it takes it over, unless both set `agent.consolidated = true`, when the proxy scrapes each and joins the results. - **Starting an embedded agent.** `startIfConfigured()` returns null, logging why, when the settings name no proxy or the start fails, so the app runs on without it; `start()` throws when the start fails. Stop the agent with the app: `use { }`, `close()`, or `shutdown()` on the `EmbeddedAgentInfo` it returns. The Ktor plugin and the Spring Boot starter start and stop it with the app. - **Secrets come from the environment,** never a committed file. An embedded agent's `fromEnvironment()` reads `PROMETHEUS_PROXY`, `PROMETHEUS_AGENT_TOKEN`, `PROMETHEUS_PROXY_CERT`, and `PROMETHEUS_PROXY_AUTHORITY`. A standalone proxy or agent reads its token from `AGENT_TOKEN`, and its TLS material from files or PEM variables (`CERT_CHAIN_PEM`, `PRIVATE_KEY_PEM`, `TRUST_CERT_COLLECTION_PEM`). - **The agent's own metrics** go through the proxy at a path of their own, with no metrics port: `agentMetricsAt(path)` in an embedded agent, `agent.metrics.proxyPath` (`--metrics_proxy_path`) in a standalone one. - **Dashboards** are off by default, and serve plain HTTP with no login until `DASHBOARD_PASSWORD` is set. Set one, and put TLS in front, before exposing either dashboard. ## Quick Start Requirements: Java 17+ ### CLI ```bash # Start proxy java -jar prometheus-proxy.jar # Start agent (pointing to proxy) java -jar prometheus-agent.jar --proxy mymachine.local --config myapps.conf ``` ### Homebrew ```bash # Each formula installs openjdk@25 as a dependency brew install pambrose/tap/prometheus-proxy prometheus-proxy brew install pambrose/tap/prometheus-agent prometheus-agent --proxy mymachine.local --config myapps.conf ``` ### Docker ```bash # A container's localhost is itself, so the agent reaches the proxy by its container name on a shared network docker network create prometheus-proxy-net # Start proxy, with its metrics enabled for simple.conf's proxy_metrics path. The agent connects over the network, so # only the scrape port is published, on this host's loopback docker run --rm --name prometheus-proxy --network prometheus-proxy-net \ -p 127.0.0.1:8080:8080 \ --env METRICS_ENABLED=true \ pambrose/prometheus-proxy:4.9.0 # Start agent, in another terminal (in a real deployment, on another host, with PROXY_HOSTNAME the proxy's address, # and the proxy publishing 50051 with TLS and a token: https://prometheus-proxy.com/docker/#production-setup) docker run --rm --network prometheus-proxy-net \ --env PROXY_HOSTNAME=prometheus-proxy \ --env AGENT_CONFIG='https://raw.githubusercontent.com/pambrose/prometheus-proxy/4.9.0/examples/simple.conf' \ pambrose/prometheus-agent:4.9.0 # Scrape the proxy's and the agent's own metrics through the proxy curl http://localhost:8080/proxy_metrics curl http://localhost:8080/agent_metrics ``` ### Kubernetes (Helm) Charts for each side of the firewall are in `charts/` (install from a clone of the repository): ```bash # Monitoring cluster, next to Prometheus (agentService adds a LoadBalancer for agents in other clusters) helm install prometheus-proxy ./charts/prometheus-proxy -n monitoring --create-namespace --set agentService.enabled=true # Each target cluster: proxy.hostname and the agent's pathConfigs (config, HOCON) in agent-values.yaml helm install prometheus-agent ./charts/prometheus-agent -f agent-values.yaml ``` ### Embedded ```kotlin // build.gradle.kts dependencies { implementation("com.pambrose:prometheus-proxy:4.9.0") } ``` The [Embedded Agent](https://prometheus-proxy.com/embedded-agent/index.md) page builds and starts an agent in Kotlin and Java; the [Ktor Plugin](https://prometheus-proxy.com/ktor-plugin/index.md) and [Spring Boot Starter](https://prometheus-proxy.com/spring-boot-starter/index.md) pages give their dependencies and settings. ## Configuration Uses Typesafe Config (HOCON). Precedence: CLI args > environment variables > `-D` settings after the JAR > config file values > JVM system properties (`-D` before `-jar`) > built-in defaults. ### Agent Path Configuration (HOCON) ```hocon agent { pathConfigs: [ { name: "App1 metrics" path: app1_metrics url: "http://app1.local:9100/metrics" labels: "{\"key1\": \"value1\"}" } ] } ``` ### Common Proxy Options | Option | Env Var | Default | Description | |--------|---------|---------|-------------| | `--port, -p` | `PROXY_PORT` | 8080 | Proxy listen port | | `--agent_port, -a` | `AGENT_PORT` | 50051 | gRPC listen port for agents | | `--agent_token` | `AGENT_TOKEN` | | Pre-shared agent auth token; agents must present the same value (empty disables) | | `--config, -c` | `PROXY_CONFIG` | | Config file or URL | | `--admin, -r` | `ADMIN_ENABLED` | false | Enable admin endpoints | | `--metrics, -e` | `METRICS_ENABLED` | false | Enable internal metrics | | `--sd_enabled` | `SD_ENABLED` | false | Service discovery endpoint | | `--sd_target_prefix` | `SD_TARGET_PREFIX` | localhost:8080 | Service discovery target: `host:port`, or an `http`/`https` URL | | `--dashboard` | `DASHBOARD_ENABLED` | false | Operational dashboard (own port, default 8094) | | | `DASHBOARD_PASSWORD` | | Requires a login on the dashboard | | | `DASHBOARD_USERNAME` | admin | The dashboard login's username | | `--cert, -t` | `CERT_CHAIN_FILE_PATH` | | TLS certificate chain | | `--key, -k` | `PRIVATE_KEY_FILE_PATH` | | TLS private key | | `--trust, -s` | `TRUST_CERT_COLLECTION_FILE_PATH` | | TLS trust certificates | The agent reads the same `--dashboard*` flags and `DASHBOARD_*` variables for a dashboard of its own (`agent.dashboard`, default port 8095). ### Common Agent Options | Option | Env Var | Default | Description | |--------|---------|---------|-------------| | `--proxy, -p` | `PROXY_HOSTNAME` | localhost | Proxy hostname; accepts a comma-separated failover list (`proxy-a:50051,proxy-b:50051`) | | `--config, -c` | `AGENT_CONFIG` | | Config file or URL (required) | | `--name, -n` | `AGENT_NAME` | | Agent name | | `--consolidated, -o` | `CONSOLIDATED` | false | Multiple agents per path | | `--agent_token` | `AGENT_TOKEN` | | Pre-shared token presented to the proxy; must match the proxy's value (empty disables) | | `--timeout` | `SCRAPE_TIMEOUT_SECS` | 15 | Scrape timeout (seconds) | | `--chunk` | `CHUNK_CONTENT_SIZE_KBS` | 32 | Chunking threshold (KB) | | `--trust_all_x509` | `TRUST_ALL_X509_CERTIFICATES` | false | Disable SSL verification | | `--https_truststore` | `HTTPS_TRUST_STORE_PATH` | | Trust store (JKS/PKCS12) for HTTPS scrape targets | | `--https_truststore_password` | `HTTPS_TRUST_STORE_PASSWORD` | | Password for `--https_truststore` | | `--max_concurrent_clients` | `MAX_CONCURRENT_CLIENTS` | 1 | Concurrent HTTP clients | | `--metrics_proxy_path` | `METRICS_PROXY_PATH` | | A proxy path the agent serves its own metrics at, in-process, with no metrics port (`agent.metrics.proxyPath`) | ## TLS TLS without mutual auth requires: - Proxy: `certChainFilePath`, `privateKeyFilePath` - Agent: `trustCertCollectionFilePath` TLS with mutual auth additionally requires: - Proxy: `trustCertCollectionFilePath` - Agent: `certChainFilePath`, `privateKeyFilePath` Each can be given as PEM text, or its base64, instead of a file, for a platform that passes secrets as environment variables and for the shell-less Docker images: `tls.certChainPem`, `tls.privateKeyPem`, `tls.trustCertCollectionPem` (env `CERT_CHAIN_PEM`, `PRIVATE_KEY_PEM`, `TRUST_CERT_COLLECTION_PEM`; no CLI flags). A file and a PEM for the same piece are refused, and a PEM is never logged. See [TLS Setup](https://prometheus-proxy.com/security/tls/index.md). Scraping HTTPS targets (agent → endpoint, separate from the agent ↔ proxy gRPC TLS above): - `agent.http.trustStorePath` (+ `trustStorePassword`) — trust a custom/private CA, validation stays on - `agent.http.enableTrustAllX509Certificates = true` — disable verification entirely (dev only; takes precedence) ## Features - **Proxy failover**: the agent takes an ordered `agent.proxy.endpoints` list (or a comma-separated `--proxy` / `PROXY_HOSTNAME`), and moves to the next proxy when one fails ([Running in Production](https://prometheus-proxy.com/production/index.md)) - **Per-agent identities**: `proxy.auth` gives each agent its own token and the paths it may register ([Security](https://prometheus-proxy.com/security/index.md)) - **Metric filtering**: per-path `agent.filters` drop whole metric families at the agent, before they cross the network ([Agent Configuration](https://prometheus-proxy.com/configuration/agent/index.md)) - **Dynamic target discovery**: `agent.discovery` watches a file of paths, so targets change with no agent restart ([Agent Configuration](https://prometheus-proxy.com/configuration/agent/index.md)) - **Consolidated mode**: several agents serve one path, for redundancy ([Advanced Topics](https://prometheus-proxy.com/advanced/index.md)) - **Prometheus service discovery**: the proxy's `/discovery` lists every path for `http_sd_configs` ([Prometheus Service Discovery](https://prometheus-proxy.com/service-discovery/index.md)) - **Dashboards**: the [proxy's](https://prometheus-proxy.com/web-dashboard/index.md) shows its agents, paths, and recent scrapes; the [agent's](https://prometheus-proxy.com/agent-dashboard/index.md) its connection, paths, and scrapes; and the [screens page](https://prometheus-proxy.com/screens-page/index.md), `/screens`, shows them and other tools on one page, each agent's through its connection to the proxy (`proxy.dashboard.agentScreens`) - **Monitoring**: both sides export Prometheus metrics, with Grafana dashboards and alerting rules in `grafana/` ([Monitoring](https://prometheus-proxy.com/monitoring/index.md)) ## Public API Surface These are the only types intended for external consumption (everything else is `internal`): - `io.prometheus.Agent` and `io.prometheus.Proxy` (entry points; `Agent.startAsyncAgent` takes a config file or URL, or a Typesafe `Config` built in memory) - `io.prometheus.agent.AgentOptions`, `io.prometheus.proxy.ProxyOptions`, `io.prometheus.common.BaseOptions` (config/CLI parsing) - `io.prometheus.agent.EmbeddedAgentConfig` and `embeddedAgent { }` (an embedded agent's settings built in code with typed methods; `EmbeddedAgentConfig.builder()` from Java; `fromEnvironment()`, `source(path, registry)`, `agentMetricsAt(path)`, `onFailure(handler)`, `reportFailure(cause)`, `stopTimeout`, `start()`, `startIfConfigured()`, and `namesProxy()`) - `io.prometheus.agent.MetricsSource` (a host's metrics, which the agent reads in-process for a path added with `EmbeddedAgentConfig`'s `source(path, source)`, in place of a URL; `MetricsSource.of(registry)`, or `source(path, registry)`, serves a `PrometheusRegistry`) - `io.prometheus.agent.EmbeddedAgentInfo` (returned by `Agent.startAsyncAgent` and the builder's `start()`; `isConnected` and `proxyEndpoint` report its connection to the proxy, live, for a host's health check; `AutoCloseable`, `close()` stopping the agent) - `io.prometheus.agent.spring` in `com.pambrose:prometheus-proxy-spring-boot-starter` (`PrometheusProxyAgentProperties`, the `prometheus-proxy.agent.*` properties; `PrometheusProxyAgent`, the agent as a `SmartLifecycle` bean; `PrometheusProxyAgentCustomizer`; and `PrometheusProxyAgentHealthIndicator`, Actuator's `prometheusAgent` component) - `io.prometheus.agent.ktor` in `com.pambrose:prometheus-proxy-ktor` (`PrometheusProxyAgent`, the plugin `install` takes; `PrometheusProxyAgentConfig`, its settings, from `prometheus-proxy.agent` in the app's config file and the install block, whose `agent { }` takes `EmbeddedAgentConfig`'s builder; and `Application.prometheusProxyAgent`, the running agent's `EmbeddedAgentInfo`) - `io.prometheus.common.EnvVars` (typed env-var enum) - `io.prometheus.common.ConfigLoadException` (thrown by `startAsyncAgent` and `startSyncAgent` when `exitOnMissingConfig` is false, and by `startAsyncAgent(config)` always, on a config that can't be loaded or any setting the options or the Agent reject, so embedded hosts catch it instead of the JVM exiting) ## Example Configurations - Production proxy, a starting point with the Pre-Flight Checklist's settings: `examples/proxy.conf` - Production agent, a starting point with the Pre-Flight Checklist's settings: `examples/agent.conf` - Basic setup: `examples/simple.conf` - Multiple apps: `examples/myapps.conf` - Metric filtering: `examples/agent-filters.conf` - Dynamic discovery targets (watched file, not passed to `--config`): `examples/discovery-targets.conf` - TLS (no mutual auth): `examples/tls-no-mutual-auth.conf` - TLS (with mutual auth): `examples/tls-with-mutual-auth.conf` - Prometheus federation: `examples/federate.conf` - A proxy and Prometheus on a VM, for agents embedded in cloud apps (TLS and token from `.env`): `examples/cloud-proxy/` [Example Configs](https://prometheus-proxy.com/examples/index.md) shows each one. ## Demos The repository's `demos/` directory holds seven self-contained demos, each run with `make up` from its directory of a clone of the release's tag, with Docker; each has a page, listed on [Demos](https://prometheus-proxy.com/demos/index.md). ```bash git clone -c advice.detachedHead=false --depth 1 --branch 4.9.0 https://github.com/pambrose/prometheus-proxy.git cd prometheus-proxy/demos/basics make up ``` ## License Apache License 2.0 ## Docs: Home - [Home](https://prometheus-proxy.com/index.md): Prometheus Proxy lets Prometheus scrape metrics endpoints behind a firewall. ## Docs: Get Started - [Get Started](https://prometheus-proxy.com/get-started/index.md): Start here if you haven't run Prometheus Proxy yet: the Quick Start has Prometheus scraping through a proxy and an agent, and Architecture explains how. - [Quick Start](https://prometheus-proxy.com/getting-started/index.md): Run a proxy beside Prometheus and an agent beside your services, and Prometheus scrapes them through the firewall, still by pull. - [Architecture](https://prometheus-proxy.com/architecture/index.md): Prometheus Proxy is two services, a proxy outside the firewall and an agent inside it, joined by a gRPC connection the agent opens. - [Using a Coding Agent](https://prometheus-proxy.com/coding-agents/index.md): What the project gives a coding agent, such as Claude Code or Codex, that builds an app with Prometheus Proxy: a skill to install, the docs as Markdown, and rules to keep in the app's repository. ## Docs: Configure - [Configure](https://prometheus-proxy.com/configuration/index.md): The proxy and the agent each take their settings from command-line options, environment variables, `-D` properties, a config file, and built-in defaults. - [Agent Configuration](https://prometheus-proxy.com/configuration/agent/index.md): The agent runs inside the firewall and scrapes local metrics endpoints on behalf of the proxy. - [Proxy Configuration](https://prometheus-proxy.com/configuration/proxy/index.md): The proxy runs outside the firewall alongside Prometheus. - [Security](https://prometheus-proxy.com/security/index.md): The proxy accepts connections from agents and scrapes from Prometheus, and out of the box it authenticates neither. - [TLS Setup](https://prometheus-proxy.com/security/tls/index.md): Encrypt the agents' connections to the proxy with TLS, with or without mutual authentication: creating certificates, setting them from files or environment variables, and confirming it's on. - [Prometheus Service Discovery](https://prometheus-proxy.com/service-discovery/index.md): The proxy serves Prometheus HTTP service discovery, so Prometheus finds each path as an agent registers it, with no change to its config. - [Example Configs](https://prometheus-proxy.com/examples/index.md): The repository ships a set of ready-to-run config files under `examples/`. ## Docs: Deploy - [Deploy](https://prometheus-proxy.com/deploy/index.md): Once the Quick Start works, these pages run the proxy and its agents for real. - [Docker](https://prometheus-proxy.com/docker/index.md): Multi-platform images (amd64, arm64, s390x, ppc64le) are published on Docker Hub for every release. - [Kubernetes](https://prometheus-proxy.com/kubernetes/index.md): Run Prometheus Proxy on Kubernetes to scrape metrics from services that live inside firewalled or private clusters. - [Cloud Platforms](https://prometheus-proxy.com/cloud-platforms/index.md): An app on a platform such as ECS, Cloud Run, or Azure Container Apps can't be scraped by a Prometheus outside the platform without opening its metrics to the internet. - [Running in Production](https://prometheus-proxy.com/production/index.md): This page gathers what a production deployment of Prometheus Proxy needs from the security, reliability, and tuning settings documented elsewhere: first as a checklist, then section by section. - [Advanced Topics](https://prometheus-proxy.com/advanced/index.md): The proxy behind nginx, Prometheus federation, consolidated mode, gRPC reflection, performance and gRPC keepalive tuning, stale agent cleanup, and Zipkin tracing. ## Docs: Operate - [Operate](https://prometheus-proxy.com/operate/index.md): For the team that runs the proxy once it's deployed, often for several teams at once: seeing what the proxy and its agents are doing, giving each team's agents a separate identity, upgrading, watching their metrics and alerts, and finding out why a scrape fails. - [Dashboards](https://prometheus-proxy.com/dashboards/index.md): The proxy and each agent can serve a dashboard, off by default, that shows what it's doing without anyone reading its logs. - [Proxy Dashboard](https://prometheus-proxy.com/web-dashboard/index.md): The proxy's dashboard answers the question this system raises most often: why isn't this target scraping? - [Screens Page](https://prometheus-proxy.com/screens-page/index.md): An operator works across several screens: the proxy's dashboard, each agent's dashboard, Prometheus, Grafana, and other tools. - [Exposing the Proxy Dashboard](https://prometheus-proxy.com/dashboard-exposure/index.md): The dashboard is off by default, and once on, anyone who can reach its port can read it until you set a login. - [Agent Dashboard](https://prometheus-proxy.com/agent-dashboard/index.md): The agent's dashboard, direct on the agent's port or relayed on the proxy's screens page: its connection to the proxy, its paths and their scrapes, Scrape now, its activity, and its settings. - [Onboarding a Team](https://prometheus-proxy.com/onboarding/index.md): When several teams share one proxy, give each team a separate identity: a name, a token, and the path patterns its agents may register. - [Upgrading](https://prometheus-proxy.com/upgrading/index.md): How to upgrade a shared proxy and then its agents, what a proxy restart interrupts, and which releases work together. - [Monitoring](https://prometheus-proxy.com/monitoring/index.md): Both the proxy and agent expose operational metrics and admin endpoints. - [Grafana & Alerting](https://prometheus-proxy.com/grafana/index.md): Ready-to-import Grafana dashboards and Prometheus alerting rules built on the proxy and agent metrics. - [Troubleshooting](https://prometheus-proxy.com/troubleshooting/index.md): A symptom-driven guide to the failures Prometheus Proxy most commonly produces, with how to confirm each cause and how to fix it. ## Docs: JVM Embed - [JVM Embed](https://prometheus-proxy.com/embed/index.md): For developers whose app runs on the JVM: the agent can run inside the app instead of as a separate process. - [Embedded Agent](https://prometheus-proxy.com/embedded-agent/index.md): A JVM app can run the agent inside itself instead of beside it, as a separate process. - [Ktor Plugin](https://prometheus-proxy.com/ktor-plugin/index.md): A Ktor app can run the embedded agent by installing a plugin, `com.pambrose:prometheus-proxy-ktor`. - [Spring Boot Starter](https://prometheus-proxy.com/spring-boot-starter/index.md): A Spring Boot app can run the embedded agent with a dependency and a few properties. - [Embedded Agent API](https://prometheus-proxy.com/embedded-api/index.md): The methods and types an application that embeds the agent calls, with what each takes, returns, and throws. - [Debugging an Embedded Agent](https://prometheus-proxy.com/embedded-debugging/index.md): Where an embedded agent logs, and how to see what it's doing: its admin and debug endpoints, its dashboard, its log, and the proxy's view of it. - [Upgrading an Embedded Agent](https://prometheus-proxy.com/embedded-upgrading/index.md): What each release since 4.0 changed for code that embeds the agent, and what to do about it. ## Docs: Reference - [Reference](https://prometheus-proxy.com/reference/index.md): For looking something up once you know the system: a setting, a term, or a type in the public API. - [CLI Reference](https://prometheus-proxy.com/cli-reference/index.md): Each row is one setting: its command-line option over its environment variable, its config key, and its default. - [Glossary](https://prometheus-proxy.com/glossary/index.md): The terms the documentation, the logs, and the dashboards use, grouped by topic. - [KDocs](https://prometheus-proxy.com/kdocs/) ## Optional - [Demos](https://prometheus-proxy.com/demos/index.md): Seven self-contained demos run the proxy, its agents, and Prometheus on your laptop from the released images. - [Basics Demo](https://prometheus-proxy.com/basics-demo/index.md): The repository ships a demo that runs the whole system on one machine: the proxy with its dashboard, three agents with theirs behind a simulated firewall, a set of simulated services, and Prometheus and Grafana in front. - [Network Demo](https://prometheus-proxy.com/network-demo/index.md): A demo that puts a simulated WAN between two agents and a proxy and its standby, and shows what a far, thin, dead, flaky, or missing link does, and how the proxy and agents cope. - [nginx Demo](https://prometheus-proxy.com/nginx-demo/index.md): A demo that puts nginx in front of the proxy, ending the agents' TLS, and shows what its stream timeouts and reloads do to connected agents, and what the dashboard needs behind it. - [Kubernetes Demo](https://prometheus-proxy.com/kubernetes-demo/index.md): A demo that runs the proxy and an agent with the Helm charts on two kind clusters, the agent's cluster exposing nothing. - [Ktor Demo](https://prometheus-proxy.com/ktor-demo/index.md): The repository ships a demo of the agent embedded in an app: a coffee shop, a small Ktor app with built-in customers, runs the agent inside its JVM. - [Spring Boot Demo](https://prometheus-proxy.com/spring-boot-demo/index.md): The repository ships a demo of the agent embedded in a Spring Boot app written in Java: a roastery, which roasts the coffee shop's beans, runs the agent inside its JVM, started by the Spring Boot starter from a few properties. - [Plain Kotlin Demo](https://prometheus-proxy.com/plain-kotlin-demo/index.md): The repository ships a demo of the agent embedded in a plain Kotlin program, with no framework and no HTTP server: a bakery's ovens, workers that take orders from a Redis queue.