VictoriaMetrics / VictoriaMetrics

VictoriaMetrics: fast, cost-effective monitoring solution and time series database
https://victoriametrics.com/
Apache License 2.0
12.2k stars 1.21k forks source link

VictoriaLogs: The Querying HTTP API compatible with Loki query API #5512

Open zhangsean opened 10 months ago

zhangsean commented 10 months ago

Is your feature request related to a problem? Please describe

No

Describe the solution you'd like

The Web UI of VictoriaLogs is quite simple for deep use of searching logs, for example, the feature showing 50 lines before and after match in Grafana is very useful. Please consider adding the feature that the Querying HTTP API are compatible with the Loki Query HTTP API, in order to integrate VictoriaLogs into Grafana's datasources, then search logs through the Grafana's Explore page. image

Describe alternatives you've considered

I have to use Loki instead of VictoriaLogs before implementing the feature.

Additional information

No response

hagen1778 commented 10 months ago

jfyi: @valyala @Loori-R

pgassmann commented 3 months ago

According to @valyala it is very unlikely VictoriaLogs will support Loki query language. https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4630#issuecomment-2198274680

Closing this feature request, since there is a Grafana plugin for VictoriaLogs - https://github.com/VictoriaMetrics/victorialogs-datasource . Please file bugreports and feature requests at this project instead.

VictoriaLogs also provides built-in web UI for logs' analysis - see these docs.

we would love backwards compatibility with Loki

This isn't on VictoriaLogs roadmap, since it provides much better query language for logs - LogsQL - than the query language for Loki. LogsQL has the following features, which are missing in the query language for Loki:

  • Ability to calculate multiple stats in a single query. For example, you can calculate the total number of logs, the number of logs with error word, plus the number of unique user_id field values across some logs matching the given filter on the given time range, in a single query.

  • Ability to use arbitrary complex logical filters with AND, OR and NOT operators - see these docs.

  • Ability to use subquery results in filters - see this docs.

  • Ability to use conditional transformations. See these docs.

  • More clear syntax and more practical functionality - see LogsQL docs.

On top of this, query language for Loki lacks functionality for working with non-stream log fields (which may contain high-cardinality values), because Loki didn't support such fields in the first place. VictoriaMetrics supports high-cardinality non-stream log fields from the beginning, so LogsQL provides very easy filtering and access to these fields via simple field_name:filter pattern.

That's why it is very unlikely VictoriaLogs will support Loki query language.

tiny-pangolin commented 3 months ago

it looks like we are planning to add support for the show context feature if you have any other functionality you see missing in the plugin please submit a feature request to the victorialogs datasource project.