Skip to main content
On this page

Observability & monitoring

Piping exports its telemetry through OpenTelemetry and publishes inventory hosts through Prometheus HTTP service discovery. It also reads host metrics from Prometheus, VictoriaMetrics or Zabbix for the connection-target inspector.

Telemetry export (OTLP)

Backend and proxy runtimes can export traces, metrics, and logs over OTLP. Export is off by default. Enable observability.otel_enabled and configure a collector endpoint in configuration. In the bundled Compose stack, set PIPING_OBSERVABILITY_OTEL_ENABLED=true and OTEL_EXPORTER_OTLP_ENDPOINT; outside Compose, use PIPING_OBSERVABILITY__OTEL_ENABLED=true. Standard OpenTelemetry environment variables are supported:

VariableEffect
OTEL_EXPORTER_OTLP_ENDPOINTCollector endpoint; overrides the observability.otel_exporter_otlp_endpoint config key. Empty means no export.
OTEL_EXPORTER_OTLP_PROTOCOLgrpc (default) or http/protobuf.
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT / ..._METRICS_ENDPOINT / ..._LOGS_ENDPOINTPer-signal endpoint overrides.
OTEL_TRACES_EXPORTER / OTEL_METRICS_EXPORTER / OTEL_LOGS_EXPORTERotlp (default) or none to disable that signal.
OTEL_SERVICE_NAMEService name; the bundled Compose stack sets piping-backend and piping-proxy.
OTEL_SERVICE_INSTANCE_IDInstance id; falls back to HOSTNAME, then /etc/machine-id.
OTEL_RESOURCE_ATTRIBUTESExtra comma-separated key=value resource attributes.
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCEcumulative (default), delta, or lowmemory.
OTEL_SDK_DISABLEDtrue disables the OpenTelemetry SDK entirely.

With http/protobuf, the per-signal paths /v1/traces, /v1/metrics, /v1/logs are appended automatically when the endpoint URL has no path. Metrics are pushed every 30 seconds.

Built-in Prometheus metrics

GET /metrics (alias GET /api/v1/metrics) serves the backend's own metrics in Prometheus text format. Protect it with PIPING_MONITORING__METRICS_TOKEN; if the token is empty, the endpoint is unauthenticated. The token is accepted as a ?token= query parameter, an X-Piping-Monitoring-Token header, or an Authorization: Bearer header.

Service discovery for inventory targets

A Prometheus-compatible collector scrapes the targets published by Piping. Piping does not scrape exporters itself.

Exporters and assignments

Configured in Administration → Observability → Service Discovery:

  • Exporter profiles name the things collectors scrape — node, nginx, postgres, or any custom name. The name is not a closed list; it becomes the scrape job label, so keep it stable enough for PromQL, relabeling rules, and dashboards.
  • Exporter assignments bind a profile to a scope — global, site, tenant, role, or a single connection target — with optional overrides: job, target, scheme, port, metrics path, extra labels (a JSON object), a weight, and an enabled flag.
  • Labels in output controls which label groups appear in discovery responses.

A preview panel renders the resulting discovery output for the current configuration (GET /api/v1/monitoring/sd/preview, session-authenticated, no monitoring token required).

Discovery endpoint

GET /api/v1/monitoring/sd returns Prometheus HTTP SD JSON — an array of {"targets": [...], "labels": {...}} groups. Authenticate with PIPING_MONITORING__SD_TOKEN using any of the three token transports above; with no token configured the endpoint is open, so set one before exposing it.

When an assignment does not override them, targets use the configured defaults: port 9100, scheme http, metrics path /metrics, job node (all adjustable via PIPING_MONITORING__SD_DEFAULT_*). Query parameters such as kind, site_id, tenant_id, role_id, status, and search filter the returned targets.

scrape_configs:
  - job_name: piping-discovered
    http_sd_configs:
      - url: https://piping.example.com/api/v1/monitoring/sd
        authorization:
          credentials: <sd-token>

Zabbix: connection and problems

Piping reads current item values and active problems from a Zabbix server and shows them in the target inspector and its hover card. This release reads only: it never creates or changes hosts, groups or templates in Zabbix.

Automatic host provisioning from the inventory is not part of the published release and is not documented here.

The Piping server needs network access to the Zabbix HTTPS JSON-RPC endpoint, usually /api_jsonrpc.php. Host matching requires Zabbix 7 or later. Create the token for a user that can read only the hosts and items you display, store it as a named secret, and do not grant Super Admin just to connect. See the Zabbix 7.0 token documentation.

Connect a source and metric

  1. Create a Zabbix API token for a user allowed to read the required objects. Store its value as a Piping named secret. Do not put the token in a URL, description or configuration example.
  2. Under Administration → Observability → Inspector metrics → Data sources, create a source with the Zabbix family. Enter the JSON-RPC URL and select the secret in Named secret credential. Set allowed private addresses and timeout if necessary. Enable the source.
  3. In Host match, select object name, interface IP, or Piping object ID. Names and IP addresses are not stable identities. For a single host, an Explicit Zabbix host ID can be used; do not assign one static ID to a source used by multiple hosts. Optional group IDs restrict host searches. Monitored hosts only excludes disabled hosts and items.
  4. Assign the source to the intended scope and create metric queries by Zabbix item key, name or ID. Add them to a metric set and assign the set to the same scope. Check the returned item and unit; configure thresholds and display in the metric query. A missing or stale sample does not mean zero or a down host.

For example, if the selected host already collects the numeric system.cpu.util item in percent, create a query of type zabbix_item_key with that key, set unit %, warning threshold 80 and critical threshold 90. This is a display example, not a universal threshold; check the item key and unit in Zabbix first.

Correlate active problems

Create a separate Zabbix source under Alert sources, using the same endpoint and read secret UUID; assign it to the intended scope under Alert source assignments.

To associate a problem with one host manually:

  1. Under Administration → Observability → Connect collector (/observability?tab=collector), open Discovery preview and choose Load sample. Find the host by piping_host_name and copy its piping_target_id: this is the Piping object UUID, not the numeric Zabbix host ID. Check other pages if needed; if the host is absent, configure the corresponding discovery assignment first.
  2. In Zabbix open the trigger and add a piping_target_id tag on its Tags tab, using the copied UUID, for example 11111111-1111-1111-1111-111111111111. For a trigger from a template, consider its scope: different hosts must not receive another host's UUID. See Zabbix tagging.
  3. In Monitoring → Problems, open the active problem and inspect its tags: the key and value must match the selected host. Do not assume a newly added tag has appeared on an existing event. After the next poll, check the host card in Piping. A problem without a matching tag is not attributed.

Metric host matching and problem correlation are separate mechanisms: a matched host is not enough to attribute problems to it.

API methods

PurposeZabbix methods used
Metric and problem readshost.get, item.get, problem.get; history.get for metric history

Method access does not replace permissions on the specific Zabbix objects.

What appears in Piping

In Connections, the hover card shows the names and severities of active problems. The badge combines the worst problem severity and breached metric thresholds; its count refers to problems. disaster maps to critical, high and average to warning, and information to normal; unknown severities and not_classified map to warning. When only informational problems exist and no threshold is breached, the badge is hidden but the problems remain in the card. At most 64 problems are retained per host.

This is a current-problems view, not an incident history: handle recovery history, acknowledgments and problem actions in Zabbix. Configure notifications there too. Metric history is separate from problem history. If a source fails, data can become stale; check the freshness warning.

Troubleshooting

If data is missing, check TLS reachability from the Piping server, token validity, API permissions and object visibility, source and set assignments, unambiguous host matching and item freshness. For problems, also check the event tag and alert source assignment. Do not include tokens or authorization headers in error reports.

Inspector host metrics

The browser requests metrics through the Piping API. For the selected target, the backend resolves the monitoring configuration, enabled metric queries, metric sets and query source, then reads credentials and queries the source server-side. Inspector cards in Connections show the configured label, description, value, unit and status colour.

Query sources

Sources are managed under Administration → Observability → Inspector metrics → Data sources.

Source familyQuery typesNotes
prometheuspromqlLatest instant values over the Prometheus HTTP API.
victoriametricspromqlSame PromQL-compatible path; a separate profile so operators can name and manage it independently.
zabbixzabbix_item_key, zabbix_item_name, zabbix_itemidQueried through the Zabbix JSON-RPC endpoint, usually /api_jsonrpc.php.

Each source has a name, slug, family, query URL, optional credential reference, poll interval (seconds), history size, timeout (milliseconds), and an enabled flag. The credential reference is the canonical hyphenated UUID of a named secret, for example 11111111-1111-1111-1111-111111111111; values are decrypted server-side only. If a Prometheus-compatible source defines no URL, the backend falls back to the global PIPING_MONITORING__QUERY_URL and PIPING_MONITORING__QUERY_TOKEN.

Metric queries and metric sets

A metric query couples a source expression with a display contract: value type (state, percent, bytes, count, duration, temperature), unit and precision, a compact label and optional description, and status rules — boolean rules, state mappings to ok/warn/critical/unknown, or numeric warning/critical thresholds. The contract lives on the query so the same query can be reused in several metric sets, which bundle the metrics shown together in an inspector.

Tip: Status colouring is display metadata. It does not replace alerting in Prometheus, VictoriaMetrics, Zabbix, or Grafana.

Assignments

Source assignments and metric set assignments bind a data source or a metric set to the same scope model: global, site, tenant, role, or connection target. For a selected target, the backend resolves the effective source and metric sets from the matching assignments. Scope assignment keeps scrape-target advertising independent from the UI decision about which source to read and which values to show.

Polling model

While a target inspector is open, the frontend refreshes metrics through the backend every 5 seconds. Values are also collected in the background every poll_interval_seconds, so a target you open already has recent samples.

Metric history and inspector charts

Range values live behind GET /api/v1/monitoring/history (Prometheus + VictoriaMetrics range queries); Zabbix history is proxied through the same endpoint when the source is a Zabbix profile. Inspector hover cards render a compact sparkline from this range so you can see the last minutes of a metric without leaving the connection target. Inspector metrics are grouped by category (CPU / memory / network / disk). The same history is exposed as MCP tools so AI agents pull time-series data through the shared access + audit path — see MCP.

Host-metric labels and alerts

Each metric query can carry a display label plus status rules — booleans, state maps, or numeric warning/critical thresholds edited inline in the metric editor. Results surface in three places:

  • as coloured badges on nodes in the connections tree, table view, and card view;
  • as hover-card summaries next to the inventory Health column;
  • as active problems from external sources configured under Administration → Observability → Inspector metrics → Alert sources, separate from metric thresholds.

Which labels appear in the tree and how they render is controlled per query with three flags — show_in_list, hover, and list_render. Host label state is served by GET /api/v1/monitoring/host-labels.

Metric setup shortcuts

Use these controls to configure or test metrics:

  • Exporter presets — POST /api/v1/monitoring/exporters/{slug}/apply creates the metric queries, metric set, and scrape assignment for node, blackbox, snmp, and other common exporter families so metric names and label keys line up with what the exporter emits. An existing scrape assignment at the same scope is reused and never overwritten; create_scrape_assignment=false keeps only inspector metrics.
  • Quick start (POST /api/v1/monitoring/quick-start) — creates the query source and its scope assignment; with preset_slug it applies that preset in the same call, creating the metric set and scrape assignment. Useful for a fresh install to reach a meaningful default state before tuning. Verify the result with GET /api/v1/monitoring/sd/preview.
  • Default-set fallback — targets without a scope match use the shared default metric set.
  • Per-host overrides (/api/v1/monitoring/host-overrides) — override a specific metric's expression, label, unit, or thresholds for one host without editing the shared metric set. Overrides are stored per-target and take precedence during metric resolution.
  • Live PromQL test — POST /api/v1/monitoring/metric-queries/test runs the current expression against the target(s) in scope through the backend and returns the result inline, so you validate a query before saving.

In-box demo observability stack

The optional observability Compose profile starts Prometheus and Grafana with Piping service discovery and a starter dashboard. Use it for evaluation; connect production installations to your monitoring stack.

REST API reference

MethodPathPurpose
GET/api/v1/monitoring/sdPrometheus HTTP SD output (monitoring token)
GET/api/v1/monitoring/sd/previewDiscovery preview (session auth)
GET PUT/api/v1/monitoring/sd/label-settingsLabels included in SD output
GET/metricsBackend Prometheus metrics (monitoring token)
GET/api/v1/monitoring/latestLatest metric values (target_id, repeated query)
GET/api/v1/monitoring/historyRange values for one metric on one target (Prometheus/VictoriaMetrics/Zabbix)
GET/api/v1/monitoring/host-labelsPer-host label state for the connections tree/table
GET/api/v1/monitoring/targets/{id}Per-target discovery data and metric descriptors
GET POST/api/v1/monitoring/exportersExporter profiles
POST/api/v1/monitoring/exporters/{slug}/applyApply a preset: queries, metric set, and scrape assignment
POST/api/v1/monitoring/quick-startCreate a source, its assignment, and the preset scrape assignment
GET POST/api/v1/monitoring/exporter-assignmentsExporter assignments
GET POST/api/v1/monitoring/query-sourcesQuery sources
GET POST/api/v1/monitoring/query-source-assignmentsSource assignments
GET POST/api/v1/monitoring/metric-queriesMetric queries
POST/api/v1/monitoring/metric-queries/testLive PromQL / Zabbix query test against target scope
GET POST/api/v1/monitoring/metric-setsMetric sets (items via /{id}/items)
GET POST/api/v1/monitoring/metric-set-assignmentsMetric set assignments
GET POST/api/v1/monitoring/host-overridesPer-host metric overrides (expression, unit, label, thresholds)
GET POST/api/v1/monitoring/alert-sourcesAlert-source CRUD (threshold-driven alerts)
GET POST/api/v1/monitoring/alert-source-assignmentsAlert-source assignments (site/tenant/role/target)
GET/api/v1/monitoring/presetsBuilt-in exporter preset catalog

Every collection resource also exposes PUT and DELETE on /{id}. The authoritative contract is the OpenAPI document — see API reference.

Operational notes

  • Monitoring source URLs and credentials are backend-side configuration; browsers only need access to the Piping frontend/API.
  • The backend must be able to reach configured query sources from its runtime network.
  • Prometheus-compatible sources are queried for latest instant values only.
  • Errors are returned per metric, so one failed query does not hide the other values for a target.