Cadence Advanced Visibility
Advanced Visibility allows users to search (via CLIs, APIs and Cadence Web) for running or previously executed Cadence workflows with a custom SQL-like query.
For example, you can create workflows with keys Location and StartTime, then search all workflows with Location = ‘Sydney’ and StartTime > ‘2022-03-01T11:00:00+11:00’.
Without Advanced Visibility, the relevant APIs will generally return a complete list of all workflows.
Enabling advanced visibility requires the use of Apache Kafka® and OpenSearch clusters which will be used by the Cadence cluster.
Advanced visibility is available via CLI, APIs(Go and Java) and Cadence Web as illustrated in the examples below.
Example:
Command Line Interface (CLI)
1 2 3 4 5 6 7 8 9 10 11 |
# add search attribute ‘Location’ as keyword cadence --ad 127.0.0.1:7933 --domain samples-domain adm cl asa --search_attr_key Location --search_attr_type 1 # default will only show one page of workflow cadence --ad 127.0.0.1:7933 --domain samples-domain workflow list # use --more -m flag to view more than one page of workflow cadence --ad 127.0.0.1:7933 --domain samples-domain workflow list -m # use --query to list workflows with SQL-like query (advance visibility) cadence --ad 127.0.0.1:7933 --domain samples-domain workflow list --query "Location = 'Sydney' AND StartTime > '2022-03-01T11:40:00+11:00' ORDER BY StartTime DESC" |
APIs (Java)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import com.uber.cadence.serviceclient.ClientOptions; import com.uber.cadence.serviceclient.WorkflowServiceTChannel; import com.uber.cadence.ListWorkflowExecutionsRequest; import com.uber.cadence.ListWorkflowExecutionsResponse; final String DOMAIN = "samples-domain"; final WorkflowServiceTChannel cadenceService = new WorkflowServiceTChannel( ClientOptions.newBuilder() .setHost("127.0.0.1") .setPort(7933) .build()); ListWorkflowExecutionsRequest request = new ListWorkflowExecutionsRequest(); request.setDomain(DOMAIN); request.setQuery("Location = ‘Sydney’" + " AND StartTime > ‘2022-03-01T11:00:00+11:00" + " ORDER BY StartTime DESC"); try { ListWorkflowExecutionsResponse resp = cadenceService.ListWorkflowExecutions(request); } catch (Exception e) { // ... } |
Cadence Web UI
Please contact [email protected] if you have any questions.
By Instaclustr Support
Need Support?
Experiencing difficulties on the website or console?
Already have an account?
Need help with your cluster?
Contact Support
Why sign up?