view

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeltaPreferredTemporality

func DeltaPreferredTemporality(ik sdkinstrument.Kind) aggregation.Temporality

DeltaPreferredTemporality returns a function that configures a preference for Delta temporality for all instrument kinds except UpDownCounter, which remain Cumulative.

func StandardAggregationKind

func StandardAggregationKind(ik sdkinstrument.Kind) aggregation.Kind

StandardAggregationKind returns a function that configures the specified default aggregation Kind for each instrument Kind.

func StandardConfigForPerformance added in v1.14.0

func StandardConfigForPerformance(perf sdkinstrument.Performance) func(ik sdkinstrument.Kind) (ints, floats aggregator.Config)

StandardConfigForPerformance returns a function that configures two default aggregator.Configs using the specified performance defaults.

func StandardTemporality

func StandardTemporality(ik sdkinstrument.Kind) aggregation.Temporality

StandardTemporality returns a function that conifigures the specified default Cumulative temporality for all instrument kinds.

Types

type ClauseConfig

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

ClauseConfig contains each of the configurable aspects of a single Views clause.

func (*ClauseConfig) Aggregation

func (c *ClauseConfig) Aggregation() aggregation.Kind

func (*ClauseConfig) AggregatorConfig

func (c *ClauseConfig) AggregatorConfig() aggregator.Config

func (*ClauseConfig) Description

func (c *ClauseConfig) Description() string

func (*ClauseConfig) Keys

func (c *ClauseConfig) Keys() []attribute.Key

func (*ClauseConfig) Matches

func (*ClauseConfig) Rename added in v1.18.7

func (c *ClauseConfig) Rename(name string) string

Rename executes the rename function on the name provided. If no rename function was set, the original name is returned.

type ClauseOption

type ClauseOption interface {
	// contains filtered or unexported methods
}

ClauseOption applies a configuration option value to a view Config.

func MatchInstrumentKind

func MatchInstrumentKind(k sdkinstrument.Kind) ClauseOption

func MatchInstrumentName

func MatchInstrumentName(name string) ClauseOption

func MatchInstrumentNameRegexp

func MatchInstrumentNameRegexp(re *regexp.Regexp) ClauseOption

func MatchInstrumentationLibrary

func MatchInstrumentationLibrary(lib instrumentation.Library) ClauseOption

func MatchNumberKind

func MatchNumberKind(k number.Kind) ClauseOption

func WithAggregation

func WithAggregation(kind aggregation.Kind) ClauseOption

func WithAggregatorConfig

func WithAggregatorConfig(acfg aggregator.Config) ClauseOption

func WithDescription

func WithDescription(desc string) ClauseOption

func WithKeys

func WithKeys(keys []attribute.Key) ClauseOption

WithKeys overwrites; nil is distinct from empty non-nil.

func WithName

func WithName(name string) ClauseOption

func WithRenameFunction added in v1.18.7

func WithRenameFunction(renameFunc RenameInstrumentFunction) ClauseOption

WithRenameFunction provides a function for renaming chosen instruments. This should not be set with WithName() - whichever is applied last will be used.

type Config

type Config struct {
	Clauses  []ClauseConfig
	Defaults DefaultConfig
}

Config contains configuration options for a view.

The configurable aspects are: - Clauses in effect - Defaults by instrument kind for:

  • Aggregation Kind
  • Aggregation Temporality
  • Aggregator configuration for int64, float64

func NewConfig

func NewConfig(perf sdkinstrument.Performance, options ...Option) Config

NewConfig returns a new and configured view Config.

type DefaultConfig

type DefaultConfig struct {
	ByInstrumentKind [sdkinstrument.NumKinds]struct {
		Aggregation aggregation.Kind
		Temporality aggregation.Temporality
		Int64       aggregator.Config
		Float64     aggregator.Config
	}
}

DefaultConfig contains configurable aspects that apply to all instruments in a View.

func (*DefaultConfig) Aggregation

func (d *DefaultConfig) Aggregation(k sdkinstrument.Kind) aggregation.Kind

Aggregation returns the default aggregation.Kind for each instrument kind.

func (*DefaultConfig) AggregationConfig

func (d *DefaultConfig) AggregationConfig(k sdkinstrument.Kind, nk number.Kind) aggregator.Config

AggregationConfig returns the default aggregation.Temporality for each instrument kind.

func (*DefaultConfig) Temporality

DefaultTemporality returns the default aggregation.Temporality for each instrument kind.

type Hint

type Hint struct {
	// Description takes the place of the hint after decoding
	// this Hint from the Description.
	Description string `json:"description"`

	// Aggregation determines the kind of aggregator used.  When
	// this is set, semantic compatibility checking is bypassed.
	Aggregation string `json:"aggregation"`

	// Config configures the aggregator selected in the
	// Aggregation field.
	Config aggregator.JSONConfig `json:"config"`

	// Temporality overrides the default temporality choice.
	Temporality string `json:"temporality"`
}

Hint is a structure that can be serialized into a Description field to control the aggregation and config. These hints are only taken when no other View clauses match the instrument.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option applies a configuration option value to a view Config.

func WithClause

func WithClause(options ...ClauseOption) Option

WithClause adds a clause to the Views configuration.

func WithDefaultAggregationConfigSelector

func WithDefaultAggregationConfigSelector(d aggregator.ConfigSelector) Option

WithDefaultAggregationConfigSelector configures the default aggregator.Config to use with each kind of instrument. This overwrites previous settings of the same option.

func WithDefaultAggregationKindSelector

func WithDefaultAggregationKindSelector(d aggregation.KindSelector) Option

WithDefaultAggregationKindSelector configures the default aggregation.Kind to use with each kind of instrument. This overwrites previous settings of the same option.

func WithDefaultAggregationTemporalitySelector

func WithDefaultAggregationTemporalitySelector(d aggregation.TemporalitySelector) Option

WithDefaultAggregationTemporalitySelector configures the default aggregation.Temporality to use with each kind of instrument. This overwrites previous settings of the same option.

type RenameInstrumentFunction added in v1.18.7

type RenameInstrumentFunction func(string) string

type Views

type Views struct {
	// Name of these views, used in error reporting.
	Name string

	// Config is the configuration for these views.
	Config

	// Performance defaults used in these views.
	sdkinstrument.Performance
}

that is used for debugging.

func New

func New(name string, perf sdkinstrument.Performance, opts ...Option) *Views

New configures the clauses and default settings of a Views.

func Validate

func Validate(v *Views) (*Views, error)

Validate checks for inconsistent view settings and returns any errors with the nearest consistent configuration for use.

Jump to

Keyboard shortcuts

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