Metrics
Exaplining how to use metrics in Blink.
Introduction
Blink offsers a way to monitor the performance of the Blink instance using metrics. In this article, we will walk you through how to use metrics in Blink.
Metrics in Blink
Metrics in Blink can be one of the following types:
- InfluxDB metrics
- Prometheus metrics
Even if you don’t use any provider for metrics - Blink still keeps track of the metrics and shows them in the logs every few seconds.
You can see the example below
Available metrics
In case you want to understand the performance of the Blink instance, you can take a look at the metrics provided by pipeline and its processors. It will be helpful to indentify the bottlenecks in the pipeline and optimize the performance.
Pipeline metrics
Pipeline provides a few general metrics that help you to understand the performance of the pipeline. Here is the list of metrics that the pipeline provides:
Number of messages received by the pipeline from the source
Number of messages send to the downstream by the pipeline
Number of errors that occurred in the sink. Usually happens when Blink can’t write the data to the destination.
Processor metrics
Each processor provides the same group of metrics that help you to understand the performance of the processor. Here is the list of metrics that each processor provides:
The number of messages dropped by the pipeline.
Dropped messages are the messages that the pipeline filtered by the processors.
For example, if you have a processor that filters out the messages that contain the word error
, the number of messages that contain the word error
will be counted as dropped messages.
The time it takes to execute the processor.
Number of messages processed by the processor and sent it to the next processor or sink
Number of messages received by the processor from the source or previous processor
Using InfluxDB metrics
In order to use InfluxDB metrics, you need to define the InfluxDB URI in the configuration file. Here is an example of how to define the InfluxDB URI in the configuration file (this is partial config file. It doesn’t contain all the properties):
Prometheus metrics
Prometheus metrics are enabled by default. You can access the metrics by visiting the /metrics
endpoint of the Blink instance.
By defult Blink starts HTTP server is disabled. But you can enable it on port :3333
by setting starting Blink with -s true
flag.
But you can also access the metrics by visiting the /metrics
endpoint of the Blink instance. Here is an example of how to access the metrics:
Promehteus metrics are exposed in the following format:
Was this page helpful?