Skip to content

Monitoring#

There are several monitoring methods in the LUNA Vinder Module:

When choosing between databases, it is recommended to study the documentation for Influx and Clickhouse. ClickHouse demonstrates better performance for data aggregation tasks, especially when working with large volumes of information and complex analytical queries. However, currently, InfluxDB remains the default option. In future versions of LVM, ClickHouse will become the default monitoring system.

Below is a description of the data that LVM sends to InfluxDB and ClickHouse.

Metrics in Prometheus format contain exactly the same data as in LUNA PLATFORM.

Setting up dashboards to visualize this data is the same as in LUNA PLATFORM. For instructions, see the "Monitoring" section of the LUNA PLATFORM Administrator manual.

Send data to InfluxDB#

LUNA Vinder Module supports sending monitoring data to InfluxDB, a specialized time series database. See the InfluxDB documentation.

Data being sent#

Monitoring is possible for two types of events: request (all requests) and error (only failed requests).

Every event is a point in the time series. The point is represented using the following data:

  • Series name (requests or errors)
  • Timestamp of the request start
  • Tags
  • Fields

The tag is an indexed data in storage. It is represented as a dictionary, where

  • Keys — String tag names.
  • Values — String, integer or float.

The field is a non-indexed data in storage. It is represented as a dictionary, where

  • Keys — String field names.
  • Values — String, integer or float.

Saving data for requests series is triggered on every request. Each point contains data about the corresponding request (execution time and etc.).

  • Tags
Tag name Description
service "luna-vinder-projector" or "luna-vinder-matcher"
route Concatenation of a request method and a request resource (GET:/version).
status_code HTTP status code of response.
  • Fields
Field name Description
request_id Request ID.
execution_time Request execution time.

Saving data for errors series is triggered when a request fails. Each point contains error_code.

  • Tags
Tag name Description
service "luna-vinder-projector" or "luna-vinder-matcher".
route Concatenation of a request method and a request resource (GET:/version).
status_code HTTP status code of response.
error_code LVM error code.
  • Fields
Field name Description
request_id Request ID.

Send data to ClickHouse#

ClickHouse is a column-oriented DBMS, where data is stored in columns rather than rows. This allows for fast reading and aggregation of data by only the required columns, without processing the entire row. See the ClickHouse documentation.

Data being sent#

Monitoring is possible for two types of events: request (all requests) and error (only failed requests). Unlike InfluxDB, where data is divided into tags and fields, ClickHouse uses a single table structure with JSON support. Each event is represented by a record, where:

  • time is the timestamp of the record's creation;
  • data is the event information in JSON format, which would otherwise be distributed across tags and fields in InfluxDB.

Saving data for requests series is triggered on every request. Each point contains data about the corresponding request (execution time and etc.). Example of the data field contents for the Projector service:

{
    "service": "luna-vinder-projector",
    "route": "POST:/projections",
    "status_code": 200,
    "request_id": "1536751345,6a5c2191-3e9b-f5a4-fc45-3abf43625c5f",
    "execution_time": 0.123
}

Saving data for errors series is triggered when a request fails. Each point contains error_code.

{
    "service": "luna-vinder-projector",
    "route": "POST:/projections",
    "status_code": 400,
    "error_code": 13037,
    "request_id": "1536751345,6a5c2191-3e9b-f5a4-fc45-3abf43625c5f"
}