Remote Write
Defines a Prometheus Remote-Write output to publish TenXSummary metrics.
This output utilizes The PrometheusRWMetricRegistryFactory class to instantiate a Micrometer registry that uses the Prometheus Remote-Write protocol.
Configuration
To configure the Prometheus RW metrics output module, Edit these settings.
Below is the default configuration from: remote-write/config.yaml (* Required Fields).
ewogICJ0eXBlIiA6ICJvYmplY3QiLAogICJwcm9wZXJ0aWVzIiA6IHsKICAgICJpbmNsdWRlIiA6IHsKICAgICAgInR5cGUiIDogInN0cmluZyIKICAgIH0sCiAgICAidGVueCIgOiB7CiAgICAgICJ0eXBlIiA6ICJzdHJpbmciCiAgICB9LAogICAgInByb21ldGhldXNSVyIgOiB7CiAgICAgICJ0eXBlIiA6ICJhcnJheSIsCiAgICAgICJpdGVtcyIgOiB7CiAgICAgICAgInR5cGUiIDogIm9iamVjdCIsCiAgICAgICAgImFkZGl0aW9uYWxQcm9wZXJ0aWVzIiA6IGZhbHNlLAogICAgICAgICJwcm9wZXJ0aWVzIiA6IHsKICAgICAgICAgICJlbmFibGVkIiA6IHsKICAgICAgICAgICAgInR5cGUiIDogWwogICAgICAgICAgICAgICJib29sZWFuIiwKICAgICAgICAgICAgICAic3RyaW5nIgogICAgICAgICAgICBdLAogICAgICAgICAgICAibWFya2Rvd25EZXNjcmlwdGlvbiIgOiAiRW5hYmxlIHRoaXMgb3V0cHV0XG5cbkVuYWJsZSBvciBkaXNhYmxlIHRoaXMgb3V0cHV0LiAoQWNjZXB0cyBib29sZWFuIG9yIHN0cmluZyB3aXRoICQ9IHByZWZpeCBmb3IgcnVudGltZSBldmFsdWF0aW9uKSAoRGVmYXVsdDogdHJ1ZSkiLAogICAgICAgICAgICAiZGVmYXVsdCIgOiB0cnVlCiAgICAgICAgICB9LAogICAgICAgICAgImhvc3QiIDogewogICAgICAgICAgICAidHlwZSIgOiBbCiAgICAgICAgICAgICAgInN0cmluZyIsCiAgICAgICAgICAgICAgIm51bGwiCiAgICAgICAgICAgIF0sCiAgICAgICAgICAgICJtYXJrZG93b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l0aCB0aGUgcmVtb3RlIHdyaXRlIHRhcmdldC4gT25seSB1c2VkIGlmICdwcm9tZXRoZXVzUldVc2VyJyBpcyBhbHNvIHNwZWNpZmllZC4iCiAgICAgICAgICB9LAogICAgICAgICAgInRva2VuIiA6IHsKICAgICAgICAgICAgInR5cGUiIDogWwogICAgICAgICAgICAgICJzdHJpbmciLAogICAgICAgICAgICAgICJudWxsIgogICAgICAgICAgICBdLAogICAgICAgICAgICAibWFya2Rvd25EZXNjcmlwdGlvbiIgOiAiVG9rZW4gdG8gdXNlIHdoZW4gYXV0aGVudGljYXRpbmcgd2l0aCByZW1vdGUgd3JpdGUgdGFyZ2V0XG5cbkRlZmluZXMgYSB0b2tlbiB3aXRoIHdoaWNoIHRvIHBlcmZvcm0gYSBiZWFyZXIgdG9rZW4gYXV0aCB3aXRoIHRoZSByZW1vdGUgd3JpdGUgdGFyZ2V0LiIKICAgICAgICAgIH0sCiAgICAgICAgICAic3RlcCIgOiB7CiAgICAgICAgICAgICJ0eXBlIiA6IFsKICAgICAgICAgICAgICAic3RyaW5nIiwKICAgICAgICAgICAgICAibnVsbCIKICAgICAgICAgICAgXSwKICAgICAgICAgICAgIm1hcmtkb3duRGVzY3JpcHRpb24iIDogIlRoZSBpbnRlcnZhbCBhdCB3aGljaCB0byBwdWJsaXNoIG1ldHJpY3MgdG8gb3V0cHV0XG5cblNldHMgdGhlIGludGVydmFsIGF0IHdoaWNoIHRvIHB1Ymxpc2ggbWV0cmljcyB0byB0aGUgdGltZS1zZXJpZXMgZGVzdGluYXRpb24gKGUuZy4sICcxbScpLiBUbyBsZWFybiBtb3JlIHNlZSBbcmF0ZS1hZ2dyZWdhdGlvbl0oaHR0cHM6Ly9taWNyb21ldGVyLmlvL2RvY3MvY29uY2VwdHMjcmF0ZS1hZ2dyZWdhdGlvbikgKERlZmF1bHQ6IDFtaW4pIiwKICAgICAgICAgICAgImRlZmF1bHQiIDogIjFtaW4iCiAgICAgICAgICB9LAogICAgICAgICAgIm5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ICAgICAibnVsbCIKICAgICAgICAgICAgXSwKICAgICAgICAgICAgIm1hcmtkb3duRGVzY3JpcHRpb24iIDogIk5hbWVzIG9mIHRoZSBUZW5YU3VtbWFyeSBmaWVsZHMgdXNlZCB0byBpbmNyZW1lbnQgdGhlIG1ldHJpYyBjb3VudGVyIHZhbHVlXG5cbkRlZmluZXMgdGhlIG5hbWUgb2YgdGhlIFRlblhTdW1tYXJ5IGZpZWxkIGJ5IHdob3NlIHZhbHVlIHRvIGluY3JlbWVudCB0aGUgY291bnRlci4iLAogICAgICAgICAgICAiaXRlbXMiIDogewogICAgICAgICAgICAgICJ0eXBlIiA6ICJzdHJpbmciCiAgICAgICAgICAgIH0KICAgICAgICAgIH0sCiAgICAgICAgICAidGFnRmllbGRzIiA6IHsKICAgICAgICAgICAgInR5cGUiIDogWwogICAgICAgICAgICAgICJhcnJheSIsCiAgICAgICAgICAgICAgIm51bGwiCiAgICAgICAgICAgIF0sCiAgICAgICAgICAgICJtYXJrZG93bkRlc2NyaXB0aW9uIiA6ICJMaXN0IG9mIFRlblhTdW1tYXJ5IGZpZWxkcyB0byB1c2UgYXMgbWV0cmljIHRhZyB2YWx1ZXNcblxuRGVmaW5lcyB0aGUgVGVuWFN1bW1hcnkgZmllbGQgbmFtZXMgdG8gdXNlIGFzIGB0YWdgIHZhbHVlcy4gVGFncyBhcmUgZGltZW5zaW9ucyB0aGF0IGVuYWJsZSBzbGljaW5nIGEgcGFydGljdWxhciBuYW1lZCBtZXRyaWMgdG8gZHJpbGwgZG93biB0byByZWFzb24gYWJvdXQgaXRzIHZhbHVlLiBUbyBsZWFybiBtb3JlIHNlZSBbbWljcm9tZXRlciB0YWdzXShodHRwczovL3d3dy5iYWVsZHVuZy5jb20vbWljcm9tZXRlciMxLXRhZ3MpIiwKICAgICAgICAgICAgIml0ZW1zIiA6IHsKICAgICAgICAgICAgICAidHlwZSIgOiAic3RyaW5nIgogICAgICAgICAgICB9CiAgICAgICAgICB9LAogICAgICAgICAgInR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UwMCkiLAogICAgICAgICAgICAiZGVmYXVsdCIgOiA1MDAKICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgICJyZXF1aXJlZCIgOiBbCiAgICAgICAgICAiaG9zdCIsCiAgICAgICAgICAidXNlciIsCiAgICAgICAgICAicGFzc3dvcmQiCiAgICAgICAgXQogICAgICB9CiAgICB9CiAgfSwKICAiYWRkaXRpb25hbFByb3BlcnRpZXMiIDogZmFsc2UKfQ==
# 🔟❎ 'run' Prometheus remote write metric output configuration
# Configure Prometheus remote write metric counter outputs.
# To learn more see https://doc.log10x.com/run/output/metric/prometheus/remote-write/
# For Prometheus RW, see https://prometheus.io/docs/concepts/remote_write_spec/
# Set the 10x pipeline to 'run'
tenx: run
# =============================== Dependencies ================================
include: run/modules/output/metric/prometheus/remote-write
# ========================== Prometheus RW Options ============================
# Define multiple Prometheus RW metric outputs below
prometheusRW:
# --------------------------- Connection Options --------------------------
# 'host' sets the Prometheus remote write endpoint
- host: http://localhost:9090/api/v1/write # (❗ REQUIRED)
# 'user' for authentication
user: null # (❗ REQUIRED)
# 'password' for authentication
password: null # (❗ REQUIRED)
# ---------------------------- 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 to Prometheus RW (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 RW metrics output:
| Name | Description | Category |
|---|---|---|
| prometheusRWEnabled | Enable this output | General |
| prometheusRWHost | Host address of remote Prometheus instance to write data to | Connection |
| prometheusRWUser | Username to use when authenticating with remote write target | Connection |
| prometheusRWPassword | Password to use when authenticating with remote write target | Connection |
| prometheusRWToken | Token to use when authenticating with remote write target | Connection |
| prometheusRWStep | The interval at which to publish metrics to output | Counter |
| prometheusRWNameField | Name of the TenXSummary field identifying the metric | Counter |
| prometheusRWCounterFields | Names of the TenXSummary fields used to increment the metric counter value | Counter |
| prometheusRWTagFields | List of TenXSummary fields to use as metric tag values | Counter |
| prometheusRWTagFieldNames | List of custom names to use for TenXSummary fields. | Counter |
| prometheusRWFilter | A JavaScript expression an TenXSummary must evaluate as 'truthy' against to be written to this output | Counter |
| prometheusRWMaxCardinality | Maximum number of unique metric combinations allowed | Counter |
General
prometheusRWEnabled
Enable this output.
| Type | Default | Category |
|---|---|---|
| Boolean | true | General |
Enable or disable this output.
Connection
prometheusRWHost
Host address of remote Prometheus instance to write data to.
| Type | Required | Category |
|---|---|---|
| String | ✔ | Connection |
Defines the target host address for remote write.
Use full URL path, (i.e. http://
prometheusRWUser
Username to use when authenticating with remote write target.
| Type | Default | Category |
|---|---|---|
| String | "" | Connection |
Defines the username with which to perform a basic auth with the remote write target. If specified, expects 'prometheusRWPassword' also be passed.
prometheusRWPassword
Password to use when authenticating with remote write target.
| Type | Default | Category |
|---|---|---|
| String | "" | Connection |
Defines the password with which to perform a basic auth with the remote write target. Only used if 'prometheusRWUser' is also specified.
prometheusRWToken
Token to use when authenticating with remote write target.
| Type | Default | Category |
|---|---|---|
| String | "" | Connection |
Defines a token with which to perform a bearer token auth with the remote write target.
Counter
prometheusRWStep
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.
prometheusRWNameField
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.
prometheusRWCounterFields
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.
prometheusRWTagFields
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.
prometheusRWTagFieldNames
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':
prometheusRWFilter
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:
To learn more see inputName.
prometheusRWMaxCardinality
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 remote-write/module.yaml.