Resolving a Job-related Incident need incident key

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();

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.

1 Like

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.

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.

1 Like

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.

1 Like

Thanks @jwulf

1 Like

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.

Update, here is an Incident webhook trigger exporter: https://github.com/jwulf/zeebe-incident-alerter

1 Like