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
@@ -120,18 +120,18 @@
// }
// Name:
// Dimensions: 5 Fields by 6 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 |
// +---------------------------------------+-----------------------------------------+------------------+---------------------+-----------------------------------+
// | {"code":"one\",","location":"moon🌙"} | 2022-02-16 16:50:44.81075712 +0000 UTC | log line error 1 | 1645030244810757120 | 1645030244810757120_1d8c2178_sq |
// | {"code":"\",two","location":"moon🌙"} | 2022-02-16 16:50:47.02773504 +0000 UTC | log line info 1 | 1645030247027735040 | 1645030247027735040_87a7aed2_sq |
// | {"code":"\",two","location":"moon🌙"} | 2022-02-16 16:50:46.277587968 +0000 UTC | log line info 2 | 1645030246277587968 | 1645030246277587968_318d05c9_sq |
// | {"code":"\",two","location":"moon🌙"} | 2022-02-16 16:50:46.277587968 +0000 UTC | log line info 2 | 1645030246277587968 | 1645030246277587968_318d05c9_1_sq |
// | {"code":"\",two","location":"moon🌙"} | 2022-02-16 16:50:45.539423744 +0000 UTC | log line info 3 | 1645030245539423744 | 1645030245539423744_fd17f65c_sq |
// | {"code":"\",two","location":"moon🌙"} | 2022-02-16 16:50:44.091700992 +0000 UTC | log line info 4 | 1645030244091700992 | 1645030244091700992_62ae07f3_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 |
// +---------------------------------------+-----------------------------------------+------------------+---------------------+--------------------------------+
// | {"code":"one\",","location":"moon🌙"} | 2022-02-16 16:50:44.81075712 +0000 UTC | log line error 1 | 1645030244810757120 | 1645030244810757120_1d8c2178 |
// | {"code":"\",two","location":"moon🌙"} | 2022-02-16 16:50:47.02773504 +0000 UTC | log line info 1 | 1645030247027735040 | 1645030247027735040_87a7aed2 |
// | {"code":"\",two","location":"moon🌙"} | 2022-02-16 16:50:46.277587968 +0000 UTC | log line info 2 | 1645030246277587968 | 1645030246277587968_318d05c9 |
// | {"code":"\",two","location":"moon🌙"} | 2022-02-16 16:50:46.277587968 +0000 UTC | log line info 2 | 1645030246277587968 | 1645030246277587968_318d05c9_1 |
// | {"code":"\",two","location":"moon🌙"} | 2022-02-16 16:50:45.539423744 +0000 UTC | log line info 3 | 1645030245539423744 | 1645030245539423744_fd17f65c |
// | {"code":"\",two","location":"moon🌙"} | 2022-02-16 16:50:44.091700992 +0000 UTC | log line info 4 | 1645030244091700992 | 1645030244091700992_62ae07f3 |
// +---------------------------------------+-----------------------------------------+------------------+---------------------+--------------------------------+
//
//
// 🌟 This was machine generated. Do not edit. 🌟
@@ -349,12 +349,12 @@
"1645030244091700992"
],
[
"1645030244810757120_1d8c2178_sq",
"1645030247027735040_87a7aed2_sq",
"1645030246277587968_318d05c9_sq",
"1645030246277587968_318d05c9_1_sq",
"1645030245539423744_fd17f65c_sq",
"1645030244091700992_62ae07f3_sq"
"1645030244810757120_1d8c2178",
"1645030247027735040_87a7aed2",
"1645030246277587968_318d05c9",
"1645030246277587968_318d05c9_1",
"1645030245539423744_fd17f65c",
"1645030244091700992_62ae07f3"
]
],
"nanos": [