Jump to: navigation, search

Difference between revisions of "Monasca/Message Schema"

(Alarm Events)
(Metrics Message)
Line 100: Line 100:
  
 
== Metrics Message ==
 
== Metrics Message ==
 +
A metric that is sent to the API or created by the Transform Engine, Event Engine or Anomaly Engine is published to the MessageQ as a MetricsMessage. The MetricsMessage has the following fields:
 +
* metric
 +
* meta:
 +
** tenantId
 +
** region
 +
* creation_time
  
 
== Event Message ==
 
== Event Message ==

Revision as of 02:41, 14 January 2015

Overview

There are several messages that are published and consumed by various components in Monasca via the MessageQ.

Message Produced By Consumed By Kafka Topic Description
AlarmDefinitionCreatedEvent API Threshold Engine events When an alarm definition is created by the API an AlarmDefinitionCreatedEvent is published to the MessageQ.
AlarmDefinitionDeletedEvent API Threshold Engine events When an alarm definition is deleted by the API an AlarmDefinitionDeletedEvent is published to the MessageQ.
AlarmDefinitionUpdatedEvent API Threshold Engine events When an alarm definition is updated by the API an AlarmDefinitionUpdatedEvent is published to the MessageQ.
AlarmCreatedEvent Threshold Engine events When an alarm is created by the Threshold Engine an AlarmCreatedEvent is published to the MessageQ.
AlarmDeletedEvent API Threshold Engine events When an alarm is deleted by the API an AlarmDeletedEvent is published to the MessageQ.
AlarmUpdatedEvent API Threshold Engine events When an alarm is updated by the API an AlarmUpdatedEvent is published to the MessageQ.
AlarmStateTransitionedEvent Threshold Engine Notification Engine, Persister alarm-state-transitions When an alarm transitions from the OK to Alarmed, Alarmed to OK, ..., this event is published to the MessageQ and persisted by the persister and processed by the Notification Engine. The Monitoring API can query the history of alarm state transition events.
AlarmNotification Notification Engine Persister alarm-notifications This event is published to the MessageQ when the notification engine processes an alarm and sends a notification. The alarm notification is persisted by the Persister and can be queried by the Monitoring API. The database maintains a history of all events.
Metric API, Transform and Aggregation Engine Persister, Threshold Engine metrics A metric sent to the API or created by the Transform Engine, Event Engine or Anomaly Engine is published to the MessageQ.
Event API, Transform Engine, Event Engine Persister, Event Engine raw-events, transformed-events An event sent to the API or created by the Transform Engine or Event Engine or is published to the MessageQ.

Alarm Definition Events

Alarm Definition Events are created when an alarm definition is created, deleted or updated by the API. These events are meant to be primarily consumed by the Threshold Engine to maintain a synchronized in-memory model of the alarm definitions in the system, without having to query or poll the Config Database. When the Threshold Engine starts up it queries the Config Database for all the alarm definitions to initialize it's internal state. Subsequently, the Threshold Engine consumes AlarmDefinitionEvents to update it's internal model of the alarm definitions.

AlarmDefinitionCreatedEvent

  • String tenantId
  • String alarmDefinitionId
  • String alarmName
  • String alarmDescription
  • String alarmExpression
  • Map<String, AlarmSubExpression> alarmSubExpressions
  • List<String> matchBy

AlarmDefinitionDeletedEvent

  • String alarmDefinitionId
  • Map<String, MetricDefinition> subAlarmMetricDefinitions

AlarmDefinitionUpdatedEvent

  • String tenantId
  • String alarmDefinitionId
  • String alarmName
  • String alarmDescription
  • String alarmExpression
  • String severity
  • List<String> matchBy
  • boolean alarmActionsEnabled
  • Map<String, AlarmSubExpression> oldAlarmSubExpressions
  • Map<String, AlarmSubExpression> changedSubExpressions
  • Map<String, AlarmSubExpression> unchangedSubExpressions
  • Map<String, AlarmSubExpression> newAlarmSubExpressions

Alarm Events

Alarm Events are created when an alarm is created by the Threshold Engine or deleted or updated by the API. The AlarmDeletedEvent and AlarmUpdatedEvent is meant to be primarily consumed by the Threshold Engine to delete or update it's internal in-memory model of alarms when they are updated or deleted by the API.

AlarmCreatedEvent

  • String tenantId
  • String alarmId
  • String alarmName
  • String alarmExpression
  • Map<String, AlarmSubExpression> alarmSubExpressions

AlarmDeletedEvent

  • String tenantId
  • String alarmId
  • List<MetricDefinition> alarmMetrics
  • String alarmDefinitionId
  • Map<String, AlarmSubExpression> subAlarms

AlarmUpdatedEvent

  • String alarmId
  • String tenantId
  • String alarmDefinitionId
  • List<MetricDefinition> alarmMetrics
  • Map<String, AlarmSubExpression> subAlarms
  • AlarmState alarmState
  • AlarmState oldAlarmState

AlarmStateTransitionedEvent

An AlarmStateTransitionedEvent is created when an alarm state changes. These events are primarily published by the ThresholdEngine and consumed by the Persister and Notification Engine. The AlarmStateTransitionEvent consists of the following:

  • String tenantId
  • String alarmId
  • String alarmDefinitionId
  • List<MetricDefinition> metrics
  • String alarmName
  • String alarmDescription
  • AlarmState oldState
  • AlarmState newState
  • boolean actionsEnabled
  • String stateChangeReason
  • String severity
  • long timestamp

Metrics Message

A metric that is sent to the API or created by the Transform Engine, Event Engine or Anomaly Engine is published to the MessageQ as a MetricsMessage. The MetricsMessage has the following fields:

  • metric
  • meta:
    • tenantId
    • region
  • creation_time

Event Message

Types

AlarmSubExpression

  • AggregateFunction function
  • MetricDefinition metricDefinition
  • AlarmOperator operator
  • double threshold threshold
  • int period
  • int periods

MetricDefinition

  • String name
  • Map<String, String> dimensions

enum AlarmState

  • UNDETERMINED
  • OK
  • ALARM