Skip to content

Monitoring#

Monitoring is implemented as sending data to InfluxDB. Monitoring for LUNA Streams is enabled by default. Monitoring for FaceStream is disabled by default.

InfluxDB#

To work with InfluxDB, you need to register with a username and password and specify the bucket name, organization name and token. All this data is set when starting the InfluxDB container using environment variables.

In order to use FaceStream or LUNA Streams monitoring, it is necessary in FaceStream settings or LUNA Streams settings to set for the "bucket", "organization", "token" fields exactly the same data specified when launching the InfluxDB container. So, for example, if the following settings were used when starting the InfluxDB container...:

-e DOCKER_INFLUXDB_INIT_BUCKET=luna_monitoring \
-e DOCKER_INFLUXDB_INIT_USERNAME=luna \
-e DOCKER_INFLUXDB_INIT_PASSWORD=password \
-e DOCKER_INFLUXDB_INIT_ORG=luna \
-e DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=kofqt4Pfqjn6o \

... then the following parameters should be specified in the FaceStream or LUNA Streams settings:

"influxdb": {
    "organization": "luna",
    "token": "kofqt4Pfqjn6o",
    "bucket": "luna_monitoring",

Login and password are used to access the InfluxDB user interface.

FaceStream and LUNA Streams settings contain different data of the "bucket", "organization" and "token" fields by default. If you need to use monitoring for both services, then you need to set the same settings. If necessary, you can save FaceStream and LUNA Streams data to different buckets (see below).

In order to separate FaceStream and LUNA Streams monitoring data, you can create separate buckets after launching the InfluxDB container. This can be done using one of the following methods:

  • using the InfluxDB user interface (Explore tab > Create bucket) after launching the InfluxDB container
  • using the command influx bucket create -n <bucket_name> -o <organization_name> in InfluxCLI after launching the InfluxDB container

The organization name must be the same as when creating the InfluxDB container.

FaceStream monitoring#

Enable monitoring#

To enable FaceStream monitoring, follow these steps:

  • go to the Configurator user interface: http://<configurator_server_ip>:5070/

  • enter "FACE_STREAM_CONFIG" in the "Setting name" field and click "Apply Filters"

  • enable the "send_data" setting in the "monitoring" section

  • depending on the values of the parameters "DOCKER_INFLUXDB_INIT_BUCKET", "DOCKER_INFLUXDB_INIT_ORG", "DOCKER_INFLUXDB_INIT_ADMIN_TOKEN" set when launching the Influx container, specify the corresponding values in the fields "bucket", "organization" and "token" in the section "monitoring".

  • restart the FaceStream container: docker restart facestream

Data being sent#

The following data is sent to InfluxDB:

  • measurement element. It is equal to the value of fs-requests.
  • tag set:

    • fs_ip - IP address where FaceStream is deployed
    • source - the "name" field set when creating a stream in LUNA Streams (optional)
    • stream_id - stream ID
  • field set:

    • track_id - track ID
    • event_id - event ID
    • request_id - external ID for communication with monitoring of LUNA PLATFORM services
    • track_start_time - track start time
    • track_best_shot_time - the time when the frame with the bestshot being sent appeared in the system
    • track_best_shot_min_size_time (optional) - the time when the detection size reached the value specified in the "best_shot_min_size" parameter
    • track_best_shot_proper_size_time (optional) - time when the detection size reached the value specified in the "best_shot_proper_size" parameter
    • liveness_start_time (optional) - Liveness start time
    • liveness_end_time (optional) - Liveness end time
    • bestshot_count - the number of bestshots sent in one request to LP along with the current bestshot. So, for example, if 2 sends of 10 bestshots were made, then the value of this parameter will be 10, and the value of the track_send_count parameter will be 2
    • time_from_first_frame_to_send - the time that passed from the appearance of the first frame in FS to sending to LP
    • track_send_count - sequence number of sending data from the track

    Tags containing time are sent as UTC with microsecond precision.

  • <timestamp> element. Is the time the bestshot(s) was(were) sent in microseconds.

The frequency of sending data to InfluxDB is controlled by the "flashing_period" parameter of the FaceStream settings.

There may be several bestshots, because sending from one track at a time counts as one measurement. To save this measurement, InfluxDB uses the last bestshot data from the bestshots group. Data that is unique for each best shot (track_best_shot_time, liveness_start_time, liveness_end_time) will be lost for all bestshots except the last one if sent this way.

If there are no optional fields, the data of these fields will not be sent to the Influxdb.

During normal monitoring operation, no additional information is output to the FaceStream logs. If an error is detected during monitoring, the corresponding message will appear in the FaceStream logs.

LUNA Streams monitoring#

Data being sent#

There are two types of events that are monitored: request (all requests) and error (failed requests only).

Every event is a point in the time series. For the API service, the point is represented using the following data:

  • series name (requests or errors)
  • timestamp of the request start
  • tags
  • fields

For other services, the set of event types may differ. For example, the Handlers service also collects data on SDK usage, estimations, and licensing.

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.

Requests series. Triggered on every request. Each point contains a data about corresponding request (execution time and etc).

  • tags
Tag name Description
service always "luna-streams"
route concatenation of a request method and a request resource (POST:/streams)
status_code HTTP status code of response
  • fields
Field name Description
request_id request ID
execution_time request execution time

Errors series. Triggered on failed request. Each point contains error_code of luna error.

  • tags
Tag name Description
service always "luna-streams"
route concatenation of a request method and a request resource (POST:/streams)
status_code HTTP status code of response
error_code LUNA PLATFORM error code
  • fields
Field name Description
request_id request ID

‘Licensing’ series. Triggered at service start and every 60 seconds. Each dot contains license verification data.

  • tags
Tag name Description
service always "luna-streams"
license_status license status (“ok”, “warning”, “error”, “exception”)
  • fields
Field name Description
license_streams_limit_rate the percentage of used streams
warnings license warning messages
errors license error messages

View monitoring data#

You can use the InfluxDB GUI to view monitoring data.

  • go to the InfluxDB GUI <server_ip>:<influx_port>. The default port is 8086. The default login data is luna/password.

  • select the "Explore" tab

  • select a way to display information in the drop-down list (graph, histogram, table, etc.)

  • select a bucket at the bottom of the page

  • filter the necessary data

  • click "Submit".