Glue: Correlations minor APIs behavior improvements (#56078)

* add correlation config type, CorrelationConfig validator & default values

* make config required when creating correlations

* make targetUID optional, add validation for createCommand & configType

* fix tests

* update remaining tests

* fix lint error

* Update pkg/services/correlations/models.go

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>

* update docs

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
This commit is contained in:
Giordano Ricci
2022-10-04 09:39:55 +01:00
committed by GitHub
co-authored by Piotr Jamróz
parent 3381629d3d
commit 489b302c03
11 changed files with 313 additions and 76 deletions
@@ -34,6 +34,11 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
"targetUID": "PDDA8E780A17E7EF1",
"label": "My Label",
"description": "Logs to Traces",
"config": {
"type": "query",
"field": "message",
"target": {},
}
}
```
@@ -55,7 +60,12 @@ Content-Type: application/json
"label": "My Label",
"sourceUID": "uyBf2637k",
"targetUID": "PDDA8E780A17E7EF1",
"uid": "50xhMlg9k"
"uid": "50xhMlg9k",
"config": {
"type": "query",
"field": "message",
"target": {},
}
}
}
```
@@ -138,7 +148,12 @@ Content-Type: application/json
"label": "My Label",
"sourceUID": "uyBf2637k",
"targetUID": "PDDA8E780A17E7EF1",
"uid": "J6gn7d31L"
"uid": "J6gn7d31L",
"config": {
"type": "query",
"field": "message",
"target": {}
}
}
}
```
@@ -175,7 +190,12 @@ Content-Type: application/json
"label": "My Label",
"sourceUID": "uyBf2637k",
"targetUID": "PDDA8E780A17E7EF1",
"uid": "J6gn7d31L"
"uid": "J6gn7d31L",
"config": {
"type": "query",
"field": "message",
"target": {},
}
}
```
@@ -211,14 +231,24 @@ Content-Type: application/json
"label": "My Label",
"sourceUID": "uyBf2637k",
"targetUID": "PDDA8E780A17E7EF1",
"uid": "J6gn7d31L"
"uid": "J6gn7d31L",
"config": {
"type": "query",
"field": "message",
"target": {},
}
},
{
"description": "Logs to Metrics",
"label": "Another Label",
"sourceUID": "uyBf2637k",
"targetUID": "P15396BDD62B2BE29",
"uid": "uWCpURgVk"
"uid": "uWCpURgVk",
"config": {
"type": "query",
"field": "message",
"target": {},
}
}
]
```
@@ -255,14 +285,24 @@ Content-Type: application/json
"label": "My Label",
"sourceUID": "uyBf2637k",
"targetUID": "PDDA8E780A17E7EF1",
"uid": "J6gn7d31L"
"uid": "J6gn7d31L",
"config": {
"type": "query",
"field": "message",
"target": {},
}
},
{
"description": "Loki to Tempo",
"label": "Another Label",
"sourceUID": "PDDA8E780A17E7EF1",
"targetUID": "P15396BDD62B2BE29",
"uid": "uWCpURgVk"
"uid": "uWCpURgVk",
"config": {
"type": "query",
"field": "message",
"target": {},
}
}
]
```