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:
| Argument | Description | Default if missing |
|---|---|---|
analyzer | Name of analyzer (string). Required: exchanges without it are ignored by the API | — |
analyzer_index | Indexing supported (boolean) | false |
analyzer_log_search | Log search supported (boolean) | false |
analyzer_suggest | Suggest supported (boolean) | false |
analyzer_cluster | Cluster generation supported (boolean) | false |
analyzer_priority | Priority (number). Lower number = higher priority | used 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:
| Route | Purpose |
|---|---|
analyze | Auto-analysis request |
search | Similar log search |
index | Index logs |
namespace_finder | Sent together with index |
clean | Remove selected logs from index |
delete | Delete entire project index |
defect_update | Update defect type in index |
item_remove | Remove test items from index |
launch_remove | Remove launches from index |
suggest | Suggest similar items |
index_suggest_info | User choice from suggests |
remove_suggest_info | Remove suggest index |
cluster | Generate 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
| Attribute | Description | Example |
|---|---|---|
| launchId | Id of launch | 101 |
| launchName | Name of launch | Smoke Test |
| launchStartTime | Launch start time as an array: [year, month, day, hour, minute, second, nanosecond] | [2026, 10, 19, 11, 42, 24, 663000000] |
| launchNumber | Launch number | 12 |
| previousLaunchId | Previous launch id (when relevant for mode) | 100 |
| project | Id of project | 12 |
| analyzerConfig | Analyzer configuration | |
| testItems | Array of test items | |
| clusters | Map of cluster id → name |
AnalyzerConfig
| Attribute | Description | Example |
|---|---|---|
| minShouldMatch | Percent of words equality between analyzed log and indexed log | 95 |
| searchLogsMinShouldMatch | Min should match used for log search | 95 |
| numberOfLogLines | Number of first log lines considered (-1 = all) | -1 |
| isAutoAnalyzerEnabled | Is auto analysis enabled | true |
| analyzerMode | Analysis mode. Allowable values: ALL, LAUNCH_NAME, CURRENT_LAUNCH, PREVIOUS_LAUNCH, CURRENT_AND_THE_SAME_NAME | ALL |
| indexingRunning | Is indexing running | false |
| allMessagesShouldMatch | Require all messages to match | false |
| largestRetryPriority | Prefer largest retry when analyzing | false |
IndexTestItem
| Attribute | Description | Example |
|---|---|---|
| testItemId | Id of test item | 123 |
| testItemName | Name of test item | uploadPlugin |
| issueType | Issue type locator | pb001 |
| startTime | Test item start time as an array: [year, month, day, hour, minute, second, nanosecond] | [2026, 10, 19, 11, 42, 25, 318000000] |
| uniqueId | Unique id of test item | auto:c6edafc24a03c6f69b6ec070d1fd0089 |
| testCaseHash | Test case hash | 123456 |
| isAutoAnalyzed | Is test item auto analyzed | false |
| logs | Array of test item logs |
IndexLog
| Attribute | Description | Example |
|---|---|---|
| logId | Id of log | 125 |
| logLevel | Log level (integer) | 40000 |
| logTime | Log time as an array: [year, month, day, hour, minute, second, nanosecond] | [2026, 10, 19, 11, 42, 25, 318000000] |
| message | Log message | java.lang.AssertionError: ... |
| clusterId | Cluster id, if any | 1 |
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 attribute | Description | Example |
|---|---|---|
| testItem | Id of analyzed test item | 111 |
| relevantItem | Id of relevant test item | 123 |
| issueType | Issue type locator | pb001 |
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
| Attribute | Description | Example |
|---|---|---|
| launchId | Id of launch | 111 |
| launchName | Name of launch | Smoke Test |
| itemId | Id of test item | 112 |
| projectId | Id of project | 10 |
| filteredLaunchIds | Launch ids to search among | [1, 2, 3] |
| logMessages | Log messages to look for | ["first message", "second message"] |
| logLines | Number of log lines used in comparison | 5 |
| analyzerConfig | Analyzer configuration |
SearchRs
Analyzer returns an array of objects:
| Attribute | Description | Example |
|---|---|---|
| logId | Matched log id | 111 |
| testItemId | Matched test item id | 112 |
Clean
Clean removes selected logs from the index. Route: clean. Fire-and-forget (no reply expected).
CleanIndexRq
| Attribute | Description | Example |
|---|---|---|
| project | Id of project / index | 10 |
| ids | Array 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;1means success - async (
deleteIndexAsync): fire-and-forget
Other index maintenance routes
| Route | Direction | Notes |
|---|---|---|
defect_update | request/reply | Updates defect types in index; reply is a list of item ids |
item_remove | fire-and-forget | Removes items from index |
launch_remove | fire-and-forget | Removes launches from index |
Suggest and cluster
These routes are used when the corresponding exchange flags are enabled:
| Route | Flag | Pattern |
|---|---|---|
suggest | analyzer_suggest | request/reply |
index_suggest_info | analyzer_suggest | fire-and-forget (user choice) |
remove_suggest_info | analyzer_suggest | fire-and-forget (project id) |
cluster | analyzer_cluster | request/reply |
For these operations the API selects a single exchange by lowest analyzer_priority.
Examples
Custom analyzer written in Java using Spring AMQP.