grafana/pkg/services/ngalert/models/constants.go
Marcus Efraimsson c35c689a96
Plugins: Automatically forward plugin request HTTP headers in outgoing HTTP requests (#60417)
Automatically forward core plugin request HTTP headers in outgoing HTTP requests. 
Core datasource plugin authors don't have to specifically handle forwarding of HTTP 
headers, e.g. do not have to "hardcode" the header-names in the datasource plugin, 
if not having custom needs.

Fixes #57065
2022-12-21 13:25:58 +01:00

22 lines
867 B
Go

package models
const (
// FromAlertHeaderName name of header added to datasource query requests
// to denote request is originating from Grafana Alerting.
//
// Data sources might check this in query method as sometimes alerting
// needs special considerations.
// Several existing systems also compare against the value of this header.
// Altering this constitutes a breaking change.
//
// Note: The spelling of this headers is intentionally degenerate from the
// others for compatibility reasons. When sent over a network, the key of
// this header is canonicalized to "Fromalert".
// However, some datasources still compare against the string "FromAlert".
FromAlertHeaderName = "FromAlert"
// CacheSkipHeaderName name of header added to datasource query requests
// to denote request should not be cached.
CacheSkipHeaderName = "X-Cache-Skip"
)