1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2026-06-03 18:35:08 +02:00

Add observable instrument variants to semconv v1.41.0 (#8350)

Fixes https://github.com/open-telemetry/opentelemetry-go/issues/7342

Generates both observable and synchronous variants of instruments per
https://github.com/open-telemetry/opentelemetry-go/issues/7342#issuecomment-3292806559
This commit is contained in:
David Ashpole
2026-05-21 00:50:33 -04:00
committed by GitHub
parent 2919ac8ed2
commit 597532c4d4
19 changed files with 20393 additions and 26 deletions
+71
View File
@@ -175,6 +175,77 @@ func (CosmosDBClientActiveInstanceCount) AttrServerAddress(val string) attribute
return attribute.String("server.address", val)
}
// CosmosDBClientActiveInstanceCountObservable is an instrument used to record
// metric values conforming to the "azure.cosmosdb.client.active_instance.count"
// semantic conventions. It represents the number of active client instances.
type CosmosDBClientActiveInstanceCountObservable struct {
metric.Int64ObservableUpDownCounter
}
var newCosmosDBClientActiveInstanceCountObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("Number of active client instances."),
metric.WithUnit("{instance}"),
}
// NewCosmosDBClientActiveInstanceCountObservable returns a new
// CosmosDBClientActiveInstanceCountObservable instrument.
func NewCosmosDBClientActiveInstanceCountObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (CosmosDBClientActiveInstanceCountObservable, error) {
// Check if the meter is nil.
if m == nil {
return CosmosDBClientActiveInstanceCountObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newCosmosDBClientActiveInstanceCountObservableOpts
} else {
opt = append(opt, newCosmosDBClientActiveInstanceCountObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"azure.cosmosdb.client.active_instance.count",
opt...,
)
if err != nil {
return CosmosDBClientActiveInstanceCountObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return CosmosDBClientActiveInstanceCountObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m CosmosDBClientActiveInstanceCountObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (CosmosDBClientActiveInstanceCountObservable) Name() string {
return "azure.cosmosdb.client.active_instance.count"
}
// Unit returns the semantic convention unit of the instrument
func (CosmosDBClientActiveInstanceCountObservable) Unit() string {
return "{instance}"
}
// Description returns the semantic convention description of the instrument
func (CosmosDBClientActiveInstanceCountObservable) Description() string {
return "Number of active client instances."
}
// AttrServerPort returns an optional attribute for the "server.port" semantic
// convention. It represents the server port number.
func (CosmosDBClientActiveInstanceCountObservable) AttrServerPort(val int) attribute.KeyValue {
return attribute.Int("server.port", val)
}
// AttrServerAddress returns an optional attribute for the "server.address"
// semantic convention. It represents the name of the database host.
func (CosmosDBClientActiveInstanceCountObservable) AttrServerAddress(val string) attribute.KeyValue {
return attribute.String("server.address", val)
}
// CosmosDBClientOperationRequestCharge is an instrument used to record metric
// values conforming to the "azure.cosmosdb.client.operation.request_charge"
// semantic conventions. It represents the [Request units] consumed by the
+237
View File
@@ -213,6 +213,66 @@ func (m PipelineRunActive) AddSet(ctx context.Context, incr int64, set attribute
m.Int64UpDownCounter.Add(ctx, incr, *o...)
}
// PipelineRunActiveObservable is an instrument used to record metric values
// conforming to the "cicd.pipeline.run.active" semantic conventions. It
// represents the number of pipeline runs currently active in the system by
// state.
type PipelineRunActiveObservable struct {
metric.Int64ObservableUpDownCounter
}
var newPipelineRunActiveObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("The number of pipeline runs currently active in the system by state."),
metric.WithUnit("{run}"),
}
// NewPipelineRunActiveObservable returns a new PipelineRunActiveObservable
// instrument.
func NewPipelineRunActiveObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (PipelineRunActiveObservable, error) {
// Check if the meter is nil.
if m == nil {
return PipelineRunActiveObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newPipelineRunActiveObservableOpts
} else {
opt = append(opt, newPipelineRunActiveObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"cicd.pipeline.run.active",
opt...,
)
if err != nil {
return PipelineRunActiveObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return PipelineRunActiveObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m PipelineRunActiveObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (PipelineRunActiveObservable) Name() string {
return "cicd.pipeline.run.active"
}
// Unit returns the semantic convention unit of the instrument
func (PipelineRunActiveObservable) Unit() string {
return "{run}"
}
// Description returns the semantic convention description of the instrument
func (PipelineRunActiveObservable) Description() string {
return "The number of pipeline runs currently active in the system by state."
}
// PipelineRunDuration is an instrument used to record metric values conforming
// to the "cicd.pipeline.run.duration" semantic conventions. It represents the
// duration of a pipeline run grouped by pipeline, state and result.
@@ -484,6 +544,66 @@ func (m PipelineRunErrors) AddSet(ctx context.Context, incr int64, set attribute
m.Int64Counter.Add(ctx, incr, *o...)
}
// PipelineRunErrorsObservable is an instrument used to record metric values
// conforming to the "cicd.pipeline.run.errors" semantic conventions. It
// represents the number of errors encountered in pipeline runs (eg. compile,
// test failures).
type PipelineRunErrorsObservable struct {
metric.Int64ObservableCounter
}
var newPipelineRunErrorsObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("The number of errors encountered in pipeline runs (eg. compile, test failures)."),
metric.WithUnit("{error}"),
}
// NewPipelineRunErrorsObservable returns a new PipelineRunErrorsObservable
// instrument.
func NewPipelineRunErrorsObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (PipelineRunErrorsObservable, error) {
// Check if the meter is nil.
if m == nil {
return PipelineRunErrorsObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newPipelineRunErrorsObservableOpts
} else {
opt = append(opt, newPipelineRunErrorsObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"cicd.pipeline.run.errors",
opt...,
)
if err != nil {
return PipelineRunErrorsObservable{noop.Int64ObservableCounter{}}, err
}
return PipelineRunErrorsObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m PipelineRunErrorsObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (PipelineRunErrorsObservable) Name() string {
return "cicd.pipeline.run.errors"
}
// Unit returns the semantic convention unit of the instrument
func (PipelineRunErrorsObservable) Unit() string {
return "{error}"
}
// Description returns the semantic convention description of the instrument
func (PipelineRunErrorsObservable) Description() string {
return "The number of errors encountered in pipeline runs (eg. compile, test failures)."
}
// SystemErrors is an instrument used to record metric values conforming to the
// "cicd.system.errors" semantic conventions. It represents the number of errors
// in a component of the CICD system (eg. controller, scheduler, agent).
@@ -611,6 +731,65 @@ func (m SystemErrors) AddSet(ctx context.Context, incr int64, set attribute.Set)
m.Int64Counter.Add(ctx, incr, *o...)
}
// SystemErrorsObservable is an instrument used to record metric values
// conforming to the "cicd.system.errors" semantic conventions. It represents the
// number of errors in a component of the CICD system (eg. controller, scheduler,
// agent).
type SystemErrorsObservable struct {
metric.Int64ObservableCounter
}
var newSystemErrorsObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("The number of errors in a component of the CICD system (eg. controller, scheduler, agent)."),
metric.WithUnit("{error}"),
}
// NewSystemErrorsObservable returns a new SystemErrorsObservable instrument.
func NewSystemErrorsObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (SystemErrorsObservable, error) {
// Check if the meter is nil.
if m == nil {
return SystemErrorsObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newSystemErrorsObservableOpts
} else {
opt = append(opt, newSystemErrorsObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"cicd.system.errors",
opt...,
)
if err != nil {
return SystemErrorsObservable{noop.Int64ObservableCounter{}}, err
}
return SystemErrorsObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m SystemErrorsObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (SystemErrorsObservable) Name() string {
return "cicd.system.errors"
}
// Unit returns the semantic convention unit of the instrument
func (SystemErrorsObservable) Unit() string {
return "{error}"
}
// Description returns the semantic convention description of the instrument
func (SystemErrorsObservable) Description() string {
return "The number of errors in a component of the CICD system (eg. controller, scheduler, agent)."
}
// WorkerCount is an instrument used to record metric values conforming to the
// "cicd.worker.count" semantic conventions. It represents the number of workers
// on the CICD system by state.
@@ -726,3 +905,61 @@ func (m WorkerCount) AddSet(ctx context.Context, incr int64, set attribute.Set)
*o = append(*o, metric.WithAttributeSet(set))
m.Int64UpDownCounter.Add(ctx, incr, *o...)
}
// WorkerCountObservable is an instrument used to record metric values conforming
// to the "cicd.worker.count" semantic conventions. It represents the number of
// workers on the CICD system by state.
type WorkerCountObservable struct {
metric.Int64ObservableUpDownCounter
}
var newWorkerCountObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("The number of workers on the CICD system by state."),
metric.WithUnit("{count}"),
}
// NewWorkerCountObservable returns a new WorkerCountObservable instrument.
func NewWorkerCountObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (WorkerCountObservable, error) {
// Check if the meter is nil.
if m == nil {
return WorkerCountObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newWorkerCountObservableOpts
} else {
opt = append(opt, newWorkerCountObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"cicd.worker.count",
opt...,
)
if err != nil {
return WorkerCountObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return WorkerCountObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m WorkerCountObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (WorkerCountObservable) Name() string {
return "cicd.worker.count"
}
// Unit returns the semantic convention unit of the instrument
func (WorkerCountObservable) Unit() string {
return "{count}"
}
// Description returns the semantic convention description of the instrument
func (WorkerCountObservable) Description() string {
return "The number of workers on the CICD system by state."
}
+809
View File
@@ -207,6 +207,72 @@ func (CPUTime) AttrCPUMode(val CPUModeAttr) attribute.KeyValue {
return attribute.String("cpu.mode", string(val))
}
// CPUTimeObservable is an instrument used to record metric values conforming to
// the "container.cpu.time" semantic conventions. It represents the total CPU
// time consumed.
type CPUTimeObservable struct {
metric.Float64ObservableCounter
}
var newCPUTimeObservableOpts = []metric.Float64ObservableCounterOption{
metric.WithDescription("Total CPU time consumed."),
metric.WithUnit("s"),
}
// NewCPUTimeObservable returns a new CPUTimeObservable instrument.
func NewCPUTimeObservable(
m metric.Meter,
opt ...metric.Float64ObservableCounterOption,
) (CPUTimeObservable, error) {
// Check if the meter is nil.
if m == nil {
return CPUTimeObservable{noop.Float64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newCPUTimeObservableOpts
} else {
opt = append(opt, newCPUTimeObservableOpts...)
}
i, err := m.Float64ObservableCounter(
"container.cpu.time",
opt...,
)
if err != nil {
return CPUTimeObservable{noop.Float64ObservableCounter{}}, err
}
return CPUTimeObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m CPUTimeObservable) Inst() metric.Float64ObservableCounter {
return m.Float64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (CPUTimeObservable) Name() string {
return "container.cpu.time"
}
// Unit returns the semantic convention unit of the instrument
func (CPUTimeObservable) Unit() string {
return "s"
}
// Description returns the semantic convention description of the instrument
func (CPUTimeObservable) Description() string {
return "Total CPU time consumed."
}
// AttrCPUMode returns an optional attribute for the "cpu.mode" semantic
// convention. It represents the CPU mode for this data point. A container's CPU
// metric SHOULD be characterized *either* by data points with no `mode` labels,
// *or only* data points with `mode` labels.
func (CPUTimeObservable) AttrCPUMode(val CPUModeAttr) attribute.KeyValue {
return attribute.String("cpu.mode", string(val))
}
// CPUUsage is an instrument used to record metric values conforming to the
// "container.cpu.usage" semantic conventions. It represents the container's CPU
// usage, measured in cpus. Range from 0 to the number of allocatable CPUs.
@@ -331,6 +397,72 @@ func (CPUUsage) AttrCPUMode(val CPUModeAttr) attribute.KeyValue {
return attribute.String("cpu.mode", string(val))
}
// CPUUsageObservable is an instrument used to record metric values conforming to
// the "container.cpu.usage" semantic conventions. It represents the container's
// CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs.
type CPUUsageObservable struct {
metric.Int64ObservableGauge
}
var newCPUUsageObservableOpts = []metric.Int64ObservableGaugeOption{
metric.WithDescription("Container's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs."),
metric.WithUnit("{cpu}"),
}
// NewCPUUsageObservable returns a new CPUUsageObservable instrument.
func NewCPUUsageObservable(
m metric.Meter,
opt ...metric.Int64ObservableGaugeOption,
) (CPUUsageObservable, error) {
// Check if the meter is nil.
if m == nil {
return CPUUsageObservable{noop.Int64ObservableGauge{}}, nil
}
if len(opt) == 0 {
opt = newCPUUsageObservableOpts
} else {
opt = append(opt, newCPUUsageObservableOpts...)
}
i, err := m.Int64ObservableGauge(
"container.cpu.usage",
opt...,
)
if err != nil {
return CPUUsageObservable{noop.Int64ObservableGauge{}}, err
}
return CPUUsageObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m CPUUsageObservable) Inst() metric.Int64ObservableGauge {
return m.Int64ObservableGauge
}
// Name returns the semantic convention name of the instrument.
func (CPUUsageObservable) Name() string {
return "container.cpu.usage"
}
// Unit returns the semantic convention unit of the instrument
func (CPUUsageObservable) Unit() string {
return "{cpu}"
}
// Description returns the semantic convention description of the instrument
func (CPUUsageObservable) Description() string {
return "Container's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs."
}
// AttrCPUMode returns an optional attribute for the "cpu.mode" semantic
// convention. It represents the CPU mode for this data point. A container's CPU
// metric SHOULD be characterized *either* by data points with no `mode` labels,
// *or only* data points with `mode` labels.
func (CPUUsageObservable) AttrCPUMode(val CPUModeAttr) attribute.KeyValue {
return attribute.String("cpu.mode", string(val))
}
// DiskIO is an instrument used to record metric values conforming to the
// "container.disk.io" semantic conventions. It represents the disk bytes for the
// container.
@@ -459,6 +591,76 @@ func (DiskIO) AttrSystemDevice(val string) attribute.KeyValue {
return attribute.String("system.device", val)
}
// DiskIOObservable is an instrument used to record metric values conforming to
// the "container.disk.io" semantic conventions. It represents the disk bytes for
// the container.
type DiskIOObservable struct {
metric.Int64ObservableCounter
}
var newDiskIOObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("Disk bytes for the container."),
metric.WithUnit("By"),
}
// NewDiskIOObservable returns a new DiskIOObservable instrument.
func NewDiskIOObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (DiskIOObservable, error) {
// Check if the meter is nil.
if m == nil {
return DiskIOObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newDiskIOObservableOpts
} else {
opt = append(opt, newDiskIOObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"container.disk.io",
opt...,
)
if err != nil {
return DiskIOObservable{noop.Int64ObservableCounter{}}, err
}
return DiskIOObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m DiskIOObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (DiskIOObservable) Name() string {
return "container.disk.io"
}
// Unit returns the semantic convention unit of the instrument
func (DiskIOObservable) Unit() string {
return "By"
}
// Description returns the semantic convention description of the instrument
func (DiskIOObservable) Description() string {
return "Disk bytes for the container."
}
// AttrDiskIODirection returns an optional attribute for the "disk.io.direction"
// semantic convention. It represents the disk IO operation direction.
func (DiskIOObservable) AttrDiskIODirection(val DiskIODirectionAttr) attribute.KeyValue {
return attribute.String("disk.io.direction", string(val))
}
// AttrSystemDevice returns an optional attribute for the "system.device"
// semantic convention. It represents the device identifier.
func (DiskIOObservable) AttrSystemDevice(val string) attribute.KeyValue {
return attribute.String("system.device", val)
}
// FilesystemAvailable is an instrument used to record metric values conforming
// to the "container.filesystem.available" semantic conventions. It represents
// the container filesystem available bytes.
@@ -573,6 +775,65 @@ func (m FilesystemAvailable) AddSet(ctx context.Context, incr int64, set attribu
m.Int64UpDownCounter.Add(ctx, incr, *o...)
}
// FilesystemAvailableObservable is an instrument used to record metric values
// conforming to the "container.filesystem.available" semantic conventions. It
// represents the container filesystem available bytes.
type FilesystemAvailableObservable struct {
metric.Int64ObservableUpDownCounter
}
var newFilesystemAvailableObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("Container filesystem available bytes."),
metric.WithUnit("By"),
}
// NewFilesystemAvailableObservable returns a new FilesystemAvailableObservable
// instrument.
func NewFilesystemAvailableObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (FilesystemAvailableObservable, error) {
// Check if the meter is nil.
if m == nil {
return FilesystemAvailableObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newFilesystemAvailableObservableOpts
} else {
opt = append(opt, newFilesystemAvailableObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"container.filesystem.available",
opt...,
)
if err != nil {
return FilesystemAvailableObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return FilesystemAvailableObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m FilesystemAvailableObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (FilesystemAvailableObservable) Name() string {
return "container.filesystem.available"
}
// Unit returns the semantic convention unit of the instrument
func (FilesystemAvailableObservable) Unit() string {
return "By"
}
// Description returns the semantic convention description of the instrument
func (FilesystemAvailableObservable) Description() string {
return "Container filesystem available bytes."
}
// FilesystemCapacity is an instrument used to record metric values conforming to
// the "container.filesystem.capacity" semantic conventions. It represents the
// container filesystem capacity.
@@ -687,6 +948,65 @@ func (m FilesystemCapacity) AddSet(ctx context.Context, incr int64, set attribut
m.Int64UpDownCounter.Add(ctx, incr, *o...)
}
// FilesystemCapacityObservable is an instrument used to record metric values
// conforming to the "container.filesystem.capacity" semantic conventions. It
// represents the container filesystem capacity.
type FilesystemCapacityObservable struct {
metric.Int64ObservableUpDownCounter
}
var newFilesystemCapacityObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("Container filesystem capacity."),
metric.WithUnit("By"),
}
// NewFilesystemCapacityObservable returns a new FilesystemCapacityObservable
// instrument.
func NewFilesystemCapacityObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (FilesystemCapacityObservable, error) {
// Check if the meter is nil.
if m == nil {
return FilesystemCapacityObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newFilesystemCapacityObservableOpts
} else {
opt = append(opt, newFilesystemCapacityObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"container.filesystem.capacity",
opt...,
)
if err != nil {
return FilesystemCapacityObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return FilesystemCapacityObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m FilesystemCapacityObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (FilesystemCapacityObservable) Name() string {
return "container.filesystem.capacity"
}
// Unit returns the semantic convention unit of the instrument
func (FilesystemCapacityObservable) Unit() string {
return "By"
}
// Description returns the semantic convention description of the instrument
func (FilesystemCapacityObservable) Description() string {
return "Container filesystem capacity."
}
// FilesystemUsage is an instrument used to record metric values conforming to
// the "container.filesystem.usage" semantic conventions. It represents the
// container filesystem usage.
@@ -805,6 +1125,65 @@ func (m FilesystemUsage) AddSet(ctx context.Context, incr int64, set attribute.S
m.Int64UpDownCounter.Add(ctx, incr, *o...)
}
// FilesystemUsageObservable is an instrument used to record metric values
// conforming to the "container.filesystem.usage" semantic conventions. It
// represents the container filesystem usage.
type FilesystemUsageObservable struct {
metric.Int64ObservableUpDownCounter
}
var newFilesystemUsageObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("Container filesystem usage."),
metric.WithUnit("By"),
}
// NewFilesystemUsageObservable returns a new FilesystemUsageObservable
// instrument.
func NewFilesystemUsageObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (FilesystemUsageObservable, error) {
// Check if the meter is nil.
if m == nil {
return FilesystemUsageObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newFilesystemUsageObservableOpts
} else {
opt = append(opt, newFilesystemUsageObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"container.filesystem.usage",
opt...,
)
if err != nil {
return FilesystemUsageObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return FilesystemUsageObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m FilesystemUsageObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (FilesystemUsageObservable) Name() string {
return "container.filesystem.usage"
}
// Unit returns the semantic convention unit of the instrument
func (FilesystemUsageObservable) Unit() string {
return "By"
}
// Description returns the semantic convention description of the instrument
func (FilesystemUsageObservable) Description() string {
return "Container filesystem usage."
}
// MemoryAvailable is an instrument used to record metric values conforming to
// the "container.memory.available" semantic conventions. It represents the
// container memory available.
@@ -927,6 +1306,65 @@ func (m MemoryAvailable) AddSet(ctx context.Context, incr int64, set attribute.S
m.Int64UpDownCounter.Add(ctx, incr, *o...)
}
// MemoryAvailableObservable is an instrument used to record metric values
// conforming to the "container.memory.available" semantic conventions. It
// represents the container memory available.
type MemoryAvailableObservable struct {
metric.Int64ObservableUpDownCounter
}
var newMemoryAvailableObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("Container memory available."),
metric.WithUnit("By"),
}
// NewMemoryAvailableObservable returns a new MemoryAvailableObservable
// instrument.
func NewMemoryAvailableObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (MemoryAvailableObservable, error) {
// Check if the meter is nil.
if m == nil {
return MemoryAvailableObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newMemoryAvailableObservableOpts
} else {
opt = append(opt, newMemoryAvailableObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"container.memory.available",
opt...,
)
if err != nil {
return MemoryAvailableObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return MemoryAvailableObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m MemoryAvailableObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (MemoryAvailableObservable) Name() string {
return "container.memory.available"
}
// Unit returns the semantic convention unit of the instrument
func (MemoryAvailableObservable) Unit() string {
return "By"
}
// Description returns the semantic convention description of the instrument
func (MemoryAvailableObservable) Description() string {
return "Container memory available."
}
// MemoryPagingFaults is an instrument used to record metric values conforming to
// the "container.memory.paging.faults" semantic conventions. It represents the
// container memory paging faults.
@@ -1070,6 +1508,72 @@ func (MemoryPagingFaults) AttrSystemPagingFaultType(val SystemPagingFaultTypeAtt
return attribute.String("system.paging.fault.type", string(val))
}
// MemoryPagingFaultsObservable is an instrument used to record metric values
// conforming to the "container.memory.paging.faults" semantic conventions. It
// represents the container memory paging faults.
type MemoryPagingFaultsObservable struct {
metric.Int64ObservableCounter
}
var newMemoryPagingFaultsObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("Container memory paging faults."),
metric.WithUnit("{fault}"),
}
// NewMemoryPagingFaultsObservable returns a new MemoryPagingFaultsObservable
// instrument.
func NewMemoryPagingFaultsObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (MemoryPagingFaultsObservable, error) {
// Check if the meter is nil.
if m == nil {
return MemoryPagingFaultsObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newMemoryPagingFaultsObservableOpts
} else {
opt = append(opt, newMemoryPagingFaultsObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"container.memory.paging.faults",
opt...,
)
if err != nil {
return MemoryPagingFaultsObservable{noop.Int64ObservableCounter{}}, err
}
return MemoryPagingFaultsObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m MemoryPagingFaultsObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (MemoryPagingFaultsObservable) Name() string {
return "container.memory.paging.faults"
}
// Unit returns the semantic convention unit of the instrument
func (MemoryPagingFaultsObservable) Unit() string {
return "{fault}"
}
// Description returns the semantic convention description of the instrument
func (MemoryPagingFaultsObservable) Description() string {
return "Container memory paging faults."
}
// AttrSystemPagingFaultType returns an optional attribute for the
// "system.paging.fault.type" semantic convention. It represents the paging fault
// type.
func (MemoryPagingFaultsObservable) AttrSystemPagingFaultType(val SystemPagingFaultTypeAttr) attribute.KeyValue {
return attribute.String("system.paging.fault.type", string(val))
}
// MemoryRss is an instrument used to record metric values conforming to the
// "container.memory.rss" semantic conventions. It represents the container
// memory RSS.
@@ -1186,6 +1690,64 @@ func (m MemoryRss) AddSet(ctx context.Context, incr int64, set attribute.Set) {
m.Int64UpDownCounter.Add(ctx, incr, *o...)
}
// MemoryRssObservable is an instrument used to record metric values conforming
// to the "container.memory.rss" semantic conventions. It represents the
// container memory RSS.
type MemoryRssObservable struct {
metric.Int64ObservableUpDownCounter
}
var newMemoryRssObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("Container memory RSS."),
metric.WithUnit("By"),
}
// NewMemoryRssObservable returns a new MemoryRssObservable instrument.
func NewMemoryRssObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (MemoryRssObservable, error) {
// Check if the meter is nil.
if m == nil {
return MemoryRssObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newMemoryRssObservableOpts
} else {
opt = append(opt, newMemoryRssObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"container.memory.rss",
opt...,
)
if err != nil {
return MemoryRssObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return MemoryRssObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m MemoryRssObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (MemoryRssObservable) Name() string {
return "container.memory.rss"
}
// Unit returns the semantic convention unit of the instrument
func (MemoryRssObservable) Unit() string {
return "By"
}
// Description returns the semantic convention description of the instrument
func (MemoryRssObservable) Description() string {
return "Container memory RSS."
}
// MemoryUsage is an instrument used to record metric values conforming to the
// "container.memory.usage" semantic conventions. It represents the memory usage
// of the container.
@@ -1288,6 +1850,64 @@ func (m MemoryUsage) AddSet(ctx context.Context, incr int64, set attribute.Set)
m.Int64Counter.Add(ctx, incr, *o...)
}
// MemoryUsageObservable is an instrument used to record metric values conforming
// to the "container.memory.usage" semantic conventions. It represents the memory
// usage of the container.
type MemoryUsageObservable struct {
metric.Int64ObservableCounter
}
var newMemoryUsageObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("Memory usage of the container."),
metric.WithUnit("By"),
}
// NewMemoryUsageObservable returns a new MemoryUsageObservable instrument.
func NewMemoryUsageObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (MemoryUsageObservable, error) {
// Check if the meter is nil.
if m == nil {
return MemoryUsageObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newMemoryUsageObservableOpts
} else {
opt = append(opt, newMemoryUsageObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"container.memory.usage",
opt...,
)
if err != nil {
return MemoryUsageObservable{noop.Int64ObservableCounter{}}, err
}
return MemoryUsageObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m MemoryUsageObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (MemoryUsageObservable) Name() string {
return "container.memory.usage"
}
// Unit returns the semantic convention unit of the instrument
func (MemoryUsageObservable) Unit() string {
return "By"
}
// Description returns the semantic convention description of the instrument
func (MemoryUsageObservable) Description() string {
return "Memory usage of the container."
}
// MemoryWorkingSet is an instrument used to record metric values conforming to
// the "container.memory.working_set" semantic conventions. It represents the
// container memory working set.
@@ -1404,6 +2024,65 @@ func (m MemoryWorkingSet) AddSet(ctx context.Context, incr int64, set attribute.
m.Int64UpDownCounter.Add(ctx, incr, *o...)
}
// MemoryWorkingSetObservable is an instrument used to record metric values
// conforming to the "container.memory.working_set" semantic conventions. It
// represents the container memory working set.
type MemoryWorkingSetObservable struct {
metric.Int64ObservableUpDownCounter
}
var newMemoryWorkingSetObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("Container memory working set."),
metric.WithUnit("By"),
}
// NewMemoryWorkingSetObservable returns a new MemoryWorkingSetObservable
// instrument.
func NewMemoryWorkingSetObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (MemoryWorkingSetObservable, error) {
// Check if the meter is nil.
if m == nil {
return MemoryWorkingSetObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newMemoryWorkingSetObservableOpts
} else {
opt = append(opt, newMemoryWorkingSetObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"container.memory.working_set",
opt...,
)
if err != nil {
return MemoryWorkingSetObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return MemoryWorkingSetObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m MemoryWorkingSetObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (MemoryWorkingSetObservable) Name() string {
return "container.memory.working_set"
}
// Unit returns the semantic convention unit of the instrument
func (MemoryWorkingSetObservable) Unit() string {
return "By"
}
// Description returns the semantic convention description of the instrument
func (MemoryWorkingSetObservable) Description() string {
return "Container memory working set."
}
// NetworkIO is an instrument used to record metric values conforming to the
// "container.network.io" semantic conventions. It represents the network bytes
// for the container.
@@ -1532,6 +2211,78 @@ func (NetworkIO) AttrNetworkIODirection(val NetworkIODirectionAttr) attribute.Ke
return attribute.String("network.io.direction", string(val))
}
// NetworkIOObservable is an instrument used to record metric values conforming
// to the "container.network.io" semantic conventions. It represents the network
// bytes for the container.
type NetworkIOObservable struct {
metric.Int64ObservableCounter
}
var newNetworkIOObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("Network bytes for the container."),
metric.WithUnit("By"),
}
// NewNetworkIOObservable returns a new NetworkIOObservable instrument.
func NewNetworkIOObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (NetworkIOObservable, error) {
// Check if the meter is nil.
if m == nil {
return NetworkIOObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newNetworkIOObservableOpts
} else {
opt = append(opt, newNetworkIOObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"container.network.io",
opt...,
)
if err != nil {
return NetworkIOObservable{noop.Int64ObservableCounter{}}, err
}
return NetworkIOObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m NetworkIOObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (NetworkIOObservable) Name() string {
return "container.network.io"
}
// Unit returns the semantic convention unit of the instrument
func (NetworkIOObservable) Unit() string {
return "By"
}
// Description returns the semantic convention description of the instrument
func (NetworkIOObservable) Description() string {
return "Network bytes for the container."
}
// AttrNetworkInterfaceName returns an optional attribute for the
// "network.interface.name" semantic convention. It represents the network
// interface name.
func (NetworkIOObservable) AttrNetworkInterfaceName(val string) attribute.KeyValue {
return attribute.String("network.interface.name", val)
}
// AttrNetworkIODirection returns an optional attribute for the
// "network.io.direction" semantic convention. It represents the network IO
// operation direction.
func (NetworkIOObservable) AttrNetworkIODirection(val NetworkIODirectionAttr) attribute.KeyValue {
return attribute.String("network.io.direction", string(val))
}
// Uptime is an instrument used to record metric values conforming to the
// "container.uptime" semantic conventions. It represents the time the container
// has been running.
@@ -1637,3 +2388,61 @@ func (m Uptime) RecordSet(ctx context.Context, val float64, set attribute.Set) {
*o = append(*o, metric.WithAttributeSet(set))
m.Float64Gauge.Record(ctx, val, *o...)
}
// UptimeObservable is an instrument used to record metric values conforming to
// the "container.uptime" semantic conventions. It represents the time the
// container has been running.
type UptimeObservable struct {
metric.Float64ObservableGauge
}
var newUptimeObservableOpts = []metric.Float64ObservableGaugeOption{
metric.WithDescription("The time the container has been running."),
metric.WithUnit("s"),
}
// NewUptimeObservable returns a new UptimeObservable instrument.
func NewUptimeObservable(
m metric.Meter,
opt ...metric.Float64ObservableGaugeOption,
) (UptimeObservable, error) {
// Check if the meter is nil.
if m == nil {
return UptimeObservable{noop.Float64ObservableGauge{}}, nil
}
if len(opt) == 0 {
opt = newUptimeObservableOpts
} else {
opt = append(opt, newUptimeObservableOpts...)
}
i, err := m.Float64ObservableGauge(
"container.uptime",
opt...,
)
if err != nil {
return UptimeObservable{noop.Float64ObservableGauge{}}, err
}
return UptimeObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m UptimeObservable) Inst() metric.Float64ObservableGauge {
return m.Float64ObservableGauge
}
// Name returns the semantic convention name of the instrument.
func (UptimeObservable) Name() string {
return "container.uptime"
}
// Unit returns the semantic convention unit of the instrument
func (UptimeObservable) Unit() string {
return "s"
}
// Description returns the semantic convention description of the instrument
func (UptimeObservable) Description() string {
return "The time the container has been running."
}
+357
View File
@@ -344,6 +344,66 @@ func (m ClientConnectionCount) AddSet(ctx context.Context, incr int64, set attri
m.Int64UpDownCounter.Add(ctx, incr, *o...)
}
// ClientConnectionCountObservable is an instrument used to record metric values
// conforming to the "db.client.connection.count" semantic conventions. It
// represents the number of connections that are currently in state described by
// the `state` attribute.
type ClientConnectionCountObservable struct {
metric.Int64ObservableUpDownCounter
}
var newClientConnectionCountObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("The number of connections that are currently in state described by the `state` attribute."),
metric.WithUnit("{connection}"),
}
// NewClientConnectionCountObservable returns a new
// ClientConnectionCountObservable instrument.
func NewClientConnectionCountObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (ClientConnectionCountObservable, error) {
// Check if the meter is nil.
if m == nil {
return ClientConnectionCountObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newClientConnectionCountObservableOpts
} else {
opt = append(opt, newClientConnectionCountObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"db.client.connection.count",
opt...,
)
if err != nil {
return ClientConnectionCountObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return ClientConnectionCountObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m ClientConnectionCountObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (ClientConnectionCountObservable) Name() string {
return "db.client.connection.count"
}
// Unit returns the semantic convention unit of the instrument
func (ClientConnectionCountObservable) Unit() string {
return "{connection}"
}
// Description returns the semantic convention description of the instrument
func (ClientConnectionCountObservable) Description() string {
return "The number of connections that are currently in state described by the `state` attribute."
}
// ClientConnectionCreateTime is an instrument used to record metric values
// conforming to the "db.client.connection.create_time" semantic conventions. It
// represents the time it took to create a new connection.
@@ -589,6 +649,65 @@ func (m ClientConnectionIdleMax) AddSet(ctx context.Context, incr int64, set att
m.Int64UpDownCounter.Add(ctx, incr, *o...)
}
// ClientConnectionIdleMaxObservable is an instrument used to record metric
// values conforming to the "db.client.connection.idle.max" semantic conventions.
// It represents the maximum number of idle open connections allowed.
type ClientConnectionIdleMaxObservable struct {
metric.Int64ObservableUpDownCounter
}
var newClientConnectionIdleMaxObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("The maximum number of idle open connections allowed."),
metric.WithUnit("{connection}"),
}
// NewClientConnectionIdleMaxObservable returns a new
// ClientConnectionIdleMaxObservable instrument.
func NewClientConnectionIdleMaxObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (ClientConnectionIdleMaxObservable, error) {
// Check if the meter is nil.
if m == nil {
return ClientConnectionIdleMaxObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newClientConnectionIdleMaxObservableOpts
} else {
opt = append(opt, newClientConnectionIdleMaxObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"db.client.connection.idle.max",
opt...,
)
if err != nil {
return ClientConnectionIdleMaxObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return ClientConnectionIdleMaxObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m ClientConnectionIdleMaxObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (ClientConnectionIdleMaxObservable) Name() string {
return "db.client.connection.idle.max"
}
// Unit returns the semantic convention unit of the instrument
func (ClientConnectionIdleMaxObservable) Unit() string {
return "{connection}"
}
// Description returns the semantic convention description of the instrument
func (ClientConnectionIdleMaxObservable) Description() string {
return "The maximum number of idle open connections allowed."
}
// ClientConnectionIdleMin is an instrument used to record metric values
// conforming to the "db.client.connection.idle.min" semantic conventions. It
// represents the minimum number of idle open connections allowed.
@@ -711,6 +830,65 @@ func (m ClientConnectionIdleMin) AddSet(ctx context.Context, incr int64, set att
m.Int64UpDownCounter.Add(ctx, incr, *o...)
}
// ClientConnectionIdleMinObservable is an instrument used to record metric
// values conforming to the "db.client.connection.idle.min" semantic conventions.
// It represents the minimum number of idle open connections allowed.
type ClientConnectionIdleMinObservable struct {
metric.Int64ObservableUpDownCounter
}
var newClientConnectionIdleMinObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("The minimum number of idle open connections allowed."),
metric.WithUnit("{connection}"),
}
// NewClientConnectionIdleMinObservable returns a new
// ClientConnectionIdleMinObservable instrument.
func NewClientConnectionIdleMinObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (ClientConnectionIdleMinObservable, error) {
// Check if the meter is nil.
if m == nil {
return ClientConnectionIdleMinObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newClientConnectionIdleMinObservableOpts
} else {
opt = append(opt, newClientConnectionIdleMinObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"db.client.connection.idle.min",
opt...,
)
if err != nil {
return ClientConnectionIdleMinObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return ClientConnectionIdleMinObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m ClientConnectionIdleMinObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (ClientConnectionIdleMinObservable) Name() string {
return "db.client.connection.idle.min"
}
// Unit returns the semantic convention unit of the instrument
func (ClientConnectionIdleMinObservable) Unit() string {
return "{connection}"
}
// Description returns the semantic convention description of the instrument
func (ClientConnectionIdleMinObservable) Description() string {
return "The minimum number of idle open connections allowed."
}
// ClientConnectionMax is an instrument used to record metric values conforming
// to the "db.client.connection.max" semantic conventions. It represents the
// maximum number of open connections allowed.
@@ -833,6 +1011,65 @@ func (m ClientConnectionMax) AddSet(ctx context.Context, incr int64, set attribu
m.Int64UpDownCounter.Add(ctx, incr, *o...)
}
// ClientConnectionMaxObservable is an instrument used to record metric values
// conforming to the "db.client.connection.max" semantic conventions. It
// represents the maximum number of open connections allowed.
type ClientConnectionMaxObservable struct {
metric.Int64ObservableUpDownCounter
}
var newClientConnectionMaxObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("The maximum number of open connections allowed."),
metric.WithUnit("{connection}"),
}
// NewClientConnectionMaxObservable returns a new ClientConnectionMaxObservable
// instrument.
func NewClientConnectionMaxObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (ClientConnectionMaxObservable, error) {
// Check if the meter is nil.
if m == nil {
return ClientConnectionMaxObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newClientConnectionMaxObservableOpts
} else {
opt = append(opt, newClientConnectionMaxObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"db.client.connection.max",
opt...,
)
if err != nil {
return ClientConnectionMaxObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return ClientConnectionMaxObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m ClientConnectionMaxObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (ClientConnectionMaxObservable) Name() string {
return "db.client.connection.max"
}
// Unit returns the semantic convention unit of the instrument
func (ClientConnectionMaxObservable) Unit() string {
return "{connection}"
}
// Description returns the semantic convention description of the instrument
func (ClientConnectionMaxObservable) Description() string {
return "The maximum number of open connections allowed."
}
// ClientConnectionPendingRequests is an instrument used to record metric values
// conforming to the "db.client.connection.pending_requests" semantic
// conventions. It represents the number of current pending requests for an open
@@ -957,6 +1194,66 @@ func (m ClientConnectionPendingRequests) AddSet(ctx context.Context, incr int64,
m.Int64UpDownCounter.Add(ctx, incr, *o...)
}
// ClientConnectionPendingRequestsObservable is an instrument used to record
// metric values conforming to the "db.client.connection.pending_requests"
// semantic conventions. It represents the number of current pending requests for
// an open connection.
type ClientConnectionPendingRequestsObservable struct {
metric.Int64ObservableUpDownCounter
}
var newClientConnectionPendingRequestsObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("The number of current pending requests for an open connection."),
metric.WithUnit("{request}"),
}
// NewClientConnectionPendingRequestsObservable returns a new
// ClientConnectionPendingRequestsObservable instrument.
func NewClientConnectionPendingRequestsObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (ClientConnectionPendingRequestsObservable, error) {
// Check if the meter is nil.
if m == nil {
return ClientConnectionPendingRequestsObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newClientConnectionPendingRequestsObservableOpts
} else {
opt = append(opt, newClientConnectionPendingRequestsObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"db.client.connection.pending_requests",
opt...,
)
if err != nil {
return ClientConnectionPendingRequestsObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return ClientConnectionPendingRequestsObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m ClientConnectionPendingRequestsObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (ClientConnectionPendingRequestsObservable) Name() string {
return "db.client.connection.pending_requests"
}
// Unit returns the semantic convention unit of the instrument
func (ClientConnectionPendingRequestsObservable) Unit() string {
return "{request}"
}
// Description returns the semantic convention description of the instrument
func (ClientConnectionPendingRequestsObservable) Description() string {
return "The number of current pending requests for an open connection."
}
// ClientConnectionTimeouts is an instrument used to record metric values
// conforming to the "db.client.connection.timeouts" semantic conventions. It
// represents the number of connection timeouts that have occurred trying to
@@ -1080,6 +1377,66 @@ func (m ClientConnectionTimeouts) AddSet(ctx context.Context, incr int64, set at
m.Int64Counter.Add(ctx, incr, *o...)
}
// ClientConnectionTimeoutsObservable is an instrument used to record metric
// values conforming to the "db.client.connection.timeouts" semantic conventions.
// It represents the number of connection timeouts that have occurred trying to
// obtain a connection from the pool.
type ClientConnectionTimeoutsObservable struct {
metric.Int64ObservableCounter
}
var newClientConnectionTimeoutsObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("The number of connection timeouts that have occurred trying to obtain a connection from the pool."),
metric.WithUnit("{timeout}"),
}
// NewClientConnectionTimeoutsObservable returns a new
// ClientConnectionTimeoutsObservable instrument.
func NewClientConnectionTimeoutsObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (ClientConnectionTimeoutsObservable, error) {
// Check if the meter is nil.
if m == nil {
return ClientConnectionTimeoutsObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newClientConnectionTimeoutsObservableOpts
} else {
opt = append(opt, newClientConnectionTimeoutsObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"db.client.connection.timeouts",
opt...,
)
if err != nil {
return ClientConnectionTimeoutsObservable{noop.Int64ObservableCounter{}}, err
}
return ClientConnectionTimeoutsObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m ClientConnectionTimeoutsObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (ClientConnectionTimeoutsObservable) Name() string {
return "db.client.connection.timeouts"
}
// Unit returns the semantic convention unit of the instrument
func (ClientConnectionTimeoutsObservable) Unit() string {
return "{timeout}"
}
// Description returns the semantic convention description of the instrument
func (ClientConnectionTimeoutsObservable) Description() string {
return "The number of connection timeouts that have occurred trying to obtain a connection from the pool."
}
// ClientConnectionUseTime is an instrument used to record metric values
// conforming to the "db.client.connection.use_time" semantic conventions. It
// represents the time between borrowing a connection and returning it to the
+260
View File
@@ -158,6 +158,71 @@ func (Coldstarts) AttrTrigger(val TriggerAttr) attribute.KeyValue {
return attribute.String("faas.trigger", string(val))
}
// ColdstartsObservable is an instrument used to record metric values conforming
// to the "faas.coldstarts" semantic conventions. It represents the number of
// invocation cold starts.
type ColdstartsObservable struct {
metric.Int64ObservableCounter
}
var newColdstartsObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("Number of invocation cold starts."),
metric.WithUnit("{coldstart}"),
}
// NewColdstartsObservable returns a new ColdstartsObservable instrument.
func NewColdstartsObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (ColdstartsObservable, error) {
// Check if the meter is nil.
if m == nil {
return ColdstartsObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newColdstartsObservableOpts
} else {
opt = append(opt, newColdstartsObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"faas.coldstarts",
opt...,
)
if err != nil {
return ColdstartsObservable{noop.Int64ObservableCounter{}}, err
}
return ColdstartsObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m ColdstartsObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (ColdstartsObservable) Name() string {
return "faas.coldstarts"
}
// Unit returns the semantic convention unit of the instrument
func (ColdstartsObservable) Unit() string {
return "{coldstart}"
}
// Description returns the semantic convention description of the instrument
func (ColdstartsObservable) Description() string {
return "Number of invocation cold starts."
}
// AttrTrigger returns an optional attribute for the "faas.trigger" semantic
// convention. It represents the type of the trigger which caused this function
// invocation.
func (ColdstartsObservable) AttrTrigger(val TriggerAttr) attribute.KeyValue {
return attribute.String("faas.trigger", string(val))
}
// 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.
@@ -392,6 +457,71 @@ func (Errors) AttrTrigger(val TriggerAttr) attribute.KeyValue {
return attribute.String("faas.trigger", string(val))
}
// ErrorsObservable is an instrument used to record metric values conforming to
// the "faas.errors" semantic conventions. It represents the number of invocation
// errors.
type ErrorsObservable struct {
metric.Int64ObservableCounter
}
var newErrorsObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("Number of invocation errors."),
metric.WithUnit("{error}"),
}
// NewErrorsObservable returns a new ErrorsObservable instrument.
func NewErrorsObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (ErrorsObservable, error) {
// Check if the meter is nil.
if m == nil {
return ErrorsObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newErrorsObservableOpts
} else {
opt = append(opt, newErrorsObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"faas.errors",
opt...,
)
if err != nil {
return ErrorsObservable{noop.Int64ObservableCounter{}}, err
}
return ErrorsObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m ErrorsObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (ErrorsObservable) Name() string {
return "faas.errors"
}
// Unit returns the semantic convention unit of the instrument
func (ErrorsObservable) Unit() string {
return "{error}"
}
// Description returns the semantic convention description of the instrument
func (ErrorsObservable) Description() string {
return "Number of invocation errors."
}
// AttrTrigger returns an optional attribute for the "faas.trigger" semantic
// convention. It represents the type of the trigger which caused this function
// invocation.
func (ErrorsObservable) AttrTrigger(val TriggerAttr) attribute.KeyValue {
return attribute.String("faas.trigger", string(val))
}
// 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.
@@ -626,6 +756,71 @@ func (Invocations) AttrTrigger(val TriggerAttr) attribute.KeyValue {
return attribute.String("faas.trigger", string(val))
}
// InvocationsObservable is an instrument used to record metric values conforming
// to the "faas.invocations" semantic conventions. It represents the number of
// successful invocations.
type InvocationsObservable struct {
metric.Int64ObservableCounter
}
var newInvocationsObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("Number of successful invocations."),
metric.WithUnit("{invocation}"),
}
// NewInvocationsObservable returns a new InvocationsObservable instrument.
func NewInvocationsObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (InvocationsObservable, error) {
// Check if the meter is nil.
if m == nil {
return InvocationsObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newInvocationsObservableOpts
} else {
opt = append(opt, newInvocationsObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"faas.invocations",
opt...,
)
if err != nil {
return InvocationsObservable{noop.Int64ObservableCounter{}}, err
}
return InvocationsObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m InvocationsObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (InvocationsObservable) Name() string {
return "faas.invocations"
}
// Unit returns the semantic convention unit of the instrument
func (InvocationsObservable) Unit() string {
return "{invocation}"
}
// Description returns the semantic convention description of the instrument
func (InvocationsObservable) Description() string {
return "Number of successful invocations."
}
// AttrTrigger returns an optional attribute for the "faas.trigger" semantic
// convention. It represents the type of the trigger which caused this function
// invocation.
func (InvocationsObservable) AttrTrigger(val TriggerAttr) attribute.KeyValue {
return attribute.String("faas.trigger", string(val))
}
// 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.
@@ -1093,3 +1288,68 @@ func (m Timeouts) AddSet(ctx context.Context, incr int64, set attribute.Set) {
func (Timeouts) AttrTrigger(val TriggerAttr) attribute.KeyValue {
return attribute.String("faas.trigger", string(val))
}
// TimeoutsObservable is an instrument used to record metric values conforming to
// the "faas.timeouts" semantic conventions. It represents the number of
// invocation timeouts.
type TimeoutsObservable struct {
metric.Int64ObservableCounter
}
var newTimeoutsObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("Number of invocation timeouts."),
metric.WithUnit("{timeout}"),
}
// NewTimeoutsObservable returns a new TimeoutsObservable instrument.
func NewTimeoutsObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (TimeoutsObservable, error) {
// Check if the meter is nil.
if m == nil {
return TimeoutsObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newTimeoutsObservableOpts
} else {
opt = append(opt, newTimeoutsObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"faas.timeouts",
opt...,
)
if err != nil {
return TimeoutsObservable{noop.Int64ObservableCounter{}}, err
}
return TimeoutsObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m TimeoutsObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (TimeoutsObservable) Name() string {
return "faas.timeouts"
}
// Unit returns the semantic convention unit of the instrument
func (TimeoutsObservable) Unit() string {
return "{timeout}"
}
// Description returns the semantic convention description of the instrument
func (TimeoutsObservable) Description() string {
return "Number of invocation timeouts."
}
// AttrTrigger returns an optional attribute for the "faas.trigger" semantic
// convention. It represents the type of the trigger which caused this function
// invocation.
func (TimeoutsObservable) AttrTrigger(val TriggerAttr) attribute.KeyValue {
return attribute.String("faas.trigger", string(val))
}
+123
View File
@@ -242,6 +242,71 @@ func (CPUTime) AttrCPUDetailedState(val string) attribute.KeyValue {
return attribute.String("go.cpu.detailed_state", val)
}
// CPUTimeObservable is an instrument used to record metric values conforming to
// the "go.cpu.time" semantic conventions. It represents the estimated CPU time
// spent by the Go runtime.
type CPUTimeObservable struct {
metric.Float64ObservableCounter
}
var newCPUTimeObservableOpts = []metric.Float64ObservableCounterOption{
metric.WithDescription("Estimated CPU time spent by the Go runtime."),
metric.WithUnit("s"),
}
// NewCPUTimeObservable returns a new CPUTimeObservable instrument.
func NewCPUTimeObservable(
m metric.Meter,
opt ...metric.Float64ObservableCounterOption,
) (CPUTimeObservable, error) {
// Check if the meter is nil.
if m == nil {
return CPUTimeObservable{noop.Float64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newCPUTimeObservableOpts
} else {
opt = append(opt, newCPUTimeObservableOpts...)
}
i, err := m.Float64ObservableCounter(
"go.cpu.time",
opt...,
)
if err != nil {
return CPUTimeObservable{noop.Float64ObservableCounter{}}, err
}
return CPUTimeObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m CPUTimeObservable) Inst() metric.Float64ObservableCounter {
return m.Float64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (CPUTimeObservable) Name() string {
return "go.cpu.time"
}
// Unit returns the semantic convention unit of the instrument
func (CPUTimeObservable) Unit() string {
return "s"
}
// Description returns the semantic convention description of the instrument
func (CPUTimeObservable) Description() string {
return "Estimated CPU time spent by the Go runtime."
}
// AttrCPUDetailedState returns an optional attribute for the
// "go.cpu.detailed_state" semantic convention. It represents the detailed state
// of the CPU.
func (CPUTimeObservable) AttrCPUDetailedState(val string) attribute.KeyValue {
return attribute.String("go.cpu.detailed_state", val)
}
// GoroutineCount is an instrument used to record metric values conforming to the
// "go.goroutine.count" semantic conventions. It represents the count of live
// goroutines.
@@ -518,6 +583,64 @@ func (m MemoryGCCycles) AddSet(ctx context.Context, incr int64, set attribute.Se
m.Int64Counter.Add(ctx, incr, *o...)
}
// MemoryGCCyclesObservable is an instrument used to record metric values
// conforming to the "go.memory.gc.cycles" semantic conventions. It represents
// the number of completed GC cycles.
type MemoryGCCyclesObservable struct {
metric.Int64ObservableCounter
}
var newMemoryGCCyclesObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("Number of completed GC cycles."),
metric.WithUnit("{gc_cycle}"),
}
// NewMemoryGCCyclesObservable returns a new MemoryGCCyclesObservable instrument.
func NewMemoryGCCyclesObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (MemoryGCCyclesObservable, error) {
// Check if the meter is nil.
if m == nil {
return MemoryGCCyclesObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newMemoryGCCyclesObservableOpts
} else {
opt = append(opt, newMemoryGCCyclesObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"go.memory.gc.cycles",
opt...,
)
if err != nil {
return MemoryGCCyclesObservable{noop.Int64ObservableCounter{}}, err
}
return MemoryGCCyclesObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m MemoryGCCyclesObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (MemoryGCCyclesObservable) Name() string {
return "go.memory.gc.cycles"
}
// Unit returns the semantic convention unit of the instrument
func (MemoryGCCyclesObservable) Unit() string {
return "{gc_cycle}"
}
// Description returns the semantic convention description of the instrument
func (MemoryGCCyclesObservable) Description() string {
return "Number of completed GC cycles."
}
// MemoryGCGoal is an instrument used to record metric values conforming to the
// "go.memory.gc.goal" semantic conventions. It represents the heap size target
// for the end of the GC cycle.
+239
View File
@@ -234,6 +234,89 @@ func (ClientActiveRequests) AttrURLScheme(val string) attribute.KeyValue {
return attribute.String("url.scheme", val)
}
// ClientActiveRequestsObservable is an instrument used to record metric values
// conforming to the "http.client.active_requests" semantic conventions. It
// represents the number of active HTTP requests.
type ClientActiveRequestsObservable struct {
metric.Int64ObservableUpDownCounter
}
var newClientActiveRequestsObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("Number of active HTTP requests."),
metric.WithUnit("{request}"),
}
// NewClientActiveRequestsObservable returns a new ClientActiveRequestsObservable
// instrument.
func NewClientActiveRequestsObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (ClientActiveRequestsObservable, error) {
// Check if the meter is nil.
if m == nil {
return ClientActiveRequestsObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newClientActiveRequestsObservableOpts
} else {
opt = append(opt, newClientActiveRequestsObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"http.client.active_requests",
opt...,
)
if err != nil {
return ClientActiveRequestsObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return ClientActiveRequestsObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m ClientActiveRequestsObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (ClientActiveRequestsObservable) Name() string {
return "http.client.active_requests"
}
// Unit returns the semantic convention unit of the instrument
func (ClientActiveRequestsObservable) Unit() string {
return "{request}"
}
// Description returns the semantic convention description of the instrument
func (ClientActiveRequestsObservable) Description() string {
return "Number of active HTTP requests."
}
// AttrURLTemplate returns an optional attribute for the "url.template" semantic
// convention. It represents the low-cardinality template of an
// [absolute path reference].
//
// [absolute path reference]: https://www.rfc-editor.org/rfc/rfc3986#section-4.2
func (ClientActiveRequestsObservable) AttrURLTemplate(val string) attribute.KeyValue {
return attribute.String("url.template", val)
}
// AttrRequestMethod returns an optional attribute for the "http.request.method"
// semantic convention. It represents the HTTP request method.
func (ClientActiveRequestsObservable) AttrRequestMethod(val RequestMethodAttr) attribute.KeyValue {
return attribute.String("http.request.method", string(val))
}
// AttrURLScheme returns an optional attribute for the "url.scheme" semantic
// convention. It represents the [URI scheme] component identifying the used
// protocol.
//
// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1
func (ClientActiveRequestsObservable) AttrURLScheme(val string) attribute.KeyValue {
return attribute.String("url.scheme", val)
}
// ClientConnectionDuration is an instrument used to record metric values
// conforming to the "http.client.connection.duration" semantic conventions. It
// represents the duration of the successfully established outbound HTTP
@@ -536,6 +619,89 @@ func (ClientOpenConnections) AttrURLScheme(val string) attribute.KeyValue {
return attribute.String("url.scheme", val)
}
// ClientOpenConnectionsObservable is an instrument used to record metric values
// conforming to the "http.client.open_connections" semantic conventions. It
// represents the number of outbound HTTP connections that are currently active
// or idle on the client.
type ClientOpenConnectionsObservable struct {
metric.Int64ObservableUpDownCounter
}
var newClientOpenConnectionsObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("Number of outbound HTTP connections that are currently active or idle on the client."),
metric.WithUnit("{connection}"),
}
// NewClientOpenConnectionsObservable returns a new
// ClientOpenConnectionsObservable instrument.
func NewClientOpenConnectionsObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (ClientOpenConnectionsObservable, error) {
// Check if the meter is nil.
if m == nil {
return ClientOpenConnectionsObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newClientOpenConnectionsObservableOpts
} else {
opt = append(opt, newClientOpenConnectionsObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"http.client.open_connections",
opt...,
)
if err != nil {
return ClientOpenConnectionsObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return ClientOpenConnectionsObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m ClientOpenConnectionsObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (ClientOpenConnectionsObservable) Name() string {
return "http.client.open_connections"
}
// Unit returns the semantic convention unit of the instrument
func (ClientOpenConnectionsObservable) Unit() string {
return "{connection}"
}
// Description returns the semantic convention description of the instrument
func (ClientOpenConnectionsObservable) Description() string {
return "Number of outbound HTTP connections that are currently active or idle on the client."
}
// AttrNetworkPeerAddress returns an optional attribute for the
// "network.peer.address" semantic convention. It represents the peer address of
// the network connection - IP address or Unix domain socket name.
func (ClientOpenConnectionsObservable) AttrNetworkPeerAddress(val string) attribute.KeyValue {
return attribute.String("network.peer.address", val)
}
// AttrNetworkProtocolVersion returns an optional attribute for the
// "network.protocol.version" semantic convention. It represents the actual
// version of the protocol used for network communication.
func (ClientOpenConnectionsObservable) AttrNetworkProtocolVersion(val string) attribute.KeyValue {
return attribute.String("network.protocol.version", val)
}
// AttrURLScheme returns an optional attribute for the "url.scheme" semantic
// convention. It represents the [URI scheme] component identifying the used
// protocol.
//
// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1
func (ClientOpenConnectionsObservable) AttrURLScheme(val string) attribute.KeyValue {
return attribute.String("url.scheme", val)
}
// ClientRequestBodySize is an instrument used to record metric values conforming
// to the "http.client.request.body.size" semantic conventions. It represents the
// size of HTTP client request bodies.
@@ -1241,6 +1407,79 @@ func (ServerActiveRequests) AttrServerPort(val int) attribute.KeyValue {
return attribute.Int("server.port", val)
}
// ServerActiveRequestsObservable is an instrument used to record metric values
// conforming to the "http.server.active_requests" semantic conventions. It
// represents the number of active HTTP server requests.
type ServerActiveRequestsObservable struct {
metric.Int64ObservableUpDownCounter
}
var newServerActiveRequestsObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("Number of active HTTP server requests."),
metric.WithUnit("{request}"),
}
// NewServerActiveRequestsObservable returns a new ServerActiveRequestsObservable
// instrument.
func NewServerActiveRequestsObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (ServerActiveRequestsObservable, error) {
// Check if the meter is nil.
if m == nil {
return ServerActiveRequestsObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newServerActiveRequestsObservableOpts
} else {
opt = append(opt, newServerActiveRequestsObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"http.server.active_requests",
opt...,
)
if err != nil {
return ServerActiveRequestsObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return ServerActiveRequestsObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m ServerActiveRequestsObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (ServerActiveRequestsObservable) Name() string {
return "http.server.active_requests"
}
// Unit returns the semantic convention unit of the instrument
func (ServerActiveRequestsObservable) Unit() string {
return "{request}"
}
// Description returns the semantic convention description of the instrument
func (ServerActiveRequestsObservable) Description() string {
return "Number of active HTTP server requests."
}
// AttrServerAddress returns an optional attribute for the "server.address"
// semantic convention. It represents the name of the local HTTP server that
// received the request.
func (ServerActiveRequestsObservable) AttrServerAddress(val string) attribute.KeyValue {
return attribute.String("server.address", val)
}
// AttrServerPort returns an optional attribute for the "server.port" semantic
// convention. It represents the port of the local HTTP server that received the
// request.
func (ServerActiveRequestsObservable) AttrServerPort(val int) attribute.KeyValue {
return attribute.Int("server.port", val)
}
// ServerRequestBodySize is an instrument used to record metric values conforming
// to the "http.server.request.body.size" semantic conventions. It represents the
// size of HTTP server request bodies.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+216
View File
@@ -282,6 +282,121 @@ func (ClientConsumedMessages) AttrServerPort(val int) attribute.KeyValue {
return attribute.Int("server.port", val)
}
// ClientConsumedMessagesObservable is an instrument used to record metric values
// conforming to the "messaging.client.consumed.messages" semantic conventions.
// It represents the number of messages that were delivered to the application.
type ClientConsumedMessagesObservable struct {
metric.Int64ObservableCounter
}
var newClientConsumedMessagesObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("Number of messages that were delivered to the application."),
metric.WithUnit("{message}"),
}
// NewClientConsumedMessagesObservable returns a new
// ClientConsumedMessagesObservable instrument.
func NewClientConsumedMessagesObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (ClientConsumedMessagesObservable, error) {
// Check if the meter is nil.
if m == nil {
return ClientConsumedMessagesObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newClientConsumedMessagesObservableOpts
} else {
opt = append(opt, newClientConsumedMessagesObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"messaging.client.consumed.messages",
opt...,
)
if err != nil {
return ClientConsumedMessagesObservable{noop.Int64ObservableCounter{}}, err
}
return ClientConsumedMessagesObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m ClientConsumedMessagesObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (ClientConsumedMessagesObservable) Name() string {
return "messaging.client.consumed.messages"
}
// Unit returns the semantic convention unit of the instrument
func (ClientConsumedMessagesObservable) Unit() string {
return "{message}"
}
// Description returns the semantic convention description of the instrument
func (ClientConsumedMessagesObservable) Description() string {
return "Number of messages that were delivered to the application."
}
// AttrErrorType returns an optional attribute for the "error.type" semantic
// convention. It represents the describes a class of error the operation ended
// with.
func (ClientConsumedMessagesObservable) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue {
return attribute.String("error.type", string(val))
}
// AttrConsumerGroupName returns an optional attribute for the
// "messaging.consumer.group.name" semantic convention. It represents the name of
// the consumer group with which a consumer is associated.
func (ClientConsumedMessagesObservable) AttrConsumerGroupName(val string) attribute.KeyValue {
return attribute.String("messaging.consumer.group.name", val)
}
// AttrDestinationName returns an optional attribute for the
// "messaging.destination.name" semantic convention. It represents the message
// destination name.
func (ClientConsumedMessagesObservable) AttrDestinationName(val string) attribute.KeyValue {
return attribute.String("messaging.destination.name", val)
}
// AttrDestinationSubscriptionName returns an optional attribute for the
// "messaging.destination.subscription.name" semantic convention. It represents
// the name of the destination subscription from which a message is consumed.
func (ClientConsumedMessagesObservable) AttrDestinationSubscriptionName(val string) attribute.KeyValue {
return attribute.String("messaging.destination.subscription.name", val)
}
// AttrDestinationTemplate returns an optional attribute for the
// "messaging.destination.template" semantic convention. It represents the low
// cardinality representation of the messaging destination name.
func (ClientConsumedMessagesObservable) AttrDestinationTemplate(val string) attribute.KeyValue {
return attribute.String("messaging.destination.template", val)
}
// AttrServerAddress returns an optional attribute for the "server.address"
// semantic convention. It represents the server domain name if available without
// reverse DNS lookup; otherwise, IP address or Unix domain socket name.
func (ClientConsumedMessagesObservable) AttrServerAddress(val string) attribute.KeyValue {
return attribute.String("server.address", val)
}
// AttrDestinationPartitionID returns an optional attribute for the
// "messaging.destination.partition.id" semantic convention. It represents the
// identifier of the partition messages are sent to or received from, unique
// within the `messaging.destination.name`.
func (ClientConsumedMessagesObservable) AttrDestinationPartitionID(val string) attribute.KeyValue {
return attribute.String("messaging.destination.partition.id", val)
}
// AttrServerPort returns an optional attribute for the "server.port" semantic
// convention. It represents the server port number.
func (ClientConsumedMessagesObservable) AttrServerPort(val int) attribute.KeyValue {
return attribute.Int("server.port", val)
}
// ClientOperationDuration is an instrument used to record metric values
// conforming to the "messaging.client.operation.duration" semantic conventions.
// It represents the duration of messaging operation initiated by a producer or
@@ -648,6 +763,107 @@ func (ClientSentMessages) AttrServerPort(val int) attribute.KeyValue {
return attribute.Int("server.port", val)
}
// ClientSentMessagesObservable is an instrument used to record metric values
// conforming to the "messaging.client.sent.messages" semantic conventions. It
// represents the number of messages producer attempted to send to the broker.
type ClientSentMessagesObservable struct {
metric.Int64ObservableCounter
}
var newClientSentMessagesObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("Number of messages producer attempted to send to the broker."),
metric.WithUnit("{message}"),
}
// NewClientSentMessagesObservable returns a new ClientSentMessagesObservable
// instrument.
func NewClientSentMessagesObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (ClientSentMessagesObservable, error) {
// Check if the meter is nil.
if m == nil {
return ClientSentMessagesObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newClientSentMessagesObservableOpts
} else {
opt = append(opt, newClientSentMessagesObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"messaging.client.sent.messages",
opt...,
)
if err != nil {
return ClientSentMessagesObservable{noop.Int64ObservableCounter{}}, err
}
return ClientSentMessagesObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m ClientSentMessagesObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (ClientSentMessagesObservable) Name() string {
return "messaging.client.sent.messages"
}
// Unit returns the semantic convention unit of the instrument
func (ClientSentMessagesObservable) Unit() string {
return "{message}"
}
// Description returns the semantic convention description of the instrument
func (ClientSentMessagesObservable) Description() string {
return "Number of messages producer attempted to send to the broker."
}
// AttrErrorType returns an optional attribute for the "error.type" semantic
// convention. It represents the describes a class of error the operation ended
// with.
func (ClientSentMessagesObservable) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue {
return attribute.String("error.type", string(val))
}
// AttrDestinationName returns an optional attribute for the
// "messaging.destination.name" semantic convention. It represents the message
// destination name.
func (ClientSentMessagesObservable) AttrDestinationName(val string) attribute.KeyValue {
return attribute.String("messaging.destination.name", val)
}
// AttrDestinationTemplate returns an optional attribute for the
// "messaging.destination.template" semantic convention. It represents the low
// cardinality representation of the messaging destination name.
func (ClientSentMessagesObservable) AttrDestinationTemplate(val string) attribute.KeyValue {
return attribute.String("messaging.destination.template", val)
}
// AttrServerAddress returns an optional attribute for the "server.address"
// semantic convention. It represents the server domain name if available without
// reverse DNS lookup; otherwise, IP address or Unix domain socket name.
func (ClientSentMessagesObservable) AttrServerAddress(val string) attribute.KeyValue {
return attribute.String("server.address", val)
}
// AttrDestinationPartitionID returns an optional attribute for the
// "messaging.destination.partition.id" semantic convention. It represents the
// identifier of the partition messages are sent to or received from, unique
// within the `messaging.destination.name`.
func (ClientSentMessagesObservable) AttrDestinationPartitionID(val string) attribute.KeyValue {
return attribute.String("messaging.destination.partition.id", val)
}
// AttrServerPort returns an optional attribute for the "server.port" semantic
// convention. It represents the server port number.
func (ClientSentMessagesObservable) AttrServerPort(val int) attribute.KeyValue {
return attribute.Int("server.port", val)
}
// ProcessDuration is an instrument used to record metric values conforming to
// the "messaging.process.duration" semantic conventions. It represents the
// duration of processing operation.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+908
View File
@@ -283,6 +283,100 @@ func (SDKExporterLogExported) AttrServerPort(val int) attribute.KeyValue {
return attribute.Int("server.port", val)
}
// SDKExporterLogExportedObservable is an instrument used to record metric values
// conforming to the "otel.sdk.exporter.log.exported" semantic conventions. It
// represents the number of log records for which the export has finished, either
// successful or failed.
type SDKExporterLogExportedObservable struct {
metric.Int64ObservableCounter
}
var newSDKExporterLogExportedObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("The number of log records for which the export has finished, either successful or failed."),
metric.WithUnit("{log_record}"),
}
// NewSDKExporterLogExportedObservable returns a new
// SDKExporterLogExportedObservable instrument.
func NewSDKExporterLogExportedObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (SDKExporterLogExportedObservable, error) {
// Check if the meter is nil.
if m == nil {
return SDKExporterLogExportedObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newSDKExporterLogExportedObservableOpts
} else {
opt = append(opt, newSDKExporterLogExportedObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"otel.sdk.exporter.log.exported",
opt...,
)
if err != nil {
return SDKExporterLogExportedObservable{noop.Int64ObservableCounter{}}, err
}
return SDKExporterLogExportedObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m SDKExporterLogExportedObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (SDKExporterLogExportedObservable) Name() string {
return "otel.sdk.exporter.log.exported"
}
// Unit returns the semantic convention unit of the instrument
func (SDKExporterLogExportedObservable) Unit() string {
return "{log_record}"
}
// Description returns the semantic convention description of the instrument
func (SDKExporterLogExportedObservable) Description() string {
return "The number of log records for which the export has finished, either successful or failed."
}
// AttrErrorType returns an optional attribute for the "error.type" semantic
// convention. It represents the describes a class of error the operation ended
// with.
func (SDKExporterLogExportedObservable) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue {
return attribute.String("error.type", string(val))
}
// AttrComponentName returns an optional attribute for the "otel.component.name"
// semantic convention. It represents a name uniquely identifying the instance of
// the OpenTelemetry component within its containing SDK instance.
func (SDKExporterLogExportedObservable) AttrComponentName(val string) attribute.KeyValue {
return attribute.String("otel.component.name", val)
}
// AttrComponentType returns an optional attribute for the "otel.component.type"
// semantic convention. It represents a name identifying the type of the
// OpenTelemetry component.
func (SDKExporterLogExportedObservable) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue {
return attribute.String("otel.component.type", string(val))
}
// AttrServerAddress returns an optional attribute for the "server.address"
// semantic convention. It represents the server domain name if available without
// reverse DNS lookup; otherwise, IP address or Unix domain socket name.
func (SDKExporterLogExportedObservable) AttrServerAddress(val string) attribute.KeyValue {
return attribute.String("server.address", val)
}
// AttrServerPort returns an optional attribute for the "server.port" semantic
// convention. It represents the server port number.
func (SDKExporterLogExportedObservable) AttrServerPort(val int) attribute.KeyValue {
return attribute.Int("server.port", val)
}
// SDKExporterLogInflight is an instrument used to record metric values
// conforming to the "otel.sdk.exporter.log.inflight" semantic conventions. It
// represents the number of log records which were passed to the exporter, but
@@ -427,6 +521,93 @@ func (SDKExporterLogInflight) AttrServerPort(val int) attribute.KeyValue {
return attribute.Int("server.port", val)
}
// SDKExporterLogInflightObservable is an instrument used to record metric values
// conforming to the "otel.sdk.exporter.log.inflight" semantic conventions. It
// represents the number of log records which were passed to the exporter, but
// that have not been exported yet (neither successful, nor failed).
type SDKExporterLogInflightObservable struct {
metric.Int64ObservableUpDownCounter
}
var newSDKExporterLogInflightObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("The number of log records which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)."),
metric.WithUnit("{log_record}"),
}
// NewSDKExporterLogInflightObservable returns a new
// SDKExporterLogInflightObservable instrument.
func NewSDKExporterLogInflightObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (SDKExporterLogInflightObservable, error) {
// Check if the meter is nil.
if m == nil {
return SDKExporterLogInflightObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newSDKExporterLogInflightObservableOpts
} else {
opt = append(opt, newSDKExporterLogInflightObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"otel.sdk.exporter.log.inflight",
opt...,
)
if err != nil {
return SDKExporterLogInflightObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return SDKExporterLogInflightObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m SDKExporterLogInflightObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (SDKExporterLogInflightObservable) Name() string {
return "otel.sdk.exporter.log.inflight"
}
// Unit returns the semantic convention unit of the instrument
func (SDKExporterLogInflightObservable) Unit() string {
return "{log_record}"
}
// Description returns the semantic convention description of the instrument
func (SDKExporterLogInflightObservable) Description() string {
return "The number of log records which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)."
}
// AttrComponentName returns an optional attribute for the "otel.component.name"
// semantic convention. It represents a name uniquely identifying the instance of
// the OpenTelemetry component within its containing SDK instance.
func (SDKExporterLogInflightObservable) AttrComponentName(val string) attribute.KeyValue {
return attribute.String("otel.component.name", val)
}
// AttrComponentType returns an optional attribute for the "otel.component.type"
// semantic convention. It represents a name identifying the type of the
// OpenTelemetry component.
func (SDKExporterLogInflightObservable) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue {
return attribute.String("otel.component.type", string(val))
}
// AttrServerAddress returns an optional attribute for the "server.address"
// semantic convention. It represents the server domain name if available without
// reverse DNS lookup; otherwise, IP address or Unix domain socket name.
func (SDKExporterLogInflightObservable) AttrServerAddress(val string) attribute.KeyValue {
return attribute.String("server.address", val)
}
// AttrServerPort returns an optional attribute for the "server.port" semantic
// convention. It represents the server port number.
func (SDKExporterLogInflightObservable) AttrServerPort(val int) attribute.KeyValue {
return attribute.Int("server.port", val)
}
// SDKExporterMetricDataPointExported is an instrument used to record metric
// values conforming to the "otel.sdk.exporter.metric_data_point.exported"
// semantic conventions. It represents the number of metric data points for which
@@ -589,6 +770,100 @@ func (SDKExporterMetricDataPointExported) AttrServerPort(val int) attribute.KeyV
return attribute.Int("server.port", val)
}
// SDKExporterMetricDataPointExportedObservable is an instrument used to record
// metric values conforming to the "otel.sdk.exporter.metric_data_point.exported"
// semantic conventions. It represents the number of metric data points for which
// the export has finished, either successful or failed.
type SDKExporterMetricDataPointExportedObservable struct {
metric.Int64ObservableCounter
}
var newSDKExporterMetricDataPointExportedObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("The number of metric data points for which the export has finished, either successful or failed."),
metric.WithUnit("{data_point}"),
}
// NewSDKExporterMetricDataPointExportedObservable returns a new
// SDKExporterMetricDataPointExportedObservable instrument.
func NewSDKExporterMetricDataPointExportedObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (SDKExporterMetricDataPointExportedObservable, error) {
// Check if the meter is nil.
if m == nil {
return SDKExporterMetricDataPointExportedObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newSDKExporterMetricDataPointExportedObservableOpts
} else {
opt = append(opt, newSDKExporterMetricDataPointExportedObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"otel.sdk.exporter.metric_data_point.exported",
opt...,
)
if err != nil {
return SDKExporterMetricDataPointExportedObservable{noop.Int64ObservableCounter{}}, err
}
return SDKExporterMetricDataPointExportedObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m SDKExporterMetricDataPointExportedObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (SDKExporterMetricDataPointExportedObservable) Name() string {
return "otel.sdk.exporter.metric_data_point.exported"
}
// Unit returns the semantic convention unit of the instrument
func (SDKExporterMetricDataPointExportedObservable) Unit() string {
return "{data_point}"
}
// Description returns the semantic convention description of the instrument
func (SDKExporterMetricDataPointExportedObservable) Description() string {
return "The number of metric data points for which the export has finished, either successful or failed."
}
// AttrErrorType returns an optional attribute for the "error.type" semantic
// convention. It represents the describes a class of error the operation ended
// with.
func (SDKExporterMetricDataPointExportedObservable) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue {
return attribute.String("error.type", string(val))
}
// AttrComponentName returns an optional attribute for the "otel.component.name"
// semantic convention. It represents a name uniquely identifying the instance of
// the OpenTelemetry component within its containing SDK instance.
func (SDKExporterMetricDataPointExportedObservable) AttrComponentName(val string) attribute.KeyValue {
return attribute.String("otel.component.name", val)
}
// AttrComponentType returns an optional attribute for the "otel.component.type"
// semantic convention. It represents a name identifying the type of the
// OpenTelemetry component.
func (SDKExporterMetricDataPointExportedObservable) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue {
return attribute.String("otel.component.type", string(val))
}
// AttrServerAddress returns an optional attribute for the "server.address"
// semantic convention. It represents the server domain name if available without
// reverse DNS lookup; otherwise, IP address or Unix domain socket name.
func (SDKExporterMetricDataPointExportedObservable) AttrServerAddress(val string) attribute.KeyValue {
return attribute.String("server.address", val)
}
// AttrServerPort returns an optional attribute for the "server.port" semantic
// convention. It represents the server port number.
func (SDKExporterMetricDataPointExportedObservable) AttrServerPort(val int) attribute.KeyValue {
return attribute.Int("server.port", val)
}
// SDKExporterMetricDataPointInflight is an instrument used to record metric
// values conforming to the "otel.sdk.exporter.metric_data_point.inflight"
// semantic conventions. It represents the number of metric data points which
@@ -735,6 +1010,94 @@ func (SDKExporterMetricDataPointInflight) AttrServerPort(val int) attribute.KeyV
return attribute.Int("server.port", val)
}
// SDKExporterMetricDataPointInflightObservable is an instrument used to record
// metric values conforming to the "otel.sdk.exporter.metric_data_point.inflight"
// semantic conventions. It represents the number of metric data points which
// were passed to the exporter, but that have not been exported yet (neither
// successful, nor failed).
type SDKExporterMetricDataPointInflightObservable struct {
metric.Int64ObservableUpDownCounter
}
var newSDKExporterMetricDataPointInflightObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("The number of metric data points which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)."),
metric.WithUnit("{data_point}"),
}
// NewSDKExporterMetricDataPointInflightObservable returns a new
// SDKExporterMetricDataPointInflightObservable instrument.
func NewSDKExporterMetricDataPointInflightObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (SDKExporterMetricDataPointInflightObservable, error) {
// Check if the meter is nil.
if m == nil {
return SDKExporterMetricDataPointInflightObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newSDKExporterMetricDataPointInflightObservableOpts
} else {
opt = append(opt, newSDKExporterMetricDataPointInflightObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"otel.sdk.exporter.metric_data_point.inflight",
opt...,
)
if err != nil {
return SDKExporterMetricDataPointInflightObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return SDKExporterMetricDataPointInflightObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m SDKExporterMetricDataPointInflightObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (SDKExporterMetricDataPointInflightObservable) Name() string {
return "otel.sdk.exporter.metric_data_point.inflight"
}
// Unit returns the semantic convention unit of the instrument
func (SDKExporterMetricDataPointInflightObservable) Unit() string {
return "{data_point}"
}
// Description returns the semantic convention description of the instrument
func (SDKExporterMetricDataPointInflightObservable) Description() string {
return "The number of metric data points which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)."
}
// AttrComponentName returns an optional attribute for the "otel.component.name"
// semantic convention. It represents a name uniquely identifying the instance of
// the OpenTelemetry component within its containing SDK instance.
func (SDKExporterMetricDataPointInflightObservable) AttrComponentName(val string) attribute.KeyValue {
return attribute.String("otel.component.name", val)
}
// AttrComponentType returns an optional attribute for the "otel.component.type"
// semantic convention. It represents a name identifying the type of the
// OpenTelemetry component.
func (SDKExporterMetricDataPointInflightObservable) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue {
return attribute.String("otel.component.type", string(val))
}
// AttrServerAddress returns an optional attribute for the "server.address"
// semantic convention. It represents the server domain name if available without
// reverse DNS lookup; otherwise, IP address or Unix domain socket name.
func (SDKExporterMetricDataPointInflightObservable) AttrServerAddress(val string) attribute.KeyValue {
return attribute.String("server.address", val)
}
// AttrServerPort returns an optional attribute for the "server.port" semantic
// convention. It represents the server port number.
func (SDKExporterMetricDataPointInflightObservable) AttrServerPort(val int) attribute.KeyValue {
return attribute.Int("server.port", val)
}
// SDKExporterOperationDuration is an instrument used to record metric values
// conforming to the "otel.sdk.exporter.operation.duration" semantic conventions.
// It represents the duration of exporting a batch of telemetry records.
@@ -1075,6 +1438,100 @@ func (SDKExporterSpanExported) AttrServerPort(val int) attribute.KeyValue {
return attribute.Int("server.port", val)
}
// SDKExporterSpanExportedObservable is an instrument used to record metric
// values conforming to the "otel.sdk.exporter.span.exported" semantic
// conventions. It represents the number of spans for which the export has
// finished, either successful or failed.
type SDKExporterSpanExportedObservable struct {
metric.Int64ObservableCounter
}
var newSDKExporterSpanExportedObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("The number of spans for which the export has finished, either successful or failed."),
metric.WithUnit("{span}"),
}
// NewSDKExporterSpanExportedObservable returns a new
// SDKExporterSpanExportedObservable instrument.
func NewSDKExporterSpanExportedObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (SDKExporterSpanExportedObservable, error) {
// Check if the meter is nil.
if m == nil {
return SDKExporterSpanExportedObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newSDKExporterSpanExportedObservableOpts
} else {
opt = append(opt, newSDKExporterSpanExportedObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"otel.sdk.exporter.span.exported",
opt...,
)
if err != nil {
return SDKExporterSpanExportedObservable{noop.Int64ObservableCounter{}}, err
}
return SDKExporterSpanExportedObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m SDKExporterSpanExportedObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (SDKExporterSpanExportedObservable) Name() string {
return "otel.sdk.exporter.span.exported"
}
// Unit returns the semantic convention unit of the instrument
func (SDKExporterSpanExportedObservable) Unit() string {
return "{span}"
}
// Description returns the semantic convention description of the instrument
func (SDKExporterSpanExportedObservable) Description() string {
return "The number of spans for which the export has finished, either successful or failed."
}
// AttrErrorType returns an optional attribute for the "error.type" semantic
// convention. It represents the describes a class of error the operation ended
// with.
func (SDKExporterSpanExportedObservable) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue {
return attribute.String("error.type", string(val))
}
// AttrComponentName returns an optional attribute for the "otel.component.name"
// semantic convention. It represents a name uniquely identifying the instance of
// the OpenTelemetry component within its containing SDK instance.
func (SDKExporterSpanExportedObservable) AttrComponentName(val string) attribute.KeyValue {
return attribute.String("otel.component.name", val)
}
// AttrComponentType returns an optional attribute for the "otel.component.type"
// semantic convention. It represents a name identifying the type of the
// OpenTelemetry component.
func (SDKExporterSpanExportedObservable) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue {
return attribute.String("otel.component.type", string(val))
}
// AttrServerAddress returns an optional attribute for the "server.address"
// semantic convention. It represents the server domain name if available without
// reverse DNS lookup; otherwise, IP address or Unix domain socket name.
func (SDKExporterSpanExportedObservable) AttrServerAddress(val string) attribute.KeyValue {
return attribute.String("server.address", val)
}
// AttrServerPort returns an optional attribute for the "server.port" semantic
// convention. It represents the server port number.
func (SDKExporterSpanExportedObservable) AttrServerPort(val int) attribute.KeyValue {
return attribute.Int("server.port", val)
}
// SDKExporterSpanInflight is an instrument used to record metric values
// conforming to the "otel.sdk.exporter.span.inflight" semantic conventions. It
// represents the number of spans which were passed to the exporter, but that
@@ -1219,6 +1676,94 @@ func (SDKExporterSpanInflight) AttrServerPort(val int) attribute.KeyValue {
return attribute.Int("server.port", val)
}
// SDKExporterSpanInflightObservable is an instrument used to record metric
// values conforming to the "otel.sdk.exporter.span.inflight" semantic
// conventions. It represents the number of spans which were passed to the
// exporter, but that have not been exported yet (neither successful, nor
// failed).
type SDKExporterSpanInflightObservable struct {
metric.Int64ObservableUpDownCounter
}
var newSDKExporterSpanInflightObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("The number of spans which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)."),
metric.WithUnit("{span}"),
}
// NewSDKExporterSpanInflightObservable returns a new
// SDKExporterSpanInflightObservable instrument.
func NewSDKExporterSpanInflightObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (SDKExporterSpanInflightObservable, error) {
// Check if the meter is nil.
if m == nil {
return SDKExporterSpanInflightObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newSDKExporterSpanInflightObservableOpts
} else {
opt = append(opt, newSDKExporterSpanInflightObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"otel.sdk.exporter.span.inflight",
opt...,
)
if err != nil {
return SDKExporterSpanInflightObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return SDKExporterSpanInflightObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m SDKExporterSpanInflightObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (SDKExporterSpanInflightObservable) Name() string {
return "otel.sdk.exporter.span.inflight"
}
// Unit returns the semantic convention unit of the instrument
func (SDKExporterSpanInflightObservable) Unit() string {
return "{span}"
}
// Description returns the semantic convention description of the instrument
func (SDKExporterSpanInflightObservable) Description() string {
return "The number of spans which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)."
}
// AttrComponentName returns an optional attribute for the "otel.component.name"
// semantic convention. It represents a name uniquely identifying the instance of
// the OpenTelemetry component within its containing SDK instance.
func (SDKExporterSpanInflightObservable) AttrComponentName(val string) attribute.KeyValue {
return attribute.String("otel.component.name", val)
}
// AttrComponentType returns an optional attribute for the "otel.component.type"
// semantic convention. It represents a name identifying the type of the
// OpenTelemetry component.
func (SDKExporterSpanInflightObservable) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue {
return attribute.String("otel.component.type", string(val))
}
// AttrServerAddress returns an optional attribute for the "server.address"
// semantic convention. It represents the server domain name if available without
// reverse DNS lookup; otherwise, IP address or Unix domain socket name.
func (SDKExporterSpanInflightObservable) AttrServerAddress(val string) attribute.KeyValue {
return attribute.String("server.address", val)
}
// AttrServerPort returns an optional attribute for the "server.port" semantic
// convention. It represents the server port number.
func (SDKExporterSpanInflightObservable) AttrServerPort(val int) attribute.KeyValue {
return attribute.Int("server.port", val)
}
// SDKLogCreated is an instrument used to record metric values conforming to the
// "otel.sdk.log.created" semantic conventions. It represents the number of logs
// submitted to enabled SDK Loggers.
@@ -1317,6 +1862,64 @@ func (m SDKLogCreated) AddSet(ctx context.Context, incr int64, set attribute.Set
m.Int64Counter.Add(ctx, incr, *o...)
}
// SDKLogCreatedObservable is an instrument used to record metric values
// conforming to the "otel.sdk.log.created" semantic conventions. It represents
// the number of logs submitted to enabled SDK Loggers.
type SDKLogCreatedObservable struct {
metric.Int64ObservableCounter
}
var newSDKLogCreatedObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("The number of logs submitted to enabled SDK Loggers."),
metric.WithUnit("{log_record}"),
}
// NewSDKLogCreatedObservable returns a new SDKLogCreatedObservable instrument.
func NewSDKLogCreatedObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (SDKLogCreatedObservable, error) {
// Check if the meter is nil.
if m == nil {
return SDKLogCreatedObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newSDKLogCreatedObservableOpts
} else {
opt = append(opt, newSDKLogCreatedObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"otel.sdk.log.created",
opt...,
)
if err != nil {
return SDKLogCreatedObservable{noop.Int64ObservableCounter{}}, err
}
return SDKLogCreatedObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m SDKLogCreatedObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (SDKLogCreatedObservable) Name() string {
return "otel.sdk.log.created"
}
// Unit returns the semantic convention unit of the instrument
func (SDKLogCreatedObservable) Unit() string {
return "{log_record}"
}
// Description returns the semantic convention description of the instrument
func (SDKLogCreatedObservable) Description() string {
return "The number of logs submitted to enabled SDK Loggers."
}
// SDKMetricReaderCollectionDuration is an instrument used to record metric
// values conforming to the "otel.sdk.metric_reader.collection.duration" semantic
// conventions. It represents the duration of the collect operation of the metric
@@ -1607,6 +2210,88 @@ func (SDKProcessorLogProcessed) AttrComponentType(val ComponentTypeAttr) attribu
return attribute.String("otel.component.type", string(val))
}
// SDKProcessorLogProcessedObservable is an instrument used to record metric
// values conforming to the "otel.sdk.processor.log.processed" semantic
// conventions. It represents the number of log records for which the processing
// has finished, either successful or failed.
type SDKProcessorLogProcessedObservable struct {
metric.Int64ObservableCounter
}
var newSDKProcessorLogProcessedObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("The number of log records for which the processing has finished, either successful or failed."),
metric.WithUnit("{log_record}"),
}
// NewSDKProcessorLogProcessedObservable returns a new
// SDKProcessorLogProcessedObservable instrument.
func NewSDKProcessorLogProcessedObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (SDKProcessorLogProcessedObservable, error) {
// Check if the meter is nil.
if m == nil {
return SDKProcessorLogProcessedObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newSDKProcessorLogProcessedObservableOpts
} else {
opt = append(opt, newSDKProcessorLogProcessedObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"otel.sdk.processor.log.processed",
opt...,
)
if err != nil {
return SDKProcessorLogProcessedObservable{noop.Int64ObservableCounter{}}, err
}
return SDKProcessorLogProcessedObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m SDKProcessorLogProcessedObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (SDKProcessorLogProcessedObservable) Name() string {
return "otel.sdk.processor.log.processed"
}
// Unit returns the semantic convention unit of the instrument
func (SDKProcessorLogProcessedObservable) Unit() string {
return "{log_record}"
}
// Description returns the semantic convention description of the instrument
func (SDKProcessorLogProcessedObservable) Description() string {
return "The number of log records for which the processing has finished, either successful or failed."
}
// AttrErrorType returns an optional attribute for the "error.type" semantic
// convention. It represents a low-cardinality description of the failure reason.
// SDK Batching Log Record Processors MUST use `queue_full` for log records
// dropped due to a full queue.
func (SDKProcessorLogProcessedObservable) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue {
return attribute.String("error.type", string(val))
}
// AttrComponentName returns an optional attribute for the "otel.component.name"
// semantic convention. It represents a name uniquely identifying the instance of
// the OpenTelemetry component within its containing SDK instance.
func (SDKProcessorLogProcessedObservable) AttrComponentName(val string) attribute.KeyValue {
return attribute.String("otel.component.name", val)
}
// AttrComponentType returns an optional attribute for the "otel.component.type"
// semantic convention. It represents a name identifying the type of the
// OpenTelemetry component.
func (SDKProcessorLogProcessedObservable) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue {
return attribute.String("otel.component.type", string(val))
}
// SDKProcessorLogQueueCapacity is an instrument used to record metric values
// conforming to the "otel.sdk.processor.log.queue.capacity" semantic
// conventions. It represents the maximum number of log records the queue of a
@@ -1900,6 +2585,88 @@ func (SDKProcessorSpanProcessed) AttrComponentType(val ComponentTypeAttr) attrib
return attribute.String("otel.component.type", string(val))
}
// SDKProcessorSpanProcessedObservable is an instrument used to record metric
// values conforming to the "otel.sdk.processor.span.processed" semantic
// conventions. It represents the number of spans for which the processing has
// finished, either successful or failed.
type SDKProcessorSpanProcessedObservable struct {
metric.Int64ObservableCounter
}
var newSDKProcessorSpanProcessedObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("The number of spans for which the processing has finished, either successful or failed."),
metric.WithUnit("{span}"),
}
// NewSDKProcessorSpanProcessedObservable returns a new
// SDKProcessorSpanProcessedObservable instrument.
func NewSDKProcessorSpanProcessedObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (SDKProcessorSpanProcessedObservable, error) {
// Check if the meter is nil.
if m == nil {
return SDKProcessorSpanProcessedObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newSDKProcessorSpanProcessedObservableOpts
} else {
opt = append(opt, newSDKProcessorSpanProcessedObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"otel.sdk.processor.span.processed",
opt...,
)
if err != nil {
return SDKProcessorSpanProcessedObservable{noop.Int64ObservableCounter{}}, err
}
return SDKProcessorSpanProcessedObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m SDKProcessorSpanProcessedObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (SDKProcessorSpanProcessedObservable) Name() string {
return "otel.sdk.processor.span.processed"
}
// Unit returns the semantic convention unit of the instrument
func (SDKProcessorSpanProcessedObservable) Unit() string {
return "{span}"
}
// Description returns the semantic convention description of the instrument
func (SDKProcessorSpanProcessedObservable) Description() string {
return "The number of spans for which the processing has finished, either successful or failed."
}
// AttrErrorType returns an optional attribute for the "error.type" semantic
// convention. It represents a low-cardinality description of the failure reason.
// SDK Batching Span Processors MUST use `queue_full` for spans dropped due to a
// full queue.
func (SDKProcessorSpanProcessedObservable) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue {
return attribute.String("error.type", string(val))
}
// AttrComponentName returns an optional attribute for the "otel.component.name"
// semantic convention. It represents a name uniquely identifying the instance of
// the OpenTelemetry component within its containing SDK instance.
func (SDKProcessorSpanProcessedObservable) AttrComponentName(val string) attribute.KeyValue {
return attribute.String("otel.component.name", val)
}
// AttrComponentType returns an optional attribute for the "otel.component.type"
// semantic convention. It represents a name identifying the type of the
// OpenTelemetry component.
func (SDKProcessorSpanProcessedObservable) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue {
return attribute.String("otel.component.type", string(val))
}
// SDKProcessorSpanQueueCapacity is an instrument used to record metric values
// conforming to the "otel.sdk.processor.span.queue.capacity" semantic
// conventions. It represents the maximum number of spans the queue of a given
@@ -2166,6 +2933,72 @@ func (SDKSpanLive) AttrSpanSamplingResult(val SpanSamplingResultAttr) attribute.
return attribute.String("otel.span.sampling_result", string(val))
}
// SDKSpanLiveObservable is an instrument used to record metric values conforming
// to the "otel.sdk.span.live" semantic conventions. It represents the number of
// created spans with `recording=true` for which the end operation has not been
// called yet.
type SDKSpanLiveObservable struct {
metric.Int64ObservableUpDownCounter
}
var newSDKSpanLiveObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("The number of created spans with `recording=true` for which the end operation has not been called yet."),
metric.WithUnit("{span}"),
}
// NewSDKSpanLiveObservable returns a new SDKSpanLiveObservable instrument.
func NewSDKSpanLiveObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (SDKSpanLiveObservable, error) {
// Check if the meter is nil.
if m == nil {
return SDKSpanLiveObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newSDKSpanLiveObservableOpts
} else {
opt = append(opt, newSDKSpanLiveObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"otel.sdk.span.live",
opt...,
)
if err != nil {
return SDKSpanLiveObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return SDKSpanLiveObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m SDKSpanLiveObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (SDKSpanLiveObservable) Name() string {
return "otel.sdk.span.live"
}
// Unit returns the semantic convention unit of the instrument
func (SDKSpanLiveObservable) Unit() string {
return "{span}"
}
// Description returns the semantic convention description of the instrument
func (SDKSpanLiveObservable) Description() string {
return "The number of created spans with `recording=true` for which the end operation has not been called yet."
}
// AttrSpanSamplingResult returns an optional attribute for the
// "otel.span.sampling_result" semantic convention. It represents the result
// value of the sampler for this span.
func (SDKSpanLiveObservable) AttrSpanSamplingResult(val SpanSamplingResultAttr) attribute.KeyValue {
return attribute.String("otel.span.sampling_result", string(val))
}
// SDKSpanStarted is an instrument used to record metric values conforming to the
// "otel.sdk.span.started" semantic conventions. It represents the number of
// created spans.
@@ -2298,3 +3131,78 @@ func (SDKSpanStarted) AttrSpanParentOrigin(val SpanParentOriginAttr) attribute.K
func (SDKSpanStarted) AttrSpanSamplingResult(val SpanSamplingResultAttr) attribute.KeyValue {
return attribute.String("otel.span.sampling_result", string(val))
}
// SDKSpanStartedObservable is an instrument used to record metric values
// conforming to the "otel.sdk.span.started" semantic conventions. It represents
// the number of created spans.
type SDKSpanStartedObservable struct {
metric.Int64ObservableCounter
}
var newSDKSpanStartedObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("The number of created spans."),
metric.WithUnit("{span}"),
}
// NewSDKSpanStartedObservable returns a new SDKSpanStartedObservable instrument.
func NewSDKSpanStartedObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (SDKSpanStartedObservable, error) {
// Check if the meter is nil.
if m == nil {
return SDKSpanStartedObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newSDKSpanStartedObservableOpts
} else {
opt = append(opt, newSDKSpanStartedObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"otel.sdk.span.started",
opt...,
)
if err != nil {
return SDKSpanStartedObservable{noop.Int64ObservableCounter{}}, err
}
return SDKSpanStartedObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m SDKSpanStartedObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (SDKSpanStartedObservable) Name() string {
return "otel.sdk.span.started"
}
// Unit returns the semantic convention unit of the instrument
func (SDKSpanStartedObservable) Unit() string {
return "{span}"
}
// Description returns the semantic convention description of the instrument
func (SDKSpanStartedObservable) Description() string {
return "The number of created spans."
}
// AttrSpanParentOrigin returns an optional attribute for the
// "otel.span.parent.origin" semantic convention. It represents the determines
// whether the span has a parent span, and if so, [whether it is a remote parent]
// .
//
// [whether it is a remote parent]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote
func (SDKSpanStartedObservable) AttrSpanParentOrigin(val SpanParentOriginAttr) attribute.KeyValue {
return attribute.String("otel.span.parent.origin", string(val))
}
// AttrSpanSamplingResult returns an optional attribute for the
// "otel.span.sampling_result" semantic convention. It represents the result
// value of the sampler for this span.
func (SDKSpanStartedObservable) AttrSpanSamplingResult(val SpanSamplingResultAttr) attribute.KeyValue {
return attribute.String("otel.span.sampling_result", string(val))
}
+652
View File
@@ -217,6 +217,65 @@ func (m ContextSwitches) AddSet(ctx context.Context, incr int64, set attribute.S
m.Int64Counter.Add(ctx, incr, *o...)
}
// ContextSwitchesObservable is an instrument used to record metric values
// conforming to the "process.context_switches" semantic conventions. It
// represents the number of times the process has been context switched.
type ContextSwitchesObservable struct {
metric.Int64ObservableCounter
}
var newContextSwitchesObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("Number of times the process has been context switched."),
metric.WithUnit("{context_switch}"),
}
// NewContextSwitchesObservable returns a new ContextSwitchesObservable
// instrument.
func NewContextSwitchesObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (ContextSwitchesObservable, error) {
// Check if the meter is nil.
if m == nil {
return ContextSwitchesObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newContextSwitchesObservableOpts
} else {
opt = append(opt, newContextSwitchesObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"process.context_switches",
opt...,
)
if err != nil {
return ContextSwitchesObservable{noop.Int64ObservableCounter{}}, err
}
return ContextSwitchesObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m ContextSwitchesObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (ContextSwitchesObservable) Name() string {
return "process.context_switches"
}
// Unit returns the semantic convention unit of the instrument
func (ContextSwitchesObservable) Unit() string {
return "{context_switch}"
}
// Description returns the semantic convention description of the instrument
func (ContextSwitchesObservable) Description() string {
return "Number of times the process has been context switched."
}
// CPUTime is an instrument used to record metric values conforming to the
// "process.cpu.time" semantic conventions. It represents the total CPU seconds
// broken down by different CPU modes.
@@ -392,6 +451,65 @@ func (m CPUUtilization) RecordSet(ctx context.Context, val int64, set attribute.
m.Int64Gauge.Record(ctx, val, *o...)
}
// CPUUtilizationObservable is an instrument used to record metric values
// conforming to the "process.cpu.utilization" semantic conventions. It
// represents the difference in process.cpu.time since the last measurement,
// divided by the elapsed time and number of CPUs available to the process.
type CPUUtilizationObservable struct {
metric.Int64ObservableGauge
}
var newCPUUtilizationObservableOpts = []metric.Int64ObservableGaugeOption{
metric.WithDescription("Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process."),
metric.WithUnit("1"),
}
// NewCPUUtilizationObservable returns a new CPUUtilizationObservable instrument.
func NewCPUUtilizationObservable(
m metric.Meter,
opt ...metric.Int64ObservableGaugeOption,
) (CPUUtilizationObservable, error) {
// Check if the meter is nil.
if m == nil {
return CPUUtilizationObservable{noop.Int64ObservableGauge{}}, nil
}
if len(opt) == 0 {
opt = newCPUUtilizationObservableOpts
} else {
opt = append(opt, newCPUUtilizationObservableOpts...)
}
i, err := m.Int64ObservableGauge(
"process.cpu.utilization",
opt...,
)
if err != nil {
return CPUUtilizationObservable{noop.Int64ObservableGauge{}}, err
}
return CPUUtilizationObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m CPUUtilizationObservable) Inst() metric.Int64ObservableGauge {
return m.Int64ObservableGauge
}
// Name returns the semantic convention name of the instrument.
func (CPUUtilizationObservable) Name() string {
return "process.cpu.utilization"
}
// Unit returns the semantic convention unit of the instrument
func (CPUUtilizationObservable) Unit() string {
return "1"
}
// Description returns the semantic convention description of the instrument
func (CPUUtilizationObservable) Description() string {
return "Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process."
}
// DiskIO is an instrument used to record metric values conforming to the
// "process.disk.io" semantic conventions. It represents the disk bytes
// transferred.
@@ -508,6 +626,64 @@ func (m DiskIO) AddSet(ctx context.Context, incr int64, set attribute.Set) {
m.Int64Counter.Add(ctx, incr, *o...)
}
// DiskIOObservable is an instrument used to record metric values conforming to
// the "process.disk.io" semantic conventions. It represents the disk bytes
// transferred.
type DiskIOObservable struct {
metric.Int64ObservableCounter
}
var newDiskIOObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("Disk bytes transferred."),
metric.WithUnit("By"),
}
// NewDiskIOObservable returns a new DiskIOObservable instrument.
func NewDiskIOObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (DiskIOObservable, error) {
// Check if the meter is nil.
if m == nil {
return DiskIOObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newDiskIOObservableOpts
} else {
opt = append(opt, newDiskIOObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"process.disk.io",
opt...,
)
if err != nil {
return DiskIOObservable{noop.Int64ObservableCounter{}}, err
}
return DiskIOObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m DiskIOObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (DiskIOObservable) Name() string {
return "process.disk.io"
}
// Unit returns the semantic convention unit of the instrument
func (DiskIOObservable) Unit() string {
return "By"
}
// Description returns the semantic convention description of the instrument
func (DiskIOObservable) Description() string {
return "Disk bytes transferred."
}
// MemoryUsage is an instrument used to record metric values conforming to the
// "process.memory.usage" semantic conventions. It represents the amount of
// physical memory in use.
@@ -606,6 +782,64 @@ func (m MemoryUsage) AddSet(ctx context.Context, incr int64, set attribute.Set)
m.Int64UpDownCounter.Add(ctx, incr, *o...)
}
// MemoryUsageObservable is an instrument used to record metric values conforming
// to the "process.memory.usage" semantic conventions. It represents the amount
// of physical memory in use.
type MemoryUsageObservable struct {
metric.Int64ObservableUpDownCounter
}
var newMemoryUsageObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("The amount of physical memory in use."),
metric.WithUnit("By"),
}
// NewMemoryUsageObservable returns a new MemoryUsageObservable instrument.
func NewMemoryUsageObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (MemoryUsageObservable, error) {
// Check if the meter is nil.
if m == nil {
return MemoryUsageObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newMemoryUsageObservableOpts
} else {
opt = append(opt, newMemoryUsageObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"process.memory.usage",
opt...,
)
if err != nil {
return MemoryUsageObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return MemoryUsageObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m MemoryUsageObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (MemoryUsageObservable) Name() string {
return "process.memory.usage"
}
// Unit returns the semantic convention unit of the instrument
func (MemoryUsageObservable) Unit() string {
return "By"
}
// Description returns the semantic convention description of the instrument
func (MemoryUsageObservable) Description() string {
return "The amount of physical memory in use."
}
// MemoryVirtual is an instrument used to record metric values conforming to the
// "process.memory.virtual" semantic conventions. It represents the amount of
// committed virtual memory.
@@ -704,6 +938,64 @@ func (m MemoryVirtual) AddSet(ctx context.Context, incr int64, set attribute.Set
m.Int64UpDownCounter.Add(ctx, incr, *o...)
}
// MemoryVirtualObservable is an instrument used to record metric values
// conforming to the "process.memory.virtual" semantic conventions. It represents
// the amount of committed virtual memory.
type MemoryVirtualObservable struct {
metric.Int64ObservableUpDownCounter
}
var newMemoryVirtualObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("The amount of committed virtual memory."),
metric.WithUnit("By"),
}
// NewMemoryVirtualObservable returns a new MemoryVirtualObservable instrument.
func NewMemoryVirtualObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (MemoryVirtualObservable, error) {
// Check if the meter is nil.
if m == nil {
return MemoryVirtualObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newMemoryVirtualObservableOpts
} else {
opt = append(opt, newMemoryVirtualObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"process.memory.virtual",
opt...,
)
if err != nil {
return MemoryVirtualObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return MemoryVirtualObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m MemoryVirtualObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (MemoryVirtualObservable) Name() string {
return "process.memory.virtual"
}
// Unit returns the semantic convention unit of the instrument
func (MemoryVirtualObservable) Unit() string {
return "By"
}
// Description returns the semantic convention description of the instrument
func (MemoryVirtualObservable) Description() string {
return "The amount of committed virtual memory."
}
// NetworkIO is an instrument used to record metric values conforming to the
// "process.network.io" semantic conventions. It represents the network bytes
// transferred.
@@ -820,6 +1112,64 @@ func (m NetworkIO) AddSet(ctx context.Context, incr int64, set attribute.Set) {
m.Int64Counter.Add(ctx, incr, *o...)
}
// NetworkIOObservable is an instrument used to record metric values conforming
// to the "process.network.io" semantic conventions. It represents the network
// bytes transferred.
type NetworkIOObservable struct {
metric.Int64ObservableCounter
}
var newNetworkIOObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("Network bytes transferred."),
metric.WithUnit("By"),
}
// NewNetworkIOObservable returns a new NetworkIOObservable instrument.
func NewNetworkIOObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (NetworkIOObservable, error) {
// Check if the meter is nil.
if m == nil {
return NetworkIOObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newNetworkIOObservableOpts
} else {
opt = append(opt, newNetworkIOObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"process.network.io",
opt...,
)
if err != nil {
return NetworkIOObservable{noop.Int64ObservableCounter{}}, err
}
return NetworkIOObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m NetworkIOObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (NetworkIOObservable) Name() string {
return "process.network.io"
}
// Unit returns the semantic convention unit of the instrument
func (NetworkIOObservable) Unit() string {
return "By"
}
// Description returns the semantic convention description of the instrument
func (NetworkIOObservable) Description() string {
return "Network bytes transferred."
}
// PagingFaults is an instrument used to record metric values conforming to the
// "process.paging.faults" semantic conventions. It represents the number of page
// faults the process has made.
@@ -939,6 +1289,73 @@ func (PagingFaults) AttrSystemPagingFaultType(val SystemPagingFaultTypeAttr) att
return attribute.String("system.paging.fault.type", string(val))
}
// PagingFaultsObservable is an instrument used to record metric values
// conforming to the "process.paging.faults" semantic conventions. It represents
// the number of page faults the process has made.
type PagingFaultsObservable struct {
metric.Int64ObservableCounter
}
var newPagingFaultsObservableOpts = []metric.Int64ObservableCounterOption{
metric.WithDescription("Number of page faults the process has made."),
metric.WithUnit("{fault}"),
}
// NewPagingFaultsObservable returns a new PagingFaultsObservable instrument.
func NewPagingFaultsObservable(
m metric.Meter,
opt ...metric.Int64ObservableCounterOption,
) (PagingFaultsObservable, error) {
// Check if the meter is nil.
if m == nil {
return PagingFaultsObservable{noop.Int64ObservableCounter{}}, nil
}
if len(opt) == 0 {
opt = newPagingFaultsObservableOpts
} else {
opt = append(opt, newPagingFaultsObservableOpts...)
}
i, err := m.Int64ObservableCounter(
"process.paging.faults",
opt...,
)
if err != nil {
return PagingFaultsObservable{noop.Int64ObservableCounter{}}, err
}
return PagingFaultsObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m PagingFaultsObservable) Inst() metric.Int64ObservableCounter {
return m.Int64ObservableCounter
}
// Name returns the semantic convention name of the instrument.
func (PagingFaultsObservable) Name() string {
return "process.paging.faults"
}
// Unit returns the semantic convention unit of the instrument
func (PagingFaultsObservable) Unit() string {
return "{fault}"
}
// Description returns the semantic convention description of the instrument
func (PagingFaultsObservable) Description() string {
return "Number of page faults the process has made."
}
// AttrSystemPagingFaultType returns an optional attribute for the
// "system.paging.fault.type" semantic convention. It represents the type of
// paging fault. Value MUST be either `major` or `minor`. If the metric is
// reported without this attribute, it should be the sum of major and minor page
// faults.
func (PagingFaultsObservable) AttrSystemPagingFaultType(val SystemPagingFaultTypeAttr) attribute.KeyValue {
return attribute.String("system.paging.fault.type", string(val))
}
// ThreadCount is an instrument used to record metric values conforming to the
// "process.thread.count" semantic conventions. It represents the process threads
// count.
@@ -1037,6 +1454,64 @@ func (m ThreadCount) AddSet(ctx context.Context, incr int64, set attribute.Set)
m.Int64UpDownCounter.Add(ctx, incr, *o...)
}
// ThreadCountObservable is an instrument used to record metric values conforming
// to the "process.thread.count" semantic conventions. It represents the process
// threads count.
type ThreadCountObservable struct {
metric.Int64ObservableUpDownCounter
}
var newThreadCountObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("Process threads count."),
metric.WithUnit("{thread}"),
}
// NewThreadCountObservable returns a new ThreadCountObservable instrument.
func NewThreadCountObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (ThreadCountObservable, error) {
// Check if the meter is nil.
if m == nil {
return ThreadCountObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newThreadCountObservableOpts
} else {
opt = append(opt, newThreadCountObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"process.thread.count",
opt...,
)
if err != nil {
return ThreadCountObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return ThreadCountObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m ThreadCountObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (ThreadCountObservable) Name() string {
return "process.thread.count"
}
// Unit returns the semantic convention unit of the instrument
func (ThreadCountObservable) Unit() string {
return "{thread}"
}
// Description returns the semantic convention description of the instrument
func (ThreadCountObservable) Description() string {
return "Process threads count."
}
// UnixFileDescriptorCount is an instrument used to record metric values
// conforming to the "process.unix.file_descriptor.count" semantic conventions.
// It represents the number of unix file descriptors in use by the process.
@@ -1135,6 +1610,66 @@ func (m UnixFileDescriptorCount) AddSet(ctx context.Context, incr int64, set att
m.Int64UpDownCounter.Add(ctx, incr, *o...)
}
// UnixFileDescriptorCountObservable is an instrument used to record metric
// values conforming to the "process.unix.file_descriptor.count" semantic
// conventions. It represents the number of unix file descriptors in use by the
// process.
type UnixFileDescriptorCountObservable struct {
metric.Int64ObservableUpDownCounter
}
var newUnixFileDescriptorCountObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("Number of unix file descriptors in use by the process."),
metric.WithUnit("{file_descriptor}"),
}
// NewUnixFileDescriptorCountObservable returns a new
// UnixFileDescriptorCountObservable instrument.
func NewUnixFileDescriptorCountObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (UnixFileDescriptorCountObservable, error) {
// Check if the meter is nil.
if m == nil {
return UnixFileDescriptorCountObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newUnixFileDescriptorCountObservableOpts
} else {
opt = append(opt, newUnixFileDescriptorCountObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"process.unix.file_descriptor.count",
opt...,
)
if err != nil {
return UnixFileDescriptorCountObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return UnixFileDescriptorCountObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m UnixFileDescriptorCountObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (UnixFileDescriptorCountObservable) Name() string {
return "process.unix.file_descriptor.count"
}
// Unit returns the semantic convention unit of the instrument
func (UnixFileDescriptorCountObservable) Unit() string {
return "{file_descriptor}"
}
// Description returns the semantic convention description of the instrument
func (UnixFileDescriptorCountObservable) Description() string {
return "Number of unix file descriptors in use by the process."
}
// Uptime is an instrument used to record metric values conforming to the
// "process.uptime" semantic conventions. It represents the time the process has
// been running.
@@ -1241,6 +1776,64 @@ func (m Uptime) RecordSet(ctx context.Context, val float64, set attribute.Set) {
m.Float64Gauge.Record(ctx, val, *o...)
}
// UptimeObservable is an instrument used to record metric values conforming to
// the "process.uptime" semantic conventions. It represents the time the process
// has been running.
type UptimeObservable struct {
metric.Float64ObservableGauge
}
var newUptimeObservableOpts = []metric.Float64ObservableGaugeOption{
metric.WithDescription("The time the process has been running."),
metric.WithUnit("s"),
}
// NewUptimeObservable returns a new UptimeObservable instrument.
func NewUptimeObservable(
m metric.Meter,
opt ...metric.Float64ObservableGaugeOption,
) (UptimeObservable, error) {
// Check if the meter is nil.
if m == nil {
return UptimeObservable{noop.Float64ObservableGauge{}}, nil
}
if len(opt) == 0 {
opt = newUptimeObservableOpts
} else {
opt = append(opt, newUptimeObservableOpts...)
}
i, err := m.Float64ObservableGauge(
"process.uptime",
opt...,
)
if err != nil {
return UptimeObservable{noop.Float64ObservableGauge{}}, err
}
return UptimeObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m UptimeObservable) Inst() metric.Float64ObservableGauge {
return m.Float64ObservableGauge
}
// Name returns the semantic convention name of the instrument.
func (UptimeObservable) Name() string {
return "process.uptime"
}
// Unit returns the semantic convention unit of the instrument
func (UptimeObservable) Unit() string {
return "s"
}
// Description returns the semantic convention description of the instrument
func (UptimeObservable) Description() string {
return "The time the process has been running."
}
// WindowsHandleCount is an instrument used to record metric values conforming to
// the "process.windows.handle.count" semantic conventions. It represents the
// number of handles held by the process.
@@ -1338,3 +1931,62 @@ func (m WindowsHandleCount) AddSet(ctx context.Context, incr int64, set attribut
*o = append(*o, metric.WithAttributeSet(set))
m.Int64UpDownCounter.Add(ctx, incr, *o...)
}
// WindowsHandleCountObservable is an instrument used to record metric values
// conforming to the "process.windows.handle.count" semantic conventions. It
// represents the number of handles held by the process.
type WindowsHandleCountObservable struct {
metric.Int64ObservableUpDownCounter
}
var newWindowsHandleCountObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("Number of handles held by the process."),
metric.WithUnit("{handle}"),
}
// NewWindowsHandleCountObservable returns a new WindowsHandleCountObservable
// instrument.
func NewWindowsHandleCountObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (WindowsHandleCountObservable, error) {
// Check if the meter is nil.
if m == nil {
return WindowsHandleCountObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newWindowsHandleCountObservableOpts
} else {
opt = append(opt, newWindowsHandleCountObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"process.windows.handle.count",
opt...,
)
if err != nil {
return WindowsHandleCountObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return WindowsHandleCountObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m WindowsHandleCountObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (WindowsHandleCountObservable) Name() string {
return "process.windows.handle.count"
}
// Unit returns the semantic convention unit of the instrument
func (WindowsHandleCountObservable) Unit() string {
return "{handle}"
}
// Description returns the semantic convention description of the instrument
func (WindowsHandleCountObservable) Description() string {
return "Number of handles held by the process."
}
+75
View File
@@ -182,6 +182,81 @@ func (ServerActiveConnections) AttrTransport(val TransportAttr) attribute.KeyVal
return attribute.String("signalr.transport", string(val))
}
// ServerActiveConnectionsObservable is an instrument used to record metric
// values conforming to the "signalr.server.active_connections" semantic
// conventions. It represents the number of connections that are currently active
// on the server.
type ServerActiveConnectionsObservable struct {
metric.Int64ObservableUpDownCounter
}
var newServerActiveConnectionsObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("Number of connections that are currently active on the server."),
metric.WithUnit("{connection}"),
}
// NewServerActiveConnectionsObservable returns a new
// ServerActiveConnectionsObservable instrument.
func NewServerActiveConnectionsObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (ServerActiveConnectionsObservable, error) {
// Check if the meter is nil.
if m == nil {
return ServerActiveConnectionsObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newServerActiveConnectionsObservableOpts
} else {
opt = append(opt, newServerActiveConnectionsObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"signalr.server.active_connections",
opt...,
)
if err != nil {
return ServerActiveConnectionsObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return ServerActiveConnectionsObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m ServerActiveConnectionsObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (ServerActiveConnectionsObservable) Name() string {
return "signalr.server.active_connections"
}
// Unit returns the semantic convention unit of the instrument
func (ServerActiveConnectionsObservable) Unit() string {
return "{connection}"
}
// Description returns the semantic convention description of the instrument
func (ServerActiveConnectionsObservable) Description() string {
return "Number of connections that are currently active on the server."
}
// AttrConnectionStatus returns an optional attribute for the
// "signalr.connection.status" semantic convention. It represents the signalR
// HTTP connection closure status.
func (ServerActiveConnectionsObservable) AttrConnectionStatus(val ConnectionStatusAttr) attribute.KeyValue {
return attribute.String("signalr.connection.status", string(val))
}
// AttrTransport returns an optional attribute for the "signalr.transport"
// semantic convention. It represents the [SignalR transport type].
//
// [SignalR transport type]: https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md
func (ServerActiveConnectionsObservable) AttrTransport(val TransportAttr) attribute.KeyValue {
return attribute.String("signalr.transport", string(val))
}
// ServerConnectionDuration is an instrument used to record metric values
// conforming to the "signalr.server.connection.duration" semantic conventions.
// It represents the duration of connections on the server.
File diff suppressed because it is too large Load Diff
+868
View File
@@ -295,6 +295,86 @@ func (ChangeCount) AttrProviderName(val ProviderNameAttr) attribute.KeyValue {
return attribute.String("vcs.provider.name", string(val))
}
// ChangeCountObservable is an instrument used to record metric values conforming
// to the "vcs.change.count" semantic conventions. It represents the number of
// changes (pull requests/merge requests/changelists) in a repository,
// categorized by their state (e.g. open or merged).
type ChangeCountObservable struct {
metric.Int64ObservableUpDownCounter
}
var newChangeCountObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("The number of changes (pull requests/merge requests/changelists) in a repository, categorized by their state (e.g. open or merged)."),
metric.WithUnit("{change}"),
}
// NewChangeCountObservable returns a new ChangeCountObservable instrument.
func NewChangeCountObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (ChangeCountObservable, error) {
// Check if the meter is nil.
if m == nil {
return ChangeCountObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newChangeCountObservableOpts
} else {
opt = append(opt, newChangeCountObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"vcs.change.count",
opt...,
)
if err != nil {
return ChangeCountObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return ChangeCountObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m ChangeCountObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (ChangeCountObservable) Name() string {
return "vcs.change.count"
}
// Unit returns the semantic convention unit of the instrument
func (ChangeCountObservable) Unit() string {
return "{change}"
}
// Description returns the semantic convention description of the instrument
func (ChangeCountObservable) Description() string {
return "The number of changes (pull requests/merge requests/changelists) in a repository, categorized by their state (e.g. open or merged)."
}
// AttrOwnerName returns an optional attribute for the "vcs.owner.name" semantic
// convention. It represents the group owner within the version control system.
func (ChangeCountObservable) AttrOwnerName(val string) attribute.KeyValue {
return attribute.String("vcs.owner.name", val)
}
// AttrRepositoryName returns an optional attribute for the "vcs.repository.name"
// semantic convention. It represents the human readable name of the repository.
// It SHOULD NOT include any additional identifier like Group/SubGroup in GitLab
// or organization in GitHub.
func (ChangeCountObservable) AttrRepositoryName(val string) attribute.KeyValue {
return attribute.String("vcs.repository.name", val)
}
// AttrProviderName returns an optional attribute for the "vcs.provider.name"
// semantic convention. It represents the name of the version control system
// provider.
func (ChangeCountObservable) AttrProviderName(val ProviderNameAttr) attribute.KeyValue {
return attribute.String("vcs.provider.name", string(val))
}
// ChangeDuration is an instrument used to record metric values conforming to the
// "vcs.change.duration" semantic conventions. It represents the time duration a
// change (pull request/merge request/changelist) has been in a given state.
@@ -451,6 +531,86 @@ func (ChangeDuration) AttrProviderName(val ProviderNameAttr) attribute.KeyValue
return attribute.String("vcs.provider.name", string(val))
}
// ChangeDurationObservable is an instrument used to record metric values
// conforming to the "vcs.change.duration" semantic conventions. It represents
// the time duration a change (pull request/merge request/changelist) has been in
// a given state.
type ChangeDurationObservable struct {
metric.Float64ObservableGauge
}
var newChangeDurationObservableOpts = []metric.Float64ObservableGaugeOption{
metric.WithDescription("The time duration a change (pull request/merge request/changelist) has been in a given state."),
metric.WithUnit("s"),
}
// NewChangeDurationObservable returns a new ChangeDurationObservable instrument.
func NewChangeDurationObservable(
m metric.Meter,
opt ...metric.Float64ObservableGaugeOption,
) (ChangeDurationObservable, error) {
// Check if the meter is nil.
if m == nil {
return ChangeDurationObservable{noop.Float64ObservableGauge{}}, nil
}
if len(opt) == 0 {
opt = newChangeDurationObservableOpts
} else {
opt = append(opt, newChangeDurationObservableOpts...)
}
i, err := m.Float64ObservableGauge(
"vcs.change.duration",
opt...,
)
if err != nil {
return ChangeDurationObservable{noop.Float64ObservableGauge{}}, err
}
return ChangeDurationObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m ChangeDurationObservable) Inst() metric.Float64ObservableGauge {
return m.Float64ObservableGauge
}
// Name returns the semantic convention name of the instrument.
func (ChangeDurationObservable) Name() string {
return "vcs.change.duration"
}
// Unit returns the semantic convention unit of the instrument
func (ChangeDurationObservable) Unit() string {
return "s"
}
// Description returns the semantic convention description of the instrument
func (ChangeDurationObservable) Description() string {
return "The time duration a change (pull request/merge request/changelist) has been in a given state."
}
// AttrOwnerName returns an optional attribute for the "vcs.owner.name" semantic
// convention. It represents the group owner within the version control system.
func (ChangeDurationObservable) AttrOwnerName(val string) attribute.KeyValue {
return attribute.String("vcs.owner.name", val)
}
// AttrRepositoryName returns an optional attribute for the "vcs.repository.name"
// semantic convention. It represents the human readable name of the repository.
// It SHOULD NOT include any additional identifier like Group/SubGroup in GitLab
// or organization in GitHub.
func (ChangeDurationObservable) AttrRepositoryName(val string) attribute.KeyValue {
return attribute.String("vcs.repository.name", val)
}
// AttrProviderName returns an optional attribute for the "vcs.provider.name"
// semantic convention. It represents the name of the version control system
// provider.
func (ChangeDurationObservable) AttrProviderName(val ProviderNameAttr) attribute.KeyValue {
return attribute.String("vcs.provider.name", string(val))
}
// ChangeTimeToApproval is an instrument used to record metric values conforming
// to the "vcs.change.time_to_approval" semantic conventions. It represents the
// amount of time since its creation it took a change (pull request/merge
@@ -631,6 +791,116 @@ func (ChangeTimeToApproval) AttrRefHeadRevision(val string) attribute.KeyValue {
return attribute.String("vcs.ref.head.revision", val)
}
// ChangeTimeToApprovalObservable is an instrument used to record metric values
// conforming to the "vcs.change.time_to_approval" semantic conventions. It
// represents the amount of time since its creation it took a change (pull
// request/merge request/changelist) to get the first approval.
type ChangeTimeToApprovalObservable struct {
metric.Float64ObservableGauge
}
var newChangeTimeToApprovalObservableOpts = []metric.Float64ObservableGaugeOption{
metric.WithDescription("The amount of time since its creation it took a change (pull request/merge request/changelist) to get the first approval."),
metric.WithUnit("s"),
}
// NewChangeTimeToApprovalObservable returns a new ChangeTimeToApprovalObservable
// instrument.
func NewChangeTimeToApprovalObservable(
m metric.Meter,
opt ...metric.Float64ObservableGaugeOption,
) (ChangeTimeToApprovalObservable, error) {
// Check if the meter is nil.
if m == nil {
return ChangeTimeToApprovalObservable{noop.Float64ObservableGauge{}}, nil
}
if len(opt) == 0 {
opt = newChangeTimeToApprovalObservableOpts
} else {
opt = append(opt, newChangeTimeToApprovalObservableOpts...)
}
i, err := m.Float64ObservableGauge(
"vcs.change.time_to_approval",
opt...,
)
if err != nil {
return ChangeTimeToApprovalObservable{noop.Float64ObservableGauge{}}, err
}
return ChangeTimeToApprovalObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m ChangeTimeToApprovalObservable) Inst() metric.Float64ObservableGauge {
return m.Float64ObservableGauge
}
// Name returns the semantic convention name of the instrument.
func (ChangeTimeToApprovalObservable) Name() string {
return "vcs.change.time_to_approval"
}
// Unit returns the semantic convention unit of the instrument
func (ChangeTimeToApprovalObservable) Unit() string {
return "s"
}
// Description returns the semantic convention description of the instrument
func (ChangeTimeToApprovalObservable) Description() string {
return "The amount of time since its creation it took a change (pull request/merge request/changelist) to get the first approval."
}
// AttrOwnerName returns an optional attribute for the "vcs.owner.name" semantic
// convention. It represents the group owner within the version control system.
func (ChangeTimeToApprovalObservable) AttrOwnerName(val string) attribute.KeyValue {
return attribute.String("vcs.owner.name", val)
}
// AttrRefBaseName returns an optional attribute for the "vcs.ref.base.name"
// semantic convention. It represents the name of the [reference] such as
// **branch** or **tag** in the repository.
//
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
func (ChangeTimeToApprovalObservable) AttrRefBaseName(val string) attribute.KeyValue {
return attribute.String("vcs.ref.base.name", val)
}
// AttrRepositoryName returns an optional attribute for the "vcs.repository.name"
// semantic convention. It represents the human readable name of the repository.
// It SHOULD NOT include any additional identifier like Group/SubGroup in GitLab
// or organization in GitHub.
func (ChangeTimeToApprovalObservable) AttrRepositoryName(val string) attribute.KeyValue {
return attribute.String("vcs.repository.name", val)
}
// AttrProviderName returns an optional attribute for the "vcs.provider.name"
// semantic convention. It represents the name of the version control system
// provider.
func (ChangeTimeToApprovalObservable) AttrProviderName(val ProviderNameAttr) attribute.KeyValue {
return attribute.String("vcs.provider.name", string(val))
}
// AttrRefBaseRevision returns an optional attribute for the
// "vcs.ref.base.revision" semantic convention. It represents the revision,
// literally [revised version], The revision most often refers to a commit object
// in Git, or a revision number in SVN.
//
// [revised version]: https://www.merriam-webster.com/dictionary/revision
func (ChangeTimeToApprovalObservable) AttrRefBaseRevision(val string) attribute.KeyValue {
return attribute.String("vcs.ref.base.revision", val)
}
// AttrRefHeadRevision returns an optional attribute for the
// "vcs.ref.head.revision" semantic convention. It represents the revision,
// literally [revised version], The revision most often refers to a commit object
// in Git, or a revision number in SVN.
//
// [revised version]: https://www.merriam-webster.com/dictionary/revision
func (ChangeTimeToApprovalObservable) AttrRefHeadRevision(val string) attribute.KeyValue {
return attribute.String("vcs.ref.head.revision", val)
}
// ChangeTimeToMerge is an instrument used to record metric values conforming to
// the "vcs.change.time_to_merge" semantic conventions. It represents the amount
// of time since its creation it took a change (pull request/merge
@@ -811,6 +1081,116 @@ func (ChangeTimeToMerge) AttrRefHeadRevision(val string) attribute.KeyValue {
return attribute.String("vcs.ref.head.revision", val)
}
// ChangeTimeToMergeObservable is an instrument used to record metric values
// conforming to the "vcs.change.time_to_merge" semantic conventions. It
// represents the amount of time since its creation it took a change (pull
// request/merge request/changelist) to get merged into the target(base) ref.
type ChangeTimeToMergeObservable struct {
metric.Float64ObservableGauge
}
var newChangeTimeToMergeObservableOpts = []metric.Float64ObservableGaugeOption{
metric.WithDescription("The amount of time since its creation it took a change (pull request/merge request/changelist) to get merged into the target(base) ref."),
metric.WithUnit("s"),
}
// NewChangeTimeToMergeObservable returns a new ChangeTimeToMergeObservable
// instrument.
func NewChangeTimeToMergeObservable(
m metric.Meter,
opt ...metric.Float64ObservableGaugeOption,
) (ChangeTimeToMergeObservable, error) {
// Check if the meter is nil.
if m == nil {
return ChangeTimeToMergeObservable{noop.Float64ObservableGauge{}}, nil
}
if len(opt) == 0 {
opt = newChangeTimeToMergeObservableOpts
} else {
opt = append(opt, newChangeTimeToMergeObservableOpts...)
}
i, err := m.Float64ObservableGauge(
"vcs.change.time_to_merge",
opt...,
)
if err != nil {
return ChangeTimeToMergeObservable{noop.Float64ObservableGauge{}}, err
}
return ChangeTimeToMergeObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m ChangeTimeToMergeObservable) Inst() metric.Float64ObservableGauge {
return m.Float64ObservableGauge
}
// Name returns the semantic convention name of the instrument.
func (ChangeTimeToMergeObservable) Name() string {
return "vcs.change.time_to_merge"
}
// Unit returns the semantic convention unit of the instrument
func (ChangeTimeToMergeObservable) Unit() string {
return "s"
}
// Description returns the semantic convention description of the instrument
func (ChangeTimeToMergeObservable) Description() string {
return "The amount of time since its creation it took a change (pull request/merge request/changelist) to get merged into the target(base) ref."
}
// AttrOwnerName returns an optional attribute for the "vcs.owner.name" semantic
// convention. It represents the group owner within the version control system.
func (ChangeTimeToMergeObservable) AttrOwnerName(val string) attribute.KeyValue {
return attribute.String("vcs.owner.name", val)
}
// AttrRefBaseName returns an optional attribute for the "vcs.ref.base.name"
// semantic convention. It represents the name of the [reference] such as
// **branch** or **tag** in the repository.
//
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
func (ChangeTimeToMergeObservable) AttrRefBaseName(val string) attribute.KeyValue {
return attribute.String("vcs.ref.base.name", val)
}
// AttrRepositoryName returns an optional attribute for the "vcs.repository.name"
// semantic convention. It represents the human readable name of the repository.
// It SHOULD NOT include any additional identifier like Group/SubGroup in GitLab
// or organization in GitHub.
func (ChangeTimeToMergeObservable) AttrRepositoryName(val string) attribute.KeyValue {
return attribute.String("vcs.repository.name", val)
}
// AttrProviderName returns an optional attribute for the "vcs.provider.name"
// semantic convention. It represents the name of the version control system
// provider.
func (ChangeTimeToMergeObservable) AttrProviderName(val ProviderNameAttr) attribute.KeyValue {
return attribute.String("vcs.provider.name", string(val))
}
// AttrRefBaseRevision returns an optional attribute for the
// "vcs.ref.base.revision" semantic convention. It represents the revision,
// literally [revised version], The revision most often refers to a commit object
// in Git, or a revision number in SVN.
//
// [revised version]: https://www.merriam-webster.com/dictionary/revision
func (ChangeTimeToMergeObservable) AttrRefBaseRevision(val string) attribute.KeyValue {
return attribute.String("vcs.ref.base.revision", val)
}
// AttrRefHeadRevision returns an optional attribute for the
// "vcs.ref.head.revision" semantic convention. It represents the revision,
// literally [revised version], The revision most often refers to a commit object
// in Git, or a revision number in SVN.
//
// [revised version]: https://www.merriam-webster.com/dictionary/revision
func (ChangeTimeToMergeObservable) AttrRefHeadRevision(val string) attribute.KeyValue {
return attribute.String("vcs.ref.head.revision", val)
}
// ContributorCount is an instrument used to record metric values conforming to
// the "vcs.contributor.count" semantic conventions. It represents the number of
// unique contributors to a repository.
@@ -954,6 +1334,86 @@ func (ContributorCount) AttrProviderName(val ProviderNameAttr) attribute.KeyValu
return attribute.String("vcs.provider.name", string(val))
}
// ContributorCountObservable is an instrument used to record metric values
// conforming to the "vcs.contributor.count" semantic conventions. It represents
// the number of unique contributors to a repository.
type ContributorCountObservable struct {
metric.Int64ObservableGauge
}
var newContributorCountObservableOpts = []metric.Int64ObservableGaugeOption{
metric.WithDescription("The number of unique contributors to a repository."),
metric.WithUnit("{contributor}"),
}
// NewContributorCountObservable returns a new ContributorCountObservable
// instrument.
func NewContributorCountObservable(
m metric.Meter,
opt ...metric.Int64ObservableGaugeOption,
) (ContributorCountObservable, error) {
// Check if the meter is nil.
if m == nil {
return ContributorCountObservable{noop.Int64ObservableGauge{}}, nil
}
if len(opt) == 0 {
opt = newContributorCountObservableOpts
} else {
opt = append(opt, newContributorCountObservableOpts...)
}
i, err := m.Int64ObservableGauge(
"vcs.contributor.count",
opt...,
)
if err != nil {
return ContributorCountObservable{noop.Int64ObservableGauge{}}, err
}
return ContributorCountObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m ContributorCountObservable) Inst() metric.Int64ObservableGauge {
return m.Int64ObservableGauge
}
// Name returns the semantic convention name of the instrument.
func (ContributorCountObservable) Name() string {
return "vcs.contributor.count"
}
// Unit returns the semantic convention unit of the instrument
func (ContributorCountObservable) Unit() string {
return "{contributor}"
}
// Description returns the semantic convention description of the instrument
func (ContributorCountObservable) Description() string {
return "The number of unique contributors to a repository."
}
// AttrOwnerName returns an optional attribute for the "vcs.owner.name" semantic
// convention. It represents the group owner within the version control system.
func (ContributorCountObservable) AttrOwnerName(val string) attribute.KeyValue {
return attribute.String("vcs.owner.name", val)
}
// AttrRepositoryName returns an optional attribute for the "vcs.repository.name"
// semantic convention. It represents the human readable name of the repository.
// It SHOULD NOT include any additional identifier like Group/SubGroup in GitLab
// or organization in GitHub.
func (ContributorCountObservable) AttrRepositoryName(val string) attribute.KeyValue {
return attribute.String("vcs.repository.name", val)
}
// AttrProviderName returns an optional attribute for the "vcs.provider.name"
// semantic convention. It represents the name of the version control system
// provider.
func (ContributorCountObservable) AttrProviderName(val ProviderNameAttr) attribute.KeyValue {
return attribute.String("vcs.provider.name", string(val))
}
// RefCount is an instrument used to record metric values conforming to the
// "vcs.ref.count" semantic conventions. It represents the number of refs of type
// branch or tag in a repository.
@@ -1103,6 +1563,85 @@ func (RefCount) AttrProviderName(val ProviderNameAttr) attribute.KeyValue {
return attribute.String("vcs.provider.name", string(val))
}
// RefCountObservable is an instrument used to record metric values conforming to
// the "vcs.ref.count" semantic conventions. It represents the number of refs of
// type branch or tag in a repository.
type RefCountObservable struct {
metric.Int64ObservableUpDownCounter
}
var newRefCountObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("The number of refs of type branch or tag in a repository."),
metric.WithUnit("{ref}"),
}
// NewRefCountObservable returns a new RefCountObservable instrument.
func NewRefCountObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (RefCountObservable, error) {
// Check if the meter is nil.
if m == nil {
return RefCountObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newRefCountObservableOpts
} else {
opt = append(opt, newRefCountObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"vcs.ref.count",
opt...,
)
if err != nil {
return RefCountObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return RefCountObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m RefCountObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (RefCountObservable) Name() string {
return "vcs.ref.count"
}
// Unit returns the semantic convention unit of the instrument
func (RefCountObservable) Unit() string {
return "{ref}"
}
// Description returns the semantic convention description of the instrument
func (RefCountObservable) Description() string {
return "The number of refs of type branch or tag in a repository."
}
// AttrOwnerName returns an optional attribute for the "vcs.owner.name" semantic
// convention. It represents the group owner within the version control system.
func (RefCountObservable) AttrOwnerName(val string) attribute.KeyValue {
return attribute.String("vcs.owner.name", val)
}
// AttrRepositoryName returns an optional attribute for the "vcs.repository.name"
// semantic convention. It represents the human readable name of the repository.
// It SHOULD NOT include any additional identifier like Group/SubGroup in GitLab
// or organization in GitHub.
func (RefCountObservable) AttrRepositoryName(val string) attribute.KeyValue {
return attribute.String("vcs.repository.name", val)
}
// AttrProviderName returns an optional attribute for the "vcs.provider.name"
// semantic convention. It represents the name of the version control system
// provider.
func (RefCountObservable) AttrProviderName(val ProviderNameAttr) attribute.KeyValue {
return attribute.String("vcs.provider.name", string(val))
}
// RefLinesDelta is an instrument used to record metric values conforming to the
// "vcs.ref.lines_delta" semantic conventions. It represents the number of lines
// added/removed in a ref (branch) relative to the ref from the
@@ -1301,6 +1840,94 @@ func (RefLinesDelta) AttrProviderName(val ProviderNameAttr) attribute.KeyValue {
return attribute.String("vcs.provider.name", string(val))
}
// RefLinesDeltaObservable is an instrument used to record metric values
// conforming to the "vcs.ref.lines_delta" semantic conventions. It represents
// the number of lines added/removed in a ref (branch) relative to the ref from
// the `vcs.ref.base.name` attribute.
type RefLinesDeltaObservable struct {
metric.Int64ObservableGauge
}
var newRefLinesDeltaObservableOpts = []metric.Int64ObservableGaugeOption{
metric.WithDescription("The number of lines added/removed in a ref (branch) relative to the ref from the `vcs.ref.base.name` attribute."),
metric.WithUnit("{line}"),
}
// NewRefLinesDeltaObservable returns a new RefLinesDeltaObservable instrument.
func NewRefLinesDeltaObservable(
m metric.Meter,
opt ...metric.Int64ObservableGaugeOption,
) (RefLinesDeltaObservable, error) {
// Check if the meter is nil.
if m == nil {
return RefLinesDeltaObservable{noop.Int64ObservableGauge{}}, nil
}
if len(opt) == 0 {
opt = newRefLinesDeltaObservableOpts
} else {
opt = append(opt, newRefLinesDeltaObservableOpts...)
}
i, err := m.Int64ObservableGauge(
"vcs.ref.lines_delta",
opt...,
)
if err != nil {
return RefLinesDeltaObservable{noop.Int64ObservableGauge{}}, err
}
return RefLinesDeltaObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m RefLinesDeltaObservable) Inst() metric.Int64ObservableGauge {
return m.Int64ObservableGauge
}
// Name returns the semantic convention name of the instrument.
func (RefLinesDeltaObservable) Name() string {
return "vcs.ref.lines_delta"
}
// Unit returns the semantic convention unit of the instrument
func (RefLinesDeltaObservable) Unit() string {
return "{line}"
}
// Description returns the semantic convention description of the instrument
func (RefLinesDeltaObservable) Description() string {
return "The number of lines added/removed in a ref (branch) relative to the ref from the `vcs.ref.base.name` attribute."
}
// AttrChangeID returns an optional attribute for the "vcs.change.id" semantic
// convention. It represents the ID of the change (pull request/merge
// request/changelist) if applicable. This is usually a unique (within
// repository) identifier generated by the VCS system.
func (RefLinesDeltaObservable) AttrChangeID(val string) attribute.KeyValue {
return attribute.String("vcs.change.id", val)
}
// AttrOwnerName returns an optional attribute for the "vcs.owner.name" semantic
// convention. It represents the group owner within the version control system.
func (RefLinesDeltaObservable) AttrOwnerName(val string) attribute.KeyValue {
return attribute.String("vcs.owner.name", val)
}
// AttrRepositoryName returns an optional attribute for the "vcs.repository.name"
// semantic convention. It represents the human readable name of the repository.
// It SHOULD NOT include any additional identifier like Group/SubGroup in GitLab
// or organization in GitHub.
func (RefLinesDeltaObservable) AttrRepositoryName(val string) attribute.KeyValue {
return attribute.String("vcs.repository.name", val)
}
// AttrProviderName returns an optional attribute for the "vcs.provider.name"
// semantic convention. It represents the name of the version control system
// provider.
func (RefLinesDeltaObservable) AttrProviderName(val ProviderNameAttr) attribute.KeyValue {
return attribute.String("vcs.provider.name", string(val))
}
// RefRevisionsDelta is an instrument used to record metric values conforming to
// the "vcs.ref.revisions_delta" semantic conventions. It represents the number
// of revisions (commits) a ref (branch) is ahead/behind the branch from the
@@ -1494,6 +2121,95 @@ func (RefRevisionsDelta) AttrProviderName(val ProviderNameAttr) attribute.KeyVal
return attribute.String("vcs.provider.name", string(val))
}
// RefRevisionsDeltaObservable is an instrument used to record metric values
// conforming to the "vcs.ref.revisions_delta" semantic conventions. It
// represents the number of revisions (commits) a ref (branch) is ahead/behind
// the branch from the `vcs.ref.base.name` attribute.
type RefRevisionsDeltaObservable struct {
metric.Int64ObservableGauge
}
var newRefRevisionsDeltaObservableOpts = []metric.Int64ObservableGaugeOption{
metric.WithDescription("The number of revisions (commits) a ref (branch) is ahead/behind the branch from the `vcs.ref.base.name` attribute."),
metric.WithUnit("{revision}"),
}
// NewRefRevisionsDeltaObservable returns a new RefRevisionsDeltaObservable
// instrument.
func NewRefRevisionsDeltaObservable(
m metric.Meter,
opt ...metric.Int64ObservableGaugeOption,
) (RefRevisionsDeltaObservable, error) {
// Check if the meter is nil.
if m == nil {
return RefRevisionsDeltaObservable{noop.Int64ObservableGauge{}}, nil
}
if len(opt) == 0 {
opt = newRefRevisionsDeltaObservableOpts
} else {
opt = append(opt, newRefRevisionsDeltaObservableOpts...)
}
i, err := m.Int64ObservableGauge(
"vcs.ref.revisions_delta",
opt...,
)
if err != nil {
return RefRevisionsDeltaObservable{noop.Int64ObservableGauge{}}, err
}
return RefRevisionsDeltaObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m RefRevisionsDeltaObservable) Inst() metric.Int64ObservableGauge {
return m.Int64ObservableGauge
}
// Name returns the semantic convention name of the instrument.
func (RefRevisionsDeltaObservable) Name() string {
return "vcs.ref.revisions_delta"
}
// Unit returns the semantic convention unit of the instrument
func (RefRevisionsDeltaObservable) Unit() string {
return "{revision}"
}
// Description returns the semantic convention description of the instrument
func (RefRevisionsDeltaObservable) Description() string {
return "The number of revisions (commits) a ref (branch) is ahead/behind the branch from the `vcs.ref.base.name` attribute."
}
// AttrChangeID returns an optional attribute for the "vcs.change.id" semantic
// convention. It represents the ID of the change (pull request/merge
// request/changelist) if applicable. This is usually a unique (within
// repository) identifier generated by the VCS system.
func (RefRevisionsDeltaObservable) AttrChangeID(val string) attribute.KeyValue {
return attribute.String("vcs.change.id", val)
}
// AttrOwnerName returns an optional attribute for the "vcs.owner.name" semantic
// convention. It represents the group owner within the version control system.
func (RefRevisionsDeltaObservable) AttrOwnerName(val string) attribute.KeyValue {
return attribute.String("vcs.owner.name", val)
}
// AttrRepositoryName returns an optional attribute for the "vcs.repository.name"
// semantic convention. It represents the human readable name of the repository.
// It SHOULD NOT include any additional identifier like Group/SubGroup in GitLab
// or organization in GitHub.
func (RefRevisionsDeltaObservable) AttrRepositoryName(val string) attribute.KeyValue {
return attribute.String("vcs.repository.name", val)
}
// AttrProviderName returns an optional attribute for the "vcs.provider.name"
// semantic convention. It represents the name of the version control system
// provider.
func (RefRevisionsDeltaObservable) AttrProviderName(val ProviderNameAttr) attribute.KeyValue {
return attribute.String("vcs.provider.name", string(val))
}
// RefTime is an instrument used to record metric values conforming to the
// "vcs.ref.time" semantic conventions. It represents the time a ref (branch)
// created from the default branch (trunk) has existed. The `ref.type` attribute
@@ -1651,6 +2367,86 @@ func (RefTime) AttrProviderName(val ProviderNameAttr) attribute.KeyValue {
return attribute.String("vcs.provider.name", string(val))
}
// RefTimeObservable is an instrument used to record metric values conforming to
// the "vcs.ref.time" semantic conventions. It represents the time a ref (branch)
// created from the default branch (trunk) has existed. The `ref.type` attribute
// will always be `branch`.
type RefTimeObservable struct {
metric.Float64ObservableGauge
}
var newRefTimeObservableOpts = []metric.Float64ObservableGaugeOption{
metric.WithDescription("Time a ref (branch) created from the default branch (trunk) has existed. The `ref.type` attribute will always be `branch`."),
metric.WithUnit("s"),
}
// NewRefTimeObservable returns a new RefTimeObservable instrument.
func NewRefTimeObservable(
m metric.Meter,
opt ...metric.Float64ObservableGaugeOption,
) (RefTimeObservable, error) {
// Check if the meter is nil.
if m == nil {
return RefTimeObservable{noop.Float64ObservableGauge{}}, nil
}
if len(opt) == 0 {
opt = newRefTimeObservableOpts
} else {
opt = append(opt, newRefTimeObservableOpts...)
}
i, err := m.Float64ObservableGauge(
"vcs.ref.time",
opt...,
)
if err != nil {
return RefTimeObservable{noop.Float64ObservableGauge{}}, err
}
return RefTimeObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m RefTimeObservable) Inst() metric.Float64ObservableGauge {
return m.Float64ObservableGauge
}
// Name returns the semantic convention name of the instrument.
func (RefTimeObservable) Name() string {
return "vcs.ref.time"
}
// Unit returns the semantic convention unit of the instrument
func (RefTimeObservable) Unit() string {
return "s"
}
// Description returns the semantic convention description of the instrument
func (RefTimeObservable) Description() string {
return "Time a ref (branch) created from the default branch (trunk) has existed. The `ref.type` attribute will always be `branch`."
}
// AttrOwnerName returns an optional attribute for the "vcs.owner.name" semantic
// convention. It represents the group owner within the version control system.
func (RefTimeObservable) AttrOwnerName(val string) attribute.KeyValue {
return attribute.String("vcs.owner.name", val)
}
// AttrRepositoryName returns an optional attribute for the "vcs.repository.name"
// semantic convention. It represents the human readable name of the repository.
// It SHOULD NOT include any additional identifier like Group/SubGroup in GitLab
// or organization in GitHub.
func (RefTimeObservable) AttrRepositoryName(val string) attribute.KeyValue {
return attribute.String("vcs.repository.name", val)
}
// AttrProviderName returns an optional attribute for the "vcs.provider.name"
// semantic convention. It represents the name of the version control system
// provider.
func (RefTimeObservable) AttrProviderName(val ProviderNameAttr) attribute.KeyValue {
return attribute.String("vcs.provider.name", string(val))
}
// RepositoryCount is an instrument used to record metric values conforming to
// the "vcs.repository.count" semantic conventions. It represents the number of
// repositories in an organization.
@@ -1773,3 +2569,75 @@ func (RepositoryCount) AttrOwnerName(val string) attribute.KeyValue {
func (RepositoryCount) AttrProviderName(val ProviderNameAttr) attribute.KeyValue {
return attribute.String("vcs.provider.name", string(val))
}
// RepositoryCountObservable is an instrument used to record metric values
// conforming to the "vcs.repository.count" semantic conventions. It represents
// the number of repositories in an organization.
type RepositoryCountObservable struct {
metric.Int64ObservableUpDownCounter
}
var newRepositoryCountObservableOpts = []metric.Int64ObservableUpDownCounterOption{
metric.WithDescription("The number of repositories in an organization."),
metric.WithUnit("{repository}"),
}
// NewRepositoryCountObservable returns a new RepositoryCountObservable
// instrument.
func NewRepositoryCountObservable(
m metric.Meter,
opt ...metric.Int64ObservableUpDownCounterOption,
) (RepositoryCountObservable, error) {
// Check if the meter is nil.
if m == nil {
return RepositoryCountObservable{noop.Int64ObservableUpDownCounter{}}, nil
}
if len(opt) == 0 {
opt = newRepositoryCountObservableOpts
} else {
opt = append(opt, newRepositoryCountObservableOpts...)
}
i, err := m.Int64ObservableUpDownCounter(
"vcs.repository.count",
opt...,
)
if err != nil {
return RepositoryCountObservable{noop.Int64ObservableUpDownCounter{}}, err
}
return RepositoryCountObservable{i}, nil
}
// Inst returns the underlying metric instrument.
func (m RepositoryCountObservable) Inst() metric.Int64ObservableUpDownCounter {
return m.Int64ObservableUpDownCounter
}
// Name returns the semantic convention name of the instrument.
func (RepositoryCountObservable) Name() string {
return "vcs.repository.count"
}
// Unit returns the semantic convention unit of the instrument
func (RepositoryCountObservable) Unit() string {
return "{repository}"
}
// Description returns the semantic convention description of the instrument
func (RepositoryCountObservable) Description() string {
return "The number of repositories in an organization."
}
// AttrOwnerName returns an optional attribute for the "vcs.owner.name" semantic
// convention. It represents the group owner within the version control system.
func (RepositoryCountObservable) AttrOwnerName(val string) attribute.KeyValue {
return attribute.String("vcs.owner.name", val)
}
// AttrProviderName returns an optional attribute for the "vcs.provider.name"
// semantic convention. It represents the name of the version control system
// provider.
func (RepositoryCountObservable) AttrProviderName(val ProviderNameAttr) attribute.KeyValue {
return attribute.String("vcs.provider.name", string(val))
}