thanos-io / thanos

Highly available Prometheus setup with long term storage capabilities. A CNCF Incubating project.
https://thanos.io
Apache License 2.0
12.98k stars 2.08k forks source link

FT add feature flag for 'promql-experimental-functions'. #7640

Open AL82082 opened 1 month ago

AL82082 commented 1 month ago

Is your proposal related to a problem?

I can't use sort_by_label promql experimental function in thanos-query to sort results by a label, e.g. "environment", where the values are like "dev", "qa", "uat".

This is needed to display results in Grafana Stat panel in a logical ordering.

Describe the solution you'd like

I would like to be able to provide a feature flag argument to the thanos docker image which enables promql experimental functions (sort_by_label, sort_by_label_desc, ...).

Describe alternatives you've considered

I can't add my prometheus instance as a separate Grafana Datasource, or an endpoint in thanos-query, because all of my long-term metrics are coming from S3 via thanos-store.

Additional context

Please see Issue #4022 or PR #4786 for an example of adding feature flag support.

yeya24 commented 1 month ago

How does this work with the new engine? @MichaHoffmann @fpetkovski Does the new engine support those experimental functions

MichaHoffmann commented 1 month ago

How does this work with the new engine? @MichaHoffmann @fpetkovski Does the new engine support those experimental functions

Not yet but at least those sorting functions should be very easy to add!

Edit: something like this: https://github.com/thanos-io/promql-engine/pull/481 ?

AL82082 commented 1 month ago

I appreciate the speedy response!