profilehandler

package
v0.47.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package profilehandler provides a Pyroscope-compatible API implementation backed by the ProfileQL engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PyroscopeAPI

type PyroscopeAPI struct {
	// contains filtered or unexported fields
}

PyroscopeAPI implements pyroscopeapi.Handler.

func NewPyroscopeAPI

func NewPyroscopeAPI(
	q profilestorage.Querier,
	engine *profileqlengine.Engine,
	opts PyroscopeAPIOptions,
) *PyroscopeAPI

NewPyroscopeAPI creates a new PyroscopeAPI.

func (*PyroscopeAPI) GetApps

GetApps implements getApps operation.

Returns the list of application metadata. Used by Grafana to test the connection to Pyroscope.

GET /api/apps

func (*PyroscopeAPI) Ingest

Ingest implements ingest operation.

Push data to Pyroscope.

POST /ingest

func (*PyroscopeAPI) LabelValues

LabelValues implements labelValues operation.

Returns the list of label values.

GET /label-values

func (*PyroscopeAPI) Labels

Labels implements labels operation.

Returns the list of labels.

GET /labels

func (*PyroscopeAPI) NewError

NewError creates *ErrorStatusCode from an error returned by the handler.

Used for the common default response.

func (*PyroscopeAPI) Render

Render implements render operation.

Renders the given query in the requested format (json, pprof, collapsed or html).

GET /render

type PyroscopeAPIOptions

type PyroscopeAPIOptions struct {
	// DefaultSince sets the default lookback for the time range when only the
	// end (or nothing) is provided. Defaults to one [time.Hour].
	DefaultSince time.Duration
}

PyroscopeAPIOptions describes PyroscopeAPI options.

type QuerierService

type QuerierService struct {
	querierv1connect.UnimplementedQuerierServiceHandler
	// contains filtered or unexported fields
}

QuerierService implements the connect QuerierService API used by Grafana's built-in Pyroscope datasource, backed by the same ProfileQL engine and profilestorage.Querier as the legacy Pyroscope HTTP API (PyroscopeAPI). The two are served side by side on the Pyroscope listener.

Methods that have no representation in oteldb's storage (span profiles, heatmaps, diffs, async queries) are left to the embedded Unimplemented handler, which returns CodeUnimplemented.

func NewQuerierService

func NewQuerierService(q profilestorage.Querier, engine *profileqlengine.Engine) *QuerierService

NewQuerierService returns a QuerierService backed by q and engine.

func (*QuerierService) GetProfileStats

GetProfileStats implements the GetProfileStats RPC. Grafana uses it to detect whether the datasource has any data; oteldb does not track ingestion timestamps, so only data_ingested is set.

func (*QuerierService) LabelNames

LabelNames implements the LabelNames RPC.

func (*QuerierService) LabelValues

LabelValues implements the LabelValues RPC.

func (*QuerierService) ProfileTypes

ProfileTypes implements the ProfileTypes RPC.

func (*QuerierService) SelectMergeProfile

SelectMergeProfile implements the SelectMergeProfile RPC, returning the merged profile in pprof (google.v1.Profile) format.

func (*QuerierService) SelectMergeStacktraces

SelectMergeStacktraces implements the SelectMergeStacktraces RPC, returning the merged flamegraph.

func (*QuerierService) SelectSeries

SelectSeries implements the SelectSeries RPC by evaluating the merged total per time bucket. The group_by labels are not honored (a single total series is returned); the engine has no grouped time-series primitive, so this trades fidelity for a useful timeline.

func (*QuerierService) Series

Series implements the Series RPC. oteldb's querier does not enumerate full series (unique label sets), so this returns a best-effort approximation: for each requested label name, one single-label series per distinct value. It is enough for Grafana to populate group-by and label-value pickers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL