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.

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

Autoscaling

For microservice scaling options, please refer to the autoscaling docs.

On top of the standard autoscaling options, this microservice supports the following additional configurations:

Name Value Possible Values Notes
thresholds.backlogSize 1000 Integer The number of items that need to be in the backlog before the auto-scaling starts additional processes.
thresholds.totalMetricsProcessed 400 Integer Total metrics processed by the microservice. If the average of total metrics processed in five minutes exceeds the threshold, pods will be scaled.

Example of changing the auto-scaling value

To change the thresholds used for this functionality, pass the following to the installation 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 the 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

Microservice self-metrics

The Unified Assurance Metric Sink microservice exposes the following self-metrics to Prometheus.

Metric Name Type Description
metric_sink_backlog_size Gauge Number of items pending in the backlog
total_metrics_processed Counter Number of metrics processed
processing_time_per_metric Gauge processing time per metric from receiving it to sending it to acknowledging it