Documentation ¶
Index ¶
Constants ¶
View Source
const ( HeaderPluginID = "X-Plugin-Id" // can be used for routing HeaderDatasourceUID = "X-Datasource-Uid" // can be used for routing/ load balancing HeaderDashboardUID = "X-Dashboard-Uid" // mainly useful for debugging slow queries HeaderPanelID = "X-Panel-Id" // mainly useful for debugging slow queries HeaderPanelPluginId = "X-Panel-Plugin-Id" HeaderQueryGroupID = "X-Query-Group-Id" // mainly useful for finding related queries with query chunking HeaderFromExpression = "X-Grafana-From-Expr" // used by datasources to identify expression queries )
Variables ¶
View Source
var ( ErrNoQueriesFound = errutil.BadRequest("query.noQueries", errutil.WithPublicMessage("No queries found")).Errorf("no queries found") ErrInvalidDatasourceID = errutil.BadRequest("query.invalidDatasourceId", errutil.WithPublicMessage("Query does not contain a valid data source identifier")).Errorf("invalid data source identifier") ErrMissingDataSourceInfo = errutil.BadRequest("query.missingDataSourceInfo").MustTemplate("query missing datasource info: {{ .Public.RefId }}", errutil.WithPublic("Query {{ .Public.RefId }} is missing datasource information")) ErrQueryParamMismatch = errutil.BadRequest("query.headerMismatch", errutil.WithPublicMessage("The request headers point to a different plugin than is defined in the request body")).Errorf("plugin header/body mismatch") ErrDuplicateRefId = errutil.BadRequest("query.duplicateRefId", errutil.WithPublicMessage("Multiple queries using the same RefId is not allowed ")).Errorf("multiple queries using the same RefId is not allowed") )
Functions ¶
This section is empty.
Types ¶
type FakeQueryService ¶
FakeQueryService is an autogenerated mock type for the Service type
func NewFakeQueryService ¶
func NewFakeQueryService(t mockConstructorTestingTNewFakeQueryService) *FakeQueryService
NewFakeQueryService creates a new instance of FakeQueryService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*FakeQueryService) QueryData ¶
func (_m *FakeQueryService) QueryData(ctx context.Context, _a1 identity.Requester, skipDSCache bool, reqDTO dtos.MetricRequest) (*backend.QueryDataResponse, error)
QueryData provides a mock function with given fields: ctx, _a1, skipDSCache, reqDTO
type ServiceImpl ¶
type ServiceImpl struct {
// contains filtered or unexported fields
}
func ProvideService ¶
func ProvideService( cfg *setting.Cfg, dataSourceCache datasources.CacheService, expressionService *expr.Service, pluginRequestValidator validations.PluginRequestValidator, pluginClient plugins.Client, pCtxProvider *plugincontext.Provider, ) *ServiceImpl
func (*ServiceImpl) QueryData ¶
func (s *ServiceImpl) QueryData(ctx context.Context, user identity.Requester, skipDSCache bool, reqDTO dtos.MetricRequest) (*backend.QueryDataResponse, error)
QueryData processes queries and returns query responses. It handles queries to single or mixed datasources, as well as expressions.
Click to show internal directories.
Click to hide internal directories.