Loki: backend: use streaming JSON parser (#47656)

* converter: remove __name__ customization because Loki does not do that

Loki does not handle __name__ in a special way.
for Prometheus, the caller can implement the formatting
by themselves

* converter: change labels-formatting

the labels.String() method does not handle strange values well

* loki: backend: use streaming-json parser

* more idiomatic code

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>

* simpler row-length check

* simpler code

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
This commit is contained in:
Gábor Farkas
2022-05-05 08:47:40 +02:00
committed by GitHub
co-authored by Todd Treece
parent 83a5ca95c7
commit 46b40b6e82
16 changed files with 348 additions and 552 deletions
+5 -3
View File
@@ -14,12 +14,13 @@
}
},
{
"name": "up",
"name": "Value",
"type": "number",
"typeInfo": {
"frame": "float64"
},
"labels": {
"__name__": "up",
"job": "prometheus",
"instance": "localhost:9090"
}
@@ -51,14 +52,15 @@
}
},
{
"name": "up",
"name": "Value",
"type": "number",
"typeInfo": {
"frame": "float64"
},
"labels": {
"job": "node",
"instance": "localhost:9100"
"instance": "localhost:9100",
"__name__": "up"
}
}
]