normalizer

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: Apache-2.0 Imports: 32 Imported by: 2

Documentation

Index

Constants

View Source
const (
	MetadataSchemaVersion = "parca_write_schema_version"
)
View Source
const (
	MetadataSchemaVersionV1 = "v1"
)

Variables

View Source
var ErrMissingNameLabel = errors.New("missing __name__ label")

Functions

func LabelNamesFromSamples

func LabelNamesFromSamples(
	takenLabels map[string]string,
	stringTable []string,
	samples []*pprofpb.Sample,
	allLabels map[string]struct{},
	allNumLabels map[string]struct{},
)

func LabelsFromSample

func LabelsFromSample(takenLabels map[string]string, stringTable []string, plabels []*pprofpb.Label) (map[string]string, map[string]int64)

TODO: support num label units.

func MetaFromOtelProfile added in v0.22.0

func MetaFromOtelProfile(p *pprofextended.Profile, name string, sampleIndex int, duration int64) profile.Meta

func MetaFromPprof added in v0.22.0

func MetaFromPprof(p *pprofpb.Profile, name string, sampleIndex int) profile.Meta

func NewArrowToInternalConverter added in v0.22.0

func NewArrowToInternalConverter(
	mem memory.Allocator,
	schema *dynparquet.Schema,
	metrics *Metrics,
) *arrowToInternalConverter

func OtlpRequestToArrowRecord added in v0.22.0

func OtlpRequestToArrowRecord(
	ctx context.Context,
	req *otelgrpcprofilingpb.ExportProfilesServiceRequest,
	schema *dynparquet.Schema,
	mem memory.Allocator,
) (arrow.Record, error)

func SampleToParquetRow added in v0.22.0

func SampleToParquetRow(
	schema *dynparquet.Schema,
	row parquet.Row,
	labelNames, profileLabelNames, profileNumLabelNames []string,
	lset map[string]string,
	meta profile.Meta,
	s *NormalizedSample,
) parquet.Row

SampleToParquetRow converts a sample to a Parquet row. The passed labels must be sorted.

func ValidateOtelExportProfilesServiceRequest added in v0.22.0

func ValidateOtelExportProfilesServiceRequest(req *otelgrpcprofilingpb.ExportProfilesServiceRequest) error

func ValidateOtelProfile added in v0.22.0

func ValidateOtelProfile(p *otelprofilingpb.Profile) error

func ValidatePprofProfile

func ValidatePprofProfile(p *pprofpb.Profile, ei []*profilestorepb.ExecutableInfo) error

func WriteRawRequestToArrowRecord added in v0.22.0

func WriteRawRequestToArrowRecord(
	ctx context.Context,
	mem memory.Allocator,
	req *profilestorepb.WriteRawRequest,
	schema *dynparquet.Schema,
) (arrow.Record, error)

Types

type InternalRecordBuilderV1 added in v0.22.0

type InternalRecordBuilderV1 struct {
	Producer   *array.Dictionary
	SampleType *array.Dictionary
	SampleUnit *array.Dictionary
	PeriodType *array.Dictionary
	PeriodUnit *array.Dictionary

	Period    *array.Int64
	Duration  *array.Int64
	Timestamp *array.Int64
	Value     *array.Int64

	Labels      []arrow.Array
	LabelFields []arrow.Field

	Locations *array.List

	StacktraceIDs *array.Dictionary
}

func (*InternalRecordBuilderV1) Release added in v0.22.0

func (r *InternalRecordBuilderV1) Release()

type Metrics added in v0.22.0

type Metrics struct {
	IncompleteLocations prometheus.Counter
}

func NewMetrics added in v0.22.0

func NewMetrics(reg prometheus.Registerer) *Metrics

type NormalizedProfile added in v0.22.0

type NormalizedProfile struct {
	Samples []*NormalizedSample
	Meta    profile.Meta
}

func NormalizePprof added in v0.22.0

func NormalizePprof(
	ctx context.Context,
	name string,
	takenLabelNames map[string]string,
	p *pprofpb.Profile,
	normalizedAddress bool,
	executableInfo []*profilestorepb.ExecutableInfo,
) ([]*NormalizedProfile, error)

type NormalizedSample added in v0.22.0

type NormalizedSample struct {
	Locations [][]byte
	Value     int64
	DiffValue int64
	Label     map[string]string
	NumLabel  map[string]int64
}

type NormalizedWriteRawRequest

type NormalizedWriteRawRequest struct {
	Series                []Series
	AllLabelNames         []string
	AllPprofLabelNames    []string
	AllPprofNumLabelNames []string
}

func NormalizeWriteRawRequest added in v0.22.0

func NormalizeWriteRawRequest(ctx context.Context, req *profilestorepb.WriteRawRequest) (NormalizedWriteRawRequest, error)

type Series

type Series struct {
	Labels  map[string]string
	Samples [][]*NormalizedProfile
}

Jump to

Keyboard shortcuts

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