package faasconv
import "go.opentelemetry.io/otel/semconv/v1.32.0/faasconv"
Package faasconv provides types and functionality for OpenTelemetry semantic conventions in the "faas" namespace.
Index ¶
- type CPUUsage
- func NewCPUUsage( m metric.Meter, opt ...metric.Float64HistogramOption, ) (CPUUsage, error)
- func (CPUUsage) AttrTrigger(val TriggerAttr) attribute.KeyValue
- func (CPUUsage) Description() string
- func (m CPUUsage) Inst() metric.Float64Histogram
- func (CPUUsage) Name() string
- func (m CPUUsage) Record( ctx context.Context, val float64, attrs ...attribute.KeyValue, )
- func (CPUUsage) Unit() string
- type Coldstarts
- func NewColdstarts( m metric.Meter, opt ...metric.Int64CounterOption, ) (Coldstarts, error)
- func (m Coldstarts) Add( ctx context.Context, incr int64, attrs ...attribute.KeyValue, )
- func (Coldstarts) AttrTrigger(val TriggerAttr) attribute.KeyValue
- func (Coldstarts) Description() string
- func (m Coldstarts) Inst() metric.Int64Counter
- func (Coldstarts) Name() string
- func (Coldstarts) Unit() string
- type Errors
- func NewErrors( m metric.Meter, opt ...metric.Int64CounterOption, ) (Errors, error)
- func (m Errors) Add( ctx context.Context, incr int64, attrs ...attribute.KeyValue, )
- func (Errors) AttrTrigger(val TriggerAttr) attribute.KeyValue
- func (Errors) Description() string
- func (m Errors) Inst() metric.Int64Counter
- func (Errors) Name() string
- func (Errors) Unit() string
- type InitDuration
- func NewInitDuration( m metric.Meter, opt ...metric.Float64HistogramOption, ) (InitDuration, error)
- func (InitDuration) AttrTrigger(val TriggerAttr) attribute.KeyValue
- func (InitDuration) Description() string
- func (m InitDuration) Inst() metric.Float64Histogram
- func (InitDuration) Name() string
- func (m InitDuration) Record( ctx context.Context, val float64, attrs ...attribute.KeyValue, )
- func (InitDuration) Unit() string
- type Invocations
- func NewInvocations( m metric.Meter, opt ...metric.Int64CounterOption, ) (Invocations, error)
- func (m Invocations) Add( ctx context.Context, incr int64, attrs ...attribute.KeyValue, )
- func (Invocations) AttrTrigger(val TriggerAttr) attribute.KeyValue
- func (Invocations) Description() string
- func (m Invocations) Inst() metric.Int64Counter
- func (Invocations) Name() string
- func (Invocations) Unit() string
- type InvokeDuration
- func NewInvokeDuration( m metric.Meter, opt ...metric.Float64HistogramOption, ) (InvokeDuration, error)
- func (InvokeDuration) AttrTrigger(val TriggerAttr) attribute.KeyValue
- func (InvokeDuration) Description() string
- func (m InvokeDuration) Inst() metric.Float64Histogram
- func (InvokeDuration) Name() string
- func (m InvokeDuration) Record( ctx context.Context, val float64, attrs ...attribute.KeyValue, )
- func (InvokeDuration) Unit() string
- type MemUsage
- func NewMemUsage( m metric.Meter, opt ...metric.Int64HistogramOption, ) (MemUsage, error)
- func (MemUsage) AttrTrigger(val TriggerAttr) attribute.KeyValue
- func (MemUsage) Description() string
- func (m MemUsage) Inst() metric.Int64Histogram
- func (MemUsage) Name() string
- func (m MemUsage) Record( ctx context.Context, val int64, attrs ...attribute.KeyValue, )
- func (MemUsage) Unit() string
- type NetIO
- func NewNetIO( m metric.Meter, opt ...metric.Int64HistogramOption, ) (NetIO, error)
- func (NetIO) AttrTrigger(val TriggerAttr) attribute.KeyValue
- func (NetIO) Description() string
- func (m NetIO) Inst() metric.Int64Histogram
- func (NetIO) Name() string
- func (m NetIO) Record( ctx context.Context, val int64, attrs ...attribute.KeyValue, )
- func (NetIO) Unit() string
- type Timeouts
- func NewTimeouts( m metric.Meter, opt ...metric.Int64CounterOption, ) (Timeouts, error)
- func (m Timeouts) Add( ctx context.Context, incr int64, attrs ...attribute.KeyValue, )
- func (Timeouts) AttrTrigger(val TriggerAttr) attribute.KeyValue
- func (Timeouts) Description() string
- func (m Timeouts) Inst() metric.Int64Counter
- func (Timeouts) Name() string
- func (Timeouts) Unit() string
- type TriggerAttr
Types ¶
type 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.
func NewCPUUsage ¶
NewCPUUsage returns a new CPUUsage instrument.
func (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.
func (CPUUsage) Description ¶
Description returns the semantic convention description of the instrument
func (CPUUsage) Inst ¶
func (m CPUUsage) Inst() metric.Float64Histogram
Inst returns the underlying metric instrument.
func (CPUUsage) Name ¶
Name returns the semantic convention name of the instrument.
func (CPUUsage) Record ¶
Record records val to the current distribution.
All additional attrs passed are included in the recorded value.
func (CPUUsage) Unit ¶
Unit returns the semantic convention unit of the instrument
type 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.
func NewColdstarts ¶
func NewColdstarts( m metric.Meter, opt ...metric.Int64CounterOption, ) (Coldstarts, error)
NewColdstarts returns a new Coldstarts instrument.
func (Coldstarts) Add ¶
Add adds incr to the existing count.
All additional attrs passed are included in the recorded value.
func (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.
func (Coldstarts) Description ¶
func (Coldstarts) Description() string
Description returns the semantic convention description of the instrument
func (Coldstarts) Inst ¶
func (m Coldstarts) Inst() metric.Int64Counter
Inst returns the underlying metric instrument.
func (Coldstarts) Name ¶
func (Coldstarts) Name() string
Name returns the semantic convention name of the instrument.
func (Coldstarts) Unit ¶
func (Coldstarts) Unit() string
Unit returns the semantic convention unit of the instrument
type 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.
func NewErrors ¶
NewErrors returns a new Errors instrument.
func (Errors) Add ¶
Add adds incr to the existing count.
All additional attrs passed are included in the recorded value.
func (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.
func (Errors) Description ¶
Description returns the semantic convention description of the instrument
func (Errors) Inst ¶
func (m Errors) Inst() metric.Int64Counter
Inst returns the underlying metric instrument.
func (Errors) Name ¶
Name returns the semantic convention name of the instrument.
func (Errors) Unit ¶
Unit returns the semantic convention unit of the instrument
type 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.
func NewInitDuration ¶
func NewInitDuration( m metric.Meter, opt ...metric.Float64HistogramOption, ) (InitDuration, error)
NewInitDuration returns a new InitDuration instrument.
func (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.
func (InitDuration) Description ¶
func (InitDuration) Description() string
Description returns the semantic convention description of the instrument
func (InitDuration) Inst ¶
func (m InitDuration) Inst() metric.Float64Histogram
Inst returns the underlying metric instrument.
func (InitDuration) Name ¶
func (InitDuration) Name() string
Name returns the semantic convention name of the instrument.
func (InitDuration) Record ¶
Record records val to the current distribution.
All additional attrs passed are included in the recorded value.
func (InitDuration) Unit ¶
func (InitDuration) Unit() string
Unit returns the semantic convention unit of the instrument
type 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.
func NewInvocations ¶
func NewInvocations( m metric.Meter, opt ...metric.Int64CounterOption, ) (Invocations, error)
NewInvocations returns a new Invocations instrument.
func (Invocations) Add ¶
Add adds incr to the existing count.
All additional attrs passed are included in the recorded value.
func (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.
func (Invocations) Description ¶
func (Invocations) Description() string
Description returns the semantic convention description of the instrument
func (Invocations) Inst ¶
func (m Invocations) Inst() metric.Int64Counter
Inst returns the underlying metric instrument.
func (Invocations) Name ¶
func (Invocations) Name() string
Name returns the semantic convention name of the instrument.
func (Invocations) Unit ¶
func (Invocations) Unit() string
Unit returns the semantic convention unit of the instrument
type 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.
func NewInvokeDuration ¶
func NewInvokeDuration( m metric.Meter, opt ...metric.Float64HistogramOption, ) (InvokeDuration, error)
NewInvokeDuration returns a new InvokeDuration instrument.
func (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.
func (InvokeDuration) Description ¶
func (InvokeDuration) Description() string
Description returns the semantic convention description of the instrument
func (InvokeDuration) Inst ¶
func (m InvokeDuration) Inst() metric.Float64Histogram
Inst returns the underlying metric instrument.
func (InvokeDuration) Name ¶
func (InvokeDuration) Name() string
Name returns the semantic convention name of the instrument.
func (InvokeDuration) Record ¶
Record records val to the current distribution.
All additional attrs passed are included in the recorded value.
func (InvokeDuration) Unit ¶
func (InvokeDuration) Unit() string
Unit returns the semantic convention unit of the instrument
type 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.
func NewMemUsage ¶
NewMemUsage returns a new MemUsage instrument.
func (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.
func (MemUsage) Description ¶
Description returns the semantic convention description of the instrument
func (MemUsage) Inst ¶
func (m MemUsage) Inst() metric.Int64Histogram
Inst returns the underlying metric instrument.
func (MemUsage) Name ¶
Name returns the semantic convention name of the instrument.
func (MemUsage) Record ¶
Record records val to the current distribution.
All additional attrs passed are included in the recorded value.
func (MemUsage) Unit ¶
Unit returns the semantic convention unit of the instrument
type 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.
func NewNetIO ¶
NewNetIO returns a new NetIO instrument.
func (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.
func (NetIO) Description ¶
Description returns the semantic convention description of the instrument
func (NetIO) Inst ¶
func (m NetIO) Inst() metric.Int64Histogram
Inst returns the underlying metric instrument.
func (NetIO) Name ¶
Name returns the semantic convention name of the instrument.
func (NetIO) Record ¶
Record records val to the current distribution.
All additional attrs passed are included in the recorded value.
func (NetIO) Unit ¶
Unit returns the semantic convention unit of the instrument
type 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.
func NewTimeouts ¶
NewTimeouts returns a new Timeouts instrument.
func (Timeouts) Add ¶
Add adds incr to the existing count.
All additional attrs passed are included in the recorded value.
func (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.
func (Timeouts) Description ¶
Description returns the semantic convention description of the instrument
func (Timeouts) Inst ¶
func (m Timeouts) Inst() metric.Int64Counter
Inst returns the underlying metric instrument.
func (Timeouts) Name ¶
Name returns the semantic convention name of the instrument.
func (Timeouts) Unit ¶
Unit returns the semantic convention unit of the instrument
type 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.
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" )
Source Files ¶
metric.go
- Version
- v1.43.0 (latest)
- Published
- Apr 3, 2026
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 1 hour ago –
Tools for package owners.