Help us shape the future of Go! Take the 2026 Go Developer Survey

normalizer

package
v0.29.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 34 Imported by: 2

Documentation

Index

Constants

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

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{},
)

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(stringTable []string, p *pprofextended.Profile, name string, duration uint64) 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 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 ValidateOtelDictionary added in v0.24.1

func ValidateOtelDictionary(d *otelprofilingpb.ProfilesDictionary) error

func ValidateOtelExportProfilesServiceRequest added in v0.22.0

func ValidateOtelExportProfilesServiceRequest(req *otelgrpcprofilingpb.ExportProfilesServiceRequest) error

func ValidateOtelProfile added in v0.22.0

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.RecordBatch, 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
	TimeNanos *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
}

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