mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Loki: do not special-case __name__ label (#47251)
* loki: do not mutate the caller's data * Update public/app/plugins/datasource/loki/result_transformer.ts better comment Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com> * Update public/app/plugins/datasource/loki/result_transformer.ts no need to handle __name__ Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com> * simplify code Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
This commit is contained in:
parent
659cf17e10
commit
fdb7bab41a
@ -290,12 +290,10 @@ export function createMetricLabel(labelData: { [key: string]: string }, options?
|
||||
}
|
||||
|
||||
function getOriginalMetricName(labelData: { [key: string]: string }) {
|
||||
const metricName = labelData.__name__ || '';
|
||||
delete labelData.__name__;
|
||||
const labelPart = Object.entries(labelData)
|
||||
.map((label) => `${label[0]}="${label[1]}"`)
|
||||
.join(',');
|
||||
return `${metricName}{${labelPart}}`;
|
||||
return `{${labelPart}}`;
|
||||
}
|
||||
|
||||
export function decamelize(s: string): string {
|
||||
|
Loading…
Reference in New Issue
Block a user