Documentation ¶
Index ¶
- Constants
- func NewPhlareDatasource(httpClientProvider httpclient.Provider, ...) (instancemgmt.Instance, error)
- type App
- type BackendTypeRespBody
- type CustomMeta
- type EnumField
- type Flamebearer
- type Function
- type Group
- type JsonData
- type LabelPair
- type LabelValuesPayload
- type Level
- type Metadata
- type PhlareClient
- func (c *PhlareClient) GetProfile(ctx context.Context, profileTypeID, labelSelector string, start, end int64, ...) (*ProfileResponse, error)
- func (c *PhlareClient) GetSeries(ctx context.Context, profileTypeID string, labelSelector string, start int64, ...) (*SeriesResponse, error)
- func (c *PhlareClient) LabelNames(ctx context.Context, query string, start int64, end int64) ([]string, error)
- func (c *PhlareClient) LabelValues(ctx context.Context, query string, label string, start int64, end int64) ([]string, error)
- func (c *PhlareClient) ProfileTypes(ctx context.Context) ([]*ProfileType, error)
- type PhlareDatasource
- func (d *PhlareDatasource) CallResource(ctx context.Context, req *backend.CallResourceRequest, ...) error
- func (d *PhlareDatasource) CheckHealth(ctx context.Context, _ *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (d *PhlareDatasource) PublishStream(_ context.Context, _ *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
- func (d *PhlareDatasource) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- func (d *PhlareDatasource) RunStream(ctx context.Context, req *backend.RunStreamRequest, ...) error
- func (d *PhlareDatasource) SubscribeStream(_ context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
- type Point
- type ProfileResponse
- type ProfileTree
- type ProfileType
- type ProfilingClient
- type PyroFlamebearer
- type PyroscopeClient
- func (c *PyroscopeClient) GetProfile(ctx context.Context, profileTypeID, labelSelector string, start, end int64, ...) (*ProfileResponse, error)
- func (c *PyroscopeClient) GetSeries(ctx context.Context, profileTypeID string, labelSelector string, ...) (*SeriesResponse, error)
- func (c *PyroscopeClient) LabelNames(ctx context.Context, query string, start int64, end int64) ([]string, error)
- func (c *PyroscopeClient) LabelValues(ctx context.Context, query string, label string, start int64, end int64) ([]string, error)
- func (c *PyroscopeClient) ProfileTypes(ctx context.Context) ([]*ProfileType, error)
- type PyroscopeProfileResponse
- type Series
- type SeriesResponse
- type Service
- func (s *Service) CallResource(ctx context.Context, req *backend.CallResourceRequest, ...) error
- func (s *Service) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (s *Service) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
- func (s *Service) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- func (s *Service) RunStream(ctx context.Context, req *backend.RunStreamRequest, ...) error
- func (s *Service) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
Constants ¶
const ITEM_OFFSET = 4
ITEM_OFFSET Next bar. Each bar of the profile is represented by 4 number in a flat array.
const NAME_OFFSET = 3
NAME_OFFSET is index into the names array
const SELF_OFFSET = 2
SELF_OFFSET is self value of the bar
const START_OFFSET = 0
START_OFFSET is offset of the bar relative to previous sibling
const VALUE_OFFSET = 1
VALUE_OFFSET is value or width of the bar
Variables ¶
This section is empty.
Functions ¶
func NewPhlareDatasource ¶
func NewPhlareDatasource(httpClientProvider httpclient.Provider, settings backend.DataSourceInstanceSettings, ac accesscontrol.AccessControl) (instancemgmt.Instance, error)
NewPhlareDatasource creates a new datasource instance.
Types ¶
type BackendTypeRespBody ¶
type BackendTypeRespBody struct {
BackendType string `json:"backendType"` // "phlare" or "pyroscope"
}
type CustomMeta ¶
type CustomMeta struct {
ProfileTypeID string
}
type Flamebearer ¶
type LabelValuesPayload ¶
type PhlareClient ¶
type PhlareClient struct {
// contains filtered or unexported fields
}
func NewPhlareClient ¶
func NewPhlareClient(httpClient *http.Client, url string) *PhlareClient
func (*PhlareClient) GetProfile ¶
func (c *PhlareClient) GetProfile(ctx context.Context, profileTypeID, labelSelector string, start, end int64, maxNodes *int64) (*ProfileResponse, error)
func (*PhlareClient) LabelNames ¶
func (*PhlareClient) LabelValues ¶
func (*PhlareClient) ProfileTypes ¶
func (c *PhlareClient) ProfileTypes(ctx context.Context) ([]*ProfileType, error)
type PhlareDatasource ¶
type PhlareDatasource struct {
// contains filtered or unexported fields
}
PhlareDatasource is a datasource for querying application performance profiles.
func (*PhlareDatasource) CallResource ¶
func (d *PhlareDatasource) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error
func (*PhlareDatasource) CheckHealth ¶
func (d *PhlareDatasource) CheckHealth(ctx context.Context, _ *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
CheckHealth handles health checks sent from Grafana to the plugin. The main use case for these health checks is the test button on the datasource configuration page which allows users to verify that a datasource is working as expected.
func (*PhlareDatasource) PublishStream ¶
func (d *PhlareDatasource) PublishStream(_ context.Context, _ *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
PublishStream is called when a client sends a message to the stream.
func (*PhlareDatasource) QueryData ¶
func (d *PhlareDatasource) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
QueryData handles multiple queries and returns multiple responses. req contains the queries []DataQuery (where each query contains RefID as a unique identifier). The QueryDataResponse contains a map of RefID to the response for each query, and each response contains Frames ([]*Frame).
func (*PhlareDatasource) RunStream ¶
func (d *PhlareDatasource) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error
RunStream is called once for any open channel. Results are shared with everyone subscribed to the same channel.
func (*PhlareDatasource) SubscribeStream ¶
func (d *PhlareDatasource) SubscribeStream(_ context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)
SubscribeStream is called when a client wants to connect to a stream. This callback allows sending the first message.
type ProfileResponse ¶
type ProfileResponse struct { Flamebearer *Flamebearer Units string }
type ProfileTree ¶
type ProfileTree struct { Start int64 Value int64 Self int64 Level int Name string Nodes []*ProfileTree }
func (*ProfileTree) String ¶
func (pt *ProfileTree) String() string
type ProfileType ¶
type ProfilingClient ¶
type ProfilingClient interface { ProfileTypes(context.Context) ([]*ProfileType, error) LabelNames(ctx context.Context, query string, start int64, end int64) ([]string, error) LabelValues(ctx context.Context, query string, label string, start int64, end int64) ([]string, error) GetSeries(ctx context.Context, profileTypeID string, labelSelector string, start int64, end int64, groupBy []string, step float64) (*SeriesResponse, error) GetProfile(ctx context.Context, profileTypeID string, labelSelector string, start int64, end int64, maxNodes *int64) (*ProfileResponse, error) }
type PyroFlamebearer ¶
type PyroscopeClient ¶
type PyroscopeClient struct { URL string // contains filtered or unexported fields }
func NewPyroscopeClient ¶
func NewPyroscopeClient(httpClient *http.Client, url string) *PyroscopeClient
func (*PyroscopeClient) GetProfile ¶
func (c *PyroscopeClient) GetProfile(ctx context.Context, profileTypeID, labelSelector string, start, end int64, maxNodes *int64) (*ProfileResponse, error)
func (*PyroscopeClient) GetSeries ¶
func (c *PyroscopeClient) GetSeries(ctx context.Context, profileTypeID string, labelSelector string, start, end int64, groupBy []string, step float64) (*SeriesResponse, error)
func (*PyroscopeClient) LabelNames ¶
func (*PyroscopeClient) LabelValues ¶
func (*PyroscopeClient) ProfileTypes ¶
func (c *PyroscopeClient) ProfileTypes(ctx context.Context) ([]*ProfileType, error)
type PyroscopeProfileResponse ¶
type PyroscopeProfileResponse struct { Flamebearer *PyroFlamebearer `json:"flamebearer"` Metadata *Metadata `json:"metadata"` Groups map[string]*Group `json:"groups"` }
type SeriesResponse ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func ProvideService ¶
func ProvideService(httpClientProvider httpclient.Provider, ac accesscontrol.AccessControl) *Service
func (*Service) CallResource ¶
func (s *Service) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error
func (*Service) CheckHealth ¶
func (s *Service) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
func (*Service) PublishStream ¶
func (s *Service) PublishStream(ctx context.Context, req *backend.PublishStreamRequest) (*backend.PublishStreamResponse, error)
PublishStream is called when a client sends a message to the stream.
func (*Service) QueryData ¶
func (s *Service) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
func (*Service) RunStream ¶
func (s *Service) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error
func (*Service) SubscribeStream ¶
func (s *Service) SubscribeStream(ctx context.Context, req *backend.SubscribeStreamRequest) (*backend.SubscribeStreamResponse, error)