Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra settings for the Prometheus datasource when used for Thanos or other LTS solutions #16665

Closed
bergquist opened this issue Apr 18, 2019 · 5 comments

Comments

@bergquist
Copy link
Contributor

bergquist commented Apr 18, 2019

Thanos offers extra settings that can be very useful when looking at long term data such as downsampling, timeout, partial_response, dedup

Instead of building a new datasource plugin for Thanos which would be a lot of code duplication, we should add a setting to the Prometheus datasource where LTS storage alternatives can be configured. Query editors and other parts of Grafana can then show those when it makes sense instead of duplicating all other aspects of the Prometheus datasource.

@bergquist bergquist changed the title Add extra settings for the Prometheus datasource when used for Thanos or other LTS solutions Extra settings for the Prometheus datasource when used for Thanos or other LTS solutions Apr 18, 2019
@povilasv
Copy link

povilasv commented Apr 18, 2019

I'll try to implement something to what we discussed in #16574 .
So you can assign this to me. Also I'll let thanos community know aboiut this.

@bergquist Could you help me on the UX bits?

  jsonData:
    # enable Thanos
    long_term_storage: thanos
    deduplication: true
    timeout: 2m
    downsampling: false
    partial_response: false

Maybe we should prefix flags? instead of deduplication thanos_deduplication: true or do nested structs?

@tomwilkie
Copy link
Contributor

SGTM; it would be better long term to allow code reuse between datasources, and have a separate datasource for Thanos (or Cortex). But for now, adding it to the Prometheus datasource seems fine.

@davkal
Copy link
Contributor

davkal commented Apr 18, 2019

UX: I'd add a Long Term Storage section similar to Elastic's custom area and then have a dropdown that defaults to None. When Thanos is selected from the dropdown, additional fields pop up.
Try adding an Elastic datasource in Grafana to see what I mean (you don't need to actually have one).
Here is the config page code: https://github.com/grafana/grafana/blob/master/public/app/plugins/datasource/elasticsearch/partials/config.html and then see the config_ctrl.js one level up on how to read/set those values.

@povilasv
Copy link

povilasv commented Apr 18, 2019

I'm really horrible at frontend stuff :D so right now I'll do a PR with config thingy. If it isn't too complicated will try to do js / html as well

@davkal
Copy link
Contributor

davkal commented Sep 18, 2019

Fixed via #19121

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants