Scraping Connectware Metrics with Self-Managed Prometheus
Verify that a Connectware metrics endpoint responds and configure a self-managed Prometheus instance to scrape it, without relying on the Prometheus Operator ServiceMonitor resource.
Configure a self-managed Prometheus instance to scrape Connectware metrics endpoints using static targets or Kubernetes Service Discovery, without relying on Prometheus Operator.
For Kubernetes deployments with Prometheus Operator, use ServiceMonitor resources through the Helm chart instead. See Configuring Prometheus Metrics.
Prerequisites
Metrics are enabled for the component you want to scrape. See Enabling Metrics for a Single Component.
kubectl is installed and configured for your cluster.
You know the namespace of your Connectware installation. See Obtaining the Name, Namespace, and Version of Your Installation.
Metrics Endpoints
Each component with metrics.enabled set to true creates a dedicated Kubernetes Service for its metrics endpoint, separate from its main Service. The Service name always follows the pattern <app-name>-metrics, regardless of your installation name or namespace. All endpoints use HTTP and the path /metrics.
Auth Server
auth-server
auth-server-metrics
9184
Broker
broker
broker-metrics
8888
NATS
nats
nats-metrics
7777
Protocol Mapper
protocol-mapper
protocol-mapper-metrics
9184
Resource Status Tracking
resource-status-tracking
resource-status-tracking-metrics
9184
Service Manager
service-manager
service-manager-metrics
9184
Scraping horizontally scaled Workloads
Workloads which are horizontally scaled, like Broker, NATS, or auth-server deliver metrics per node. Each replica exposes its own metrics endpoint and the cluster does not aggregate them. The Kubernetes Service load-balances across nodes, so scraping it by its Service name or ClusterIP returns metrics from only one node per scrape. To capture every node, scrape the individual pod endpoints, for example by using the endpoints role instead of the service role in kubernetes_sd_configs.
For node-level broker metrics and calculating cluster-level aggregates at query time, see Monitoring & Analytics.
Verifying an Endpoint with curl
To confirm that a metrics endpoint responds before configuring Prometheus:
Forward the component's metrics Service to your local machine. The following example targets Protocol Mapper:
Replace protocol-mapper-metrics and 9184 with the Service name and port for your component from Metrics Endpoints. Leave this command running in its own terminal.
In a separate terminal, request the endpoint:
The endpoint returns metrics in the OpenMetrics text format, which Prometheus scrapes natively. The following shows a sample from Protocol Mapper:
Configuring Prometheus
Add a scrape job to your prometheus.yml file. Choose one of the following approaches.
Static Targets
Use a static target when you know the exact Service address you want to scrape. The following example targets Protocol Mapper:
Add one job per component, replacing the Service name and port from Metrics Endpoints. This approach requires updating prometheus.yml whenever you change a component's metrics configuration.
Kubernetes Service Discovery
Every metrics Service carries prometheus.io/scrape, prometheus.io/port, and prometheus.io/path annotations once metrics.enabled is true. If your Prometheus instance discovers targets through kubernetes_sd_configs, configure a scrape job that filters on these annotations:
This job automatically picks up every Connectware metrics Service in the cluster without requiring a ServiceMonitor.
Avoiding the Scrape Rate Limit
Auth Server, Protocol Mapper, Resource Status Tracking, and Service Manager limit how many scrape requests their metrics endpoint accepts within a time window. If you set a short scrape interval or scrape a component from multiple Prometheus jobs simultaneously, you may exceed rateLimit.count. Increase rateLimit.count or rateLimit.windowMs for the affected component, or reduce your scrape frequency. See Configuring Prometheus Metrics for the full Helm values reference.
Broker and NATS do not have a configurable rate limit.
Last updated
Was this helpful?

