Skip to content

Do not sort fields received from VictoriaLogs at plugin side #563

@valyala

Description

@valyala

The issue

Previously VictoriaLogs didn't give any guarantees regarding the order of fields it returns in query responses, so response fields could be returned in an arbitrary order. If the response contains many fields, it would be great sorting them for easier investigation by humans. That's why it was recommended to sort the received fields by name by clients, which query VictoriaLogs, such as built-in web UI for VictoriaLogs and the Grafana plugin for VictoriaLogs.

The commit VictoriaMetrics/VictoriaLogs@db81556 implemented such a guarantee. Now VictoriaLogs consistently returns fields sorted by name for all the queries except those queries, which end with a pipe, which preserves the order of output fields. The most frequently used pipes, which preserve the order of the returned fields, are fields pipe and stats pipe. If the query ends with such pipes, then VictoriaLogs preserves the order of the requested fields in the query response.

This removes the need to sort the returned fields at client side.

The solution

To remove all the sorting of the returned log fields at the VictoriaLogs plugin for Grafana side.

See VictoriaMetrics/VictoriaLogs#1011 (comment) for more details.

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions