Metric Sink

Overview

The Unified Assurance Metric Sink microservice is part of the microservice metric pipeline. The Metric Sink is responsible for taking metrics that have been normalized and inserting them into the Metric database.

Prerequisites

  1. A microservices cluster must be setup. Refer to Microservice Cluster Setup.

  2. Apache Pulsar must be installed. Refer to Apache Pulsar microservice.

Setup

su - assure1
export NAMESPACE=a1-zone1-pri
export WEBFQDN=<Primary Presentation Web FQDN> 
a1helm install metric-sink assure1/metric-sink -n $NAMESPACE --set global.imageRegistry=$WEBFQDN

Default Configuration

Name Value Possible Values Notes
LOG_LEVEL INFO FATAL, ERROR, WARN, INFO, DEBUG Logging level used by application.
STREAM_INPUT persistent://assure1/metric/sink Text, 255 characters Apache Pulsar topic path. Topic at end of path may be any text value.
backlogSize 1000 Integer The number of items that need to be in the backlog before the auto-scaling starts additional processes.

Configurations can be changed by passing the values to the a1helm install prefixed with the configData parent key.

Example of setting the log level to DEBUG

a1helm install ... --set configData.LOG_LEVEL=DEBUG

Example of changing the auto-scaling value

Auto-scaling is enabled by default. To change the thresholds used for this functionality, pass the following to the install command:

a1helm install ... --set autoscaling.thresholds.backlogSize=2000

Schema

Metric-sink is expecting metric measurements in the following schema example:

{
    "@timestamp":  "2021-05-06T18:40:00.000Z",
    "measurement": "iot_test",
    "tags": {
        "host":     "some_host",
        "instance": "some_instance"
    },
    "fields": {
        "availability": 1,
        "value":        123456789000,
        "utilization":  0.1,
        "other":        1
    }
}

The operator is responsible for defining the proper format, although metric-sink will do its best to match the current Metric schema. For example, it will clean up slash marks (), replace dashes (-) and spaces with underscores (_) and capitalize letters as needed.

Debugging

The metric-sink consists of two components: metric-sink and telegraf. To see logs for each of the components run following command (replacing appropriate parameters).

For metric-sink logs:

a1k logs <Pod Name> -n <Namespace> metric-sink

For telegraf logs:

a1k logs <Pod Name> -n <Namespace> telegraf

Note:

The <Pod Name> and <Namespace> values are available in the get pods command:

a1k get pods --all-namespaces