Monitoring

Data for monitoring

We are currently processing several types of events for monitoring:

  1. request (any http request)

  2. error (failed http request)

  3. licensing

  4. sdk estimation

Every event is a point in the time series. The point is represented as union of the following data:

  • series name

  • start event time

  • tags, indexed data in storage, dictionary: keys - string tag names, values - string, integer, float

  • fields, non indexed data in storage, dictionary: keys - string tag names, values - string, integer, float

Monitoring series

  • Requests series.

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

    Requests series tags

    tag name

    description

    service

    always “luna-remote-sdk”

    route

    concatenation of a request method and a request resource (POST:/sdk)

    status_code

    http status code of response

    Requests series fields

    fields

    description

    request_id

    request id

    execution_time

    request execution time

    Requests series additional fields

    fields

    resource

    description

    load_images_for_processing_time

    /sdk

    time taken to load image for processing from request

    load_images_for_processing_time

    /iso

    time taken to load image for processing from request

  • Errors series.

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

    Errors series tags

    tag name

    description

    service

    always “luna-remote-sdk”

    route

    concatenation of a request method and a request resource (POST:/sdk)

    status_code

    http status code of response

    error_code

    Luna Platform error code

    Errors series fields

    fields

    description

    request_id

    request id

  • Licensing series.

    Triggered if liveness balance is over. Each point contains license check data.

    Licensing series tags

    tag name

    description

    service

    always “luna-remote-sdk”

    license_status

    license status (“warning”, “error”)

    Licensing series fields

    fields

    description

    liveness_balance

    number of liveness estimations before the license expires

    warnings

    license warning messages

    errors

    license errors messages

  • Usages_statistic series.

    Triggered on every request involving some SDK estimations. Each point contains data on the number of estimations performed.

    Usages_statistic series tags

    tag name

    description

    service

    always “luna-remote-sdk”

    Usages_statistic series fields

    fields

    description

    people_counter_usages

    people counter estimator usages count

    face_detector_usages

    face detector usages count

    landmarks68_detector_usages

    landmarks68 detector usages count

    head_pose_estimator_usages

    head pose estimator usages count

    liveness_estimator_usages

    liveness estimator usages count

    mask_estimator_usages

    mask estimator usages count

    emotion_estimator_usages

    emotion estimator usages count

    mouth_estimator_usages

    mouth estimator usages count

    eye_estimator_usages

    eye estimator usages count

    gaze_estimator_usages

    gaze estimator usages count

    glasses_estimator_usages

    glasses estimator usages count

    face_warp_quality_estimator_usages

    face warp quality estimator usages count

    face_basic_attributes_extractor_usages

    face basic attributes extractor usages count

    face_descriptor_extractor_usages

    face descriptor extractor usages count

    body_detector_usages

    body detector estimator usages count

    body_descriptor_extractor_usages

    body descriptor extractor usages count

    iso_estimator_usages

    iso estimator usages count

    face_quality_estimator_usages

    face quality estimator usages count

    body_basic_attributes_estimator_usages

    body basic attribute estimator usages count

    body_upper_attributes_estimator_usages

    body upper attribute estimator usages count

    body_accessories_estimator_usages

    body accessory estimator usages count

    body_lower_attributes_estimator_usages

    body lower attribute estimator usages count

  • Sdkloop_task series.

    SDK monitoring series. Triggered on every request involving some SDK estimations. Each point contains data on estimations performed.

    Sdkloop_task series tags

    tag name

    description

    service

    always “luna-remote-sdk”

    image_count

    number of images in request

    Sdkloop_task series fields

    fields

    description

    execution_time

    task execution time in seconds

  • Image_load series.

    SDK monitoring series. Triggered on every request involving some SDK estimations. Each point contains data on estimations performed.

    Image_load series tags

    tag name

    description

    service

    always “luna-remote-sdk”

    format

    image format, i.e. “JPEG”, “PNG”, etc.

    exif

    whether the exif loading is on

    autorotated

    whether the autorotation is on

    Image_load series fields

    fields

    description

    execution_time

    image loading time in seconds

    size

    image size in bytes

    height

    image height in pel

    width

    image width in pel

Database

Monitoring is implemented as data sending to an influx database. You can setup your database credentials in configuration file in section “monitoring”.

Plugins

You can implement your own plugin for sending monitoring data. See plugins

Module request monitoring plugin example

class luna_remote_sdk.crutches_on_wheels.cow.plugins.plugin_examples.request_monitoring_plugin_example.BaseRequestMonitoringPlugin(app)[source]

Base class for requests monitoring.

abstract async flushPointToMonitoring(points, logger)[source]

All plugins must realize this method.

This function call after end of request

Parameters:
  • points (List[ForwardRef]) – points for monitoring which corresponding the request

  • logger (Logger) – logger

Return type:

None

async handleEvent(points, logger)[source]

Handle event

Parameters:
  • *args – positional arg for event handler function

  • **kwargs – named arg for event handler function

class luna_remote_sdk.crutches_on_wheels.cow.plugins.plugin_examples.request_monitoring_plugin_example.RequestMonitoringPlugin(app)[source]

Example plugin sends a request data for monitoring to third-party source. Only one instance of this class exist during the program execution.

async close()[source]

Stop plugin.

Close all open connections and ect

async flushPointToMonitoring(points, logger)[source]

Callback for sending a request monitoring data.

Parameters:
  • points (List[ForwardRef]) – point for monitoring which corresponding the request

  • logger (Logger) – logger

Return type:

None

async initialize()[source]

Initialize plugin.

Close all open connections and ect