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

Add properties to reduce the amount of data fetching from prometheus. #23712

Closed
wants to merge 1 commit into from

Conversation

amitkharb
Copy link
Contributor

Description

To reduce the amount of data fetched by Prometheus connector, adding to new config and session properties

  1. prometheus.match_filter = this will add match filter to prometheus query string, for example up{instance="localhost:9090"}[1d]
  2. prometheus.query_functions = we can pass the functions offered by prometheus APIs to do aggregation on the prometheus server and reduce the amount of data sent over the network.

Additional context and related issues

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

## Section
* Fix some things. ({issue}`22416`)

@cla-bot cla-bot bot added the cla-signed label Oct 8, 2024
@amitkharb amitkharb marked this pull request as draft October 8, 2024 12:06
@github-actions github-actions bot added the docs label Oct 8, 2024
@amitkharb amitkharb marked this pull request as ready for review October 8, 2024 15:28
@amitkharb amitkharb requested review from ebyhr, zhaoyim and arhimondr and removed request for ebyhr and zhaoyim October 8, 2024 15:28
* - `prometheus.query.functions`
- Comma separated list of functions to be sent to Prometheus HTTP API as part of query.
The equivalent catalog session property is `query_functions`.
-
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think using session properties which affect query results is a good idea. We usually don't do that.
Please consider creating a table function instead: https://trino.io/docs/current/develop/table-functions.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @ebyhr , closing this PR, will create a new one with Table Function

@ebyhr ebyhr removed the request for review from arhimondr October 9, 2024 23:10
Copy link

This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua

@github-actions github-actions bot added the stale label Oct 31, 2024
@amitkharb amitkharb closed this Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants