Skip to content

Push Gateway

Publish TenXSummary instance values as metric counters to a Prometheus Push Gateway.

This output utilizes the Prometheus Micrometer registry.

Configuration

To configure the Prometheus Push gateway metrics output module, Edit these settings.

Below is the default configuration from: push-gateway/config.yaml (* Required Fields).

Edit Online

Edit config.yaml Locally

# 🔟❎ 'run' Prometheus push gateway metric output configuration

# Configures Prometheus push gateway metric counter outputs.
# To learn more see https://doc.log10x.com/run/output/metric/prometheus/push-gateway/
# For the Prometheus push gateway see: https://prometheus.io/docs/practices/pushing/

# Set the 10x pipeline to 'run'
tenx: run

# =============================== Dependencies ================================

include: run/modules/output/metric/prometheus/push-gateway

# ========================== Prometheus PG Options ============================

# Define multiple Prometheus push gateway metric outputs below
prometheusPG:

    # --------------------------- Connection Options --------------------------

    # 'host' sets the address and port number of the push gateway
  - host: localhost:9091 # (❗ REQUIRED)

    # 'job' sets the logical job name reported to the push gateway
    job: my-10x-job

    # ---------------------------- Counter Options ----------------------------

    # 'nameField' sets the TenXSummary field whose value identifies the micrometer counter to increment. 
    #  The 'inputName' field returns the name of the aggregator that produced the target TenXSummary instance.
    #  To learn more see https://doc.log10x.com/run/aggregate
    nameField: inputName

    # 'counterFields' specifies the TenXSummary fields whose values are used to increment the counter.
    #  To learn more see https://doc.log10x.com/run/aggregate/#summary-fields
    counterFields:
      - summaryVolume
      - summaryBytes
      - summaryTotals

    # 'tagFields' sets the TenXSummary fields used as the counter tag dimension values.
    #  Defaults to https://doc.log10x.com/run/initialize/#enrichmentFields
    tagFields:
      - $=yield TenXEnv.get("enrichmentFields")

    # 'tagFieldNames' allows setting custom names to aggregated fields for metrics reporting.
    #  Defaults to https://doc.log10x.com/run/initialize/#metricFieldNames
    tagFieldNames:
      - $=yield TenXEnv.get("metricFieldNames")

    # 'filter' sets a JavaScript expression that TenXSummaries must evaluate as truthy to write to the output.
    #  To learn more see https://doc.log10x.com/run/output/regulate/#filter-expressions
    filter: isSummary

    # ---------------------------- Publish Options ----------------------------

    # 'step' sets the interval to send metrics Prometheus PG (e.g., '1m').
    #  To learn more see https://micrometer.io/docs/concepts#rate-aggregation
    step: 5s

Options

Specify the options below to configure multiple Prometheus Push gateway metrics output:

Name Description Category
prometheusPGEnabled Enable this output General
prometheusPGHost Host address of Prometheus push gateway instance to push data to Connection
prometheusPGJob Name of job assigned to pushed metrics Connection
prometheusPGStep The interval at which to publish metrics to output Counter
prometheusPGNameField Name of the TenXSummary field identifying the metric Counter
prometheusPGCounterFields Names of the TenXSummary fields used to increment the metric counter value Counter
prometheusPGTagFields List of TenXSummary fields to use as metric tag values Counter
prometheusPGTagFieldNames List of custom names to use for TenXSummary fields. Counter
prometheusPGFilter A JavaScript expression an TenXSummary must evaluate as 'truthy' against to be written to this output Counter
prometheusPGMaxCardinality Maximum number of unique metric combinations allowed Counter

General

prometheusPGEnabled

Enable this output.

Type Default Category
Boolean true General

Enable or disable this output.

Connection

prometheusPGHost

Host address of Prometheus push gateway instance to push data to.

Type Required Category
String Connection

Defines the host address of the push gateway used for pushing the metrics.

prometheusPGJob

Name of job assigned to pushed metrics.

Type Required Category
String Connection

Defines the name of the job that to assign to output metrics.

Counter

prometheusPGStep

The interval at which to publish metrics to output.

Type Default Category
String 1min Counter

Sets the interval at which to publish metrics to the time-series destination (e.g., '1m'). To learn more see rate-aggregation.

prometheusPGNameField

Name of the TenXSummary field identifying the metric.

Type Default Category
String summaryValues Counter

Defines the name of the TenXSummary field whose value identifies a metric counter. Defaults to the summaryValues field which holds the value(s) by which TenXObjects are grouped into the current TenXSummary instance. To learn more see micrometer counters.

prometheusPGCounterFields

Names of the TenXSummary fields used to increment the metric counter value.

Type Default Category
List summaryVolume Counter

Defines the name of the TenXSummary field by whose value to increment the counter.

prometheusPGTagFields

List of TenXSummary fields to use as metric tag values.

Type Default Category
List [] Counter

Defines the TenXSummary field names to use as tag values. Tags are dimensions that enable slicing a particular named metric to drill down to reason about its value. To learn more see micrometer tags.

prometheusPGTagFieldNames

List of custom names to use for TenXSummary fields.

Type Default Category
List [] Counter

Defines the a list of custom names to give fields when reporting them. Format as a list of name1, custom1, name2, custom2.

For example, to set a custom name of 'My-Custom-Field' to an existing 'intrinsic-field':

prometheusPG:
  tagFieldNames:
    - intrinsic-field
    - My-Custom-Field.

prometheusPGFilter

A JavaScript expression an TenXSummary must evaluate as 'truthy' against to be written to this output.

Type Default Category
String "" Counter

Specifies a JavaScript expression that an TenXSummary must evaluate as truthy to write its instance/template field values to the target counter.

For example, to only emit TenXSummaries produced by the 'myMetric' aggregator, specify:

prometheusPG:
  filter: this.inputName == "myMetric"

To learn more see inputName.

prometheusPGMaxCardinality

Maximum number of unique metric combinations allowed.

Type Default Category
Number 500 Counter

Sets the maximum number of unique metric combinations (cardinality) allowed for this output. When exceeded, metrics will be dropped to prevent excessive cardinality.


This module is defined in push-gateway/module.yaml.