-
Notifications
You must be signed in to change notification settings - Fork 26
Add support for passing header X-Trino-Client-Tags #309
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
Conversation
|
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
|
Realy usefull ! is it planned to release this soon ? |
|
Good job ! |
src/e2e.test.ts
Outdated
| async function setupDataSourceWithAccessToken(page: Page) { | ||
| await page.getByTestId('data-testid Datasource HTTP settings url').fill('http://trino:8080'); | ||
| await page.locator('div').filter({hasText: /^Impersonate logged in userAccess token$/}).getByLabel('Toggle switch').click(); | ||
| await page.locator('#trino-settings-enable-impersonation').click({ force: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it in the same pr? is it related to the client tags?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI tests were failing so I just fixed it here. Should I revert it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion it should be a separated pr, taging a contributor that had merged pr recently. @nineinchnick
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do I fix the failing unit tests then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, @nineinchnick let me know if I should create a new MR for this minor fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be ideal, but also see #303 where I'm trying to refactor tests to run on the latest and newest supported Grafana versions. This is required for publishing a new release, but I'm blocked there since I don't know Playwright.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#318
I also don't know Playwright. I can take a look using Copilot if there is no one else to take a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what are we doing? Can i help it get merged?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is not failing on the main branch. Can you remove this change from this PR if there's another one open that fixes it?
|
@laserninja pls address |
src/e2e.test.ts
Outdated
| async function setupDataSourceWithAccessToken(page: Page) { | ||
| await page.getByTestId('data-testid Datasource HTTP settings url').fill('http://trino:8080'); | ||
| await page.locator('div').filter({hasText: /^Impersonate logged in userAccess token$/}).getByLabel('Toggle switch').click(); | ||
| await page.locator('#trino-settings-enable-impersonation').click({ force: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion it should be a separated pr, taging a contributor that had merged pr recently. @nineinchnick
|
Hi what’s going on? Can i help it get merged? @nineinchnick @laserninja |
|
@RoeyoOgen may you help with getting it merged? |
src/e2e.test.ts
Outdated
| async function setupDataSourceWithAccessToken(page: Page) { | ||
| await page.getByTestId('data-testid Datasource HTTP settings url').fill('http://trino:8080'); | ||
| await page.locator('div').filter({hasText: /^Impersonate logged in userAccess token$/}).getByLabel('Toggle switch').click(); | ||
| await page.locator('#trino-settings-enable-impersonation').click({ force: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is not failing on the main branch. Can you remove this change from this PR if there's another one open that fixes it?
src/e2e.test.ts
Outdated
|
|
||
| async function setupDataSourceWithClientTags(page: Page, clientTags: string) { | ||
| await page.getByTestId('data-testid Datasource HTTP settings url').fill('http://trino:8080'); | ||
| await page.locator('#trino-settings-enable-impersonation').click({ force: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I already asked, but why force: true is required here? I don't know much about Playwright tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected and used the one that was already being used in the line https://github.com/trinodb/grafana-trino/blob/main/src/e2e.test.ts#L24C1-L25C1
Add support for X-Trino-Client-Tags header
Description
This PR adds support for the
X-Trino-Client-Tagsheader in the Grafana Trino datasource plugin. TheX-Trino-Client-Tagsheader is part of the official Trino client protocol and allows sending a comma-separated list of tag strings to identify Trino resource groups, which is useful for resource management and query monitoring.How to Use
grafana,dashboard,analytics)The tags will be automatically sent with every query to help Trino administrators identify and manage resource usage from different client sources.
Technical Details
X-Trino-Client-Tagsheader is only sent when client tags are configured (optional field)Testing
References