Prometheus and Grafana metrics for the NeMo Guardrails server

The guardrails server can expose metrics that Prometheus scrapes and Grafana charts, so your team can watch admission queue behavior and alert on it. This page covers what to enable, the gauge caveat with several configurations, and the dashboards and alerts to build first.

On this page

Prometheus and Grafana metrics for the NeMo Guardrails server: what it gives your operations team

A platform or SRE team running a NeMo Guardrails server in front of an LLM application needs to see queue depth, request load and blocked-request trends before users start reporting slow or refused answers. Prometheus and Grafana give that view through metrics, which are numeric time series sampled at regular intervals. Prometheus pulls metrics over HTTP from scrape targets it finds through service discovery or static configuration, stores them in its own time series database, and lets operators query them with PromQL. Alert rules evaluated by Prometheus are sent to Alertmanager, which groups, silences and routes them. Grafana sits on top as the dashboard layer, reading from Prometheus as one of its data sources.

Choose this metrics path when the question is about trends and thresholds across time: is the admission queue growing, is the blocked share rising after a configuration change, is the server saturated at peak hours. Logs and traces answer why a specific request was blocked, which is a different job. Prometheus values reliability over precision and its documentation says it is not a good choice where every single event must be counted exactly, so per-request billing or audit evidence belongs in other tooling. Plan the metrics path for operational health and alerting, and keep request-level evidence in the log or trace pipelines covered elsewhere on this page.

Before building anything, confirm the metric names, labels and admission queue behavior against the NeMo Guardrails documentation for the version you run. The current library release is 0.25.0, which requires Python 3.11, 3.12 or 3.13, and metric exposure can differ between releases. Also confirm whether the metrics endpoint is enabled by default and how it is secured, since Grafana's own hardening guidance treats authentication on metrics endpoints as a control to set deliberately. Your team will also own Prometheus storage, which is local, not clustered and not replicated by default, so decide early where long-term data lives and who maintains it.

How metrics move from the guardrails server to dashboards and alerts

The path starts at the guardrails server, which exposes an HTTP metrics endpoint that the client must protect. Prometheus pulls from that endpoint using static or service discovery configuration, stores samples in its local time series database, and can forward them to remote storage. Prometheus sends alerts to Alertmanager, while Grafana queries Prometheus for dashboards behind its own login. Check that the metrics endpoint and the Grafana login sit inside the boundary you control, because local Prometheus storage is not clustered or replicated.

Scrape, storage, alerting and dashboard hand-offs for the guardrails metrics.

Metrics configuration options and when each fits

This table compares the main choices for NeMo Guardrails metrics: how widely metrics are enabled, where Prometheus stores them, which Grafana edition you run, and whether dashboards are built by hand or as code. Read each row for the trade-off and the operating work it adds. Confirm the exact setting names and defaults in the NeMo Guardrails documentation for your version before you commit to a design.

ChoiceOptionTrade-offWhen it fits
Metrics scopeServer-wide metricsLowest label count and simplest dashboards, but one blended view hides which configuration is slow or blocking more traffic.Single-configuration deployments or early rollout when you need a baseline first.
Metrics scopeMetrics per configurationClear per-assistant views, but each configuration adds series and label cardinality, which raises Prometheus memory and storage use.Several distinct assistants with separate owners, SLOs or alert routes, and a known, bounded list of configurations.
Prometheus storageSingle local Prometheus instanceSimple to run, but local storage is not clustered or replicated and is managed like any single-node database. Default retention is 15 days.Small or mid-sized estates where metrics are operational rather than audit evidence.
Prometheus storageRemote storage backend via remote writeLonger retention and central querying through an external system, with more components to size, secure and monitor.Retention requirements beyond local defaults or a shared platform team already running long-term metrics storage.
Grafana editionGrafana open source, self-hostedNo license fee for the software, but you run the database (MySQL or PostgreSQL for production), upgrades, backups and high availability yourself.Teams with platform engineers who already operate Grafana and accept the upgrade and backup work.
Grafana editionGrafana Enterprise, self-hostedAdds commercial features such as SAML and team sync, with a commercial license to buy and manage alongside the same operating work.Organizations that need SAML or team sync for access control and have budget for a commercial license.
Grafana editionGrafana CloudShifts hosting and upgrades to the vendor, but usage-based pricing and data residency need review against your policies.Teams that want less infrastructure to run and can approve the hosted data path for metrics.
Dashboard definitionBuilt by hand in the Grafana UIFast to start, but dashboards drift between environments and changes are hard to review or roll back.Early exploration before panel and alert requirements are settled.
Dashboard definitionDefined as code (provisioning files, Terraform or Git Sync)Versioned and reviewable, reproducible across environments, with added pipeline work and a need for someone to own the definitions.Production dashboards and alerts that must be reviewed, promoted between environments and shown to auditors.

Single configuration or several: how the gauge caveat changes what you build

When one guardrails server loads one configuration folder, its metrics describe one application. A dashboard panel for queue depth, request outcomes or latency can be read as a statement about that assistant without extra filtering. This is the simplest case to build and the right place to start, because questions about per-configuration behavior are easier to answer once the single-application dashboards are correct. Confirm with your server version which metric families are exposed and whether any labels are attached, since that decides which panels you can build.

  • Panels map directly: each panel answers a question about the one application, such as whether requests are waiting for admission.
  • No selector required: queries can run across the job without a configuration filter, which keeps the first dashboard short.
  • One scrape target: Prometheus pulls from one endpoint, so the target health and up series show whether the server is visible at all.
  • Local thresholds: alert thresholds set from observed baseline traffic apply to that one application only.

Before writing any panel, check the metrics endpoint after a test request and record the exact metric names for your version.

How to set up scraping, dashboards and alerts

This sequence takes a NeMo Guardrails server from a verified installation to a Prometheus scrape job, a Grafana dashboard and alert rules routed through Alertmanager. Each step closes with a check, so a fault is caught before the next layer depends on it. The result is a metrics view of admission queue behavior that your platform team can run, review and roll back.

  1. Confirm the Python version and server installation

    The platform engineer confirms the interpreter is Python 3.11, 3.12 or 3.13, the versions NeMo Guardrails 0.25.0 requires, and then installs the nemoguardrails package from PyPI or builds the server image from the Dockerfile in the project. Do not build on the NGC microservice container, because NVIDIA has sunset it. Start the server with your configuration folder. The check is that the server starts without errors and answers its HTTP API from the local host.

  2. Enable metrics for the chosen scope

    Decide whether metrics should cover the whole server or each configuration separately, because that choice shapes every label and panel that follows. Turn on the metrics option in the server configuration as described in the NeMo Guardrails documentation for your installed version. Confirm the exact key name there, since this page does not fix it. Restart the server and check the startup log for a line confirming that metrics are enabled.

  3. Confirm the metrics endpoint responds from Prometheus

    From the host that will run Prometheus, request the metrics path with curl and confirm an HTTP 200 response containing admission queue metric names. If your network policy or the server requires authentication for the metrics endpoint, supply the credentials your security team approved and confirm that unauthenticated requests are refused. Fix any firewall or routing issue now, because a scrape job cannot succeed until this request does. The check is a readable metrics response from the Prometheus host.

  4. Add the scrape job and verify series

    Add a job to the Prometheus configuration file with the server host and port as the static target and a scrape interval you choose and document. Prometheus pulls metrics over HTTP, so the server does not push anything. Reload the configuration, then open the Targets page and confirm the job shows as up. In the expression browser, query the admission queue metric names and check that each series carries a configuration label when you enabled per-configuration metrics. If one gauge shows a single value across several configurations, resolve the labelling before going further.

  5. Connect Grafana and build the first panels

    Add Prometheus as a data source in Grafana, either in the user interface or in a provisioning YAML file loaded at startup, which keeps the setup reproducible. For production, confirm Grafana uses MySQL or PostgreSQL rather than SQLite. Build panels for queue depth, admission outcomes and rejected requests, and add a variable so each panel can be filtered by configuration. Export the finished dashboard as JSON so it can be provisioned again. The check is that Save and test succeeds on the data source and every panel returns series.

  6. Run a load test across several configurations

    Choose a few configurations that represent different rails and traffic patterns, then drive concurrent requests at each one with a load tool your team selects. Run the test against a non-production server so real users are not affected. Watch the dashboard while the load runs and record the queue values as your baseline. Confirm that the per-configuration labels separate the traffic correctly, and that the panels reflect the load rather than a single aggregated value. The check is a saved baseline that the alert thresholds in the next step can be based on.

  7. Define alert rules and route through Alertmanager

    Write alert rules in Prometheus for sustained queue growth and rejection rates, with thresholds set from your load test baseline rather than from published defaults. Point Prometheus at every Alertmanager instance, not at a load balancer in front of them, and configure grouping, routing and silences for your on-call receivers. The Alertmanager documentation covers the clustering options if you run more than one instance. The check is a deliberately triggered test alert that appears in Alertmanager and reaches the intended receiver.

  8. Roll back the server configuration when needed

    Keep every server configuration folder under version control, so the previous working state is one commit away. To roll back, check out the last known good configuration, restart the server and repeat the endpoint check from step three. Confirm that the scrape job returns to up and that the dashboard panels show data again. Prometheus retains its local data under its own retention settings, so a configuration rollback does not erase history. The check is that the endpoint, target and panels match the baseline recorded during the load test.

Security and operational considerations for metrics endpoints and dashboards

Metrics from the guardrails server can reveal how your assistant is used, which rails fire and how often. The cards below cover who can reach those metrics, what must stay out of labels, how Prometheus and Grafana themselves are protected and how long data is kept.

Restrict access to the metrics endpoint

The guardrails server exposes its metrics over HTTP, and anyone who can reach that path can read counts, rail names and queue behavior. Limit the endpoint to the Prometheus servers that scrape it, using network policy, firewall rules or a reverse proxy, and require authentication where the server or your network layer allows it. Confirm in your environment that unauthenticated requests to the metrics path are refused before you expose the service beyond the cluster or host.

Keep user content out of labels

Metric labels create a separate time series for every distinct value, so prompt text, user identifiers or session IDs in labels both leak sensitive content and inflate storage. Use only bounded values such as configuration name, rail type and outcome. Review every custom metric before release and check the exposed series list for any label that carries free text. Put request-level detail in content-controlled traces or logs instead, under their own access rules.

Protect the Prometheus HTTP API

Prometheus has no built-in user management, and its HTTP API can run queries and read every stored series. The Prometheus security model expects the operator to protect that surface with network controls and a reverse proxy. Bind the server to internal interfaces, place authentication and TLS in front of the query API and Alertmanager, and confirm which paths your proxy exposes. Treat the Prometheus host as a single-node database that needs its own patching and backup plan.

Prometheus security model

Design Grafana login and roles

Grafana roles decide who can see dashboards, edit panels and change data sources. Choose an authentication method that your edition supports, such as LDAP, generic OAuth or Entra ID, and map identity groups to viewer, editor and admin roles. Confirm whether SAML, team sync or SCIM provisioning is needed, since the authentication docs list these as Enterprise or Cloud features. Keep admin accounts few and review them on a schedule.

Grafana authentication docs

Separate sensitive dashboards and alerts

Some panels show blocked-request counts by rail, which can hint at attack patterns or policy gaps, while others show only latency. Place security-relevant dashboards and alert rules in folders with restricted permissions, and send their notifications to the security or operations channel that needs them. Confirm that data source permissions and folder permissions both apply, since a viewer with access to a broad data source may still see sensitive series.

Set local retention deliberately

Prometheus keeps data in local storage, and retention is set by time or size. The default retention is 15 days, and local storage is not clustered or replicated. Choose a retention window that matches your investigation and audit needs, set a size limit as a safeguard against disk exhaustion, and decide whether long-term data goes to remote storage. Confirm the retention flags for your version and test that alerts still evaluate when the disk fills.

Prometheus storage docs

Why the gauge caveat matters before you write alerts

Confirm what one gauge series represents before you write an alert on it. A gauge holds a single current value, such as the number of requests waiting in a queue when Prometheus scrapes the server. A counter only increases until the process restarts, so it records totals such as requests admitted or rejected since start. When several guardrail configurations run in one server, a gauge may describe the whole process, a single configuration, or whichever configuration updated it last. Read the NeMo Guardrails documentation to see how the server labels and aggregates each value, and do not assume the answer from a metric name alone.

Rate-based alerts need counters. Prometheus computes a rate from increasing counter values over a time window, so an alert on how fast requests are rejected must be built on a counter. A gauge sampled at scrape time can rise and fall between scrapes and disappear from view. Prometheus values reliability over precision, so short-lived changes may not be recorded exactly. The Prometheus overview says it is a poor choice where every event must be counted exactly, such as per-request billing. For guardrail alerts, the threshold is an operating judgment that needs testing against measured behavior.

Check the behavior with a controlled load test before you trust any dashboard or alert. Send a known number of requests to each configuration, then compare the values the server reports with the counts from your load generator and the application logs. Repeat the test with two or more configurations loaded at the same time, since that is where a gauge is most likely to mislead. Record the scrape interval, because a short burst can finish between scrapes. Agree the expected results in writing before the first alert goes live, and keep the test so your team can rerun it after each upgrade.

Which dashboards and alerts to build first

These cards cover the first dashboards and alerts for the guardrails server, one per question an on-call engineer will ask. Each panel needs data that is already exposed by the server or by Prometheus itself, and each alert threshold should be set from baselines you observe in your own environment, not from published numbers.

Queue depth and wait time

This panel answers whether requests are backing up in the admission queue before they reach a rail. Plot queue depth and time spent waiting as trends over at least several days, so you can see the normal daily pattern. Test alert logic that fires when waiting time stays above your observed baseline for a sustained window, not on a single spike. Confirm the exact metric names exposed by your server version before writing queries.

Request volume per configuration

This panel shows how many requests each guardrails configuration handles over time, which tells you which assistant is driving load. It is the first place to check when latency or queue depth rises. Keep in mind that per-configuration labels only appear when metrics are enabled per configuration, and that several configurations sharing one server can distort gauge values, so read the caveat before trusting per-configuration numbers. Compare volume against a baseline from the same weekday and hour.

Blocked versus allowed outcomes

This panel plots the share of requests that rails blocked against those allowed through, over time. A sudden rise in blocks can mean an attack, a broken prompt template, or a rail that has become too strict after a configuration change. Alert on a sharp change from your baseline ratio rather than on an absolute count, since volume varies. Pair the panel with logs or traces when you need the reason a request was blocked.

Server errors and timeouts

This panel answers whether the server is failing requests or whether rails are timing out before returning a response. Split errors by type so that a timeout from a slow model is not mixed with a configuration error. Test an alert that fires when the error ratio exceeds your observed baseline for a sustained period. Confirm which error and timeout counters your server version exposes before you build the query.

Availability through scrape health

This panel answers whether Prometheus can reach the guardrails server at all. The up series for the scrape job shows a target that has stopped responding, which is a different failure from a healthy server returning errors. Alert when the target is down for a sustained window, and route that alert to the same team that owns the server. Use this signal to decide whether the other panels still reflect current data.

Capacity headroom

This panel estimates how much load the server can take before queue wait grows, by comparing current request rate and resource use with the level at which queueing began in past incidents. Build it from your own load tests and historical peaks, and record the figures you observe. Alert when headroom falls below a margin you choose, giving the team time to add replicas or adjust admission limits. Retention matters here: Prometheus keeps 15 days of local data by default, so plan longer retention or remote storage if you need to compare against seasonal peaks.

Questions teams ask before building NeMo Guardrails metrics

How much effort does a Prometheus and Grafana setup for NeMo Guardrails take?

The effort depends on how many guardrail configurations you expose, how many Prometheus and Grafana environments you run (for example, development, staging and production), and how closely the setup must match your existing monitoring standards. Each configuration adds metric labels to review, each environment adds scrape targets, data sources and dashboards to maintain, and each alert you add needs a threshold, a severity and an owner. Ask any partner or internal lead to size the work from a written list of configurations, environments, required dashboards and alert rules, since those counts drive most of the schedule.

Do Prometheus and Grafana cost money to run?

The Prometheus project has no paid enterprise edition. It is licensed under Apache-2.0, so the cost comes from the servers or containers that run it, the storage it uses, and the people who install, upgrade and maintain it. Grafana open source is licensed under AGPLv3 after Grafana Labs relicensed Grafana on April 20, 2021, and Grafana Enterprise is offered as a separate commercial option. Grafana Cloud has its own pricing, including a free tier, a Pro tier with a monthly platform fee plus usage, and an Enterprise tier with a minimum annual commitment, according to Grafana's pricing page. Check whether your legal team is comfortable with AGPLv3 terms before you choose a deployment model.

How long does Prometheus keep metrics by default?

By default, Prometheus keeps local time series data for 15 days. Data is stored in two-hour blocks with a write-ahead log, and you can change retention by time or by size. Local storage is not clustered or replicated, so a single Prometheus server is a single point of data loss unless you plan backups or send samples to long-term storage through remote write. Decide retention with your compliance and incident review needs in mind, and confirm the storage size and disk performance in your own environment before you set it.

What does the work need from our team?

You will need named owners for the guardrails server, the Prometheus server, Grafana and Alertmanager, plus someone who can change the guardrails server configuration and expose the metrics endpoint. Security or platform staff should approve network paths for scraping, the authentication on the metrics endpoint and who can view dashboards. Your on-call team should agree which alerts page someone and which go to a channel. Expect to provide access to test environments, a sample of real traffic patterns and your current monitoring standards, because these decide the labels, naming and retention choices.

Can our internal team set this up without an outside partner?

Often yes, if your team already runs Prometheus and Grafana and has someone who knows PromQL. The work is standard, but it touches a guardrails server that changes with each release, so a team new to both tools should expect a learning period. The areas most often underestimated are alert tuning, which needs real traffic to set thresholds, and keeping Grafana secure, including its security hardening settings and authentication options. Note that Grafana's high availability setup needs a shared MySQL or PostgreSQL database, and SQLite is not suitable for production. Check your team's capacity before committing to the timeline.

When is an outside partner worth bringing in?

An outside partner is most useful when several configurations and environments must share one monitoring standard, when auditors or security reviewers need documented controls and evidence, or when your team lacks time to tune alerts. DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms in infrastructure you control, so it can build the metrics endpoint, Prometheus and Grafana setup, dashboards and alert rules inside your environment and hand over runbooks. Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts, and a quote follows from that written scope. DeployOpen does not issue audit reports or certifications; independent auditors do that.

Which Prometheus release line should we deploy?

Choose between a standard minor release and the long-term support line based on how often you can upgrade. Prometheus starts a new minor release cycle every 6 weeks, and a minor release generally stops receiving bug fixes after those 6 weeks. Long-term support releases receive bug fixes for one year. According to the Prometheus release cycle page, the current LTS line is 3.13, released July 1, 2026 and supported until July 31, 2027. Confirm the version you install against the Prometheus releases page at the time of deployment, and plan an upgrade window in your operating procedures.

Limits to confirm in your environment before you rely on these metrics

The metrics pipeline has several moving parts, and each one carries a limit that changes what the dashboards can tell you. The cards below cover the guardrails server version, its supported lifecycle, Prometheus storage and release choices, and Grafana's production requirements. Confirm each item with the people named before you build alerts on top of it.

Exact metric names and labels

Confirm the metric names, types and label sets that your NeMo Guardrails server version actually exposes on its metrics endpoint. Names, histogram buckets and labels can differ between releases, so a dashboard written against one version can go silent after an upgrade. Check the scrape output from a test instance running your exact version and record it alongside the dashboard definitions. Ask your platform engineers and the NeMo Guardrails maintainers' release notes for the version you run.

Current library release
0.25.0
Release notes

Per-configuration metric support

Before you plan dashboards by guardrail configuration, confirm whether your server version emits metrics labeled per configuration. Support for this varies by version, and some setups expose only server-wide gauges. If you run several configurations in one server process, a shared gauge can mix their admission queue values, so you may need one server per configuration to read each queue correctly. Ask the team that operates the server which layout you run.

Microservice sunset and server path

NVIDIA has retired the NeMo Guardrails microservice container, so a deployment built on that artifact has no new releases or support. Confirm which artifact and version your team runs, and whether it is the open-source library server built from the Python package. If the server runs on the retired container, plan the move before you invest in metric dashboards. Ask your NVIDIA account team and your platform owner which path applies.

Microservice sunset date
October 1, 2026
NGC container page

Prometheus local storage limits

Prometheus local storage is a single node and is not clustered or replicated, so a disk failure or node loss means lost metric history. Data is written in two-hour blocks, and the default retention of 15 days may be shorter than your review or audit window. Confirm the retention you need, whether remote write to long-term storage is required, and who owns backups of the data directory. Your SRE or observability lead should answer these before alerts depend on the history.

Prometheus storage docs

Grafana high availability requirements

A single Grafana instance using its default SQLite database is not suitable for production or high availability. Running two or more active servers behind a load balancer requires MySQL or PostgreSQL shared by all nodes, and alerting needs extra configuration to avoid duplicate notifications. Confirm which database your team will operate, who will back it up, and how alert routing will avoid duplicates. Your platform team and database owner should review these choices before the dashboards become a shared service.

Grafana HA docs

Prometheus release lifecycle choice

Decide whether your Prometheus deployment follows the current minor release line or the long-term support line. Minor releases stop receiving bug fixes about six weeks after the next minor release begins, so they demand frequent upgrades. The LTS line receives bug fixes for one year and is the better fit for teams that cannot upgrade often. Confirm the line you choose, the upgrade window your operations team can meet, and who approves each version change.

Current LTS line
3.13
Release cycle page

How DeployOpen works on this

DeployOpen plans and deploys the metrics path for a self-hosted NeMo Guardrails server inside your infrastructure, so Prometheus scraping, Grafana dashboards and alert rules are reviewed by your platform and security teams. The work is scoped in writing before it starts, built against your server configuration, and handed over with runbooks your operators can follow.

How we scope

  • We confirm which guardrails server deployments, configurations and environments need metrics before any build starts.
  • The written scope names the Prometheus targets, Grafana instances, dashboards and alert rules that will be delivered.
  • We agree how per-configuration metrics will be labeled and how the gauge caveat for several configurations is handled.

How we build

  • We expose and verify admission queue metrics from the guardrails server in a non-production environment first.
  • Prometheus scrape configuration, retention and any remote write target are set up in infrastructure you control.
  • Dashboards and alert rules are tested against real request load and reviewed with the teams who will act on them.

How we hand over

  • You receive configuration files, dashboard definitions and alert rules in version control, ready for review.
  • Grafana provisioning files are supplied so dashboards and data sources can be rebuilt from code.
  • Runbooks cover metric meanings, alert responses and the steps to add or remove a configuration from monitoring.

How we support

  • Ongoing support, upgrades and continuous testing of the monitoring stack are available as a retainer.
  • We can review Prometheus and Grafana version upgrades against the release and support dates you plan around.
  • Changes to guardrail configurations are checked to confirm that metrics and alerts still reflect what is deployed.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.