Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

faasconv

v1.47.0
go.opentelemetry.io/otel/semconv/v1.32.0/faasconv

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

79 matches

Top ↑

Package faasconv provides types and functionality for OpenTelemetry semantic conventions in the "faas" namespace.

Types

CPUUsage

type CPUUsage struct {
	metric.Float64Histogram
}

CPUUsage is an instrument used to record metric values conforming to the "faas.cpu_usage" semantic conventions. It represents the distribution of CPU usage per invocation.

NewCPUUsage

func NewCPUUsage(
	m metric.Meter,
	opt ...metric.Float64HistogramOption,
) (CPUUsage, error)

NewCPUUsage returns a new CPUUsage instrument.

CPUUsage.AttrTrigger

func (CPUUsage) AttrTrigger(val TriggerAttr) attribute.KeyValue

AttrTrigger returns an optional attribute for the "faas.trigger" semantic convention. It represents the type of the trigger which caused this function invocation.

CPUUsage.Description

func (CPUUsage) Description() string

Description returns the semantic convention description of the instrument

CPUUsage.Inst

func (m CPUUsage) Inst() metric.Float64Histogram

Inst returns the underlying metric instrument.

CPUUsage.Name

func (CPUUsage) Name() string

Name returns the semantic convention name of the instrument.

CPUUsage.Record

func (m CPUUsage) Record(
	ctx context.Context,
	val float64,
	attrs ...attribute.KeyValue,
)

Record records val to the current distribution.

All additional attrs passed are included in the recorded value.

CPUUsage.Unit

func (CPUUsage) Unit() string

Unit returns the semantic convention unit of the instrument

Coldstarts

type Coldstarts struct {
	metric.Int64Counter
}

Coldstarts is an instrument used to record metric values conforming to the "faas.coldstarts" semantic conventions. It represents the number of invocation cold starts.

NewColdstarts

func NewColdstarts(
	m metric.Meter,
	opt ...metric.Int64CounterOption,
) (Coldstarts, error)

NewColdstarts returns a new Coldstarts instrument.

Coldstarts.Add

func (m Coldstarts) Add(
	ctx context.Context,
	incr int64,
	attrs ...attribute.KeyValue,
)

Add adds incr to the existing count.

All additional attrs passed are included in the recorded value.

Coldstarts.AttrTrigger

func (Coldstarts) AttrTrigger(val TriggerAttr) attribute.KeyValue

AttrTrigger returns an optional attribute for the "faas.trigger" semantic convention. It represents the type of the trigger which caused this function invocation.

Coldstarts.Description

func (Coldstarts) Description() string

Description returns the semantic convention description of the instrument

Coldstarts.Inst

func (m Coldstarts) Inst() metric.Int64Counter

Inst returns the underlying metric instrument.

Coldstarts.Name

func (Coldstarts) Name() string

Name returns the semantic convention name of the instrument.

Coldstarts.Unit

func (Coldstarts) Unit() string

Unit returns the semantic convention unit of the instrument

Errors

type Errors struct {
	metric.Int64Counter
}

Errors is an instrument used to record metric values conforming to the "faas.errors" semantic conventions. It represents the number of invocation errors.

NewErrors

func NewErrors(
	m metric.Meter,
	opt ...metric.Int64CounterOption,
) (Errors, error)

NewErrors returns a new Errors instrument.

Errors.Add

func (m Errors) Add(
	ctx context.Context,
	incr int64,
	attrs ...attribute.KeyValue,
)

Add adds incr to the existing count.

All additional attrs passed are included in the recorded value.

Errors.AttrTrigger

func (Errors) AttrTrigger(val TriggerAttr) attribute.KeyValue

AttrTrigger returns an optional attribute for the "faas.trigger" semantic convention. It represents the type of the trigger which caused this function invocation.

Errors.Description

func (Errors) Description() string

Description returns the semantic convention description of the instrument

Errors.Inst

func (m Errors) Inst() metric.Int64Counter

Inst returns the underlying metric instrument.

Errors.Name

func (Errors) Name() string

Name returns the semantic convention name of the instrument.

Errors.Unit

func (Errors) Unit() string

Unit returns the semantic convention unit of the instrument

InitDuration

type InitDuration struct {
	metric.Float64Histogram
}

InitDuration is an instrument used to record metric values conforming to the "faas.init_duration" semantic conventions. It represents the measures the duration of the function's initialization, such as a cold start.

NewInitDuration

func NewInitDuration(
	m metric.Meter,
	opt ...metric.Float64HistogramOption,
) (InitDuration, error)

NewInitDuration returns a new InitDuration instrument.

InitDuration.AttrTrigger

func (InitDuration) AttrTrigger(val TriggerAttr) attribute.KeyValue

AttrTrigger returns an optional attribute for the "faas.trigger" semantic convention. It represents the type of the trigger which caused this function invocation.

InitDuration.Description

func (InitDuration) Description() string

Description returns the semantic convention description of the instrument

InitDuration.Inst

func (m InitDuration) Inst() metric.Float64Histogram

Inst returns the underlying metric instrument.

InitDuration.Name

func (InitDuration) Name() string

Name returns the semantic convention name of the instrument.

InitDuration.Record

func (m InitDuration) Record(
	ctx context.Context,
	val float64,
	attrs ...attribute.KeyValue,
)

Record records val to the current distribution.

All additional attrs passed are included in the recorded value.

InitDuration.Unit

func (InitDuration) Unit() string

Unit returns the semantic convention unit of the instrument

Invocations

type Invocations struct {
	metric.Int64Counter
}

Invocations is an instrument used to record metric values conforming to the "faas.invocations" semantic conventions. It represents the number of successful invocations.

NewInvocations

func NewInvocations(
	m metric.Meter,
	opt ...metric.Int64CounterOption,
) (Invocations, error)

NewInvocations returns a new Invocations instrument.

Invocations.Add

func (m Invocations) Add(
	ctx context.Context,
	incr int64,
	attrs ...attribute.KeyValue,
)

Add adds incr to the existing count.

All additional attrs passed are included in the recorded value.

Invocations.AttrTrigger

func (Invocations) AttrTrigger(val TriggerAttr) attribute.KeyValue

AttrTrigger returns an optional attribute for the "faas.trigger" semantic convention. It represents the type of the trigger which caused this function invocation.

Invocations.Description

func (Invocations) Description() string

Description returns the semantic convention description of the instrument

Invocations.Inst

func (m Invocations) Inst() metric.Int64Counter

Inst returns the underlying metric instrument.

Invocations.Name

func (Invocations) Name() string

Name returns the semantic convention name of the instrument.

Invocations.Unit

func (Invocations) Unit() string

Unit returns the semantic convention unit of the instrument

InvokeDuration

type InvokeDuration struct {
	metric.Float64Histogram
}

InvokeDuration is an instrument used to record metric values conforming to the "faas.invoke_duration" semantic conventions. It represents the measures the duration of the function's logic execution.

NewInvokeDuration

func NewInvokeDuration(
	m metric.Meter,
	opt ...metric.Float64HistogramOption,
) (InvokeDuration, error)

NewInvokeDuration returns a new InvokeDuration instrument.

InvokeDuration.AttrTrigger

func (InvokeDuration) AttrTrigger(val TriggerAttr) attribute.KeyValue

AttrTrigger returns an optional attribute for the "faas.trigger" semantic convention. It represents the type of the trigger which caused this function invocation.

InvokeDuration.Description

func (InvokeDuration) Description() string

Description returns the semantic convention description of the instrument

InvokeDuration.Inst

func (m InvokeDuration) Inst() metric.Float64Histogram

Inst returns the underlying metric instrument.

InvokeDuration.Name

func (InvokeDuration) Name() string

Name returns the semantic convention name of the instrument.

InvokeDuration.Record

func (m InvokeDuration) Record(
	ctx context.Context,
	val float64,
	attrs ...attribute.KeyValue,
)

Record records val to the current distribution.

All additional attrs passed are included in the recorded value.

InvokeDuration.Unit

func (InvokeDuration) Unit() string

Unit returns the semantic convention unit of the instrument

MemUsage

type MemUsage struct {
	metric.Int64Histogram
}

MemUsage is an instrument used to record metric values conforming to the "faas.mem_usage" semantic conventions. It represents the distribution of max memory usage per invocation.

NewMemUsage

func NewMemUsage(
	m metric.Meter,
	opt ...metric.Int64HistogramOption,
) (MemUsage, error)

NewMemUsage returns a new MemUsage instrument.

MemUsage.AttrTrigger

func (MemUsage) AttrTrigger(val TriggerAttr) attribute.KeyValue

AttrTrigger returns an optional attribute for the "faas.trigger" semantic convention. It represents the type of the trigger which caused this function invocation.

MemUsage.Description

func (MemUsage) Description() string

Description returns the semantic convention description of the instrument

MemUsage.Inst

func (m MemUsage) Inst() metric.Int64Histogram

Inst returns the underlying metric instrument.

MemUsage.Name

func (MemUsage) Name() string

Name returns the semantic convention name of the instrument.

MemUsage.Record

func (m MemUsage) Record(
	ctx context.Context,
	val int64,
	attrs ...attribute.KeyValue,
)

Record records val to the current distribution.

All additional attrs passed are included in the recorded value.

MemUsage.Unit

func (MemUsage) Unit() string

Unit returns the semantic convention unit of the instrument

NetIO

type NetIO struct {
	metric.Int64Histogram
}

NetIO is an instrument used to record metric values conforming to the "faas.net_io" semantic conventions. It represents the distribution of net I/O usage per invocation.

NewNetIO

func NewNetIO(
	m metric.Meter,
	opt ...metric.Int64HistogramOption,
) (NetIO, error)

NewNetIO returns a new NetIO instrument.

NetIO.AttrTrigger

func (NetIO) AttrTrigger(val TriggerAttr) attribute.KeyValue

AttrTrigger returns an optional attribute for the "faas.trigger" semantic convention. It represents the type of the trigger which caused this function invocation.

NetIO.Description

func (NetIO) Description() string

Description returns the semantic convention description of the instrument

NetIO.Inst

func (m NetIO) Inst() metric.Int64Histogram

Inst returns the underlying metric instrument.

NetIO.Name

func (NetIO) Name() string

Name returns the semantic convention name of the instrument.

NetIO.Record

func (m NetIO) Record(
	ctx context.Context,
	val int64,
	attrs ...attribute.KeyValue,
)

Record records val to the current distribution.

All additional attrs passed are included in the recorded value.

NetIO.Unit

func (NetIO) Unit() string

Unit returns the semantic convention unit of the instrument

Timeouts

type Timeouts struct {
	metric.Int64Counter
}

Timeouts is an instrument used to record metric values conforming to the "faas.timeouts" semantic conventions. It represents the number of invocation timeouts.

NewTimeouts

func NewTimeouts(
	m metric.Meter,
	opt ...metric.Int64CounterOption,
) (Timeouts, error)

NewTimeouts returns a new Timeouts instrument.

Timeouts.Add

func (m Timeouts) Add(
	ctx context.Context,
	incr int64,
	attrs ...attribute.KeyValue,
)

Add adds incr to the existing count.

All additional attrs passed are included in the recorded value.

Timeouts.AttrTrigger

func (Timeouts) AttrTrigger(val TriggerAttr) attribute.KeyValue

AttrTrigger returns an optional attribute for the "faas.trigger" semantic convention. It represents the type of the trigger which caused this function invocation.

Timeouts.Description

func (Timeouts) Description() string

Description returns the semantic convention description of the instrument

Timeouts.Inst

func (m Timeouts) Inst() metric.Int64Counter

Inst returns the underlying metric instrument.

Timeouts.Name

func (Timeouts) Name() string

Name returns the semantic convention name of the instrument.

Timeouts.Unit

func (Timeouts) Unit() string

Unit returns the semantic convention unit of the instrument

TriggerAttr

type TriggerAttr string

TriggerAttr is an attribute conforming to the faas.trigger semantic conventions. It represents the type of the trigger which caused this function invocation.

TriggerDatasource (5 declarations)

var (
	// TriggerDatasource is a response to some data source operation such as a
	// database or filesystem read/write.
	TriggerDatasource TriggerAttr = "datasource"
	// TriggerHTTP is the to provide an answer to an inbound HTTP request.
	TriggerHTTP TriggerAttr = "http"
	// TriggerPubSub is a function is set to be executed when messages are sent to a
	// messaging system.
	TriggerPubSub TriggerAttr = "pubsub"
	// TriggerTimer is a function is scheduled to be executed regularly.
	TriggerTimer TriggerAttr = "timer"
	// TriggerOther is the if none of the others apply.
	TriggerOther TriggerAttr = "other"
)

Dependency graph