Resolving a Job-related Incident need incident key


#1

I want to resolve the incident by using below code. so for that i need job key,instance key and incident key. I know the job and instance key but how do i get incident key?

client.newSetVariablesCommand(incident.getElementInstanceKey())
    .variables(NEW_PAYLOAD)
    .send()
    .join();

client.newUpdateRetriesCommand(incident.getJobKey())
    .retries(3)
    .send()
    .join();

client.newResolveIncidentCommand(incident.getKey())
    .send()
    .join();

#2

Hi @regojoyson, there is no method to retrieve an incident key that I can see in the proto file.

I’d say your options are to write an exporter, to use Operate, or to use the Elastic Search exporter and a query.


#3

Thanks @jwulf for quick respose.

  1. Is operate is free ? Because its saying free trail in home page.
  2. Can i create new users in operate ? As of now the password and username is demo/demo.

#4

Operate is in Alpha Preview at the moment.

  1. The exact licensing / pricing model hasn’t been finalised yet. However, Operate is not open-source like the Zeebe engine and it is likely that the management layer will be part of an Enterprise offering, much the same way that Camunda / Optimize is offered.
  2. There is only the single user at the moment. Multiple users will be added as it nears the production release.

In the meantime (and probably forever), you can query ElasticSearch for incidents while using the ElasticSearch exporter, or write your own light-weight exporter. It’s not hard to do.

See this blog post: https://zeebe.io/blog/2019/05/exporter-part-1/, and this exporter that I wrote in a couple of days: https://github.com/jwulf/zeebe-eventstore-exporter.

You can filter on the type of events sent to an exporter using a RecordFilter.


#5

One way to do it that would be pretty meta, would be to trigger an incident handling workflow from an exporter. Although you’d want to be careful - because if that workflow triggered an incident you’d bring the broker down.


#6

Thanks @jwulf


#7

Here is an example of writing an exporter to filter on a specific event type: Too frequently ACTIVATED message about one job(one instance)

For incidents you would filter on ValueType.INCIDENT.