Skip to main content
Version: 26.1

Interactions between API and Analyzer

Overview​

Communication between API service and analyzer service is carried out using AMQP 0-9-1 and RabbitMQ as message broker. API service creates a virtual host named analyzer on start. Analyzers connect to that virtual host and declare a direct exchange with capability arguments.

Messages are JSON. Some operations use request/reply on the analyzer exchange; analyze is fire-and-forget: the API publishes to every analyzer exchange, and analyzers send results to a separate reply queue (analysis.matches by default, exchange analyzer-reply).

Declaring exchange​

Each analyzer has to declare a direct exchange with the following arguments:

ArgumentDescriptionDefault if missing
analyzerName of analyzer (string). Required: exchanges without it are ignored by the API—
analyzer_indexIndexing supported (boolean)false
analyzer_log_searchLog search supported (boolean)false
analyzer_suggestSuggest supported (boolean)false
analyzer_clusterCluster generation supported (boolean)false
analyzer_priorityPriority (number). Lower number = higher priorityused as lowest priority

analyzer_priority is used when the API must pick one analyzer exchange (search, suggest, cluster).
For analyze and index, the API fans out to all matching analyzer exchanges. Analyze results arriving later overwrite earlier ones for the same item (last-write-wins).

Analyzers may also declare a version argument for their own needs; the API does not use it for routing.

Declaring queues / routing keys​

Core routes used by the API:

RoutePurpose
analyzeAuto-analysis request
searchSimilar log search
indexIndex logs
namespace_finderSent together with index
cleanRemove selected logs from index
deleteDelete entire project index
defect_updateUpdate defect type in index
item_removeRemove test items from index
launch_removeRemove launches from index
suggestSuggest similar items
index_suggest_infoUser choice from suggests
remove_suggest_infoRemove suggest index
clusterGenerate clusters

A minimal custom analyzer typically declares at least: analyze, search, index, clean, delete.

Indexing​

Index request stores log information used later for analysis. The API publishes an array of IndexLaunch to analyzers that support indexing (analyzer_index=true), on both index and namespace_finder routes. Indexing is fire-and-forget (no reply with indexed count is waited for).

IndexLaunch​

AttributeDescriptionExample
launchIdId of launch101
launchNameName of launchSmoke Test
launchStartTimeLaunch start time as an array: [year, month, day, hour, minute, second, nanosecond][2026, 10, 19, 11, 42, 24, 663000000]
launchNumberLaunch number12
previousLaunchIdPrevious launch id (when relevant for mode)100
projectId of project12
analyzerConfigAnalyzer configuration
testItemsArray of test items
clustersMap of cluster id → name

AnalyzerConfig​

AttributeDescriptionExample
minShouldMatchPercent of words equality between analyzed log and indexed log95
searchLogsMinShouldMatchMin should match used for log search95
numberOfLogLinesNumber of first log lines considered (-1 = all)-1
isAutoAnalyzerEnabledIs auto analysis enabledtrue
analyzerModeAnalysis mode. Allowable values: ALL, LAUNCH_NAME, CURRENT_LAUNCH, PREVIOUS_LAUNCH, CURRENT_AND_THE_SAME_NAMEALL
indexingRunningIs indexing runningfalse
allMessagesShouldMatchRequire all messages to matchfalse
largestRetryPriorityPrefer largest retry when analyzingfalse

IndexTestItem​

AttributeDescriptionExample
testItemIdId of test item123
testItemNameName of test itemuploadPlugin
issueTypeIssue type locatorpb001
startTimeTest item start time as an array: [year, month, day, hour, minute, second, nanosecond][2026, 10, 19, 11, 42, 25, 318000000]
uniqueIdUnique id of test itemauto:c6edafc24a03c6f69b6ec070d1fd0089
testCaseHashTest case hash123456
isAutoAnalyzedIs test item auto analyzedfalse
logsArray of test item logs

IndexLog​

AttributeDescriptionExample
logIdId of log125
logLevelLog level (integer)40000
logTimeLog time as an array: [year, month, day, hour, minute, second, nanosecond][2026, 10, 19, 11, 42, 25, 318000000]
messageLog messagejava.lang.AssertionError: ...
clusterIdCluster id, if any1

API sends an array of IndexLaunch entities that have to be indexed.

Example in JSON:

[
{
"launchId": 110,
"launchName": "Smoke Test",
"launchStartTime": [2026, 10, 19, 11, 42, 24, 663000000],
"project": 11,
"analyzerConfig": {
"minShouldMatch": 95,
"searchLogsMinShouldMatch": 95,
"numberOfLogLines": -1,
"isAutoAnalyzerEnabled": true,
"analyzerMode": "ALL",
"indexingRunning": false,
"allMessagesShouldMatch": false,
"largestRetryPriority": false
},
"testItems": [
{
"testItemId": 101,
"testItemName": "uploadPlugin",
"issueType": "pb001",
"startTime": [2026, 10, 19, 11, 42, 25, 318000000],
"uniqueId": "auto:c6edafc24a03c6f69b6ec070d1fd0089",
"testCaseHash": 123456,
"isAutoAnalyzed": false,
"logs": [
{
"logId": 111,
"logLevel": 40000,
"logTime": [2026, 10, 19, 11, 42, 25, 318000000],
"message": "java.lang.AssertionError: 1 expectation failed. Expected status code <200> but was <400>."
},
{
"logId": 112,
"logLevel": 40000,
"logTime": [2026, 10, 19, 11, 42, 25, 400000000],
"message": "java.lang.AssertionError: 1 expectation failed. Expected status code <200> but was <500>."
}
]
}
]
}
]

Analyze​

Analyze finds matches in indexed data for items that need investigation. The API publishes IndexLaunch (as a one-element list) to the analyze route on every analyzer exchange (async, no waiting for a reply on that route).

Analyzers should send the result as an array of AnalyzedItemRs to the API reply queue (analysis.matches by default). The analyzer instance name can be provided in the AMQP analyzer_id header.

AnalyzedItemRs (JSON field names)​

JSON attributeDescriptionExample
testItemId of analyzed test item111
relevantItemId of relevant test item123
issueTypeIssue type locatorpb001

Search logs​

Search finds similar logs for items with to_investigate type. Requests use the search route on an analyzer that supports log search (analyzer_log_search=true). The API waits for a reply.

SearchRq​

AttributeDescriptionExample
launchIdId of launch111
launchNameName of launchSmoke Test
itemIdId of test item112
projectIdId of project10
filteredLaunchIdsLaunch ids to search among[1, 2, 3]
logMessagesLog messages to look for["first message", "second message"]
logLinesNumber of log lines used in comparison5
analyzerConfigAnalyzer configuration

SearchRs​

Analyzer returns an array of objects:

AttributeDescriptionExample
logIdMatched log id111
testItemIdMatched test item id112

Clean​

Clean removes selected logs from the index. Route: clean. Fire-and-forget (no reply expected).

CleanIndexRq​

AttributeDescriptionExample
projectId of project / index10
idsArray of log ids to remove[111, 122, 123]

Delete​

Delete removes the entire index for a project. Route: delete. Request body is the project/index id (Long).

The API may call delete in two ways:

  • sync (deleteIndex): waits for an integer reply; 1 means success
  • async (deleteIndexAsync): fire-and-forget

Other index maintenance routes​

RouteDirectionNotes
defect_updaterequest/replyUpdates defect types in index; reply is a list of item ids
item_removefire-and-forgetRemoves items from index
launch_removefire-and-forgetRemoves launches from index

Suggest and cluster​

These routes are used when the corresponding exchange flags are enabled:

RouteFlagPattern
suggestanalyzer_suggestrequest/reply
index_suggest_infoanalyzer_suggestfire-and-forget (user choice)
remove_suggest_infoanalyzer_suggestfire-and-forget (project id)
clusteranalyzer_clusterrequest/reply

For these operations the API selects a single exchange by lowest analyzer_priority.

Examples​

Custom analyzer written in Java using Spring AMQP.