Skip to content
Smarter by Design.Simpler for Business

Provide Prometheus Service ​

What Is the Provide Prometheus Service Action? ​

The Provide Prometheus Service action serves metric data in Prometheus format over the vService. This action creates a metric endpoint at the specified URL path, making it possible for Prometheus or compatible monitoring systems to collect the TR7 metrics.

This action works only at the request stage and responds directly to the requests arriving at the specified path (it does not forward them to the Backend Service).

1 · Prometheus periodic scrape (every 30 sec)
GET /metrics HTTP/1.1
Host: tr7-vservice
↓
2 · TR7 vService response (Prometheus format)
tr7_front_current_sessions 42
tr7_front_http_requests_total 15823
tr7_back_active_servers 3
…
↓
3 · Visualized with Grafana
Dashboard · graph · alerting

The Importance of the Provide Prometheus Service Action ​

Prometheus is the most widely used monitoring and alerting system in cloud-native environments. Thanks to the Prometheus integration of TR7, the vService performance and status can be monitored in real time.

The Provide Prometheus Service action;

  • provides a data source for Grafana dashboards,
  • offers detailed metrics on a vService basis,
  • monitors connection counts, request rates and resource usage,
  • provides metric data for alerting rules,
  • provides integration with Kubernetes and cloud-native environments.

For this reason, the Provide Prometheus Service action is a critical component for modern monitoring infrastructures.

Metrics Provided ​

This action produces metrics in Prometheus format over the vService on which it is defined. The metrics can be observed at the levels of the TR7 traffic processing layer, the vService (frontend), the Backend Service list and the Backend Service server.

Traffic Manager (TR7 TM) Metrics (tr7_tm_*) ​

General Metrics ​

MetricTypeDescription
tr7_tm_uptime_secondsgaugeUptime of the worker process (seconds)
tr7_tm_pool_failures_totalcounterNumber of failed pool allocations since the worker started
tr7_tm_current_connectionsgaugeCurrent number of connections on the worker
tr7_tm_connections_totalcounterTotal number of connections since the worker started
tr7_tm_requests_totalcounterTotal number of requests since the worker started
tr7_tm_start_time_secondsgaugeWorker start time (epoch seconds)
tr7_tm_stoppinggauge1 if the worker is in the shutdown process, 0 otherwise

Resource Limits ​

MetricTypeDescription
tr7_tm_max_fdsgaugeMaximum file descriptor limit per process
tr7_tm_max_socketsgaugeMaximum socket limit per process
tr7_tm_max_connectionsgaugeConnection limit per process (via config or ulimit-n)
tr7_tm_hard_max_connectionsgauge"Hard" connection limit per process (via Memmax_MB or ulimit-n)
tr7_tm_max_ssl_connectionsgaugeSSL endpoint limit per process (front+back), 0=unlimited
tr7_tm_max_pipesgaugePipe limit for splice, 0=unlimited
tr7_tm_max_memory_bytesgaugeProcess memory hard limit (command line -m), 0=undefined

SSL Metrics ​

MetricTypeDescription
tr7_tm_current_ssl_connectionsgaugeCurrent number of SSL endpoints (front+back)
tr7_tm_ssl_connections_totalcounterTotal number of SSL endpoints since the worker started (front+back)
tr7_tm_current_ssl_rategaugeSSL connection rate created in the last 1 second (SslRate)
tr7_tm_limit_ssl_rategaugeSSL connection rate limit (global.maxsslrate)
tr7_tm_max_ssl_rategaugeHighest SSL connection rate seen throughout the worker (SslRate)
tr7_tm_current_frontend_ssl_key_rategaugeNumber of SSL keys generated on the frontend side in the last 1 second
tr7_tm_max_frontend_ssl_key_rategaugeHighest frontend SSL key generation rate seen throughout the worker
tr7_tm_frontend_ssl_reusegaugeRatio of frontend SSL connections that do not require a new key (%)
tr7_tm_current_backend_ssl_key_rategaugeNumber of SSL keys generated on the Backend Service side in the last 1 second
tr7_tm_max_backend_ssl_key_rategaugeHighest Backend Service SSL key generation rate seen throughout the worker
tr7_tm_ssl_cache_lookups_totalcounterTotal SSL session cache lookups
tr7_tm_ssl_cache_misses_totalcounterTotal SSL session cache misses

Pipe / Splice Metrics ​

MetricTypeDescription
tr7_tm_pipes_used_totalcounterNumber of pipes currently in use
tr7_tm_pipes_free_totalcounterNumber of pipes currently allocated and available
tr7_tm_spliced_bytes_out_totalcounterTotal bytes sent via kernel pipe (splice)

Connection and Session Rate Metrics (Rate/Limit/Max) ​

MetricTypeDescription
tr7_tm_current_connection_rategaugeFrontend connection rate in the last 1 second (ConnRate)
tr7_tm_limit_connection_rategaugeConnRate limit (global.maxconnrate)
tr7_tm_max_connection_rategaugeHighest ConnRate seen throughout the worker
tr7_tm_current_session_rategaugeSession rate in the last 1 second (SessRate)
tr7_tm_limit_session_rategaugeSessRate limit (global.maxsessrate)
tr7_tm_max_session_rategaugeHighest SessRate seen throughout the worker

HTTP Compression and Zlib ​

MetricTypeDescription
tr7_tm_http_comp_bytes_in_totalcounterBytes entering the HTTP compressor in the last 1 second
tr7_tm_http_comp_bytes_out_totalcounterBytes leaving the HTTP compressor in the last 1 second
tr7_tm_limit_http_compgaugeCompression auto-disable threshold (CompressBpsOut)
tr7_tm_current_zlib_memorygaugeCurrent zlib memory usage (bytes)
tr7_tm_max_zlib_memorygaugeZlib memory limit (global.maxzlibmem)

Task / Queue / Listener Status ​

MetricTypeDescription
tr7_tm_current_tasksgaugeTotal number of tasks (active + sleeping)
tr7_tm_current_run_queuegaugeNumber of active tasks + tasklets
tr7_tm_idle_time_percentgaugeTime spent idle in the last 1 second (%)
tr7_tm_jobsgaugeNumber of active jobs (frontend/master/listener)
tr7_tm_unstoppable_jobsgaugeNumber of unstoppable jobs (master connections)
tr7_tm_listenersgaugeNumber of active listeners
tr7_tm_active_peersgaugeNumber of verified active peer connections
tr7_tm_connected_peersgaugeNumber of peers that have passed the connection step

Log / DNS / Busy Polling ​

MetricTypeDescription
tr7_tm_dropped_logs_totalcounterNumber of logs dropped throughout the worker
tr7_tm_failed_resolutionscounterNumber of failed DNS resolutions throughout the worker
tr7_tm_busy_polling_enabledgauge1 if busy-polling is enabled, 0 otherwise

Traffic Byte Metrics ​

MetricTypeDescription
tr7_tm_bytes_out_totalcounterTotal bytes sent throughout the worker
tr7_tm_bytes_out_rategaugeOutgoing byte rate in the last 1 second

Memory (Pool) Usage ​

MetricTypeDescription
tr7_tm_pool_allocated_bytesgaugeAmount of memory allocated in pools (bytes)
tr7_tm_pool_used_bytesgaugeAmount of memory used in pools (bytes)

vService (Frontend) Metrics (tr7_front_*) ​

MetricTypeDescription
tr7_front_current_sessionsgaugeCurrent number of sessions on the vService
tr7_front_max_sessionsgaugeHighest concurrent session count seen throughout the worker
tr7_front_limit_sessionsgaugeSession limit (maxconn/fullconn)
tr7_front_sessions_totalcounterTotal sessions since the worker started
tr7_front_bytes_in_totalcounterTotal request bytes
tr7_front_bytes_out_totalcounterTotal response bytes
tr7_front_requests_denied_totalcounterNumber of denied requests
tr7_front_responses_denied_totalcounterNumber of denied responses
tr7_front_request_errors_totalcounterNumber of invalid requests
tr7_front_statusgaugevService status (state="UP/DOWN")
tr7_front_limit_session_rategaugeSession acceptance limit per second
tr7_front_max_session_rategaugeHighest sessions/s seen throughout the worker
tr7_front_http_responses_totalcounterHTTP response counts (1xx/2xx/3xx/4xx/5xx/other)
tr7_front_http_requests_rate_maxgaugeHighest HTTP requests/s seen throughout the worker
tr7_front_http_requests_totalcounterTotal HTTP requests
tr7_front_http_comp_bytes_in_totalcounterTotal bytes entering the compressor
tr7_front_http_comp_bytes_out_totalcounterTotal bytes leaving the compressor
tr7_front_http_comp_bytes_bypassed_totalcounterBytes bypassing compression (limit/CPU/memory)
tr7_front_http_comp_responses_totalcounterNumber of compressed HTTP responses
tr7_front_connections_rate_maxgaugeHighest connections/s seen throughout the worker
tr7_front_connections_totalcounterTotal new connections (accepted)
tr7_front_intercepted_requests_totalcounterIntercepted requests (redirect/stats/service)
tr7_front_denied_connections_totalcounterConnections blocked by a TCP rule
tr7_front_denied_sessions_totalcounterSessions blocked by a TCP rule
tr7_front_failed_header_rewriting_totalcounterNumber of failed HTTP header rewrites
tr7_front_http_cache_lookups_totalcounterNumber of HTTP cache lookups
tr7_front_http_cache_hits_totalcounterHTTP cache hit/miss counter (named according to output)
tr7_front_internal_errors_totalcounterNumber of internal errors

Backend Service Metrics (tr7_back_*) ​

MetricTypeDescription
tr7_back_current_queuegaugeCurrent number of connections in the queue
tr7_back_max_queuegaugeHighest queue length seen throughout the worker
tr7_back_current_sessionsgaugeCurrent number of sessions
tr7_back_max_sessionsgaugeHighest concurrent session count seen throughout the worker
tr7_back_limit_sessionsgaugeSession limit (Backend Service fullconn etc.)
tr7_back_sessions_totalcounterTotal sessions
tr7_back_bytes_in_totalcounterTotal request bytes
tr7_back_bytes_out_totalcounterTotal response bytes
tr7_back_requests_denied_totalcounterNumber of denied requests
tr7_back_responses_denied_totalcounterNumber of denied responses
tr7_back_connection_errors_totalcounterBackend->server connection errors
tr7_back_response_errors_totalcounterInvalid response errors
tr7_back_retry_warnings_totalcounterNumber of retries
tr7_back_redispatch_warnings_totalcounterNumber of redispatches
tr7_back_statusgaugeBackend status (state="UP/DOWN")
tr7_back_weightgaugeBackend effective weight
tr7_back_active_serversgaugeNumber of active (UP, weight>0) servers
tr7_back_backup_serversgaugeNumber of backup servers
tr7_back_check_up_down_totalcounterNumber of check-triggered UP<->DOWN transitions
tr7_back_check_last_change_secondsgaugeTime elapsed since the last status change
tr7_back_downtime_seconds_totalcounterTotal time spent in DOWN state
tr7_back_loadbalanced_totalcounterNumber of requests routed via load balancing
tr7_back_max_session_rategaugeHighest sessions/s seen throughout the worker
tr7_back_http_responses_totalcounterHTTP response counts (1xx/2xx/3xx/4xx/5xx/other)
tr7_back_http_requests_totalcounterTotal HTTP requests
tr7_back_client_aborts_totalcounterNumber of client aborts
tr7_back_server_aborts_totalcounterNumber of server aborts
tr7_back_http_comp_bytes_in_totalcounterTotal bytes entering the compressor
tr7_back_http_comp_bytes_out_totalcounterTotal bytes leaving the compressor
tr7_back_http_comp_bytes_bypassed_totalcounterBytes bypassing compression
tr7_back_http_comp_responses_totalcounterNumber of compressed HTTP responses
tr7_back_last_session_secondsgaugeTime since traffic was last seen (seconds)
tr7_back_queue_time_average_secondsgaugeAverage queue time (last 1024 connections)
tr7_back_connect_time_average_secondsgaugeAverage connect time (last 1024 connections)
tr7_back_response_time_average_secondsgaugeAverage response time (last 1024 connections)
tr7_back_total_time_average_secondsgaugeAverage total time (last 1024 connections)
tr7_back_failed_header_rewriting_totalcounterNumber of failed HTTP header rewrites
tr7_back_connection_attempts_totalcounterTotal outbound connection attempts
tr7_back_connection_reuses_totalcounterNumber of reused connections
tr7_back_http_cache_lookups_totalcounterNumber of HTTP cache lookups
tr7_back_http_cache_hits_totalcounterHTTP cache hit/miss counter (named according to output)
tr7_back_max_queue_time_secondsgaugeHighest queue time seen
tr7_back_max_connect_time_secondsgaugeHighest connect time seen
tr7_back_max_response_time_secondsgaugeHighest response time seen
tr7_back_max_total_time_secondsgaugeHighest total time seen
tr7_back_internal_errors_totalcounterNumber of internal errors
tr7_back_uweightgaugeBackend user weight
tr7_back_agg_server_statusgaugeAggregation of server statuses on the backend
tr7_back_agg_server_check_statusgauge(Deprecated) Aggregate server status metric
tr7_back_agg_check_statusgaugeCheck status aggregation (L4/L6/L7 etc. labels)

Backend Server Metrics (tr7_backsrv_*) ​

MetricTypeDescription
tr7_backsrv_current_queuegaugeCurrent queue on the server
tr7_backsrv_max_queuegaugeHighest queue length seen throughout the worker
tr7_backsrv_current_sessionsgaugeCurrent sessions on the server
tr7_backsrv_max_sessionsgaugeHighest concurrent session count seen throughout the worker
tr7_backsrv_limit_sessionsgaugeServer session limit (NaN if not defined)
tr7_backsrv_sessions_totalcounterTotal sessions on the server
tr7_backsrv_bytes_in_totalcounterTotal request bytes on the server
tr7_backsrv_bytes_out_totalcounterTotal response bytes on the server
tr7_backsrv_responses_denied_totalcounterDenied responses per server
tr7_backsrv_connection_errors_totalcounterServer connection errors
tr7_backsrv_response_errors_totalcounterInvalid response errors
tr7_backsrv_retry_warnings_totalcounterNumber of retries
tr7_backsrv_redispatch_warnings_totalcounterNumber of redispatches
tr7_backsrv_statusgaugeServer status (state="UP/DOWN/MAINT/DRAIN/NOLB")
tr7_backsrv_weightgaugeServer effective weight
tr7_backsrv_activegaugeWhether the server is active (UP and weight>0)
tr7_backsrv_backupgaugeWhether the server is a backup
tr7_backsrv_check_failures_totalcounterNumber of check failures (NaN if no check)
tr7_backsrv_check_up_down_totalcounterNumber of check-triggered UP<->DOWN transitions
tr7_backsrv_check_last_change_secondsgaugeTime elapsed since the last status change
tr7_backsrv_downtime_seconds_totalcounterTotal time spent in DOWN state
tr7_backsrv_queue_limitgaugeQueue limit (maxqueue), NaN if none
tr7_backsrv_current_throttlegaugeSlowstart throttle ratio (0-100), NaN if none
tr7_backsrv_loadbalanced_totalcounterNumber of requests routed to the server
tr7_backsrv_max_session_rategaugeHighest sessions/s seen throughout the worker
tr7_backsrv_http_responses_totalcounterHTTP response counts (1xx..5xx..other)
tr7_backsrv_client_aborts_totalcounterNumber of client aborts
tr7_backsrv_server_aborts_totalcounterNumber of server aborts
tr7_backsrv_last_session_secondsgaugeTime since traffic was last seen (seconds)
tr7_backsrv_queue_time_average_secondsgaugeAverage queue time
tr7_backsrv_connect_time_average_secondsgaugeAverage connect time
tr7_backsrv_response_time_average_secondsgaugeAverage response time
tr7_backsrv_total_time_average_secondsgaugeAverage total time
tr7_backsrv_failed_header_rewriting_totalcounterNumber of failed HTTP header rewrites
tr7_backsrv_connection_attempts_totalcounterTotal outbound connection attempts
tr7_backsrv_connection_reuses_totalcounterNumber of reused connections
tr7_backsrv_idle_connections_currentgaugeNumber of idle connections ready for reuse
tr7_backsrv_idle_connections_limitgaugeIdle connection limit (pool_max_conn), NaN if none
tr7_backsrv_max_queue_time_secondsgaugeHighest queue time seen
tr7_backsrv_max_connect_time_secondsgaugeHighest connect time seen
tr7_backsrv_max_response_time_secondsgaugeHighest response time seen
tr7_backsrv_max_total_time_secondsgaugeHighest total time seen
tr7_backsrv_internal_errors_totalcounterNumber of internal errors
tr7_backsrv_unsafe_idle_connections_currentgaugeNumber of unsafe idle connections
tr7_backsrv_safe_idle_connections_currentgaugeNumber of safe idle connections
tr7_backsrv_used_connections_currentgaugeNumber of connections in use
tr7_backsrv_need_connections_currentgaugeEstimated number of connections needed
tr7_backsrv_uweightgaugeServer user weight

TIP

These metrics can be visualized with Grafana and comprehensive monitoring dashboards can be created. TR7 also provides ready-made Grafana dashboard templates.

Supported vService Types ​

HTTP
L7 TCP
Network

Execution Timing ​

On Request
On Response

How to Add? ​

A new Provide Prometheus Service Action can be added through the TR7 web management interface by following the steps below:

  1. The Configuration Menu is opened by clicking the TR7 logo at the bottom left.
  2. The Load Balancer → Actions → Add steps are followed.
  3. A unique and descriptive name is entered for the action.
  4. Provide Prometheus Service is selected as Action Type.
  5. The related configurations of the action are made.
  6. In the Conditions tab, the condition/conditions under which the action takes effect are determined.
  7. The action is added by clicking the Add button.

Provide Prometheus Service Action Add Form ​

Provide Prometheus Service Action Add FormProvide Prometheus Service Action Add Form

INFO

Action Name ​

A unique and descriptive name is entered for the action to be created.

INFO

Action Type ​

Provide Prometheus service is selected as the action type.

Since the action works only at the request stage, the Execution Level and Rule Protocol fields are not located in the form; since a counter is not supported either, the Hit Counter and Set Variable on Hit fields are not present. More than one metric endpoint can be defined on the same vService with different addresses.

INFO

Metric Address Required Default: /metrics ​

It is the URL path on which the Prometheus metrics will be served. The requests arriving at this address return metric output in Prometheus format. When the action is added, the field comes with the /metrics value by default.

The address must match exactly

The match is made exactly and it is case sensitive: while /metrics is defined, the /metrics/ or /Metrics addresses do not match. The address must start with /; if it does not, the action is saved but never runs.

Only the path is checked; the request method (GET, POST, etc.) is not taken into account and the parameters at the end of the address do not affect the match.

TIP

Sample values:

  • /metrics: The standard Prometheus path
  • /prometheus: An alternative path
  • /monitoring/metrics: A nested path

INFO

Conditions ​

In this field, it is defined under which condition or conditions the related action takes effect.

By adding one or more conditions, the behavior can be applied in a targeted and controlled way with the and/or structure.

Detailed information about conditions is on the Conditions page.

WARNING

If no condition is defined in this field, the related action runs unconditionally (Always). In this case, the action is applied to all traffic coming to the related vService.

In live environments, using an action without defining a condition can lead to unexpected situations (service outages). For this reason, it is recommended that at least one condition always be defined when an action is created.

WARNING

The Prometheus endpoint can contain sensitive information. In a production environment, it is recommended to restrict access with IP-based or authentication-based conditions.

INFO

Form Buttons ​

Add ​

The action adding process is completed by clicking the Add button.

Add & Repeat ​

With the Add & Repeat button, the action adding process is completed, and another new action can be added with different configurations without leaving the related window.

Action AddedAction Added

Metric Output in Prometheus Format ​

The GET request made to the specified path returns output in the following format:

Prometheus Metric Output ExamplePrometheus Metric Output Example

Prometheus Configuration Example ​

yaml
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: "prometheus"

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
    - targets: ["localhost:9090"]

- job_name: "TR7 vService Dashboard"
    static_configs:
    - targets: ['172.16.102.200:80']

There is no authentication on the metric endpoint

The action responds to the requests arriving at the defined address without looking for authentication. The only way to limit access is the Conditions field; if no condition is defined, the metrics are open to everyone who can access the vService.

Since the metric output contains infrastructure information such as the vService names, the Backend Service counts, the connection and error statistics, access must be limited to the monitoring servers at least with a Source IP condition.

Operational and Safe Usage Recommendations ​

  • The endpoint is protected. The Prometheus endpoint contains system information; access is restricted with an IP whitelist or authentication. By using the Conditions field, only the monitoring systems are allowed to access it.
  • A standard path is used. The /metrics path is standard in the Prometheus ecosystem; when a different path is selected, the Prometheus scrape configuration is arranged accordingly.
  • The scrape interval is set. The Prometheus scrape interval is determined according to the need; scraping too frequently (< 10 seconds) creates unnecessary load. The typical value is 15-30 seconds.
  • Integrate with Grafana. Comprehensive monitoring is provided by visualizing the TR7 metrics in Grafana dashboards.
  • Alerting rules are created. With the Prometheus alerting rules, threshold values are determined on metrics such as the connection count and the error rate, and preventive monitoring is performed.

Common Usage Scenarios in Live Environments ​

The examples below show how the related action is applied in the most frequently encountered use cases in real systems. These scenarios are based on practices that are widely preferred in live environments and rest on experience gained in the field.

Scenario 1: A Secure Prometheus Endpoint with an IP Whitelist ​

Problem: Prometheus metrics need to be served from the TR7 vServices, but if the metric endpoint is open to everyone, system information (the connection count, the Backend Service status, the resource usage) can leak. Only the monitoring servers should have access.

Solution: The Prometheus metrics are served on the standard /metrics path and, with a Source IP condition, only the monitoring servers are allowed to access them.

Configuration:

  • Metric Address: /metrics
  • Conditions: Source IP 10.0.1.50 (Prometheus server IP)

Result:

  • ✅ Secure access → Only the Prometheus server (10.0.1.50) can access the metrics.
  • ✅ Information leakage is prevented → External users cannot access system information.
  • ✅ Standard path → Prometheus uses the default /metrics path, no extra config is required.
  • ✅ Automatic discovery → Prometheus scrapes the metrics from the http://tr7-vservice/metrics address.
  • ❌ Other requests → The /metrics requests coming from IPs other than the Prometheus server do not receive metric output; these requests are forwarded to the Backend Service like normal traffic.

Prometheus scrape config:

yaml
scrape_configs:
  - job_name: 'tr7-production'
    static_configs:
      - targets: ['172.16.102.200:80']
    metrics_path: '/metrics'
    scrape_interval: 30s