use of io.zeebe.broker.incident.IncidentEventWriter in project zeebe by zeebe-io.
the class WorkflowInstanceStreamProcessor method onOpen.
@Override
public void onOpen(StreamProcessorContext context) {
final LogStream logstream = context.getLogStream();
this.logStreamPartitionId = logstream.getPartitionId();
this.streamProcessorId = context.getId();
this.logStreamReader.wrap(logstream);
this.logStreamBatchWriter = new LogStreamBatchWriterImpl(logstream);
this.incidentEventWriter = new IncidentEventWriter(sourceEventMetadata, workflowInstanceEvent);
this.logStream = logstream;
final MetricsManager metricsManager = context.getActorScheduler().getMetricsManager();
final String topicName = logstream.getTopicName().getStringWithoutLengthUtf8(0, logstream.getTopicName().capacity());
final String partitionId = Integer.toString(logstream.getPartitionId());
workflowInstanceEventCreate = metricsManager.newMetric("workflow_instance_events_count").type("counter").label("topic", topicName).label("partition", partitionId).label("type", "created").create();
workflowInstanceEventCanceled = metricsManager.newMetric("workflow_instance_events_count").type("counter").label("topic", topicName).label("partition", partitionId).label("type", "canceled").create();
workflowInstanceEventCompleted = metricsManager.newMetric("workflow_instance_events_count").type("counter").label("topic", topicName).label("partition", partitionId).label("type", "completed").create();
}
Aggregations