Spectra Analyze Prometheus Metrics API
The Metrics API provides an interface for collecting Prometheus-compatible metrics from Spectra Analyze appliances.
Users can scrape this endpoint to monitor the health and performance of the appliance.
Prometheus honor_labels Configuration
When configuring your Prometheus server to scrape metrics from Spectra Analyze, we recommend enabling the honor_labels setting in your Prometheus scrape configuration.
By default, Prometheus renames conflicting labels scraped from targets to avoid collisions with its own internally generated labels (like instance and job). For example, a target's job label might be renamed to exported_job. However, Spectra Analyze provides certain labels (e.g., job) within its exposed metrics that are essential for proper identification and data filtering.
Setting honor_labels: true in your Prometheus scrape configuration for Spectra Analyze targets will instruct Prometheus to preserve the original label names exposed by the appliance.
Here's an example of a Prometheus scrape configuration snippet with honor_labels enabled:
scrape_configs:
- job_name: 'spectra-analyze'
honor_labels: true
scheme: https
static_configs:
- targets: ['<host>:<port>']
Metrics API response status codes
| CODE | DESCRIPTION |
|---|---|
| 200 | Metrics are returned successfully in Prometheus exposition format. |
| 404 | The /metrics endpoint isn't found. Check the request URL. |
| 500 | The appliance encountered an unexpected error while collecting metrics. |
| 503 | The appliance can't collect metrics right now, for example during a service restart or under heavy load. |
Get Prometheus metrics
GET /metrics
Description
Returns the current system and application metrics in a Prometheus-compatible format. This endpoint can be scraped by a Prometheus server to collect data about the appliance.
By default, the /metrics endpoint doesn't require authentication. To require an API key for Prometheus scrapes, enable the Require Authentication for Prometheus Metrics setting. See Metrics.
Request format
Request examples
curl -X GET https://<host>/metrics
import requests
url = "https://<host>/metrics"
response = requests.request("GET", url)
print(response.text)
Response format
A successful request returns the 200 OK status code with the metrics in the Prometheus exposition format in the response body.
Each metric family is preceded by a # HELP line describing the metric and a # TYPE line declaring its type (counter, gauge, summary, or untyped). Metric samples follow, one per line, with any labels in braces and the sample value at the end of the line.
Response examples
node_memory_Mapped_bytes{job="node"} 1.143164928e+09
node_network_receive_compressed_total{device="eth0",job="node"} 0
node_network_receive_compressed_total{device="lo",job="node"} 0
node_disk_writes_merged_total{device="dm-0",job="node"} 0
node_disk_writes_merged_total{device="dm-1",job="node"} 0
node_disk_writes_merged_total{device="sda",job="node"} 1.770993e+06
node_filesystem_avail_bytes{device="/dev/mapper/rlappliance-root",fstype="xfs",mountpoint="/",job="node"} 5.03256907776e+11
node_load1{job="node"} 0.54
rabbitmq_build_info{rabbitmq_version="3.13.7",prometheus_plugin_version="3.13.7",prometheus_client_version="4.11.0",erlang_version="26.2.5.13",job="rabbitmq"} 1
rabbitmq_detailed_queue_messages_ready{vhost="/",queue="tasks.samplesearch",job="rabbitmq"} 0
rabbitmq_detailed_queue_messages_ready{vhost="/",queue="tasks.url_analysis",job="rabbitmq"} 0
rabbitmq_detailed_queue_messages_ready{vhost="/",queue="tiscale.hagent_input",job="rabbitmq"} 0
rabbitmq_detailed_queue_messages_unacked{vhost="/",queue="tasks.samplesearch",job="rabbitmq"} 0
rabbitmq_detailed_queue_consumers{vhost="/",queue="tcbase.classifier",job="rabbitmq"} 8
rabbitmq_detailed_queue_messages{vhost="/",queue="tasks.default",job="rabbitmq"} 0