mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Loki: Fix filtering with structured metadata (#73955)
* check languageProvider to work with non-indexed metadata * change loki devenv to work with non-indexed metadata * trigger ci * add forced labels after parsers * add comment * Update public/app/plugins/datasource/loki/modifyQuery.ts Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com> --------- Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
This commit is contained in:
@@ -47,12 +47,12 @@ async function sleep(duration) {
|
||||
});
|
||||
}
|
||||
|
||||
async function lokiSendLogLine(timestampNs, line, tags) {
|
||||
async function lokiSendLogLine(timestampNs, line, tags, nonIndexed = {}) {
|
||||
const data = {
|
||||
streams: [
|
||||
{
|
||||
stream: tags,
|
||||
values: [[timestampNs, line]],
|
||||
values: [[timestampNs, line, nonIndexed]],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -187,8 +187,8 @@ async function sendNewLogs() {
|
||||
const nowMs = new Date().getTime();
|
||||
const timestampNs = `${nowMs}${getRandomNanosecPart()}`;
|
||||
const item = getRandomLogItem(globalCounter)
|
||||
await lokiSendLogLine(timestampNs, JSON.stringify(item), {age:'new', place:'moon', ...sharedLabels});
|
||||
await lokiSendLogLine(timestampNs, logFmtLine(item), {age:'new', place:'luna', ...sharedLabels});
|
||||
await lokiSendLogLine(timestampNs, JSON.stringify(item), {age:'new', place:'moon', ...sharedLabels}, {nonIndexed: 'value'});
|
||||
await lokiSendLogLine(timestampNs, logFmtLine(item), {age:'new', place:'luna', ...sharedLabels}, {nonIndexed: 'value'});
|
||||
const sleepDuration = 200 + Math.random() * 800; // between 0.2 and 1 seconds
|
||||
await sleep(sleepDuration);
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
loki:
|
||||
image: grafana/loki:latest
|
||||
image: grafana/loki:main
|
||||
command: -config.file=/etc/loki/loki-config.yaml
|
||||
volumes:
|
||||
- ./docker/blocks/loki/loki-config.yaml:/etc/loki/loki-config.yaml
|
||||
|
@@ -21,7 +21,7 @@ schema_config:
|
||||
- from: 2020-10-24
|
||||
store: tsdb
|
||||
object_store: filesystem
|
||||
schema: v11
|
||||
schema: v13
|
||||
index:
|
||||
prefix: index_
|
||||
period: 24h
|
||||
|
Reference in New Issue
Block a user