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" -
  • Field set:

    • "track_id"
    • "event_id"
    • "request_id" - External ID for communication with monitoring of LUNA PLATFORM services.
    • "track_start_time"
    • "track_best_shot_time" - Time when the frame with the best shot being sent appeared in the system.
    • "track_best_shot_min_size_time" (optional) - 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" - Number of best shots sent in one request to LP along with the current best shot. So, for example, if 2 sends of 10 best shots 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" - 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 best shot(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 best shots, because sending from one track at a time counts as one measurement. To save this measurement, InfluxDB uses the last best shot data from the best shots group. Data that is unique for each best shot (track_best_shot_time, liveness_start_time, liveness_end_time) will be lost for all best shots 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)
  • 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 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".