# Packages
Package app provides utilities for creating and serving a app plugin over gRPC.
Package datasource provides utilities for creating and serving a data source plugin over gRPC.
Package grpcplugin provides support for serving plugin over gRPC.
No description provided by the author
Package httpclient provides HTTP client and outgoing HTTP request middleware.
Package instancemgmt provides utilities for managing plugin instances.
Package log provides a logging interface to send logs from plugins to Grafana server.
Package proxy provides utilities for updating a data source plugin connection to go through a proxy.
Package resource provides utils for handling resource calls.
No description provided by the author
No description provided by the author
# Functions
ErrDataResponse returns an error DataResponse given status and message.
ErrDataResponseWithSource returns an error DataResponse given status, source of the error and message.
ErrorSourceFromStatus returns an ErrorSource based on provided HTTP status code.
FrameResponse creates a DataResponse that contains the Framer's data.Frames.
FrameResponseWithError creates a DataResponse with the error's contents (if not nil), and the Framer's data.Frames.
FrameResponseWithErrorAndSource creates a DataResponse with the error's contents (if not nil), and the Framer's data.Frames, and the source of the error.
FromProto returns a new ConvertFromProtobuf.
GracefulStandaloneServe starts a gRPC server that is not managed by hashicorp.
GrafanaConfigFromContext returns Grafana config from context.
JSONDataFromHTTPClientOptions extracts JSON data from CustomOptions of httpclient.Options.
Manage runs the plugin in either standalone mode, dummy locator or normal (hashicorp) mode.
No description provided by the author
NewInitialData allows sending JSON on subscription.
NewInitialFrame allows creating frame as subscription InitialData.
NewQueryDataResponse returns a QueryDataResponse with the Responses property initialized.
No description provided by the author
SecureJSONDataFromHTTPClientOptions extracts secure JSON data from CustomOptions of httpclient.Options.
Serve starts serving the plugin over gRPC.
SetupPluginEnvironment will read the environment variables and apply the standard environment behavior.
SetupTracer sets up the global OTEL trace provider and tracer.
TestStandaloneServe starts a gRPC server that is not managed by hashicorp.
ToProto returns a new ConvertToProtobuf.
UserAgentFromContext returns user agent from context.
WithGrafanaConfig injects supplied Grafana config into context.
WithUserAgent injects supplied user agent into context.
# Constants
No description provided by the author
No description provided by the author
CookiesHeaderName the header name used for forwarding cookies.
No description provided by the author
No description provided by the author
HealthStatusError means the plugin is in an error state.
HealthStatusOk means the status of the plugin is good.
HealthStatusUnknown means the status of the plugin is unknown.
OAuthIdentityIDTokenHeaderName the header name used for forwarding OAuth Identity ID token.
OAuthIdentityTokenHeaderName the header name used for forwarding OAuth Identity access token.
PluginProfilerEnvDeprecated is a deprecated constant for the GF_PLUGINS_PROFILER environment variable used to enable pprof.
nolint:gosec.
PluginProfilingEnabledEnv is a constant for the GF_PLUGIN_PROFILING_ENABLED environment variable used to enable pprof.
nolint:gosec.
nolint:gosec.
PluginTracingOpenTelemetryOTLPPropagationEnv is a constant for the GF_INSTANCE_OTLP_PROPAGATION environment variable used to specify the OTLP propagation format.
PluginTracingSamplerParamEnv is a constant for the GF_INSTANCE_OTLP_SAMPLER_PARAM environment variable used to specify an additional float parameter used by the OTLP sampler, depending on the type.
PluginTracingSamplerRemoteURL is a constant for the GF_INSTANCE_OTLP_SAMPLER_REMOTE_URL environment variable used to specify the remote url for the sampler type.
PluginTracingSamplerTypeEnv is a constant for the GF_INSTANCE_OTLP_SAMPLER_TYPE environment variable used to specify the OTLP sampler type.
PluginVersionEnv is a constant for the GF_PLUGIN_VERSION environment variable containing the plugin's version.
PublishStreamStatusNotFound means stream does not exist at all.
PublishStreamStatusOK means publication is allowed.
PublishStreamStatusPermissionDenied means that user is not allowed to publish.
StatusBadGateway means that the data source, while acting as a gateway or proxy, received an invalid response from downstream.
StatusBadRequest means that the data source was unable to parse the parameters or payload for the request.
StatusForbidden means that the data source refuses to perform the requested action for the authenticated user.
StatusInternal means that the data source acknowledges that there's an error, but that there is nothing the client can do to fix it.
StatusNotFound means that the data source does not have any corresponding document to return to the request.
StatusNotImplemented means that the data source does not support the requested action.
StatusOK means that the action was successful.
StatusTimeout means that the data source did not complete the request within the required time and aborted the action.
StatusTooManyRequests means that the client is rate limited by the data source and should back-off before trying again.
StatusUnauthorized means that the data source does not recognize the client's authentication, either because it has not been provided or is invalid for the operation.
StatusUnknown implies an error that should be updated to contain an accurate status code, as none has been provided.
StatusValidationFailed means that the data source was able to parse the payload for the request, but it failed one or more validation checks.
SubscribeStreamStatusNotFound means stream does not exist at all.
SubscribeStreamStatusOK means subscription is allowed.
SubscribeStreamStatusPermissionDenied means that user is not allowed to subscribe.
# Variables
Logger is the default logger instance.
NewLoggerWith creates a new logger with the given arguments.
# Structs
AppInstanceSettings represents settings for an app instance.
CallResourceRequest represents a request for a resource call.
CallResourceResponse represents a response from a resource call.
CheckHealthRequest contains the healthcheck request.
CheckHealthResult contains the healthcheck response.
CollectMetricsRequest contains the metrics request.
CollectMetricsResult collect metrics result.
ConvertFromProtobuf has a collection of methods for converting from the autogenerated protobuf go code to our SDK objects.
ConvertToProtobuf has a collection of methods for converting the autogenerated protobuf go code to our SDK objects.
DataQuery represents a single query as sent from the frontend.
DataResponse contains the results from a DataQuery.
DataSourceInstanceSettings represents settings for a data source instance.
No description provided by the author
No description provided by the author
GRPCSettings settings for gRPC.
HTTPSettings is a convenient struct for holding decoded HTTP settings from jsonData and secureJSONData.
InitialData to send to a client upon a successful subscription to a channel.
PluginContext holds contextual information about a plugin request, such as Grafana organization, user and plugin instance settings.
No description provided by the author
PublishStreamRequest is EXPERIMENTAL and is a subject to change till Grafana 8.
PublishStreamResponse is EXPERIMENTAL and is a subject to change till Grafana 8.
QueryDataRequest contains a single request which contains multiple queries.
QueryDataResponse contains the results from a QueryDataRequest.
RunStreamRequest is EXPERIMENTAL and is a subject to change till Grafana 8.
ServeOpts options for serving plugins.
StreamPacket is EXPERIMENTAL and is a subject to change till Grafana 8.
StreamSender allows sending data to a stream.
SubscribeStreamRequest is EXPERIMENTAL and is a subject to change till Grafana 8.
SubscribeStreamResponse is EXPERIMENTAL and is a subject to change till Grafana 8.
TimeRange represents a time range for a query and is a property of DataQuery.
User represents a Grafana user.
# Interfaces
CallResourceHandler handles resource calls.
CallResourceResponseSender is used for sending resource call responses.
CheckHealthHandler enables users to send health check requests to a backend plugin.
CollectMetricsHandler handles metric collection.
ForwardHTTPHeaders interface marking that forward of HTTP headers is supported.
QueryDataHandler handles data queries.
StreamHandler handles streams.
StreamPacketSender is EXPERIMENTAL and is a subject to change till Grafana 8.
# Type aliases
CallResourceHandlerFunc is an adapter to allow the use of ordinary functions as backend.CallResourceHandler.
CheckHealthHandlerFunc is an adapter to allow the use of ordinary functions as backend.CheckHealthHandler.
CollectMetricsHandlerFunc is an adapter to allow the use of ordinary functions as backend.CollectMetricsHandler.
ErrorSource type defines the source of the error.
HealthStatus is the status of the plugin.
PublishStreamStatus is a status of publication response.
QueryDataHandlerFunc is an adapter to allow the use of ordinary functions as backend.QueryDataHandler.
Responses is a map of RefIDs (Unique Query ID) to DataResponses.
No description provided by the author
SubscribeStreamStatus is a status of subscription response.