Skip to main content

Query Processor

A system task for executing queries across different systems, tailored for purposes like alert generation.

Conductor supports the ability to query the following sources:

  • Conductor Search API
    • This query type can be used for querying information from the Conductor Search API. It allows users to retrieve workflow-related data based on various parameters.
  • Conductor Metrics (Prometheus)
    • This query type facilitates querying Conductor Metrics using Prometheus. It enables users to gather and analyze performance metrics and system statistics.

Definitions

{
"name": "query_processor",
"taskReferenceName": "query_processor_ref",
"inputParameters": {
"queryType": "CONDUCTOR_API",
"statuses": "${workflow.input.statuses}",
"workflowNames": "${workflow.input.workflows}",
"startTimeFrom": "${workflow.input.fromStartedMinsFromNow}",
"startTimeTo": "${workflow.input.toStartedMinsFromNow}",
"correlationIds": "${workflow.input.correlationIds}",
"freeText": "${workflow.input.freeText}"
},
"type": "QUERY_PROCESSOR",
}

Input Parameters

AttributesDescription
queryTypeChoose the query type. It can take the following values:
  • CONDUCTOR_API
  • METRICS

Depending on the chosen query method, the configuration parameters vary. If CONDUCTOR_API is chosen, then provide the following parameters:

AttributesDescription
workflowNamesProvide the workflow names for the query.
correlationIdsProvide the correlation ID of the workflows to be queried.
statusesProvide the statuses of the workflows to be queried.
startTimeFromSpecify the time range for the query to be performed.
startTimeToSpecify the time range for the query to be performed.
freeTextSpecify the free text search parameter.

If the query type is chosen as METRICS, then the task definition is as follows:

{
"name": "query_processor",
"taskReferenceName": "query_processor_ref",
"inputParameters": {
"metricsQuery": "avg_over_time(cpu_usage{instance=\"your_instance\"}[1h])",
"metricsStart": "2024-01-01T00:00:00Z",
"metricsEnd": "2024-01-30T23:59:59Z",
"metricsStep": "5m",
"queryType": "METRICS"
},
"type": "QUERY_PROCESSOR"
}
AttributesDescription
metricsQueryIndicates the Prometheus query.
metricsStartSpecifies the start time for the metrics query.
metricsEndSpecifies the end time for the metrics query.
metricsStepDefines a step or interval of the metrics query.

Output Parameters

AttributesDescription
workflowsUrlA link to the queried workflow executions in Conductor UI.

Examples



  1. Add task type Query Processor.
  2. Configure the query parameters.

Adding Query Processor Task

Have a look at the workflow alerting example with OpsGenie for a detailed example of leveraging this task.