write

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package write This label parser is copy-pasted from grafana/pyroscope/pkg/og/storage/segment/key.go. TODO: Replace this copy with the upstream parser once it's moved to pyroscope/api.

Index

Constants

View Source
const (
	ReservedTagKeyName = "__name__"
)

Variables

View Source
var (
	DefaultArguments = func() Arguments {
		return Arguments{}
	}
)

Functions

func NewFanOut

func NewFanOut(opts component.Options, config Arguments, metrics *metrics) (*fanOutClient, error)

NewFanOut creates a new fan out client that will fan out to all endpoints.

func WithUserAgent

func WithUserAgent(agent string) connect.ClientOption

WithUserAgent returns a `connect.ClientOption` that sets the User-Agent header on.

Types

type Arguments

type Arguments struct {
	ExternalLabels map[string]string  `alloy:"external_labels,attr,optional"`
	Endpoints      []*EndpointOptions `alloy:"endpoint,block,optional"`
}

Arguments represents the input state of the pyroscope.write component.

func (*Arguments) SetToDefault

func (rc *Arguments) SetToDefault()

SetToDefault implements syntax.Defaulter.

type Component

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

Component is the pyroscope.write component.

func New

New creates a new pyroscope.write component.

func (*Component) Run

func (c *Component) Run(ctx context.Context) error

Run implements Component.

func (*Component) Update

func (c *Component) Update(newConfig component.Arguments) error

Update implements Component.

type EndpointOptions

type EndpointOptions struct {
	Name              string                   `alloy:"name,attr,optional"`
	URL               string                   `alloy:"url,attr"`
	RemoteTimeout     time.Duration            `alloy:"remote_timeout,attr,optional"`
	Headers           map[string]string        `alloy:"headers,attr,optional"`
	HTTPClientConfig  *config.HTTPClientConfig `alloy:",squash"`
	MinBackoff        time.Duration            `alloy:"min_backoff_period,attr,optional"`  // start backoff at this level
	MaxBackoff        time.Duration            `alloy:"max_backoff_period,attr,optional"`  // increase exponentially to this level
	MaxBackoffRetries int                      `alloy:"max_backoff_retries,attr,optional"` // give up after this many; zero means infinite retries
}

EndpointOptions describes an individual location for where profiles should be delivered to using the Pyroscope push API.

func GetDefaultEndpointOptions

func GetDefaultEndpointOptions() EndpointOptions

func (*EndpointOptions) SetToDefault

func (r *EndpointOptions) SetToDefault()

SetToDefault implements syntax.Defaulter.

func (*EndpointOptions) Validate

func (r *EndpointOptions) Validate() error

Validate implements syntax.Validator.

type Error added in v1.5.0

type Error struct {
	Inner error
	Expr  string
}

func (*Error) Error added in v1.5.0

func (e *Error) Error() string

type Exports

type Exports struct {
	Receiver pyroscope.Appendable `alloy:"receiver,attr"`
}

Exports are the set of fields exposed by the pyroscope.write component.

type Key added in v1.5.0

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

func ParseKey added in v1.5.0

func ParseKey(name string) (*Key, error)

func (*Key) Normalized added in v1.5.0

func (k *Key) Normalized() string

Normalized is a helper for formatting the key back to string

type ParserState added in v1.5.0

type ParserState int

type PyroscopeWriteError added in v1.5.0

type PyroscopeWriteError struct {
	StatusCode int
}

func (*PyroscopeWriteError) Error added in v1.5.0

func (e *PyroscopeWriteError) Error() string

type SortedMap added in v1.5.0

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

SortedMap provides a deterministic way to iterate over map entries

func NewSortedMap added in v1.5.0

func NewSortedMap() *SortedMap

func (*SortedMap) Get added in v1.5.0

func (s *SortedMap) Get(k string) (v interface{})

func (*SortedMap) Keys added in v1.5.0

func (s *SortedMap) Keys() []string

func (*SortedMap) Put added in v1.5.0

func (s *SortedMap) Put(k string, v interface{})

Jump to

Keyboard shortcuts

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