Logs: Fix unresponsive log lines if duplicate ids in Elasticsearch (#68569)

* Logs: Fix duplicate uids by appending series refIds

* Fix id generation in loki live streams to be consistent

* Update public/app/core/logsModel.ts

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>

* Fix test

---------

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
This commit is contained in:
Ivana Huckova
2023-05-17 15:28:25 +02:00
committed by GitHub
parent fcef387151
commit ee9620e4e0
11 changed files with 138 additions and 85 deletions
+14 -14
View File
@@ -12,16 +12,16 @@
// }
// Name:
// Dimensions: 5 Fields by 4 Rows
// +------------------------------------------------+-------------------------------+----------------+---------------------+---------------------------------+
// | Name: labels | Name: Time | Name: Line | Name: tsNs | Name: id |
// | Labels: | Labels: | Labels: | Labels: | Labels: |
// | Type: []json.RawMessage | Type: []time.Time | Type: []string | Type: []string | Type: []string |
// +------------------------------------------------+-------------------------------+----------------+---------------------+---------------------------------+
// | {"__error__":"LogfmtParserErr","place":"moon"} | 2022-06-17 06:49:51 +0000 UTC | "hello1 | 1655448591000000000 | 1655448591000000000_44cbf4ec_sq |
// | {"__error__":"LogfmtParserErr","place":"moon"} | 2022-06-17 06:49:54 +0000 UTC | "hello4 | 1655448594000000000 | 1655448594000000000_408b3f5b_sq |
// | {"place":"moon","text":"hello3"} | 2022-06-17 06:49:52 +0000 UTC | text=hello2 | 1655448592000000000 | 1655448592000000000_d1b2086_sq |
// | {"place":"moon","text":"hello4"} | 2022-06-17 06:49:53 +0000 UTC | text=hello3 | 1655448593000000000 | 1655448593000000000_45714922_sq |
// +------------------------------------------------+-------------------------------+----------------+---------------------+---------------------------------+
// +------------------------------------------------+-------------------------------+----------------+---------------------+------------------------------+
// | Name: labels | Name: Time | Name: Line | Name: tsNs | Name: id |
// | Labels: | Labels: | Labels: | Labels: | Labels: |
// | Type: []json.RawMessage | Type: []time.Time | Type: []string | Type: []string | Type: []string |
// +------------------------------------------------+-------------------------------+----------------+---------------------+------------------------------+
// | {"__error__":"LogfmtParserErr","place":"moon"} | 2022-06-17 06:49:51 +0000 UTC | "hello1 | 1655448591000000000 | 1655448591000000000_44cbf4ec |
// | {"__error__":"LogfmtParserErr","place":"moon"} | 2022-06-17 06:49:54 +0000 UTC | "hello4 | 1655448594000000000 | 1655448594000000000_408b3f5b |
// | {"place":"moon","text":"hello3"} | 2022-06-17 06:49:52 +0000 UTC | text=hello2 | 1655448592000000000 | 1655448592000000000_d1b2086 |
// | {"place":"moon","text":"hello4"} | 2022-06-17 06:49:53 +0000 UTC | text=hello3 | 1655448593000000000 | 1655448593000000000_45714922 |
// +------------------------------------------------+-------------------------------+----------------+---------------------+------------------------------+
//
//
// 🌟 This was machine generated. Do not edit. 🌟
@@ -117,10 +117,10 @@
"1655448593000000000"
],
[
"1655448591000000000_44cbf4ec_sq",
"1655448594000000000_408b3f5b_sq",
"1655448592000000000_d1b2086_sq",
"1655448593000000000_45714922_sq"
"1655448591000000000_44cbf4ec",
"1655448594000000000_408b3f5b",
"1655448592000000000_d1b2086",
"1655448593000000000_45714922"
]
]
}