Skip to content

AWS CloudWatch

Publishes TenXSummary values to AWS CloudWatch Micrometer.

Availability

This implementation is only available by default in the 10x Engine Cloud flavor to reduce the footprint of the edge/JIT-edge flavors.

Configuration

To configure the AWS CloudWatch metrics output module, Edit these settings.

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

Edit Online

Edit config.yaml Locally

# 🔟❎ 'run' AWS CloudWatch metric output configuration

# Configure AWS CloudWatch metric counter outputs.
# To learn more see https://doc.log10x.com/run/output/metric/cloudwatch/

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

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

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

include: run/modules/output/metric/cloudwatch

# ============================ AWS CloudWatch Options =========================

# Define multiple AWS CloudWatch metric outputs below

cloudwatch:

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

    # 'awsAccessKeyId' defines the AWS access key (required)
    #  To learn more see https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html
  - awsAccessKeyId: $=TenXEnv.get("AWS_ACCESS_KEY_ID") # (❗ EnvVar REQUIRED)

    # 'awsSecretKey' defines the target AWS secret key (required)
    #  To learn more see https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html
    awsSecretKey: $=TenXEnv.get("AWS_SECRET_ACCESS_KEY") # (❗ EnvVar REQUIRED)

    # 'namespace' defines the target AWS CloudWatch namespace (required)
    #  To learn more see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Namespace
    namespace: 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

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

Options

Specify the options below to configure multiple AWS CloudWatch metrics output:

Name Description Category
cloudwatchEnabled Enable this output General
cloudwatchNameField Name of the TenXSummary field identifying the metric Counter
cloudwatchCounterFields Names of the TenXSummary fields used to increment the metric counter value Counter
cloudwatchTagFields List of TenXSummary fields to use as metric tag values Counter
cloudwatchTagFieldNames List of custom names to use for TenXSummary fields. Counter
cloudwatchFilter A JavaScript expression an TenXSummary must evaluate as 'truthy' against to write to this output Counter
cloudwatchMaxCardinality Maximum number of unique metric combinations allowed Counter
cloudwatchStep Publish metrics interval Counter
cloudwatchAwsAccessKeyId AWS access key Authentication
cloudwatchAwsSecretKey AWS secret key Authentication
cloudwatchNamespace AWS CloudWatch namespace Authentication

General

cloudwatchEnabled

Enable this output.

Type Default Category
Boolean true General

Enable or disable this output.

Counter

cloudwatchNameField

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.

cloudwatchCounterFields

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.

cloudwatchTagFields

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.

cloudwatchTagFieldNames

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':

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

cloudwatchFilter

A JavaScript expression an TenXSummary must evaluate as 'truthy' against to write 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:

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

To learn more see inputName.

cloudwatchMaxCardinality

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.

cloudwatchStep

Publish metrics interval.

Type Default Category
String 1 min Counter

Sets the interval to publish metrics to the time-series destination (e.g., '1m'). To learn more see [rate-aggregation]https://docs.micrometer.io/micrometer/reference/concepts/rate-aggregation.html).

Authentication

cloudwatchAwsAccessKeyId

AWS access key.

Type Default Category
String "" Authentication

Defines the AWS access key used to authenticate. To learn more see AWS credentials.

cloudwatchAwsSecretKey

AWS secret key.

Type Default Category
String "" Authentication

Defines the target AWS secret key To learn more see AWS credentials.

cloudwatchNamespace

AWS CloudWatch namespace.

Type Default Category
String "" Authentication

Defines the target AWS CloudWatch namespace. To learn more see CloudWatch namespaces.


This module is defined in cloudwatch/module.yaml.