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

Configured custom headers not being used in Grafana managed alerts #483

Closed
johnspurlock opened this issue Jul 25, 2023 · 6 comments · Fixed by #613
Closed

Configured custom headers not being used in Grafana managed alerts #483

johnspurlock opened this issue Jul 25, 2023 · 6 comments · Fixed by #613
Assignees
Milestone

Comments

@johnspurlock
Copy link

Hi there, great plugin! I have a configured datasource that needs to specify a custom Authorization header. This is working well in multiple dashboards.

image

I'd like to use this datasource in Grafana's alert feature, but all queries fail! Seemingly not using the custom header for alerts.

image

Grafana v10.0.0 (81d85ce802)
plugin version: 2.5.3

@Slach Slach added this to the 2.6.0 milestone Jul 26, 2023
@Slach
Copy link
Collaborator

Slach commented Jul 26, 2023

looks like bug in golang part of plugin

@Slach Slach self-assigned this Jul 26, 2023
@johnspurlock
Copy link
Author

Ah ok, thanks for taking a look

@Slach Slach modified the milestones: 2.6.0, 3.0.0 Jan 9, 2024
@Slach Slach modified the milestones: 3.1.0, 3.2.0 Apr 1, 2024
@Slach Slach modified the milestones: 3.2.0, 3.3.0 Jun 20, 2024
@lopis
Copy link

lopis commented Aug 6, 2024

Hello. I've been running into this same issue. Did you ever find a workaround?

@johnspurlock
Copy link
Author

No workaround in the plugin unfortunately - I ended up making a proxy datasource

Hoping to see this in the plugin at some point!

@addshore
Copy link
Contributor

I also just experienced this issue on Grafana cloud while using this plugin to access data from Cloudflare worker analytics.

looks like bug in golang part of plugin

Got a pointer to where? :)

@addshore
Copy link
Contributor

Aaah perhaps

// DatasourceSettings TODO Add Support custom headers
relates to this

Headers on requests are currently set in this section

if client.settings.UseCompression && slices.Contains([]string{"gzip", "br", "deflate", "zstd"}, client.settings.CompressionType) {
req.Header.Set("Accept-Encoding", client.settings.CompressionType)
params := req.URL.Query()
params.Add("enable_http_compression", "1")
req.URL.RawQuery = params.Encode()
}
if client.settings.Instance.BasicAuthEnabled {
password := client.settings.Instance.DecryptedSecureJSONData["basicAuthPassword"]
req.SetBasicAuth(client.settings.Instance.BasicAuthUser, password)
} else if client.settings.UseYandexCloudAuthorization {
req.Header.Set("X-ClickHouse-User", client.settings.XHeaderUser)
if client.settings.XHeaderKey != "" {
req.Header.Set("X-ClickHouse-Key", client.settings.XHeaderKey)
}
if password, isSecured := client.settings.Instance.DecryptedSecureJSONData["xHeaderKey"]; isSecured {
req.Header.Set("X-ClickHouse-Key", password)
}
}

And I see nothing about custom headers there

addshore added a commit to addshore/clickhouse-grafana that referenced this issue Aug 19, 2024
@Slach Slach modified the milestones: 3.3.0, 3.2.4 Oct 28, 2024
Slach added a commit that referenced this issue Oct 28, 2024
@Slach Slach closed this as completed in b3c7c5f Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants