Skip to main content

Query Processor

A system task designed to execute queries across various systems, primarily used for alert generation.

Conductor supports querying from the following sources:

  • Conductor Search API
    • This query type retrieves workflow-related data from the Conductor Search API using various parameters.
  • Conductor Metrics (Prometheus)
    • This query type allows gathering and analyzing performance metrics and system statistics through Prometheus.

Definitions

  {
"name": "query_processor",
"taskReferenceName": "query_processor_ref",
"inputParameters": {
"workflowNames": [
"workflow-1"
],
"statuses": [
"FAILED"
],
"correlationIds": [],
"queryType": "CONDUCTOR_API",
"startTimeFrom": 15,
"endTimeFrom": 15,
"startTimeTo": 0,
"endTimeTo": 0,
"freeText": "your_input_here"
},
"type": "QUERY_PROCESSOR",
}

Input Parameters

AttributeDescription
queryTypeSelect the query type. Supported values:
  • CONDUCTOR_API
  • METRICS

If queryType is CONDUCTOR_API:

AttributeDescription
workflowNamesNames of the workflows to query. Can be a string or array.
correlationIdsCorrelation IDs of the workflows to query. Can be a string or array.
statusesStatuses of the workflows to query. Can be a string or array.
startTimeFromDefines the start of the time range for the query, in minutes from the current time. For example, setting this to 15 means the query will include data starting from 15 minutes ago.
startTimeToDefines the end of the time range for the query, in minutes from the current time. Setting this to 0 means the query will include data up to the current time.
endTimeFromDefines the start time of the time range for the query's execution end time, measured in minutes from the current time.
endTimeToDefines the end time of the time range for the query's execution end time, measured in minutes from the current time.
freeTextFree text search parameter..

If queryType is METRICS:

{
"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"
}
AttributeDescription
metricsQueryIndicates the Prometheus query.
metricsStartStart time for the metrics query.
metricsEndEnd time for the metrics query.
metricsStepDefines a step or interval of the metrics query.

Output Parameters

AttributeDescription
workflowsUrlURL linking to the queried workflow executions in the UI.
workflowsReturns the details of the queried workflow.

Examples



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

Adding Query Processor Task

See the workflow alerting example with Opsgenie for a detailed demonstration of leveraging this task.