You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-11-23 22:34:47 +02:00
Do not allocate instrument options if possible in generated semconv packages (#7328)
Avoid allocating instrument creation option if possible. If a user does not provide any options, use a static, read-only, file-level defined option slice. Otherwise, append to the user allocated slice the description and unit options.
This commit is contained in:
@@ -58,6 +58,11 @@ type {{ metric_name }} struct {
|
||||
metric.{{ metric_inst }}
|
||||
}
|
||||
|
||||
var new{{ metric_name }}Opts = []metric.{{ metric_inst }}Option{
|
||||
metric.WithDescription("{{ i.desc(metric) }}"),
|
||||
metric.WithUnit("{{metric.unit}}"),
|
||||
}
|
||||
|
||||
{{ ["New" ~ metric_name ~ " returns a new " ~ metric_name ~ " instrument."] | comment }}
|
||||
func New{{ metric_name }}(
|
||||
m metric.Meter,
|
||||
@@ -68,12 +73,15 @@ func New{{ metric_name }}(
|
||||
return {{metric_name}}{noop.{{ metric_inst }}{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = new{{ metric_name }}Opts
|
||||
} else {
|
||||
opt = append(opt, new{{ metric_name }}Opts...)
|
||||
}
|
||||
|
||||
i, err := m.{{ metric_inst }}(
|
||||
"{{metric.metric_name}}",
|
||||
append([]metric.{{ metric_inst }}Option{
|
||||
metric.WithDescription("{{ i.desc(metric) }}"),
|
||||
metric.WithUnit("{{metric.unit}}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return {{metric_name}}{noop.{{ metric_inst }}{}}, err
|
||||
|
||||
@@ -59,6 +59,11 @@ type CosmosDBClientActiveInstanceCount struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newCosmosDBClientActiveInstanceCountOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Number of active client instances."),
|
||||
metric.WithUnit("{instance}"),
|
||||
}
|
||||
|
||||
// NewCosmosDBClientActiveInstanceCount returns a new
|
||||
// CosmosDBClientActiveInstanceCount instrument.
|
||||
func NewCosmosDBClientActiveInstanceCount(
|
||||
@@ -70,12 +75,15 @@ func NewCosmosDBClientActiveInstanceCount(
|
||||
return CosmosDBClientActiveInstanceCount{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newCosmosDBClientActiveInstanceCountOpts
|
||||
} else {
|
||||
opt = append(opt, newCosmosDBClientActiveInstanceCountOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"azure.cosmosdb.client.active_instance.count",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Number of active client instances."),
|
||||
metric.WithUnit("{instance}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return CosmosDBClientActiveInstanceCount{noop.Int64UpDownCounter{}}, err
|
||||
@@ -171,6 +179,11 @@ type CosmosDBClientOperationRequestCharge struct {
|
||||
metric.Int64Histogram
|
||||
}
|
||||
|
||||
var newCosmosDBClientOperationRequestChargeOpts = []metric.Int64HistogramOption{
|
||||
metric.WithDescription("[Request units](https://learn.microsoft.com/azure/cosmos-db/request-units) consumed by the operation."),
|
||||
metric.WithUnit("{request_unit}"),
|
||||
}
|
||||
|
||||
// NewCosmosDBClientOperationRequestCharge returns a new
|
||||
// CosmosDBClientOperationRequestCharge instrument.
|
||||
func NewCosmosDBClientOperationRequestCharge(
|
||||
@@ -182,12 +195,15 @@ func NewCosmosDBClientOperationRequestCharge(
|
||||
return CosmosDBClientOperationRequestCharge{noop.Int64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newCosmosDBClientOperationRequestChargeOpts
|
||||
} else {
|
||||
opt = append(opt, newCosmosDBClientOperationRequestChargeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Histogram(
|
||||
"azure.cosmosdb.client.operation.request_charge",
|
||||
append([]metric.Int64HistogramOption{
|
||||
metric.WithDescription("[Request units](https://learn.microsoft.com/azure/cosmos-db/request-units) consumed by the operation."),
|
||||
metric.WithUnit("{request_unit}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return CosmosDBClientOperationRequestCharge{noop.Int64Histogram{}}, err
|
||||
|
||||
@@ -97,6 +97,11 @@ type PipelineRunActive struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newPipelineRunActiveOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The number of pipeline runs currently active in the system by state."),
|
||||
metric.WithUnit("{run}"),
|
||||
}
|
||||
|
||||
// NewPipelineRunActive returns a new PipelineRunActive instrument.
|
||||
func NewPipelineRunActive(
|
||||
m metric.Meter,
|
||||
@@ -107,12 +112,15 @@ func NewPipelineRunActive(
|
||||
return PipelineRunActive{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newPipelineRunActiveOpts
|
||||
} else {
|
||||
opt = append(opt, newPipelineRunActiveOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"cicd.pipeline.run.active",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The number of pipeline runs currently active in the system by state."),
|
||||
metric.WithUnit("{run}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return PipelineRunActive{noop.Int64UpDownCounter{}}, err
|
||||
@@ -203,6 +211,11 @@ type PipelineRunDuration struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newPipelineRunDurationOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("Duration of a pipeline run grouped by pipeline, state and result."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewPipelineRunDuration returns a new PipelineRunDuration instrument.
|
||||
func NewPipelineRunDuration(
|
||||
m metric.Meter,
|
||||
@@ -213,12 +226,15 @@ func NewPipelineRunDuration(
|
||||
return PipelineRunDuration{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newPipelineRunDurationOpts
|
||||
} else {
|
||||
opt = append(opt, newPipelineRunDurationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"cicd.pipeline.run.duration",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("Duration of a pipeline run grouped by pipeline, state and result."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return PipelineRunDuration{noop.Float64Histogram{}}, err
|
||||
@@ -324,6 +340,11 @@ type PipelineRunErrors struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newPipelineRunErrorsOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("The number of errors encountered in pipeline runs (eg. compile, test failures)."),
|
||||
metric.WithUnit("{error}"),
|
||||
}
|
||||
|
||||
// NewPipelineRunErrors returns a new PipelineRunErrors instrument.
|
||||
func NewPipelineRunErrors(
|
||||
m metric.Meter,
|
||||
@@ -334,12 +355,15 @@ func NewPipelineRunErrors(
|
||||
return PipelineRunErrors{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newPipelineRunErrorsOpts
|
||||
} else {
|
||||
opt = append(opt, newPipelineRunErrorsOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"cicd.pipeline.run.errors",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("The number of errors encountered in pipeline runs (eg. compile, test failures)."),
|
||||
metric.WithUnit("{error}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return PipelineRunErrors{noop.Int64Counter{}}, err
|
||||
@@ -439,6 +463,11 @@ type SystemErrors struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newSystemErrorsOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("The number of errors in a component of the CICD system (eg. controller, scheduler, agent)."),
|
||||
metric.WithUnit("{error}"),
|
||||
}
|
||||
|
||||
// NewSystemErrors returns a new SystemErrors instrument.
|
||||
func NewSystemErrors(
|
||||
m metric.Meter,
|
||||
@@ -449,12 +478,15 @@ func NewSystemErrors(
|
||||
return SystemErrors{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newSystemErrorsOpts
|
||||
} else {
|
||||
opt = append(opt, newSystemErrorsOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"cicd.system.errors",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("The number of errors in a component of the CICD system (eg. controller, scheduler, agent)."),
|
||||
metric.WithUnit("{error}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return SystemErrors{noop.Int64Counter{}}, err
|
||||
@@ -549,6 +581,11 @@ type WorkerCount struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newWorkerCountOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The number of workers on the CICD system by state."),
|
||||
metric.WithUnit("{count}"),
|
||||
}
|
||||
|
||||
// NewWorkerCount returns a new WorkerCount instrument.
|
||||
func NewWorkerCount(
|
||||
m metric.Meter,
|
||||
@@ -559,12 +596,15 @@ func NewWorkerCount(
|
||||
return WorkerCount{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newWorkerCountOpts
|
||||
} else {
|
||||
opt = append(opt, newWorkerCountOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"cicd.worker.count",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The number of workers on the CICD system by state."),
|
||||
metric.WithUnit("{count}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return WorkerCount{noop.Int64UpDownCounter{}}, err
|
||||
|
||||
@@ -78,6 +78,11 @@ type CPUTime struct {
|
||||
metric.Float64Counter
|
||||
}
|
||||
|
||||
var newCPUTimeOpts = []metric.Float64CounterOption{
|
||||
metric.WithDescription("Total CPU time consumed."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewCPUTime returns a new CPUTime instrument.
|
||||
func NewCPUTime(
|
||||
m metric.Meter,
|
||||
@@ -88,12 +93,15 @@ func NewCPUTime(
|
||||
return CPUTime{noop.Float64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newCPUTimeOpts
|
||||
} else {
|
||||
opt = append(opt, newCPUTimeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Counter(
|
||||
"container.cpu.time",
|
||||
append([]metric.Float64CounterOption{
|
||||
metric.WithDescription("Total CPU time consumed."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return CPUTime{noop.Float64Counter{}}, err
|
||||
@@ -186,6 +194,11 @@ type CPUUsage struct {
|
||||
metric.Int64Gauge
|
||||
}
|
||||
|
||||
var newCPUUsageOpts = []metric.Int64GaugeOption{
|
||||
metric.WithDescription("Container's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs."),
|
||||
metric.WithUnit("{cpu}"),
|
||||
}
|
||||
|
||||
// NewCPUUsage returns a new CPUUsage instrument.
|
||||
func NewCPUUsage(
|
||||
m metric.Meter,
|
||||
@@ -196,12 +209,15 @@ func NewCPUUsage(
|
||||
return CPUUsage{noop.Int64Gauge{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newCPUUsageOpts
|
||||
} else {
|
||||
opt = append(opt, newCPUUsageOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Gauge(
|
||||
"container.cpu.usage",
|
||||
append([]metric.Int64GaugeOption{
|
||||
metric.WithDescription("Container's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs."),
|
||||
metric.WithUnit("{cpu}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return CPUUsage{noop.Int64Gauge{}}, err
|
||||
@@ -295,6 +311,11 @@ type DiskIO struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newDiskIOOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("Disk bytes for the container."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewDiskIO returns a new DiskIO instrument.
|
||||
func NewDiskIO(
|
||||
m metric.Meter,
|
||||
@@ -305,12 +326,15 @@ func NewDiskIO(
|
||||
return DiskIO{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newDiskIOOpts
|
||||
} else {
|
||||
opt = append(opt, newDiskIOOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"container.disk.io",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("Disk bytes for the container."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return DiskIO{noop.Int64Counter{}}, err
|
||||
@@ -409,6 +433,11 @@ type FilesystemAvailable struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newFilesystemAvailableOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Container filesystem available bytes."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewFilesystemAvailable returns a new FilesystemAvailable instrument.
|
||||
func NewFilesystemAvailable(
|
||||
m metric.Meter,
|
||||
@@ -419,12 +448,15 @@ func NewFilesystemAvailable(
|
||||
return FilesystemAvailable{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newFilesystemAvailableOpts
|
||||
} else {
|
||||
opt = append(opt, newFilesystemAvailableOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"container.filesystem.available",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Container filesystem available bytes."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return FilesystemAvailable{noop.Int64UpDownCounter{}}, err
|
||||
@@ -509,6 +541,11 @@ type FilesystemCapacity struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newFilesystemCapacityOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Container filesystem capacity."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewFilesystemCapacity returns a new FilesystemCapacity instrument.
|
||||
func NewFilesystemCapacity(
|
||||
m metric.Meter,
|
||||
@@ -519,12 +556,15 @@ func NewFilesystemCapacity(
|
||||
return FilesystemCapacity{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newFilesystemCapacityOpts
|
||||
} else {
|
||||
opt = append(opt, newFilesystemCapacityOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"container.filesystem.capacity",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Container filesystem capacity."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return FilesystemCapacity{noop.Int64UpDownCounter{}}, err
|
||||
@@ -609,6 +649,11 @@ type FilesystemUsage struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newFilesystemUsageOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Container filesystem usage."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewFilesystemUsage returns a new FilesystemUsage instrument.
|
||||
func NewFilesystemUsage(
|
||||
m metric.Meter,
|
||||
@@ -619,12 +664,15 @@ func NewFilesystemUsage(
|
||||
return FilesystemUsage{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newFilesystemUsageOpts
|
||||
} else {
|
||||
opt = append(opt, newFilesystemUsageOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"container.filesystem.usage",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Container filesystem usage."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return FilesystemUsage{noop.Int64UpDownCounter{}}, err
|
||||
@@ -713,6 +761,11 @@ type MemoryUsage struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newMemoryUsageOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("Memory usage of the container."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewMemoryUsage returns a new MemoryUsage instrument.
|
||||
func NewMemoryUsage(
|
||||
m metric.Meter,
|
||||
@@ -723,12 +776,15 @@ func NewMemoryUsage(
|
||||
return MemoryUsage{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newMemoryUsageOpts
|
||||
} else {
|
||||
opt = append(opt, newMemoryUsageOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"container.memory.usage",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("Memory usage of the container."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return MemoryUsage{noop.Int64Counter{}}, err
|
||||
@@ -801,6 +857,11 @@ type NetworkIO struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newNetworkIOOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("Network bytes for the container."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewNetworkIO returns a new NetworkIO instrument.
|
||||
func NewNetworkIO(
|
||||
m metric.Meter,
|
||||
@@ -811,12 +872,15 @@ func NewNetworkIO(
|
||||
return NetworkIO{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newNetworkIOOpts
|
||||
} else {
|
||||
opt = append(opt, newNetworkIOOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"container.network.io",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("Network bytes for the container."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return NetworkIO{noop.Int64Counter{}}, err
|
||||
@@ -915,6 +979,11 @@ type Uptime struct {
|
||||
metric.Float64Gauge
|
||||
}
|
||||
|
||||
var newUptimeOpts = []metric.Float64GaugeOption{
|
||||
metric.WithDescription("The time the container has been running."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewUptime returns a new Uptime instrument.
|
||||
func NewUptime(
|
||||
m metric.Meter,
|
||||
@@ -925,12 +994,15 @@ func NewUptime(
|
||||
return Uptime{noop.Float64Gauge{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newUptimeOpts
|
||||
} else {
|
||||
opt = append(opt, newUptimeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Gauge(
|
||||
"container.uptime",
|
||||
append([]metric.Float64GaugeOption{
|
||||
metric.WithDescription("The time the container has been running."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return Uptime{noop.Float64Gauge{}}, err
|
||||
|
||||
@@ -224,6 +224,11 @@ type ClientConnectionCount struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newClientConnectionCountOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The number of connections that are currently in state described by the `state` attribute."),
|
||||
metric.WithUnit("{connection}"),
|
||||
}
|
||||
|
||||
// NewClientConnectionCount returns a new ClientConnectionCount instrument.
|
||||
func NewClientConnectionCount(
|
||||
m metric.Meter,
|
||||
@@ -234,12 +239,15 @@ func NewClientConnectionCount(
|
||||
return ClientConnectionCount{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientConnectionCountOpts
|
||||
} else {
|
||||
opt = append(opt, newClientConnectionCountOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"db.client.connection.count",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The number of connections that are currently in state described by the `state` attribute."),
|
||||
metric.WithUnit("{connection}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientConnectionCount{noop.Int64UpDownCounter{}}, err
|
||||
@@ -334,6 +342,11 @@ type ClientConnectionCreateTime struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newClientConnectionCreateTimeOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("The time it took to create a new connection."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewClientConnectionCreateTime returns a new ClientConnectionCreateTime
|
||||
// instrument.
|
||||
func NewClientConnectionCreateTime(
|
||||
@@ -345,12 +358,15 @@ func NewClientConnectionCreateTime(
|
||||
return ClientConnectionCreateTime{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientConnectionCreateTimeOpts
|
||||
} else {
|
||||
opt = append(opt, newClientConnectionCreateTimeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"db.client.connection.create_time",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("The time it took to create a new connection."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientConnectionCreateTime{noop.Float64Histogram{}}, err
|
||||
@@ -440,6 +456,11 @@ type ClientConnectionIdleMax struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newClientConnectionIdleMaxOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The maximum number of idle open connections allowed."),
|
||||
metric.WithUnit("{connection}"),
|
||||
}
|
||||
|
||||
// NewClientConnectionIdleMax returns a new ClientConnectionIdleMax instrument.
|
||||
func NewClientConnectionIdleMax(
|
||||
m metric.Meter,
|
||||
@@ -450,12 +471,15 @@ func NewClientConnectionIdleMax(
|
||||
return ClientConnectionIdleMax{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientConnectionIdleMaxOpts
|
||||
} else {
|
||||
opt = append(opt, newClientConnectionIdleMaxOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"db.client.connection.idle.max",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The maximum number of idle open connections allowed."),
|
||||
metric.WithUnit("{connection}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientConnectionIdleMax{noop.Int64UpDownCounter{}}, err
|
||||
@@ -546,6 +570,11 @@ type ClientConnectionIdleMin struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newClientConnectionIdleMinOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The minimum number of idle open connections allowed."),
|
||||
metric.WithUnit("{connection}"),
|
||||
}
|
||||
|
||||
// NewClientConnectionIdleMin returns a new ClientConnectionIdleMin instrument.
|
||||
func NewClientConnectionIdleMin(
|
||||
m metric.Meter,
|
||||
@@ -556,12 +585,15 @@ func NewClientConnectionIdleMin(
|
||||
return ClientConnectionIdleMin{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientConnectionIdleMinOpts
|
||||
} else {
|
||||
opt = append(opt, newClientConnectionIdleMinOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"db.client.connection.idle.min",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The minimum number of idle open connections allowed."),
|
||||
metric.WithUnit("{connection}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientConnectionIdleMin{noop.Int64UpDownCounter{}}, err
|
||||
@@ -652,6 +684,11 @@ type ClientConnectionMax struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newClientConnectionMaxOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The maximum number of open connections allowed."),
|
||||
metric.WithUnit("{connection}"),
|
||||
}
|
||||
|
||||
// NewClientConnectionMax returns a new ClientConnectionMax instrument.
|
||||
func NewClientConnectionMax(
|
||||
m metric.Meter,
|
||||
@@ -662,12 +699,15 @@ func NewClientConnectionMax(
|
||||
return ClientConnectionMax{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientConnectionMaxOpts
|
||||
} else {
|
||||
opt = append(opt, newClientConnectionMaxOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"db.client.connection.max",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The maximum number of open connections allowed."),
|
||||
metric.WithUnit("{connection}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientConnectionMax{noop.Int64UpDownCounter{}}, err
|
||||
@@ -759,6 +799,11 @@ type ClientConnectionPendingRequests struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newClientConnectionPendingRequestsOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The number of current pending requests for an open connection."),
|
||||
metric.WithUnit("{request}"),
|
||||
}
|
||||
|
||||
// NewClientConnectionPendingRequests returns a new
|
||||
// ClientConnectionPendingRequests instrument.
|
||||
func NewClientConnectionPendingRequests(
|
||||
@@ -770,12 +815,15 @@ func NewClientConnectionPendingRequests(
|
||||
return ClientConnectionPendingRequests{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientConnectionPendingRequestsOpts
|
||||
} else {
|
||||
opt = append(opt, newClientConnectionPendingRequestsOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"db.client.connection.pending_requests",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The number of current pending requests for an open connection."),
|
||||
metric.WithUnit("{request}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientConnectionPendingRequests{noop.Int64UpDownCounter{}}, err
|
||||
@@ -867,6 +915,11 @@ type ClientConnectionTimeouts struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newClientConnectionTimeoutsOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("The number of connection timeouts that have occurred trying to obtain a connection from the pool."),
|
||||
metric.WithUnit("{timeout}"),
|
||||
}
|
||||
|
||||
// NewClientConnectionTimeouts returns a new ClientConnectionTimeouts instrument.
|
||||
func NewClientConnectionTimeouts(
|
||||
m metric.Meter,
|
||||
@@ -877,12 +930,15 @@ func NewClientConnectionTimeouts(
|
||||
return ClientConnectionTimeouts{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientConnectionTimeoutsOpts
|
||||
} else {
|
||||
opt = append(opt, newClientConnectionTimeoutsOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"db.client.connection.timeouts",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("The number of connection timeouts that have occurred trying to obtain a connection from the pool."),
|
||||
metric.WithUnit("{timeout}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientConnectionTimeouts{noop.Int64Counter{}}, err
|
||||
@@ -974,6 +1030,11 @@ type ClientConnectionUseTime struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newClientConnectionUseTimeOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("The time between borrowing a connection and returning it to the pool."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewClientConnectionUseTime returns a new ClientConnectionUseTime instrument.
|
||||
func NewClientConnectionUseTime(
|
||||
m metric.Meter,
|
||||
@@ -984,12 +1045,15 @@ func NewClientConnectionUseTime(
|
||||
return ClientConnectionUseTime{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientConnectionUseTimeOpts
|
||||
} else {
|
||||
opt = append(opt, newClientConnectionUseTimeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"db.client.connection.use_time",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("The time between borrowing a connection and returning it to the pool."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientConnectionUseTime{noop.Float64Histogram{}}, err
|
||||
@@ -1079,6 +1143,11 @@ type ClientConnectionWaitTime struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newClientConnectionWaitTimeOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("The time it took to obtain an open connection from the pool."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewClientConnectionWaitTime returns a new ClientConnectionWaitTime instrument.
|
||||
func NewClientConnectionWaitTime(
|
||||
m metric.Meter,
|
||||
@@ -1089,12 +1158,15 @@ func NewClientConnectionWaitTime(
|
||||
return ClientConnectionWaitTime{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientConnectionWaitTimeOpts
|
||||
} else {
|
||||
opt = append(opt, newClientConnectionWaitTimeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"db.client.connection.wait_time",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("The time it took to obtain an open connection from the pool."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientConnectionWaitTime{noop.Float64Histogram{}}, err
|
||||
@@ -1184,6 +1256,11 @@ type ClientOperationDuration struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newClientOperationDurationOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("Duration of database client operations."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewClientOperationDuration returns a new ClientOperationDuration instrument.
|
||||
func NewClientOperationDuration(
|
||||
m metric.Meter,
|
||||
@@ -1194,12 +1271,15 @@ func NewClientOperationDuration(
|
||||
return ClientOperationDuration{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientOperationDurationOpts
|
||||
} else {
|
||||
opt = append(opt, newClientOperationDurationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"db.client.operation.duration",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("Duration of database client operations."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientOperationDuration{noop.Float64Histogram{}}, err
|
||||
@@ -1371,6 +1451,11 @@ type ClientResponseReturnedRows struct {
|
||||
metric.Int64Histogram
|
||||
}
|
||||
|
||||
var newClientResponseReturnedRowsOpts = []metric.Int64HistogramOption{
|
||||
metric.WithDescription("The actual number of records returned by the database operation."),
|
||||
metric.WithUnit("{row}"),
|
||||
}
|
||||
|
||||
// NewClientResponseReturnedRows returns a new ClientResponseReturnedRows
|
||||
// instrument.
|
||||
func NewClientResponseReturnedRows(
|
||||
@@ -1382,12 +1467,15 @@ func NewClientResponseReturnedRows(
|
||||
return ClientResponseReturnedRows{noop.Int64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientResponseReturnedRowsOpts
|
||||
} else {
|
||||
opt = append(opt, newClientResponseReturnedRowsOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Histogram(
|
||||
"db.client.response.returned_rows",
|
||||
append([]metric.Int64HistogramOption{
|
||||
metric.WithDescription("The actual number of records returned by the database operation."),
|
||||
metric.WithUnit("{row}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientResponseReturnedRows{noop.Int64Histogram{}}, err
|
||||
|
||||
@@ -38,6 +38,11 @@ type LookupDuration struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newLookupDurationOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("Measures the time taken to perform a DNS lookup."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewLookupDuration returns a new LookupDuration instrument.
|
||||
func NewLookupDuration(
|
||||
m metric.Meter,
|
||||
@@ -48,12 +53,15 @@ func NewLookupDuration(
|
||||
return LookupDuration{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newLookupDurationOpts
|
||||
} else {
|
||||
opt = append(opt, newLookupDurationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"dns.lookup.duration",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("Measures the time taken to perform a DNS lookup."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return LookupDuration{noop.Float64Histogram{}}, err
|
||||
|
||||
@@ -48,6 +48,11 @@ type Coldstarts struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newColdstartsOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("Number of invocation cold starts."),
|
||||
metric.WithUnit("{coldstart}"),
|
||||
}
|
||||
|
||||
// NewColdstarts returns a new Coldstarts instrument.
|
||||
func NewColdstarts(
|
||||
m metric.Meter,
|
||||
@@ -58,12 +63,15 @@ func NewColdstarts(
|
||||
return Coldstarts{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newColdstartsOpts
|
||||
} else {
|
||||
opt = append(opt, newColdstartsOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"faas.coldstarts",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("Number of invocation cold starts."),
|
||||
metric.WithUnit("{coldstart}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return Coldstarts{noop.Int64Counter{}}, err
|
||||
@@ -151,6 +159,11 @@ type CPUUsage struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newCPUUsageOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("Distribution of CPU usage per invocation."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewCPUUsage returns a new CPUUsage instrument.
|
||||
func NewCPUUsage(
|
||||
m metric.Meter,
|
||||
@@ -161,12 +174,15 @@ func NewCPUUsage(
|
||||
return CPUUsage{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newCPUUsageOpts
|
||||
} else {
|
||||
opt = append(opt, newCPUUsageOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"faas.cpu_usage",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("Distribution of CPU usage per invocation."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return CPUUsage{noop.Float64Histogram{}}, err
|
||||
@@ -253,6 +269,11 @@ type Errors struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newErrorsOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("Number of invocation errors."),
|
||||
metric.WithUnit("{error}"),
|
||||
}
|
||||
|
||||
// NewErrors returns a new Errors instrument.
|
||||
func NewErrors(
|
||||
m metric.Meter,
|
||||
@@ -263,12 +284,15 @@ func NewErrors(
|
||||
return Errors{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newErrorsOpts
|
||||
} else {
|
||||
opt = append(opt, newErrorsOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"faas.errors",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("Number of invocation errors."),
|
||||
metric.WithUnit("{error}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return Errors{noop.Int64Counter{}}, err
|
||||
@@ -356,6 +380,11 @@ type InitDuration struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newInitDurationOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("Measures the duration of the function's initialization, such as a cold start."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewInitDuration returns a new InitDuration instrument.
|
||||
func NewInitDuration(
|
||||
m metric.Meter,
|
||||
@@ -366,12 +395,15 @@ func NewInitDuration(
|
||||
return InitDuration{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newInitDurationOpts
|
||||
} else {
|
||||
opt = append(opt, newInitDurationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"faas.init_duration",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("Measures the duration of the function's initialization, such as a cold start."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return InitDuration{noop.Float64Histogram{}}, err
|
||||
@@ -458,6 +490,11 @@ type Invocations struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newInvocationsOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("Number of successful invocations."),
|
||||
metric.WithUnit("{invocation}"),
|
||||
}
|
||||
|
||||
// NewInvocations returns a new Invocations instrument.
|
||||
func NewInvocations(
|
||||
m metric.Meter,
|
||||
@@ -468,12 +505,15 @@ func NewInvocations(
|
||||
return Invocations{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newInvocationsOpts
|
||||
} else {
|
||||
opt = append(opt, newInvocationsOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"faas.invocations",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("Number of successful invocations."),
|
||||
metric.WithUnit("{invocation}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return Invocations{noop.Int64Counter{}}, err
|
||||
@@ -561,6 +601,11 @@ type InvokeDuration struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newInvokeDurationOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("Measures the duration of the function's logic execution."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewInvokeDuration returns a new InvokeDuration instrument.
|
||||
func NewInvokeDuration(
|
||||
m metric.Meter,
|
||||
@@ -571,12 +616,15 @@ func NewInvokeDuration(
|
||||
return InvokeDuration{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newInvokeDurationOpts
|
||||
} else {
|
||||
opt = append(opt, newInvokeDurationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"faas.invoke_duration",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("Measures the duration of the function's logic execution."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return InvokeDuration{noop.Float64Histogram{}}, err
|
||||
@@ -663,6 +711,11 @@ type MemUsage struct {
|
||||
metric.Int64Histogram
|
||||
}
|
||||
|
||||
var newMemUsageOpts = []metric.Int64HistogramOption{
|
||||
metric.WithDescription("Distribution of max memory usage per invocation."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewMemUsage returns a new MemUsage instrument.
|
||||
func NewMemUsage(
|
||||
m metric.Meter,
|
||||
@@ -673,12 +726,15 @@ func NewMemUsage(
|
||||
return MemUsage{noop.Int64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newMemUsageOpts
|
||||
} else {
|
||||
opt = append(opt, newMemUsageOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Histogram(
|
||||
"faas.mem_usage",
|
||||
append([]metric.Int64HistogramOption{
|
||||
metric.WithDescription("Distribution of max memory usage per invocation."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return MemUsage{noop.Int64Histogram{}}, err
|
||||
@@ -765,6 +821,11 @@ type NetIO struct {
|
||||
metric.Int64Histogram
|
||||
}
|
||||
|
||||
var newNetIOOpts = []metric.Int64HistogramOption{
|
||||
metric.WithDescription("Distribution of net I/O usage per invocation."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewNetIO returns a new NetIO instrument.
|
||||
func NewNetIO(
|
||||
m metric.Meter,
|
||||
@@ -775,12 +836,15 @@ func NewNetIO(
|
||||
return NetIO{noop.Int64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newNetIOOpts
|
||||
} else {
|
||||
opt = append(opt, newNetIOOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Histogram(
|
||||
"faas.net_io",
|
||||
append([]metric.Int64HistogramOption{
|
||||
metric.WithDescription("Distribution of net I/O usage per invocation."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return NetIO{noop.Int64Histogram{}}, err
|
||||
@@ -867,6 +931,11 @@ type Timeouts struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newTimeoutsOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("Number of invocation timeouts."),
|
||||
metric.WithUnit("{timeout}"),
|
||||
}
|
||||
|
||||
// NewTimeouts returns a new Timeouts instrument.
|
||||
func NewTimeouts(
|
||||
m metric.Meter,
|
||||
@@ -877,12 +946,15 @@ func NewTimeouts(
|
||||
return Timeouts{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newTimeoutsOpts
|
||||
} else {
|
||||
opt = append(opt, newTimeoutsOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"faas.timeouts",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("Number of invocation timeouts."),
|
||||
metric.WithUnit("{timeout}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return Timeouts{noop.Int64Counter{}}, err
|
||||
|
||||
@@ -147,6 +147,11 @@ type ClientOperationDuration struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newClientOperationDurationOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("GenAI operation duration."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewClientOperationDuration returns a new ClientOperationDuration instrument.
|
||||
func NewClientOperationDuration(
|
||||
m metric.Meter,
|
||||
@@ -157,12 +162,15 @@ func NewClientOperationDuration(
|
||||
return ClientOperationDuration{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientOperationDurationOpts
|
||||
} else {
|
||||
opt = append(opt, newClientOperationDurationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"gen_ai.client.operation.duration",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("GenAI operation duration."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientOperationDuration{noop.Float64Histogram{}}, err
|
||||
@@ -286,6 +294,11 @@ type ClientTokenUsage struct {
|
||||
metric.Int64Histogram
|
||||
}
|
||||
|
||||
var newClientTokenUsageOpts = []metric.Int64HistogramOption{
|
||||
metric.WithDescription("Number of input and output tokens used."),
|
||||
metric.WithUnit("{token}"),
|
||||
}
|
||||
|
||||
// NewClientTokenUsage returns a new ClientTokenUsage instrument.
|
||||
func NewClientTokenUsage(
|
||||
m metric.Meter,
|
||||
@@ -296,12 +309,15 @@ func NewClientTokenUsage(
|
||||
return ClientTokenUsage{noop.Int64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientTokenUsageOpts
|
||||
} else {
|
||||
opt = append(opt, newClientTokenUsageOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Histogram(
|
||||
"gen_ai.client.token.usage",
|
||||
append([]metric.Int64HistogramOption{
|
||||
metric.WithDescription("Number of input and output tokens used."),
|
||||
metric.WithUnit("{token}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientTokenUsage{noop.Int64Histogram{}}, err
|
||||
@@ -423,6 +439,11 @@ type ServerRequestDuration struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newServerRequestDurationOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("Generative AI server request duration such as time-to-last byte or last output token."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewServerRequestDuration returns a new ServerRequestDuration instrument.
|
||||
func NewServerRequestDuration(
|
||||
m metric.Meter,
|
||||
@@ -433,12 +454,15 @@ func NewServerRequestDuration(
|
||||
return ServerRequestDuration{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newServerRequestDurationOpts
|
||||
} else {
|
||||
opt = append(opt, newServerRequestDurationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"gen_ai.server.request.duration",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("Generative AI server request duration such as time-to-last byte or last output token."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ServerRequestDuration{noop.Float64Histogram{}}, err
|
||||
@@ -563,6 +587,11 @@ type ServerTimePerOutputToken struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newServerTimePerOutputTokenOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("Time per output token generated after the first token for successful responses."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewServerTimePerOutputToken returns a new ServerTimePerOutputToken instrument.
|
||||
func NewServerTimePerOutputToken(
|
||||
m metric.Meter,
|
||||
@@ -573,12 +602,15 @@ func NewServerTimePerOutputToken(
|
||||
return ServerTimePerOutputToken{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newServerTimePerOutputTokenOpts
|
||||
} else {
|
||||
opt = append(opt, newServerTimePerOutputTokenOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"gen_ai.server.time_per_output_token",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("Time per output token generated after the first token for successful responses."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ServerTimePerOutputToken{noop.Float64Histogram{}}, err
|
||||
@@ -695,6 +727,11 @@ type ServerTimeToFirstToken struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newServerTimeToFirstTokenOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("Time to generate first token for successful responses."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewServerTimeToFirstToken returns a new ServerTimeToFirstToken instrument.
|
||||
func NewServerTimeToFirstToken(
|
||||
m metric.Meter,
|
||||
@@ -705,12 +742,15 @@ func NewServerTimeToFirstToken(
|
||||
return ServerTimeToFirstToken{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newServerTimeToFirstTokenOpts
|
||||
} else {
|
||||
opt = append(opt, newServerTimeToFirstTokenOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"gen_ai.server.time_to_first_token",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("Time to generate first token for successful responses."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ServerTimeToFirstToken{noop.Float64Histogram{}}, err
|
||||
|
||||
@@ -41,6 +41,11 @@ type ConfigGogc struct {
|
||||
metric.Int64ObservableUpDownCounter
|
||||
}
|
||||
|
||||
var newConfigGogcOpts = []metric.Int64ObservableUpDownCounterOption{
|
||||
metric.WithDescription("Heap size target percentage configured by the user, otherwise 100."),
|
||||
metric.WithUnit("%"),
|
||||
}
|
||||
|
||||
// NewConfigGogc returns a new ConfigGogc instrument.
|
||||
func NewConfigGogc(
|
||||
m metric.Meter,
|
||||
@@ -51,12 +56,15 @@ func NewConfigGogc(
|
||||
return ConfigGogc{noop.Int64ObservableUpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newConfigGogcOpts
|
||||
} else {
|
||||
opt = append(opt, newConfigGogcOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64ObservableUpDownCounter(
|
||||
"go.config.gogc",
|
||||
append([]metric.Int64ObservableUpDownCounterOption{
|
||||
metric.WithDescription("Heap size target percentage configured by the user, otherwise 100."),
|
||||
metric.WithUnit("%"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ConfigGogc{noop.Int64ObservableUpDownCounter{}}, err
|
||||
@@ -91,6 +99,11 @@ type GoroutineCount struct {
|
||||
metric.Int64ObservableUpDownCounter
|
||||
}
|
||||
|
||||
var newGoroutineCountOpts = []metric.Int64ObservableUpDownCounterOption{
|
||||
metric.WithDescription("Count of live goroutines."),
|
||||
metric.WithUnit("{goroutine}"),
|
||||
}
|
||||
|
||||
// NewGoroutineCount returns a new GoroutineCount instrument.
|
||||
func NewGoroutineCount(
|
||||
m metric.Meter,
|
||||
@@ -101,12 +114,15 @@ func NewGoroutineCount(
|
||||
return GoroutineCount{noop.Int64ObservableUpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newGoroutineCountOpts
|
||||
} else {
|
||||
opt = append(opt, newGoroutineCountOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64ObservableUpDownCounter(
|
||||
"go.goroutine.count",
|
||||
append([]metric.Int64ObservableUpDownCounterOption{
|
||||
metric.WithDescription("Count of live goroutines."),
|
||||
metric.WithUnit("{goroutine}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return GoroutineCount{noop.Int64ObservableUpDownCounter{}}, err
|
||||
@@ -141,6 +157,11 @@ type MemoryAllocated struct {
|
||||
metric.Int64ObservableCounter
|
||||
}
|
||||
|
||||
var newMemoryAllocatedOpts = []metric.Int64ObservableCounterOption{
|
||||
metric.WithDescription("Memory allocated to the heap by the application."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewMemoryAllocated returns a new MemoryAllocated instrument.
|
||||
func NewMemoryAllocated(
|
||||
m metric.Meter,
|
||||
@@ -151,12 +172,15 @@ func NewMemoryAllocated(
|
||||
return MemoryAllocated{noop.Int64ObservableCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newMemoryAllocatedOpts
|
||||
} else {
|
||||
opt = append(opt, newMemoryAllocatedOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64ObservableCounter(
|
||||
"go.memory.allocated",
|
||||
append([]metric.Int64ObservableCounterOption{
|
||||
metric.WithDescription("Memory allocated to the heap by the application."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return MemoryAllocated{noop.Int64ObservableCounter{}}, err
|
||||
@@ -191,6 +215,11 @@ type MemoryAllocations struct {
|
||||
metric.Int64ObservableCounter
|
||||
}
|
||||
|
||||
var newMemoryAllocationsOpts = []metric.Int64ObservableCounterOption{
|
||||
metric.WithDescription("Count of allocations to the heap by the application."),
|
||||
metric.WithUnit("{allocation}"),
|
||||
}
|
||||
|
||||
// NewMemoryAllocations returns a new MemoryAllocations instrument.
|
||||
func NewMemoryAllocations(
|
||||
m metric.Meter,
|
||||
@@ -201,12 +230,15 @@ func NewMemoryAllocations(
|
||||
return MemoryAllocations{noop.Int64ObservableCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newMemoryAllocationsOpts
|
||||
} else {
|
||||
opt = append(opt, newMemoryAllocationsOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64ObservableCounter(
|
||||
"go.memory.allocations",
|
||||
append([]metric.Int64ObservableCounterOption{
|
||||
metric.WithDescription("Count of allocations to the heap by the application."),
|
||||
metric.WithUnit("{allocation}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return MemoryAllocations{noop.Int64ObservableCounter{}}, err
|
||||
@@ -241,6 +273,11 @@ type MemoryGCGoal struct {
|
||||
metric.Int64ObservableUpDownCounter
|
||||
}
|
||||
|
||||
var newMemoryGCGoalOpts = []metric.Int64ObservableUpDownCounterOption{
|
||||
metric.WithDescription("Heap size target for the end of the GC cycle."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewMemoryGCGoal returns a new MemoryGCGoal instrument.
|
||||
func NewMemoryGCGoal(
|
||||
m metric.Meter,
|
||||
@@ -251,12 +288,15 @@ func NewMemoryGCGoal(
|
||||
return MemoryGCGoal{noop.Int64ObservableUpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newMemoryGCGoalOpts
|
||||
} else {
|
||||
opt = append(opt, newMemoryGCGoalOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64ObservableUpDownCounter(
|
||||
"go.memory.gc.goal",
|
||||
append([]metric.Int64ObservableUpDownCounterOption{
|
||||
metric.WithDescription("Heap size target for the end of the GC cycle."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return MemoryGCGoal{noop.Int64ObservableUpDownCounter{}}, err
|
||||
@@ -291,6 +331,11 @@ type MemoryLimit struct {
|
||||
metric.Int64ObservableUpDownCounter
|
||||
}
|
||||
|
||||
var newMemoryLimitOpts = []metric.Int64ObservableUpDownCounterOption{
|
||||
metric.WithDescription("Go runtime memory limit configured by the user, if a limit exists."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewMemoryLimit returns a new MemoryLimit instrument.
|
||||
func NewMemoryLimit(
|
||||
m metric.Meter,
|
||||
@@ -301,12 +346,15 @@ func NewMemoryLimit(
|
||||
return MemoryLimit{noop.Int64ObservableUpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newMemoryLimitOpts
|
||||
} else {
|
||||
opt = append(opt, newMemoryLimitOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64ObservableUpDownCounter(
|
||||
"go.memory.limit",
|
||||
append([]metric.Int64ObservableUpDownCounterOption{
|
||||
metric.WithDescription("Go runtime memory limit configured by the user, if a limit exists."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return MemoryLimit{noop.Int64ObservableUpDownCounter{}}, err
|
||||
@@ -341,6 +389,11 @@ type MemoryUsed struct {
|
||||
metric.Int64ObservableUpDownCounter
|
||||
}
|
||||
|
||||
var newMemoryUsedOpts = []metric.Int64ObservableUpDownCounterOption{
|
||||
metric.WithDescription("Memory used by the Go runtime."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewMemoryUsed returns a new MemoryUsed instrument.
|
||||
func NewMemoryUsed(
|
||||
m metric.Meter,
|
||||
@@ -351,12 +404,15 @@ func NewMemoryUsed(
|
||||
return MemoryUsed{noop.Int64ObservableUpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newMemoryUsedOpts
|
||||
} else {
|
||||
opt = append(opt, newMemoryUsedOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64ObservableUpDownCounter(
|
||||
"go.memory.used",
|
||||
append([]metric.Int64ObservableUpDownCounterOption{
|
||||
metric.WithDescription("Memory used by the Go runtime."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return MemoryUsed{noop.Int64ObservableUpDownCounter{}}, err
|
||||
@@ -397,6 +453,11 @@ type ProcessorLimit struct {
|
||||
metric.Int64ObservableUpDownCounter
|
||||
}
|
||||
|
||||
var newProcessorLimitOpts = []metric.Int64ObservableUpDownCounterOption{
|
||||
metric.WithDescription("The number of OS threads that can execute user-level Go code simultaneously."),
|
||||
metric.WithUnit("{thread}"),
|
||||
}
|
||||
|
||||
// NewProcessorLimit returns a new ProcessorLimit instrument.
|
||||
func NewProcessorLimit(
|
||||
m metric.Meter,
|
||||
@@ -407,12 +468,15 @@ func NewProcessorLimit(
|
||||
return ProcessorLimit{noop.Int64ObservableUpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newProcessorLimitOpts
|
||||
} else {
|
||||
opt = append(opt, newProcessorLimitOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64ObservableUpDownCounter(
|
||||
"go.processor.limit",
|
||||
append([]metric.Int64ObservableUpDownCounterOption{
|
||||
metric.WithDescription("The number of OS threads that can execute user-level Go code simultaneously."),
|
||||
metric.WithUnit("{thread}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ProcessorLimit{noop.Int64ObservableUpDownCounter{}}, err
|
||||
@@ -448,6 +512,11 @@ type ScheduleDuration struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newScheduleDurationOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("The time goroutines have spent in the scheduler in a runnable state before actually running."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewScheduleDuration returns a new ScheduleDuration instrument.
|
||||
func NewScheduleDuration(
|
||||
m metric.Meter,
|
||||
@@ -458,12 +527,15 @@ func NewScheduleDuration(
|
||||
return ScheduleDuration{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newScheduleDurationOpts
|
||||
} else {
|
||||
opt = append(opt, newScheduleDurationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"go.schedule.duration",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("The time goroutines have spent in the scheduler in a runnable state before actually running."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ScheduleDuration{noop.Float64Histogram{}}, err
|
||||
|
||||
@@ -91,6 +91,11 @@ type ClientActiveRequests struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newClientActiveRequestsOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Number of active HTTP requests."),
|
||||
metric.WithUnit("{request}"),
|
||||
}
|
||||
|
||||
// NewClientActiveRequests returns a new ClientActiveRequests instrument.
|
||||
func NewClientActiveRequests(
|
||||
m metric.Meter,
|
||||
@@ -101,12 +106,15 @@ func NewClientActiveRequests(
|
||||
return ClientActiveRequests{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientActiveRequestsOpts
|
||||
} else {
|
||||
opt = append(opt, newClientActiveRequestsOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"http.client.active_requests",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Number of active HTTP requests."),
|
||||
metric.WithUnit("{request}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientActiveRequests{noop.Int64UpDownCounter{}}, err
|
||||
@@ -223,6 +231,11 @@ type ClientConnectionDuration struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newClientConnectionDurationOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("The duration of the successfully established outbound HTTP connections."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewClientConnectionDuration returns a new ClientConnectionDuration instrument.
|
||||
func NewClientConnectionDuration(
|
||||
m metric.Meter,
|
||||
@@ -233,12 +246,15 @@ func NewClientConnectionDuration(
|
||||
return ClientConnectionDuration{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientConnectionDurationOpts
|
||||
} else {
|
||||
opt = append(opt, newClientConnectionDurationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"http.client.connection.duration",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("The duration of the successfully established outbound HTTP connections."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientConnectionDuration{noop.Float64Histogram{}}, err
|
||||
@@ -353,6 +369,11 @@ type ClientOpenConnections struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newClientOpenConnectionsOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Number of outbound HTTP connections that are currently active or idle on the client."),
|
||||
metric.WithUnit("{connection}"),
|
||||
}
|
||||
|
||||
// NewClientOpenConnections returns a new ClientOpenConnections instrument.
|
||||
func NewClientOpenConnections(
|
||||
m metric.Meter,
|
||||
@@ -363,12 +384,15 @@ func NewClientOpenConnections(
|
||||
return ClientOpenConnections{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientOpenConnectionsOpts
|
||||
} else {
|
||||
opt = append(opt, newClientOpenConnectionsOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"http.client.open_connections",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Number of outbound HTTP connections that are currently active or idle on the client."),
|
||||
metric.WithUnit("{connection}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientOpenConnections{noop.Int64UpDownCounter{}}, err
|
||||
@@ -488,6 +512,11 @@ type ClientRequestBodySize struct {
|
||||
metric.Int64Histogram
|
||||
}
|
||||
|
||||
var newClientRequestBodySizeOpts = []metric.Int64HistogramOption{
|
||||
metric.WithDescription("Size of HTTP client request bodies."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewClientRequestBodySize returns a new ClientRequestBodySize instrument.
|
||||
func NewClientRequestBodySize(
|
||||
m metric.Meter,
|
||||
@@ -498,12 +527,15 @@ func NewClientRequestBodySize(
|
||||
return ClientRequestBodySize{noop.Int64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientRequestBodySizeOpts
|
||||
} else {
|
||||
opt = append(opt, newClientRequestBodySizeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Histogram(
|
||||
"http.client.request.body.size",
|
||||
append([]metric.Int64HistogramOption{
|
||||
metric.WithDescription("Size of HTTP client request bodies."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientRequestBodySize{noop.Int64Histogram{}}, err
|
||||
@@ -662,6 +694,11 @@ type ClientRequestDuration struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newClientRequestDurationOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("Duration of HTTP client requests."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewClientRequestDuration returns a new ClientRequestDuration instrument.
|
||||
func NewClientRequestDuration(
|
||||
m metric.Meter,
|
||||
@@ -672,12 +709,15 @@ func NewClientRequestDuration(
|
||||
return ClientRequestDuration{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientRequestDurationOpts
|
||||
} else {
|
||||
opt = append(opt, newClientRequestDurationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"http.client.request.duration",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("Duration of HTTP client requests."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientRequestDuration{noop.Float64Histogram{}}, err
|
||||
@@ -822,6 +862,11 @@ type ClientResponseBodySize struct {
|
||||
metric.Int64Histogram
|
||||
}
|
||||
|
||||
var newClientResponseBodySizeOpts = []metric.Int64HistogramOption{
|
||||
metric.WithDescription("Size of HTTP client response bodies."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewClientResponseBodySize returns a new ClientResponseBodySize instrument.
|
||||
func NewClientResponseBodySize(
|
||||
m metric.Meter,
|
||||
@@ -832,12 +877,15 @@ func NewClientResponseBodySize(
|
||||
return ClientResponseBodySize{noop.Int64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientResponseBodySizeOpts
|
||||
} else {
|
||||
opt = append(opt, newClientResponseBodySizeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Histogram(
|
||||
"http.client.response.body.size",
|
||||
append([]metric.Int64HistogramOption{
|
||||
metric.WithDescription("Size of HTTP client response bodies."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientResponseBodySize{noop.Int64Histogram{}}, err
|
||||
@@ -996,6 +1044,11 @@ type ServerActiveRequests struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newServerActiveRequestsOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Number of active HTTP server requests."),
|
||||
metric.WithUnit("{request}"),
|
||||
}
|
||||
|
||||
// NewServerActiveRequests returns a new ServerActiveRequests instrument.
|
||||
func NewServerActiveRequests(
|
||||
m metric.Meter,
|
||||
@@ -1006,12 +1059,15 @@ func NewServerActiveRequests(
|
||||
return ServerActiveRequests{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newServerActiveRequestsOpts
|
||||
} else {
|
||||
opt = append(opt, newServerActiveRequestsOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"http.server.active_requests",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Number of active HTTP server requests."),
|
||||
metric.WithUnit("{request}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ServerActiveRequests{noop.Int64UpDownCounter{}}, err
|
||||
@@ -1118,6 +1174,11 @@ type ServerRequestBodySize struct {
|
||||
metric.Int64Histogram
|
||||
}
|
||||
|
||||
var newServerRequestBodySizeOpts = []metric.Int64HistogramOption{
|
||||
metric.WithDescription("Size of HTTP server request bodies."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewServerRequestBodySize returns a new ServerRequestBodySize instrument.
|
||||
func NewServerRequestBodySize(
|
||||
m metric.Meter,
|
||||
@@ -1128,12 +1189,15 @@ func NewServerRequestBodySize(
|
||||
return ServerRequestBodySize{noop.Int64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newServerRequestBodySizeOpts
|
||||
} else {
|
||||
opt = append(opt, newServerRequestBodySizeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Histogram(
|
||||
"http.server.request.body.size",
|
||||
append([]metric.Int64HistogramOption{
|
||||
metric.WithDescription("Size of HTTP server request bodies."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ServerRequestBodySize{noop.Int64Histogram{}}, err
|
||||
@@ -1299,6 +1363,11 @@ type ServerRequestDuration struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newServerRequestDurationOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("Duration of HTTP server requests."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewServerRequestDuration returns a new ServerRequestDuration instrument.
|
||||
func NewServerRequestDuration(
|
||||
m metric.Meter,
|
||||
@@ -1309,12 +1378,15 @@ func NewServerRequestDuration(
|
||||
return ServerRequestDuration{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newServerRequestDurationOpts
|
||||
} else {
|
||||
opt = append(opt, newServerRequestDurationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"http.server.request.duration",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("Duration of HTTP server requests."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ServerRequestDuration{noop.Float64Histogram{}}, err
|
||||
@@ -1466,6 +1538,11 @@ type ServerResponseBodySize struct {
|
||||
metric.Int64Histogram
|
||||
}
|
||||
|
||||
var newServerResponseBodySizeOpts = []metric.Int64HistogramOption{
|
||||
metric.WithDescription("Size of HTTP server response bodies."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewServerResponseBodySize returns a new ServerResponseBodySize instrument.
|
||||
func NewServerResponseBodySize(
|
||||
m metric.Meter,
|
||||
@@ -1476,12 +1553,15 @@ func NewServerResponseBodySize(
|
||||
return ServerResponseBodySize{noop.Int64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newServerResponseBodySizeOpts
|
||||
} else {
|
||||
opt = append(opt, newServerResponseBodySizeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Histogram(
|
||||
"http.server.response.body.size",
|
||||
append([]metric.Int64HistogramOption{
|
||||
metric.WithDescription("Size of HTTP server response bodies."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ServerResponseBodySize{noop.Int64Histogram{}}, err
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -95,6 +95,11 @@ type ClientConsumedMessages struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newClientConsumedMessagesOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("Number of messages that were delivered to the application."),
|
||||
metric.WithUnit("{message}"),
|
||||
}
|
||||
|
||||
// NewClientConsumedMessages returns a new ClientConsumedMessages instrument.
|
||||
func NewClientConsumedMessages(
|
||||
m metric.Meter,
|
||||
@@ -105,12 +110,15 @@ func NewClientConsumedMessages(
|
||||
return ClientConsumedMessages{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientConsumedMessagesOpts
|
||||
} else {
|
||||
opt = append(opt, newClientConsumedMessagesOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"messaging.client.consumed.messages",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("Number of messages that were delivered to the application."),
|
||||
metric.WithUnit("{message}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientConsumedMessages{noop.Int64Counter{}}, err
|
||||
@@ -273,6 +281,11 @@ type ClientOperationDuration struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newClientOperationDurationOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("Duration of messaging operation initiated by a producer or consumer client."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewClientOperationDuration returns a new ClientOperationDuration instrument.
|
||||
func NewClientOperationDuration(
|
||||
m metric.Meter,
|
||||
@@ -283,12 +296,15 @@ func NewClientOperationDuration(
|
||||
return ClientOperationDuration{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientOperationDurationOpts
|
||||
} else {
|
||||
opt = append(opt, newClientOperationDurationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"messaging.client.operation.duration",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("Duration of messaging operation initiated by a producer or consumer client."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientOperationDuration{noop.Float64Histogram{}}, err
|
||||
@@ -448,6 +464,11 @@ type ClientSentMessages struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newClientSentMessagesOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("Number of messages producer attempted to send to the broker."),
|
||||
metric.WithUnit("{message}"),
|
||||
}
|
||||
|
||||
// NewClientSentMessages returns a new ClientSentMessages instrument.
|
||||
func NewClientSentMessages(
|
||||
m metric.Meter,
|
||||
@@ -458,12 +479,15 @@ func NewClientSentMessages(
|
||||
return ClientSentMessages{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientSentMessagesOpts
|
||||
} else {
|
||||
opt = append(opt, newClientSentMessagesOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"messaging.client.sent.messages",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("Number of messages producer attempted to send to the broker."),
|
||||
metric.WithUnit("{message}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientSentMessages{noop.Int64Counter{}}, err
|
||||
@@ -603,6 +627,11 @@ type ProcessDuration struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newProcessDurationOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("Duration of processing operation."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewProcessDuration returns a new ProcessDuration instrument.
|
||||
func NewProcessDuration(
|
||||
m metric.Meter,
|
||||
@@ -613,12 +642,15 @@ func NewProcessDuration(
|
||||
return ProcessDuration{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newProcessDurationOpts
|
||||
} else {
|
||||
opt = append(opt, newProcessDurationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"messaging.process.duration",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("Duration of processing operation."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ProcessDuration{noop.Float64Histogram{}}, err
|
||||
|
||||
@@ -172,6 +172,11 @@ type SDKExporterLogExported struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newSDKExporterLogExportedOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("The number of log records for which the export has finished, either successful or failed."),
|
||||
metric.WithUnit("{log_record}"),
|
||||
}
|
||||
|
||||
// NewSDKExporterLogExported returns a new SDKExporterLogExported instrument.
|
||||
func NewSDKExporterLogExported(
|
||||
m metric.Meter,
|
||||
@@ -182,12 +187,15 @@ func NewSDKExporterLogExported(
|
||||
return SDKExporterLogExported{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newSDKExporterLogExportedOpts
|
||||
} else {
|
||||
opt = append(opt, newSDKExporterLogExportedOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"otel.sdk.exporter.log.exported",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("The number of log records for which the export has finished, either successful or failed."),
|
||||
metric.WithUnit("{log_record}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return SDKExporterLogExported{noop.Int64Counter{}}, err
|
||||
@@ -319,6 +327,11 @@ type SDKExporterLogInflight struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newSDKExporterLogInflightOpts = []metric.Int64UpDownCounterOption{
|
||||
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}"),
|
||||
}
|
||||
|
||||
// NewSDKExporterLogInflight returns a new SDKExporterLogInflight instrument.
|
||||
func NewSDKExporterLogInflight(
|
||||
m metric.Meter,
|
||||
@@ -329,12 +342,15 @@ func NewSDKExporterLogInflight(
|
||||
return SDKExporterLogInflight{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newSDKExporterLogInflightOpts
|
||||
} else {
|
||||
opt = append(opt, newSDKExporterLogInflightOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"otel.sdk.exporter.log.inflight",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
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}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return SDKExporterLogInflight{noop.Int64UpDownCounter{}}, err
|
||||
@@ -449,6 +465,11 @@ type SDKExporterMetricDataPointExported struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newSDKExporterMetricDataPointExportedOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("The number of metric data points for which the export has finished, either successful or failed."),
|
||||
metric.WithUnit("{data_point}"),
|
||||
}
|
||||
|
||||
// NewSDKExporterMetricDataPointExported returns a new
|
||||
// SDKExporterMetricDataPointExported instrument.
|
||||
func NewSDKExporterMetricDataPointExported(
|
||||
@@ -460,12 +481,15 @@ func NewSDKExporterMetricDataPointExported(
|
||||
return SDKExporterMetricDataPointExported{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newSDKExporterMetricDataPointExportedOpts
|
||||
} else {
|
||||
opt = append(opt, newSDKExporterMetricDataPointExportedOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"otel.sdk.exporter.metric_data_point.exported",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("The number of metric data points for which the export has finished, either successful or failed."),
|
||||
metric.WithUnit("{data_point}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return SDKExporterMetricDataPointExported{noop.Int64Counter{}}, err
|
||||
@@ -598,6 +622,11 @@ type SDKExporterMetricDataPointInflight struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newSDKExporterMetricDataPointInflightOpts = []metric.Int64UpDownCounterOption{
|
||||
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}"),
|
||||
}
|
||||
|
||||
// NewSDKExporterMetricDataPointInflight returns a new
|
||||
// SDKExporterMetricDataPointInflight instrument.
|
||||
func NewSDKExporterMetricDataPointInflight(
|
||||
@@ -609,12 +638,15 @@ func NewSDKExporterMetricDataPointInflight(
|
||||
return SDKExporterMetricDataPointInflight{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newSDKExporterMetricDataPointInflightOpts
|
||||
} else {
|
||||
opt = append(opt, newSDKExporterMetricDataPointInflightOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"otel.sdk.exporter.metric_data_point.inflight",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
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}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return SDKExporterMetricDataPointInflight{noop.Int64UpDownCounter{}}, err
|
||||
@@ -728,6 +760,11 @@ type SDKExporterOperationDuration struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newSDKExporterOperationDurationOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("The duration of exporting a batch of telemetry records."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewSDKExporterOperationDuration returns a new SDKExporterOperationDuration
|
||||
// instrument.
|
||||
func NewSDKExporterOperationDuration(
|
||||
@@ -739,12 +776,15 @@ func NewSDKExporterOperationDuration(
|
||||
return SDKExporterOperationDuration{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newSDKExporterOperationDurationOpts
|
||||
} else {
|
||||
opt = append(opt, newSDKExporterOperationDurationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"otel.sdk.exporter.operation.duration",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("The duration of exporting a batch of telemetry records."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return SDKExporterOperationDuration{noop.Float64Histogram{}}, err
|
||||
@@ -893,6 +933,11 @@ type SDKExporterSpanExported struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newSDKExporterSpanExportedOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("The number of spans for which the export has finished, either successful or failed."),
|
||||
metric.WithUnit("{span}"),
|
||||
}
|
||||
|
||||
// NewSDKExporterSpanExported returns a new SDKExporterSpanExported instrument.
|
||||
func NewSDKExporterSpanExported(
|
||||
m metric.Meter,
|
||||
@@ -903,12 +948,15 @@ func NewSDKExporterSpanExported(
|
||||
return SDKExporterSpanExported{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newSDKExporterSpanExportedOpts
|
||||
} else {
|
||||
opt = append(opt, newSDKExporterSpanExportedOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"otel.sdk.exporter.span.exported",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("The number of spans for which the export has finished, either successful or failed."),
|
||||
metric.WithUnit("{span}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return SDKExporterSpanExported{noop.Int64Counter{}}, err
|
||||
@@ -1040,6 +1088,11 @@ type SDKExporterSpanInflight struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newSDKExporterSpanInflightOpts = []metric.Int64UpDownCounterOption{
|
||||
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}"),
|
||||
}
|
||||
|
||||
// NewSDKExporterSpanInflight returns a new SDKExporterSpanInflight instrument.
|
||||
func NewSDKExporterSpanInflight(
|
||||
m metric.Meter,
|
||||
@@ -1050,12 +1103,15 @@ func NewSDKExporterSpanInflight(
|
||||
return SDKExporterSpanInflight{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newSDKExporterSpanInflightOpts
|
||||
} else {
|
||||
opt = append(opt, newSDKExporterSpanInflightOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"otel.sdk.exporter.span.inflight",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
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}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return SDKExporterSpanInflight{noop.Int64UpDownCounter{}}, err
|
||||
@@ -1169,6 +1225,11 @@ type SDKLogCreated struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newSDKLogCreatedOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("The number of logs submitted to enabled SDK Loggers."),
|
||||
metric.WithUnit("{log_record}"),
|
||||
}
|
||||
|
||||
// NewSDKLogCreated returns a new SDKLogCreated instrument.
|
||||
func NewSDKLogCreated(
|
||||
m metric.Meter,
|
||||
@@ -1179,12 +1240,15 @@ func NewSDKLogCreated(
|
||||
return SDKLogCreated{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newSDKLogCreatedOpts
|
||||
} else {
|
||||
opt = append(opt, newSDKLogCreatedOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"otel.sdk.log.created",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("The number of logs submitted to enabled SDK Loggers."),
|
||||
metric.WithUnit("{log_record}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return SDKLogCreated{noop.Int64Counter{}}, err
|
||||
@@ -1254,6 +1318,11 @@ type SDKMetricReaderCollectionDuration struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newSDKMetricReaderCollectionDurationOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("The duration of the collect operation of the metric reader."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewSDKMetricReaderCollectionDuration returns a new
|
||||
// SDKMetricReaderCollectionDuration instrument.
|
||||
func NewSDKMetricReaderCollectionDuration(
|
||||
@@ -1265,12 +1334,15 @@ func NewSDKMetricReaderCollectionDuration(
|
||||
return SDKMetricReaderCollectionDuration{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newSDKMetricReaderCollectionDurationOpts
|
||||
} else {
|
||||
opt = append(opt, newSDKMetricReaderCollectionDurationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"otel.sdk.metric_reader.collection.duration",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("The duration of the collect operation of the metric reader."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return SDKMetricReaderCollectionDuration{noop.Float64Histogram{}}, err
|
||||
@@ -1384,6 +1456,11 @@ type SDKProcessorLogProcessed struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newSDKProcessorLogProcessedOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("The number of log records for which the processing has finished, either successful or failed."),
|
||||
metric.WithUnit("{log_record}"),
|
||||
}
|
||||
|
||||
// NewSDKProcessorLogProcessed returns a new SDKProcessorLogProcessed instrument.
|
||||
func NewSDKProcessorLogProcessed(
|
||||
m metric.Meter,
|
||||
@@ -1394,12 +1471,15 @@ func NewSDKProcessorLogProcessed(
|
||||
return SDKProcessorLogProcessed{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newSDKProcessorLogProcessedOpts
|
||||
} else {
|
||||
opt = append(opt, newSDKProcessorLogProcessedOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"otel.sdk.processor.log.processed",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("The number of log records for which the processing has finished, either successful or failed."),
|
||||
metric.WithUnit("{log_record}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return SDKProcessorLogProcessed{noop.Int64Counter{}}, err
|
||||
@@ -1515,6 +1595,11 @@ type SDKProcessorLogQueueCapacity struct {
|
||||
metric.Int64ObservableUpDownCounter
|
||||
}
|
||||
|
||||
var newSDKProcessorLogQueueCapacityOpts = []metric.Int64ObservableUpDownCounterOption{
|
||||
metric.WithDescription("The maximum number of log records the queue of a given instance of an SDK Log Record processor can hold."),
|
||||
metric.WithUnit("{log_record}"),
|
||||
}
|
||||
|
||||
// NewSDKProcessorLogQueueCapacity returns a new SDKProcessorLogQueueCapacity
|
||||
// instrument.
|
||||
func NewSDKProcessorLogQueueCapacity(
|
||||
@@ -1526,12 +1611,15 @@ func NewSDKProcessorLogQueueCapacity(
|
||||
return SDKProcessorLogQueueCapacity{noop.Int64ObservableUpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newSDKProcessorLogQueueCapacityOpts
|
||||
} else {
|
||||
opt = append(opt, newSDKProcessorLogQueueCapacityOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64ObservableUpDownCounter(
|
||||
"otel.sdk.processor.log.queue.capacity",
|
||||
append([]metric.Int64ObservableUpDownCounterOption{
|
||||
metric.WithDescription("The maximum number of log records the queue of a given instance of an SDK Log Record processor can hold."),
|
||||
metric.WithUnit("{log_record}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return SDKProcessorLogQueueCapacity{noop.Int64ObservableUpDownCounter{}}, err
|
||||
@@ -1581,6 +1669,11 @@ type SDKProcessorLogQueueSize struct {
|
||||
metric.Int64ObservableUpDownCounter
|
||||
}
|
||||
|
||||
var newSDKProcessorLogQueueSizeOpts = []metric.Int64ObservableUpDownCounterOption{
|
||||
metric.WithDescription("The number of log records in the queue of a given instance of an SDK log processor."),
|
||||
metric.WithUnit("{log_record}"),
|
||||
}
|
||||
|
||||
// NewSDKProcessorLogQueueSize returns a new SDKProcessorLogQueueSize instrument.
|
||||
func NewSDKProcessorLogQueueSize(
|
||||
m metric.Meter,
|
||||
@@ -1591,12 +1684,15 @@ func NewSDKProcessorLogQueueSize(
|
||||
return SDKProcessorLogQueueSize{noop.Int64ObservableUpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newSDKProcessorLogQueueSizeOpts
|
||||
} else {
|
||||
opt = append(opt, newSDKProcessorLogQueueSizeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64ObservableUpDownCounter(
|
||||
"otel.sdk.processor.log.queue.size",
|
||||
append([]metric.Int64ObservableUpDownCounterOption{
|
||||
metric.WithDescription("The number of log records in the queue of a given instance of an SDK log processor."),
|
||||
metric.WithUnit("{log_record}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return SDKProcessorLogQueueSize{noop.Int64ObservableUpDownCounter{}}, err
|
||||
@@ -1646,6 +1742,11 @@ type SDKProcessorSpanProcessed struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newSDKProcessorSpanProcessedOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("The number of spans for which the processing has finished, either successful or failed."),
|
||||
metric.WithUnit("{span}"),
|
||||
}
|
||||
|
||||
// NewSDKProcessorSpanProcessed returns a new SDKProcessorSpanProcessed
|
||||
// instrument.
|
||||
func NewSDKProcessorSpanProcessed(
|
||||
@@ -1657,12 +1758,15 @@ func NewSDKProcessorSpanProcessed(
|
||||
return SDKProcessorSpanProcessed{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newSDKProcessorSpanProcessedOpts
|
||||
} else {
|
||||
opt = append(opt, newSDKProcessorSpanProcessedOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"otel.sdk.processor.span.processed",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("The number of spans for which the processing has finished, either successful or failed."),
|
||||
metric.WithUnit("{span}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return SDKProcessorSpanProcessed{noop.Int64Counter{}}, err
|
||||
@@ -1778,6 +1882,11 @@ type SDKProcessorSpanQueueCapacity struct {
|
||||
metric.Int64ObservableUpDownCounter
|
||||
}
|
||||
|
||||
var newSDKProcessorSpanQueueCapacityOpts = []metric.Int64ObservableUpDownCounterOption{
|
||||
metric.WithDescription("The maximum number of spans the queue of a given instance of an SDK span processor can hold."),
|
||||
metric.WithUnit("{span}"),
|
||||
}
|
||||
|
||||
// NewSDKProcessorSpanQueueCapacity returns a new SDKProcessorSpanQueueCapacity
|
||||
// instrument.
|
||||
func NewSDKProcessorSpanQueueCapacity(
|
||||
@@ -1789,12 +1898,15 @@ func NewSDKProcessorSpanQueueCapacity(
|
||||
return SDKProcessorSpanQueueCapacity{noop.Int64ObservableUpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newSDKProcessorSpanQueueCapacityOpts
|
||||
} else {
|
||||
opt = append(opt, newSDKProcessorSpanQueueCapacityOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64ObservableUpDownCounter(
|
||||
"otel.sdk.processor.span.queue.capacity",
|
||||
append([]metric.Int64ObservableUpDownCounterOption{
|
||||
metric.WithDescription("The maximum number of spans the queue of a given instance of an SDK span processor can hold."),
|
||||
metric.WithUnit("{span}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return SDKProcessorSpanQueueCapacity{noop.Int64ObservableUpDownCounter{}}, err
|
||||
@@ -1844,6 +1956,11 @@ type SDKProcessorSpanQueueSize struct {
|
||||
metric.Int64ObservableUpDownCounter
|
||||
}
|
||||
|
||||
var newSDKProcessorSpanQueueSizeOpts = []metric.Int64ObservableUpDownCounterOption{
|
||||
metric.WithDescription("The number of spans in the queue of a given instance of an SDK span processor."),
|
||||
metric.WithUnit("{span}"),
|
||||
}
|
||||
|
||||
// NewSDKProcessorSpanQueueSize returns a new SDKProcessorSpanQueueSize
|
||||
// instrument.
|
||||
func NewSDKProcessorSpanQueueSize(
|
||||
@@ -1855,12 +1972,15 @@ func NewSDKProcessorSpanQueueSize(
|
||||
return SDKProcessorSpanQueueSize{noop.Int64ObservableUpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newSDKProcessorSpanQueueSizeOpts
|
||||
} else {
|
||||
opt = append(opt, newSDKProcessorSpanQueueSizeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64ObservableUpDownCounter(
|
||||
"otel.sdk.processor.span.queue.size",
|
||||
append([]metric.Int64ObservableUpDownCounterOption{
|
||||
metric.WithDescription("The number of spans in the queue of a given instance of an SDK span processor."),
|
||||
metric.WithUnit("{span}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return SDKProcessorSpanQueueSize{noop.Int64ObservableUpDownCounter{}}, err
|
||||
@@ -1910,6 +2030,11 @@ type SDKSpanLive struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newSDKSpanLiveOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The number of created spans with `recording=true` for which the end operation has not been called yet."),
|
||||
metric.WithUnit("{span}"),
|
||||
}
|
||||
|
||||
// NewSDKSpanLive returns a new SDKSpanLive instrument.
|
||||
func NewSDKSpanLive(
|
||||
m metric.Meter,
|
||||
@@ -1920,12 +2045,15 @@ func NewSDKSpanLive(
|
||||
return SDKSpanLive{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newSDKSpanLiveOpts
|
||||
} else {
|
||||
opt = append(opt, newSDKSpanLiveOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"otel.sdk.span.live",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The number of created spans with `recording=true` for which the end operation has not been called yet."),
|
||||
metric.WithUnit("{span}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return SDKSpanLive{noop.Int64UpDownCounter{}}, err
|
||||
@@ -2013,6 +2141,11 @@ type SDKSpanStarted struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newSDKSpanStartedOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("The number of created spans."),
|
||||
metric.WithUnit("{span}"),
|
||||
}
|
||||
|
||||
// NewSDKSpanStarted returns a new SDKSpanStarted instrument.
|
||||
func NewSDKSpanStarted(
|
||||
m metric.Meter,
|
||||
@@ -2023,12 +2156,15 @@ func NewSDKSpanStarted(
|
||||
return SDKSpanStarted{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newSDKSpanStartedOpts
|
||||
} else {
|
||||
opt = append(opt, newSDKSpanStartedOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"otel.sdk.span.started",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("The number of created spans."),
|
||||
metric.WithUnit("{span}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return SDKSpanStarted{noop.Int64Counter{}}, err
|
||||
|
||||
@@ -107,6 +107,11 @@ type ContextSwitches struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newContextSwitchesOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("Number of times the process has been context switched."),
|
||||
metric.WithUnit("{context_switch}"),
|
||||
}
|
||||
|
||||
// NewContextSwitches returns a new ContextSwitches instrument.
|
||||
func NewContextSwitches(
|
||||
m metric.Meter,
|
||||
@@ -117,12 +122,15 @@ func NewContextSwitches(
|
||||
return ContextSwitches{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newContextSwitchesOpts
|
||||
} else {
|
||||
opt = append(opt, newContextSwitchesOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"process.context_switches",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("Number of times the process has been context switched."),
|
||||
metric.WithUnit("{context_switch}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ContextSwitches{noop.Int64Counter{}}, err
|
||||
@@ -211,6 +219,11 @@ type CPUTime struct {
|
||||
metric.Float64ObservableCounter
|
||||
}
|
||||
|
||||
var newCPUTimeOpts = []metric.Float64ObservableCounterOption{
|
||||
metric.WithDescription("Total CPU seconds broken down by different states."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewCPUTime returns a new CPUTime instrument.
|
||||
func NewCPUTime(
|
||||
m metric.Meter,
|
||||
@@ -221,12 +234,15 @@ func NewCPUTime(
|
||||
return CPUTime{noop.Float64ObservableCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newCPUTimeOpts
|
||||
} else {
|
||||
opt = append(opt, newCPUTimeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64ObservableCounter(
|
||||
"process.cpu.time",
|
||||
append([]metric.Float64ObservableCounterOption{
|
||||
metric.WithDescription("Total CPU seconds broken down by different states."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return CPUTime{noop.Float64ObservableCounter{}}, err
|
||||
@@ -269,6 +285,11 @@ type CPUUtilization struct {
|
||||
metric.Int64Gauge
|
||||
}
|
||||
|
||||
var newCPUUtilizationOpts = []metric.Int64GaugeOption{
|
||||
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"),
|
||||
}
|
||||
|
||||
// NewCPUUtilization returns a new CPUUtilization instrument.
|
||||
func NewCPUUtilization(
|
||||
m metric.Meter,
|
||||
@@ -279,12 +300,15 @@ func NewCPUUtilization(
|
||||
return CPUUtilization{noop.Int64Gauge{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newCPUUtilizationOpts
|
||||
} else {
|
||||
opt = append(opt, newCPUUtilizationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Gauge(
|
||||
"process.cpu.utilization",
|
||||
append([]metric.Int64GaugeOption{
|
||||
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"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return CPUUtilization{noop.Int64Gauge{}}, err
|
||||
@@ -371,6 +395,11 @@ type DiskIO struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newDiskIOOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("Disk bytes transferred."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewDiskIO returns a new DiskIO instrument.
|
||||
func NewDiskIO(
|
||||
m metric.Meter,
|
||||
@@ -381,12 +410,15 @@ func NewDiskIO(
|
||||
return DiskIO{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newDiskIOOpts
|
||||
} else {
|
||||
opt = append(opt, newDiskIOOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"process.disk.io",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("Disk bytes transferred."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return DiskIO{noop.Int64Counter{}}, err
|
||||
@@ -473,6 +505,11 @@ type MemoryUsage struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newMemoryUsageOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The amount of physical memory in use."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewMemoryUsage returns a new MemoryUsage instrument.
|
||||
func NewMemoryUsage(
|
||||
m metric.Meter,
|
||||
@@ -483,12 +520,15 @@ func NewMemoryUsage(
|
||||
return MemoryUsage{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newMemoryUsageOpts
|
||||
} else {
|
||||
opt = append(opt, newMemoryUsageOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"process.memory.usage",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The amount of physical memory in use."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return MemoryUsage{noop.Int64UpDownCounter{}}, err
|
||||
@@ -557,6 +597,11 @@ type MemoryVirtual struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newMemoryVirtualOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The amount of committed virtual memory."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewMemoryVirtual returns a new MemoryVirtual instrument.
|
||||
func NewMemoryVirtual(
|
||||
m metric.Meter,
|
||||
@@ -567,12 +612,15 @@ func NewMemoryVirtual(
|
||||
return MemoryVirtual{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newMemoryVirtualOpts
|
||||
} else {
|
||||
opt = append(opt, newMemoryVirtualOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"process.memory.virtual",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The amount of committed virtual memory."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return MemoryVirtual{noop.Int64UpDownCounter{}}, err
|
||||
@@ -641,6 +689,11 @@ type NetworkIO struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newNetworkIOOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("Network bytes transferred."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewNetworkIO returns a new NetworkIO instrument.
|
||||
func NewNetworkIO(
|
||||
m metric.Meter,
|
||||
@@ -651,12 +704,15 @@ func NewNetworkIO(
|
||||
return NetworkIO{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newNetworkIOOpts
|
||||
} else {
|
||||
opt = append(opt, newNetworkIOOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"process.network.io",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("Network bytes transferred."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return NetworkIO{noop.Int64Counter{}}, err
|
||||
@@ -744,6 +800,11 @@ type OpenFileDescriptorCount struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newOpenFileDescriptorCountOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Number of file descriptors in use by the process."),
|
||||
metric.WithUnit("{file_descriptor}"),
|
||||
}
|
||||
|
||||
// NewOpenFileDescriptorCount returns a new OpenFileDescriptorCount instrument.
|
||||
func NewOpenFileDescriptorCount(
|
||||
m metric.Meter,
|
||||
@@ -754,12 +815,15 @@ func NewOpenFileDescriptorCount(
|
||||
return OpenFileDescriptorCount{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newOpenFileDescriptorCountOpts
|
||||
} else {
|
||||
opt = append(opt, newOpenFileDescriptorCountOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"process.open_file_descriptor.count",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Number of file descriptors in use by the process."),
|
||||
metric.WithUnit("{file_descriptor}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return OpenFileDescriptorCount{noop.Int64UpDownCounter{}}, err
|
||||
@@ -828,6 +892,11 @@ type PagingFaults struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newPagingFaultsOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("Number of page faults the process has made."),
|
||||
metric.WithUnit("{fault}"),
|
||||
}
|
||||
|
||||
// NewPagingFaults returns a new PagingFaults instrument.
|
||||
func NewPagingFaults(
|
||||
m metric.Meter,
|
||||
@@ -838,12 +907,15 @@ func NewPagingFaults(
|
||||
return PagingFaults{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newPagingFaultsOpts
|
||||
} else {
|
||||
opt = append(opt, newPagingFaultsOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"process.paging.faults",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("Number of page faults the process has made."),
|
||||
metric.WithUnit("{fault}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return PagingFaults{noop.Int64Counter{}}, err
|
||||
@@ -932,6 +1004,11 @@ type ThreadCount struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newThreadCountOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Process threads count."),
|
||||
metric.WithUnit("{thread}"),
|
||||
}
|
||||
|
||||
// NewThreadCount returns a new ThreadCount instrument.
|
||||
func NewThreadCount(
|
||||
m metric.Meter,
|
||||
@@ -942,12 +1019,15 @@ func NewThreadCount(
|
||||
return ThreadCount{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newThreadCountOpts
|
||||
} else {
|
||||
opt = append(opt, newThreadCountOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"process.thread.count",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Process threads count."),
|
||||
metric.WithUnit("{thread}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ThreadCount{noop.Int64UpDownCounter{}}, err
|
||||
@@ -1016,6 +1096,11 @@ type Uptime struct {
|
||||
metric.Float64Gauge
|
||||
}
|
||||
|
||||
var newUptimeOpts = []metric.Float64GaugeOption{
|
||||
metric.WithDescription("The time the process has been running."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewUptime returns a new Uptime instrument.
|
||||
func NewUptime(
|
||||
m metric.Meter,
|
||||
@@ -1026,12 +1111,15 @@ func NewUptime(
|
||||
return Uptime{noop.Float64Gauge{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newUptimeOpts
|
||||
} else {
|
||||
opt = append(opt, newUptimeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Gauge(
|
||||
"process.uptime",
|
||||
append([]metric.Float64GaugeOption{
|
||||
metric.WithDescription("The time the process has been running."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return Uptime{noop.Float64Gauge{}}, err
|
||||
|
||||
@@ -28,6 +28,11 @@ type ClientDuration struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newClientDurationOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("Measures the duration of outbound RPC."),
|
||||
metric.WithUnit("ms"),
|
||||
}
|
||||
|
||||
// NewClientDuration returns a new ClientDuration instrument.
|
||||
func NewClientDuration(
|
||||
m metric.Meter,
|
||||
@@ -38,12 +43,15 @@ func NewClientDuration(
|
||||
return ClientDuration{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientDurationOpts
|
||||
} else {
|
||||
opt = append(opt, newClientDurationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"rpc.client.duration",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("Measures the duration of outbound RPC."),
|
||||
metric.WithUnit("ms"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientDuration{noop.Float64Histogram{}}, err
|
||||
@@ -121,6 +129,11 @@ type ClientRequestSize struct {
|
||||
metric.Int64Histogram
|
||||
}
|
||||
|
||||
var newClientRequestSizeOpts = []metric.Int64HistogramOption{
|
||||
metric.WithDescription("Measures the size of RPC request messages (uncompressed)."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewClientRequestSize returns a new ClientRequestSize instrument.
|
||||
func NewClientRequestSize(
|
||||
m metric.Meter,
|
||||
@@ -131,12 +144,15 @@ func NewClientRequestSize(
|
||||
return ClientRequestSize{noop.Int64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientRequestSizeOpts
|
||||
} else {
|
||||
opt = append(opt, newClientRequestSizeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Histogram(
|
||||
"rpc.client.request.size",
|
||||
append([]metric.Int64HistogramOption{
|
||||
metric.WithDescription("Measures the size of RPC request messages (uncompressed)."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientRequestSize{noop.Int64Histogram{}}, err
|
||||
@@ -208,6 +224,11 @@ type ClientRequestsPerRPC struct {
|
||||
metric.Int64Histogram
|
||||
}
|
||||
|
||||
var newClientRequestsPerRPCOpts = []metric.Int64HistogramOption{
|
||||
metric.WithDescription("Measures the number of messages received per RPC."),
|
||||
metric.WithUnit("{count}"),
|
||||
}
|
||||
|
||||
// NewClientRequestsPerRPC returns a new ClientRequestsPerRPC instrument.
|
||||
func NewClientRequestsPerRPC(
|
||||
m metric.Meter,
|
||||
@@ -218,12 +239,15 @@ func NewClientRequestsPerRPC(
|
||||
return ClientRequestsPerRPC{noop.Int64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientRequestsPerRPCOpts
|
||||
} else {
|
||||
opt = append(opt, newClientRequestsPerRPCOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Histogram(
|
||||
"rpc.client.requests_per_rpc",
|
||||
append([]metric.Int64HistogramOption{
|
||||
metric.WithDescription("Measures the number of messages received per RPC."),
|
||||
metric.WithUnit("{count}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientRequestsPerRPC{noop.Int64Histogram{}}, err
|
||||
@@ -299,6 +323,11 @@ type ClientResponseSize struct {
|
||||
metric.Int64Histogram
|
||||
}
|
||||
|
||||
var newClientResponseSizeOpts = []metric.Int64HistogramOption{
|
||||
metric.WithDescription("Measures the size of RPC response messages (uncompressed)."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewClientResponseSize returns a new ClientResponseSize instrument.
|
||||
func NewClientResponseSize(
|
||||
m metric.Meter,
|
||||
@@ -309,12 +338,15 @@ func NewClientResponseSize(
|
||||
return ClientResponseSize{noop.Int64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientResponseSizeOpts
|
||||
} else {
|
||||
opt = append(opt, newClientResponseSizeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Histogram(
|
||||
"rpc.client.response.size",
|
||||
append([]metric.Int64HistogramOption{
|
||||
metric.WithDescription("Measures the size of RPC response messages (uncompressed)."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientResponseSize{noop.Int64Histogram{}}, err
|
||||
@@ -386,6 +418,11 @@ type ClientResponsesPerRPC struct {
|
||||
metric.Int64Histogram
|
||||
}
|
||||
|
||||
var newClientResponsesPerRPCOpts = []metric.Int64HistogramOption{
|
||||
metric.WithDescription("Measures the number of messages sent per RPC."),
|
||||
metric.WithUnit("{count}"),
|
||||
}
|
||||
|
||||
// NewClientResponsesPerRPC returns a new ClientResponsesPerRPC instrument.
|
||||
func NewClientResponsesPerRPC(
|
||||
m metric.Meter,
|
||||
@@ -396,12 +433,15 @@ func NewClientResponsesPerRPC(
|
||||
return ClientResponsesPerRPC{noop.Int64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newClientResponsesPerRPCOpts
|
||||
} else {
|
||||
opt = append(opt, newClientResponsesPerRPCOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Histogram(
|
||||
"rpc.client.responses_per_rpc",
|
||||
append([]metric.Int64HistogramOption{
|
||||
metric.WithDescription("Measures the number of messages sent per RPC."),
|
||||
metric.WithUnit("{count}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ClientResponsesPerRPC{noop.Int64Histogram{}}, err
|
||||
@@ -477,6 +517,11 @@ type ServerDuration struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newServerDurationOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("Measures the duration of inbound RPC."),
|
||||
metric.WithUnit("ms"),
|
||||
}
|
||||
|
||||
// NewServerDuration returns a new ServerDuration instrument.
|
||||
func NewServerDuration(
|
||||
m metric.Meter,
|
||||
@@ -487,12 +532,15 @@ func NewServerDuration(
|
||||
return ServerDuration{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newServerDurationOpts
|
||||
} else {
|
||||
opt = append(opt, newServerDurationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"rpc.server.duration",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("Measures the duration of inbound RPC."),
|
||||
metric.WithUnit("ms"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ServerDuration{noop.Float64Histogram{}}, err
|
||||
@@ -570,6 +618,11 @@ type ServerRequestSize struct {
|
||||
metric.Int64Histogram
|
||||
}
|
||||
|
||||
var newServerRequestSizeOpts = []metric.Int64HistogramOption{
|
||||
metric.WithDescription("Measures the size of RPC request messages (uncompressed)."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewServerRequestSize returns a new ServerRequestSize instrument.
|
||||
func NewServerRequestSize(
|
||||
m metric.Meter,
|
||||
@@ -580,12 +633,15 @@ func NewServerRequestSize(
|
||||
return ServerRequestSize{noop.Int64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newServerRequestSizeOpts
|
||||
} else {
|
||||
opt = append(opt, newServerRequestSizeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Histogram(
|
||||
"rpc.server.request.size",
|
||||
append([]metric.Int64HistogramOption{
|
||||
metric.WithDescription("Measures the size of RPC request messages (uncompressed)."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ServerRequestSize{noop.Int64Histogram{}}, err
|
||||
@@ -657,6 +713,11 @@ type ServerRequestsPerRPC struct {
|
||||
metric.Int64Histogram
|
||||
}
|
||||
|
||||
var newServerRequestsPerRPCOpts = []metric.Int64HistogramOption{
|
||||
metric.WithDescription("Measures the number of messages received per RPC."),
|
||||
metric.WithUnit("{count}"),
|
||||
}
|
||||
|
||||
// NewServerRequestsPerRPC returns a new ServerRequestsPerRPC instrument.
|
||||
func NewServerRequestsPerRPC(
|
||||
m metric.Meter,
|
||||
@@ -667,12 +728,15 @@ func NewServerRequestsPerRPC(
|
||||
return ServerRequestsPerRPC{noop.Int64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newServerRequestsPerRPCOpts
|
||||
} else {
|
||||
opt = append(opt, newServerRequestsPerRPCOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Histogram(
|
||||
"rpc.server.requests_per_rpc",
|
||||
append([]metric.Int64HistogramOption{
|
||||
metric.WithDescription("Measures the number of messages received per RPC."),
|
||||
metric.WithUnit("{count}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ServerRequestsPerRPC{noop.Int64Histogram{}}, err
|
||||
@@ -748,6 +812,11 @@ type ServerResponseSize struct {
|
||||
metric.Int64Histogram
|
||||
}
|
||||
|
||||
var newServerResponseSizeOpts = []metric.Int64HistogramOption{
|
||||
metric.WithDescription("Measures the size of RPC response messages (uncompressed)."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewServerResponseSize returns a new ServerResponseSize instrument.
|
||||
func NewServerResponseSize(
|
||||
m metric.Meter,
|
||||
@@ -758,12 +827,15 @@ func NewServerResponseSize(
|
||||
return ServerResponseSize{noop.Int64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newServerResponseSizeOpts
|
||||
} else {
|
||||
opt = append(opt, newServerResponseSizeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Histogram(
|
||||
"rpc.server.response.size",
|
||||
append([]metric.Int64HistogramOption{
|
||||
metric.WithDescription("Measures the size of RPC response messages (uncompressed)."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ServerResponseSize{noop.Int64Histogram{}}, err
|
||||
@@ -835,6 +907,11 @@ type ServerResponsesPerRPC struct {
|
||||
metric.Int64Histogram
|
||||
}
|
||||
|
||||
var newServerResponsesPerRPCOpts = []metric.Int64HistogramOption{
|
||||
metric.WithDescription("Measures the number of messages sent per RPC."),
|
||||
metric.WithUnit("{count}"),
|
||||
}
|
||||
|
||||
// NewServerResponsesPerRPC returns a new ServerResponsesPerRPC instrument.
|
||||
func NewServerResponsesPerRPC(
|
||||
m metric.Meter,
|
||||
@@ -845,12 +922,15 @@ func NewServerResponsesPerRPC(
|
||||
return ServerResponsesPerRPC{noop.Int64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newServerResponsesPerRPCOpts
|
||||
} else {
|
||||
opt = append(opt, newServerResponsesPerRPCOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Histogram(
|
||||
"rpc.server.responses_per_rpc",
|
||||
append([]metric.Int64HistogramOption{
|
||||
metric.WithDescription("Measures the number of messages sent per RPC."),
|
||||
metric.WithUnit("{count}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ServerResponsesPerRPC{noop.Int64Histogram{}}, err
|
||||
|
||||
@@ -58,6 +58,11 @@ type ServerActiveConnections struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newServerActiveConnectionsOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Number of connections that are currently active on the server."),
|
||||
metric.WithUnit("{connection}"),
|
||||
}
|
||||
|
||||
// NewServerActiveConnections returns a new ServerActiveConnections instrument.
|
||||
func NewServerActiveConnections(
|
||||
m metric.Meter,
|
||||
@@ -68,12 +73,15 @@ func NewServerActiveConnections(
|
||||
return ServerActiveConnections{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newServerActiveConnectionsOpts
|
||||
} else {
|
||||
opt = append(opt, newServerActiveConnectionsOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"signalr.server.active_connections",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Number of connections that are currently active on the server."),
|
||||
metric.WithUnit("{connection}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ServerActiveConnections{noop.Int64UpDownCounter{}}, err
|
||||
@@ -175,6 +183,11 @@ type ServerConnectionDuration struct {
|
||||
metric.Float64Histogram
|
||||
}
|
||||
|
||||
var newServerConnectionDurationOpts = []metric.Float64HistogramOption{
|
||||
metric.WithDescription("The duration of connections on the server."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewServerConnectionDuration returns a new ServerConnectionDuration instrument.
|
||||
func NewServerConnectionDuration(
|
||||
m metric.Meter,
|
||||
@@ -185,12 +198,15 @@ func NewServerConnectionDuration(
|
||||
return ServerConnectionDuration{noop.Float64Histogram{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newServerConnectionDurationOpts
|
||||
} else {
|
||||
opt = append(opt, newServerConnectionDurationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Histogram(
|
||||
"signalr.server.connection.duration",
|
||||
append([]metric.Float64HistogramOption{
|
||||
metric.WithDescription("The duration of connections on the server."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ServerConnectionDuration{noop.Float64Histogram{}}, err
|
||||
|
||||
@@ -256,6 +256,11 @@ type CPUFrequency struct {
|
||||
metric.Int64Gauge
|
||||
}
|
||||
|
||||
var newCPUFrequencyOpts = []metric.Int64GaugeOption{
|
||||
metric.WithDescription("Operating frequency of the logical CPU in Hertz."),
|
||||
metric.WithUnit("Hz"),
|
||||
}
|
||||
|
||||
// NewCPUFrequency returns a new CPUFrequency instrument.
|
||||
func NewCPUFrequency(
|
||||
m metric.Meter,
|
||||
@@ -266,12 +271,15 @@ func NewCPUFrequency(
|
||||
return CPUFrequency{noop.Int64Gauge{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newCPUFrequencyOpts
|
||||
} else {
|
||||
opt = append(opt, newCPUFrequencyOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Gauge(
|
||||
"system.cpu.frequency",
|
||||
append([]metric.Int64GaugeOption{
|
||||
metric.WithDescription("Operating frequency of the logical CPU in Hertz."),
|
||||
metric.WithUnit("Hz"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return CPUFrequency{noop.Int64Gauge{}}, err
|
||||
@@ -359,6 +367,11 @@ type CPULogicalCount struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newCPULogicalCountOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking."),
|
||||
metric.WithUnit("{cpu}"),
|
||||
}
|
||||
|
||||
// NewCPULogicalCount returns a new CPULogicalCount instrument.
|
||||
func NewCPULogicalCount(
|
||||
m metric.Meter,
|
||||
@@ -369,12 +382,15 @@ func NewCPULogicalCount(
|
||||
return CPULogicalCount{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newCPULogicalCountOpts
|
||||
} else {
|
||||
opt = append(opt, newCPULogicalCountOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"system.cpu.logical.count",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking."),
|
||||
metric.WithUnit("{cpu}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return CPULogicalCount{noop.Int64UpDownCounter{}}, err
|
||||
@@ -449,6 +465,11 @@ type CPUPhysicalCount struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newCPUPhysicalCountOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Reports the number of actual physical processor cores on the hardware."),
|
||||
metric.WithUnit("{cpu}"),
|
||||
}
|
||||
|
||||
// NewCPUPhysicalCount returns a new CPUPhysicalCount instrument.
|
||||
func NewCPUPhysicalCount(
|
||||
m metric.Meter,
|
||||
@@ -459,12 +480,15 @@ func NewCPUPhysicalCount(
|
||||
return CPUPhysicalCount{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newCPUPhysicalCountOpts
|
||||
} else {
|
||||
opt = append(opt, newCPUPhysicalCountOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"system.cpu.physical.count",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Reports the number of actual physical processor cores on the hardware."),
|
||||
metric.WithUnit("{cpu}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return CPUPhysicalCount{noop.Int64UpDownCounter{}}, err
|
||||
@@ -539,6 +563,11 @@ type CPUTime struct {
|
||||
metric.Float64ObservableCounter
|
||||
}
|
||||
|
||||
var newCPUTimeOpts = []metric.Float64ObservableCounterOption{
|
||||
metric.WithDescription("Seconds each logical CPU spent on each mode."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewCPUTime returns a new CPUTime instrument.
|
||||
func NewCPUTime(
|
||||
m metric.Meter,
|
||||
@@ -549,12 +578,15 @@ func NewCPUTime(
|
||||
return CPUTime{noop.Float64ObservableCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newCPUTimeOpts
|
||||
} else {
|
||||
opt = append(opt, newCPUTimeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64ObservableCounter(
|
||||
"system.cpu.time",
|
||||
append([]metric.Float64ObservableCounterOption{
|
||||
metric.WithDescription("Seconds each logical CPU spent on each mode."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return CPUTime{noop.Float64ObservableCounter{}}, err
|
||||
@@ -603,6 +635,11 @@ type CPUUtilization struct {
|
||||
metric.Int64Gauge
|
||||
}
|
||||
|
||||
var newCPUUtilizationOpts = []metric.Int64GaugeOption{
|
||||
metric.WithDescription("For each logical CPU, the utilization is calculated as the change in cumulative CPU time (cpu.time) over a measurement interval, divided by the elapsed time."),
|
||||
metric.WithUnit("1"),
|
||||
}
|
||||
|
||||
// NewCPUUtilization returns a new CPUUtilization instrument.
|
||||
func NewCPUUtilization(
|
||||
m metric.Meter,
|
||||
@@ -613,12 +650,15 @@ func NewCPUUtilization(
|
||||
return CPUUtilization{noop.Int64Gauge{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newCPUUtilizationOpts
|
||||
} else {
|
||||
opt = append(opt, newCPUUtilizationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Gauge(
|
||||
"system.cpu.utilization",
|
||||
append([]metric.Int64GaugeOption{
|
||||
metric.WithDescription("For each logical CPU, the utilization is calculated as the change in cumulative CPU time (cpu.time) over a measurement interval, divided by the elapsed time."),
|
||||
metric.WithUnit("1"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return CPUUtilization{noop.Int64Gauge{}}, err
|
||||
@@ -710,6 +750,11 @@ type DiskIO struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newDiskIOOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("TODO."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewDiskIO returns a new DiskIO instrument.
|
||||
func NewDiskIO(
|
||||
m metric.Meter,
|
||||
@@ -720,12 +765,15 @@ func NewDiskIO(
|
||||
return DiskIO{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newDiskIOOpts
|
||||
} else {
|
||||
opt = append(opt, newDiskIOOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"system.disk.io",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("TODO."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return DiskIO{noop.Int64Counter{}}, err
|
||||
@@ -818,6 +866,11 @@ type DiskIOTime struct {
|
||||
metric.Float64Counter
|
||||
}
|
||||
|
||||
var newDiskIOTimeOpts = []metric.Float64CounterOption{
|
||||
metric.WithDescription("Time disk spent activated."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewDiskIOTime returns a new DiskIOTime instrument.
|
||||
func NewDiskIOTime(
|
||||
m metric.Meter,
|
||||
@@ -828,12 +881,15 @@ func NewDiskIOTime(
|
||||
return DiskIOTime{noop.Float64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newDiskIOTimeOpts
|
||||
} else {
|
||||
opt = append(opt, newDiskIOTimeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Counter(
|
||||
"system.disk.io_time",
|
||||
append([]metric.Float64CounterOption{
|
||||
metric.WithDescription("Time disk spent activated."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return DiskIOTime{noop.Float64Counter{}}, err
|
||||
@@ -944,6 +1000,11 @@ type DiskLimit struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newDiskLimitOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The total storage capacity of the disk."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewDiskLimit returns a new DiskLimit instrument.
|
||||
func NewDiskLimit(
|
||||
m metric.Meter,
|
||||
@@ -954,12 +1015,15 @@ func NewDiskLimit(
|
||||
return DiskLimit{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newDiskLimitOpts
|
||||
} else {
|
||||
opt = append(opt, newDiskLimitOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"system.disk.limit",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The total storage capacity of the disk."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return DiskLimit{noop.Int64UpDownCounter{}}, err
|
||||
@@ -1045,6 +1109,11 @@ type DiskMerged struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newDiskMergedOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("TODO."),
|
||||
metric.WithUnit("{operation}"),
|
||||
}
|
||||
|
||||
// NewDiskMerged returns a new DiskMerged instrument.
|
||||
func NewDiskMerged(
|
||||
m metric.Meter,
|
||||
@@ -1055,12 +1124,15 @@ func NewDiskMerged(
|
||||
return DiskMerged{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newDiskMergedOpts
|
||||
} else {
|
||||
opt = append(opt, newDiskMergedOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"system.disk.merged",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("TODO."),
|
||||
metric.WithUnit("{operation}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return DiskMerged{noop.Int64Counter{}}, err
|
||||
@@ -1153,6 +1225,11 @@ type DiskOperationTime struct {
|
||||
metric.Float64Counter
|
||||
}
|
||||
|
||||
var newDiskOperationTimeOpts = []metric.Float64CounterOption{
|
||||
metric.WithDescription("Sum of the time each operation took to complete."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewDiskOperationTime returns a new DiskOperationTime instrument.
|
||||
func NewDiskOperationTime(
|
||||
m metric.Meter,
|
||||
@@ -1163,12 +1240,15 @@ func NewDiskOperationTime(
|
||||
return DiskOperationTime{noop.Float64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newDiskOperationTimeOpts
|
||||
} else {
|
||||
opt = append(opt, newDiskOperationTimeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Counter(
|
||||
"system.disk.operation_time",
|
||||
append([]metric.Float64CounterOption{
|
||||
metric.WithDescription("Sum of the time each operation took to complete."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return DiskOperationTime{noop.Float64Counter{}}, err
|
||||
@@ -1280,6 +1360,11 @@ type DiskOperations struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newDiskOperationsOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("TODO."),
|
||||
metric.WithUnit("{operation}"),
|
||||
}
|
||||
|
||||
// NewDiskOperations returns a new DiskOperations instrument.
|
||||
func NewDiskOperations(
|
||||
m metric.Meter,
|
||||
@@ -1290,12 +1375,15 @@ func NewDiskOperations(
|
||||
return DiskOperations{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newDiskOperationsOpts
|
||||
} else {
|
||||
opt = append(opt, newDiskOperationsOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"system.disk.operations",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("TODO."),
|
||||
metric.WithUnit("{operation}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return DiskOperations{noop.Int64Counter{}}, err
|
||||
@@ -1388,6 +1476,11 @@ type FilesystemLimit struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newFilesystemLimitOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The total storage capacity of the filesystem."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewFilesystemLimit returns a new FilesystemLimit instrument.
|
||||
func NewFilesystemLimit(
|
||||
m metric.Meter,
|
||||
@@ -1398,12 +1491,15 @@ func NewFilesystemLimit(
|
||||
return FilesystemLimit{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newFilesystemLimitOpts
|
||||
} else {
|
||||
opt = append(opt, newFilesystemLimitOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"system.filesystem.limit",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The total storage capacity of the filesystem."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return FilesystemLimit{noop.Int64UpDownCounter{}}, err
|
||||
@@ -1512,6 +1608,11 @@ type FilesystemUsage struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newFilesystemUsageOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Reports a filesystem's space usage across different states."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewFilesystemUsage returns a new FilesystemUsage instrument.
|
||||
func NewFilesystemUsage(
|
||||
m metric.Meter,
|
||||
@@ -1522,12 +1623,15 @@ func NewFilesystemUsage(
|
||||
return FilesystemUsage{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newFilesystemUsageOpts
|
||||
} else {
|
||||
opt = append(opt, newFilesystemUsageOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"system.filesystem.usage",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Reports a filesystem's space usage across different states."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return FilesystemUsage{noop.Int64UpDownCounter{}}, err
|
||||
@@ -1653,6 +1757,11 @@ type FilesystemUtilization struct {
|
||||
metric.Int64Gauge
|
||||
}
|
||||
|
||||
var newFilesystemUtilizationOpts = []metric.Int64GaugeOption{
|
||||
metric.WithDescription("TODO."),
|
||||
metric.WithUnit("1"),
|
||||
}
|
||||
|
||||
// NewFilesystemUtilization returns a new FilesystemUtilization instrument.
|
||||
func NewFilesystemUtilization(
|
||||
m metric.Meter,
|
||||
@@ -1663,12 +1772,15 @@ func NewFilesystemUtilization(
|
||||
return FilesystemUtilization{noop.Int64Gauge{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newFilesystemUtilizationOpts
|
||||
} else {
|
||||
opt = append(opt, newFilesystemUtilizationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Gauge(
|
||||
"system.filesystem.utilization",
|
||||
append([]metric.Int64GaugeOption{
|
||||
metric.WithDescription("TODO."),
|
||||
metric.WithUnit("1"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return FilesystemUtilization{noop.Int64Gauge{}}, err
|
||||
@@ -1784,6 +1896,11 @@ type LinuxMemoryAvailable struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newLinuxMemoryAvailableOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("An estimate of how much memory is available for starting new applications, without causing swapping."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewLinuxMemoryAvailable returns a new LinuxMemoryAvailable instrument.
|
||||
func NewLinuxMemoryAvailable(
|
||||
m metric.Meter,
|
||||
@@ -1794,12 +1911,15 @@ func NewLinuxMemoryAvailable(
|
||||
return LinuxMemoryAvailable{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newLinuxMemoryAvailableOpts
|
||||
} else {
|
||||
opt = append(opt, newLinuxMemoryAvailableOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"system.linux.memory.available",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("An estimate of how much memory is available for starting new applications, without causing swapping."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return LinuxMemoryAvailable{noop.Int64UpDownCounter{}}, err
|
||||
@@ -1889,6 +2009,11 @@ type LinuxMemorySlabUsage struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newLinuxMemorySlabUsageOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Reports the memory used by the Linux kernel for managing caches of frequently used objects."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewLinuxMemorySlabUsage returns a new LinuxMemorySlabUsage instrument.
|
||||
func NewLinuxMemorySlabUsage(
|
||||
m metric.Meter,
|
||||
@@ -1899,12 +2024,15 @@ func NewLinuxMemorySlabUsage(
|
||||
return LinuxMemorySlabUsage{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newLinuxMemorySlabUsageOpts
|
||||
} else {
|
||||
opt = append(opt, newLinuxMemorySlabUsageOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"system.linux.memory.slab.usage",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Reports the memory used by the Linux kernel for managing caches of frequently used objects."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return LinuxMemorySlabUsage{noop.Int64UpDownCounter{}}, err
|
||||
@@ -2010,6 +2138,11 @@ type MemoryLimit struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newMemoryLimitOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Total virtual memory available in the system."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewMemoryLimit returns a new MemoryLimit instrument.
|
||||
func NewMemoryLimit(
|
||||
m metric.Meter,
|
||||
@@ -2020,12 +2153,15 @@ func NewMemoryLimit(
|
||||
return MemoryLimit{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newMemoryLimitOpts
|
||||
} else {
|
||||
opt = append(opt, newMemoryLimitOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"system.memory.limit",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Total virtual memory available in the system."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return MemoryLimit{noop.Int64UpDownCounter{}}, err
|
||||
@@ -2094,6 +2230,11 @@ type MemoryShared struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newMemorySharedOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Shared memory used (mostly by tmpfs)."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewMemoryShared returns a new MemoryShared instrument.
|
||||
func NewMemoryShared(
|
||||
m metric.Meter,
|
||||
@@ -2104,12 +2245,15 @@ func NewMemoryShared(
|
||||
return MemoryShared{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newMemorySharedOpts
|
||||
} else {
|
||||
opt = append(opt, newMemorySharedOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"system.memory.shared",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Shared memory used (mostly by tmpfs)."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return MemoryShared{noop.Int64UpDownCounter{}}, err
|
||||
@@ -2190,6 +2334,11 @@ type MemoryUsage struct {
|
||||
metric.Int64ObservableUpDownCounter
|
||||
}
|
||||
|
||||
var newMemoryUsageOpts = []metric.Int64ObservableUpDownCounterOption{
|
||||
metric.WithDescription("Reports memory in use by state."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewMemoryUsage returns a new MemoryUsage instrument.
|
||||
func NewMemoryUsage(
|
||||
m metric.Meter,
|
||||
@@ -2200,12 +2349,15 @@ func NewMemoryUsage(
|
||||
return MemoryUsage{noop.Int64ObservableUpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newMemoryUsageOpts
|
||||
} else {
|
||||
opt = append(opt, newMemoryUsageOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64ObservableUpDownCounter(
|
||||
"system.memory.usage",
|
||||
append([]metric.Int64ObservableUpDownCounterOption{
|
||||
metric.WithDescription("Reports memory in use by state."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return MemoryUsage{noop.Int64ObservableUpDownCounter{}}, err
|
||||
@@ -2245,6 +2397,11 @@ type MemoryUtilization struct {
|
||||
metric.Float64ObservableGauge
|
||||
}
|
||||
|
||||
var newMemoryUtilizationOpts = []metric.Float64ObservableGaugeOption{
|
||||
metric.WithDescription("TODO."),
|
||||
metric.WithUnit("1"),
|
||||
}
|
||||
|
||||
// NewMemoryUtilization returns a new MemoryUtilization instrument.
|
||||
func NewMemoryUtilization(
|
||||
m metric.Meter,
|
||||
@@ -2255,12 +2412,15 @@ func NewMemoryUtilization(
|
||||
return MemoryUtilization{noop.Float64ObservableGauge{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newMemoryUtilizationOpts
|
||||
} else {
|
||||
opt = append(opt, newMemoryUtilizationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64ObservableGauge(
|
||||
"system.memory.utilization",
|
||||
append([]metric.Float64ObservableGaugeOption{
|
||||
metric.WithDescription("TODO."),
|
||||
metric.WithUnit("1"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return MemoryUtilization{noop.Float64ObservableGauge{}}, err
|
||||
@@ -2301,6 +2461,11 @@ type NetworkConnectionCount struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newNetworkConnectionCountOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("TODO."),
|
||||
metric.WithUnit("{connection}"),
|
||||
}
|
||||
|
||||
// NewNetworkConnectionCount returns a new NetworkConnectionCount instrument.
|
||||
func NewNetworkConnectionCount(
|
||||
m metric.Meter,
|
||||
@@ -2311,12 +2476,15 @@ func NewNetworkConnectionCount(
|
||||
return NetworkConnectionCount{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newNetworkConnectionCountOpts
|
||||
} else {
|
||||
opt = append(opt, newNetworkConnectionCountOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"system.network.connection.count",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("TODO."),
|
||||
metric.WithUnit("{connection}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return NetworkConnectionCount{noop.Int64UpDownCounter{}}, err
|
||||
@@ -2421,6 +2589,11 @@ type NetworkErrors struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newNetworkErrorsOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("Count of network errors detected."),
|
||||
metric.WithUnit("{error}"),
|
||||
}
|
||||
|
||||
// NewNetworkErrors returns a new NetworkErrors instrument.
|
||||
func NewNetworkErrors(
|
||||
m metric.Meter,
|
||||
@@ -2431,12 +2604,15 @@ func NewNetworkErrors(
|
||||
return NetworkErrors{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newNetworkErrorsOpts
|
||||
} else {
|
||||
opt = append(opt, newNetworkErrorsOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"system.network.errors",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("Count of network errors detected."),
|
||||
metric.WithUnit("{error}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return NetworkErrors{noop.Int64Counter{}}, err
|
||||
@@ -2552,6 +2728,11 @@ type NetworkIO struct {
|
||||
metric.Int64ObservableCounter
|
||||
}
|
||||
|
||||
var newNetworkIOOpts = []metric.Int64ObservableCounterOption{
|
||||
metric.WithDescription("TODO."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewNetworkIO returns a new NetworkIO instrument.
|
||||
func NewNetworkIO(
|
||||
m metric.Meter,
|
||||
@@ -2562,12 +2743,15 @@ func NewNetworkIO(
|
||||
return NetworkIO{noop.Int64ObservableCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newNetworkIOOpts
|
||||
} else {
|
||||
opt = append(opt, newNetworkIOOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64ObservableCounter(
|
||||
"system.network.io",
|
||||
append([]metric.Int64ObservableCounterOption{
|
||||
metric.WithDescription("TODO."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return NetworkIO{noop.Int64ObservableCounter{}}, err
|
||||
@@ -2616,6 +2800,11 @@ type NetworkPacketCount struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newNetworkPacketCountOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("TODO."),
|
||||
metric.WithUnit("{packet}"),
|
||||
}
|
||||
|
||||
// NewNetworkPacketCount returns a new NetworkPacketCount instrument.
|
||||
func NewNetworkPacketCount(
|
||||
m metric.Meter,
|
||||
@@ -2626,12 +2815,15 @@ func NewNetworkPacketCount(
|
||||
return NetworkPacketCount{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newNetworkPacketCountOpts
|
||||
} else {
|
||||
opt = append(opt, newNetworkPacketCountOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"system.network.packet.count",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("TODO."),
|
||||
metric.WithUnit("{packet}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return NetworkPacketCount{noop.Int64Counter{}}, err
|
||||
@@ -2725,6 +2917,11 @@ type NetworkPacketDropped struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newNetworkPacketDroppedOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("Count of packets that are dropped or discarded even though there was no error."),
|
||||
metric.WithUnit("{packet}"),
|
||||
}
|
||||
|
||||
// NewNetworkPacketDropped returns a new NetworkPacketDropped instrument.
|
||||
func NewNetworkPacketDropped(
|
||||
m metric.Meter,
|
||||
@@ -2735,12 +2932,15 @@ func NewNetworkPacketDropped(
|
||||
return NetworkPacketDropped{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newNetworkPacketDroppedOpts
|
||||
} else {
|
||||
opt = append(opt, newNetworkPacketDroppedOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"system.network.packet.dropped",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("Count of packets that are dropped or discarded even though there was no error."),
|
||||
metric.WithUnit("{packet}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return NetworkPacketDropped{noop.Int64Counter{}}, err
|
||||
@@ -2856,6 +3056,11 @@ type PagingFaults struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newPagingFaultsOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("TODO."),
|
||||
metric.WithUnit("{fault}"),
|
||||
}
|
||||
|
||||
// NewPagingFaults returns a new PagingFaults instrument.
|
||||
func NewPagingFaults(
|
||||
m metric.Meter,
|
||||
@@ -2866,12 +3071,15 @@ func NewPagingFaults(
|
||||
return PagingFaults{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newPagingFaultsOpts
|
||||
} else {
|
||||
opt = append(opt, newPagingFaultsOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"system.paging.faults",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("TODO."),
|
||||
metric.WithUnit("{fault}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return PagingFaults{noop.Int64Counter{}}, err
|
||||
@@ -2957,6 +3165,11 @@ type PagingOperations struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newPagingOperationsOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("TODO."),
|
||||
metric.WithUnit("{operation}"),
|
||||
}
|
||||
|
||||
// NewPagingOperations returns a new PagingOperations instrument.
|
||||
func NewPagingOperations(
|
||||
m metric.Meter,
|
||||
@@ -2967,12 +3180,15 @@ func NewPagingOperations(
|
||||
return PagingOperations{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newPagingOperationsOpts
|
||||
} else {
|
||||
opt = append(opt, newPagingOperationsOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"system.paging.operations",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("TODO."),
|
||||
metric.WithUnit("{operation}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return PagingOperations{noop.Int64Counter{}}, err
|
||||
@@ -3066,6 +3282,11 @@ type PagingUsage struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newPagingUsageOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Unix swap or windows pagefile usage."),
|
||||
metric.WithUnit("By"),
|
||||
}
|
||||
|
||||
// NewPagingUsage returns a new PagingUsage instrument.
|
||||
func NewPagingUsage(
|
||||
m metric.Meter,
|
||||
@@ -3076,12 +3297,15 @@ func NewPagingUsage(
|
||||
return PagingUsage{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newPagingUsageOpts
|
||||
} else {
|
||||
opt = append(opt, newPagingUsageOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"system.paging.usage",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Unix swap or windows pagefile usage."),
|
||||
metric.WithUnit("By"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return PagingUsage{noop.Int64UpDownCounter{}}, err
|
||||
@@ -3174,6 +3398,11 @@ type PagingUtilization struct {
|
||||
metric.Int64Gauge
|
||||
}
|
||||
|
||||
var newPagingUtilizationOpts = []metric.Int64GaugeOption{
|
||||
metric.WithDescription("TODO."),
|
||||
metric.WithUnit("1"),
|
||||
}
|
||||
|
||||
// NewPagingUtilization returns a new PagingUtilization instrument.
|
||||
func NewPagingUtilization(
|
||||
m metric.Meter,
|
||||
@@ -3184,12 +3413,15 @@ func NewPagingUtilization(
|
||||
return PagingUtilization{noop.Int64Gauge{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newPagingUtilizationOpts
|
||||
} else {
|
||||
opt = append(opt, newPagingUtilizationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Gauge(
|
||||
"system.paging.utilization",
|
||||
append([]metric.Int64GaugeOption{
|
||||
metric.WithDescription("TODO."),
|
||||
metric.WithUnit("1"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return PagingUtilization{noop.Int64Gauge{}}, err
|
||||
@@ -3282,6 +3514,11 @@ type ProcessCount struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newProcessCountOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Total number of processes in each state."),
|
||||
metric.WithUnit("{process}"),
|
||||
}
|
||||
|
||||
// NewProcessCount returns a new ProcessCount instrument.
|
||||
func NewProcessCount(
|
||||
m metric.Meter,
|
||||
@@ -3292,12 +3529,15 @@ func NewProcessCount(
|
||||
return ProcessCount{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newProcessCountOpts
|
||||
} else {
|
||||
opt = append(opt, newProcessCountOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"system.process.count",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("Total number of processes in each state."),
|
||||
metric.WithUnit("{process}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ProcessCount{noop.Int64UpDownCounter{}}, err
|
||||
@@ -3387,6 +3627,11 @@ type ProcessCreated struct {
|
||||
metric.Int64Counter
|
||||
}
|
||||
|
||||
var newProcessCreatedOpts = []metric.Int64CounterOption{
|
||||
metric.WithDescription("Total number of processes created over uptime of the host."),
|
||||
metric.WithUnit("{process}"),
|
||||
}
|
||||
|
||||
// NewProcessCreated returns a new ProcessCreated instrument.
|
||||
func NewProcessCreated(
|
||||
m metric.Meter,
|
||||
@@ -3397,12 +3642,15 @@ func NewProcessCreated(
|
||||
return ProcessCreated{noop.Int64Counter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newProcessCreatedOpts
|
||||
} else {
|
||||
opt = append(opt, newProcessCreatedOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Counter(
|
||||
"system.process.created",
|
||||
append([]metric.Int64CounterOption{
|
||||
metric.WithDescription("Total number of processes created over uptime of the host."),
|
||||
metric.WithUnit("{process}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ProcessCreated{noop.Int64Counter{}}, err
|
||||
@@ -3471,6 +3719,11 @@ type Uptime struct {
|
||||
metric.Float64Gauge
|
||||
}
|
||||
|
||||
var newUptimeOpts = []metric.Float64GaugeOption{
|
||||
metric.WithDescription("The time the system has been running."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewUptime returns a new Uptime instrument.
|
||||
func NewUptime(
|
||||
m metric.Meter,
|
||||
@@ -3481,12 +3734,15 @@ func NewUptime(
|
||||
return Uptime{noop.Float64Gauge{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newUptimeOpts
|
||||
} else {
|
||||
opt = append(opt, newUptimeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Gauge(
|
||||
"system.uptime",
|
||||
append([]metric.Float64GaugeOption{
|
||||
metric.WithDescription("The time the system has been running."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return Uptime{noop.Float64Gauge{}}, err
|
||||
|
||||
@@ -153,6 +153,11 @@ type ChangeCount struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newChangeCountOpts = []metric.Int64UpDownCounterOption{
|
||||
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}"),
|
||||
}
|
||||
|
||||
// NewChangeCount returns a new ChangeCount instrument.
|
||||
func NewChangeCount(
|
||||
m metric.Meter,
|
||||
@@ -163,12 +168,15 @@ func NewChangeCount(
|
||||
return ChangeCount{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newChangeCountOpts
|
||||
} else {
|
||||
opt = append(opt, newChangeCountOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"vcs.change.count",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
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}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ChangeCount{noop.Int64UpDownCounter{}}, err
|
||||
@@ -285,6 +293,11 @@ type ChangeDuration struct {
|
||||
metric.Float64Gauge
|
||||
}
|
||||
|
||||
var newChangeDurationOpts = []metric.Float64GaugeOption{
|
||||
metric.WithDescription("The time duration a change (pull request/merge request/changelist) has been in a given state."),
|
||||
metric.WithUnit("s"),
|
||||
}
|
||||
|
||||
// NewChangeDuration returns a new ChangeDuration instrument.
|
||||
func NewChangeDuration(
|
||||
m metric.Meter,
|
||||
@@ -295,12 +308,15 @@ func NewChangeDuration(
|
||||
return ChangeDuration{noop.Float64Gauge{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newChangeDurationOpts
|
||||
} else {
|
||||
opt = append(opt, newChangeDurationOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Gauge(
|
||||
"vcs.change.duration",
|
||||
append([]metric.Float64GaugeOption{
|
||||
metric.WithDescription("The time duration a change (pull request/merge request/changelist) has been in a given state."),
|
||||
metric.WithUnit("s"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ChangeDuration{noop.Float64Gauge{}}, err
|
||||
@@ -423,6 +439,11 @@ type ChangeTimeToApproval struct {
|
||||
metric.Float64Gauge
|
||||
}
|
||||
|
||||
var newChangeTimeToApprovalOpts = []metric.Float64GaugeOption{
|
||||
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"),
|
||||
}
|
||||
|
||||
// NewChangeTimeToApproval returns a new ChangeTimeToApproval instrument.
|
||||
func NewChangeTimeToApproval(
|
||||
m metric.Meter,
|
||||
@@ -433,12 +454,15 @@ func NewChangeTimeToApproval(
|
||||
return ChangeTimeToApproval{noop.Float64Gauge{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newChangeTimeToApprovalOpts
|
||||
} else {
|
||||
opt = append(opt, newChangeTimeToApprovalOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Gauge(
|
||||
"vcs.change.time_to_approval",
|
||||
append([]metric.Float64GaugeOption{
|
||||
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"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ChangeTimeToApproval{noop.Float64Gauge{}}, err
|
||||
@@ -585,6 +609,11 @@ type ChangeTimeToMerge struct {
|
||||
metric.Float64Gauge
|
||||
}
|
||||
|
||||
var newChangeTimeToMergeOpts = []metric.Float64GaugeOption{
|
||||
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"),
|
||||
}
|
||||
|
||||
// NewChangeTimeToMerge returns a new ChangeTimeToMerge instrument.
|
||||
func NewChangeTimeToMerge(
|
||||
m metric.Meter,
|
||||
@@ -595,12 +624,15 @@ func NewChangeTimeToMerge(
|
||||
return ChangeTimeToMerge{noop.Float64Gauge{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newChangeTimeToMergeOpts
|
||||
} else {
|
||||
opt = append(opt, newChangeTimeToMergeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Gauge(
|
||||
"vcs.change.time_to_merge",
|
||||
append([]metric.Float64GaugeOption{
|
||||
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"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ChangeTimeToMerge{noop.Float64Gauge{}}, err
|
||||
@@ -746,6 +778,11 @@ type ContributorCount struct {
|
||||
metric.Int64Gauge
|
||||
}
|
||||
|
||||
var newContributorCountOpts = []metric.Int64GaugeOption{
|
||||
metric.WithDescription("The number of unique contributors to a repository."),
|
||||
metric.WithUnit("{contributor}"),
|
||||
}
|
||||
|
||||
// NewContributorCount returns a new ContributorCount instrument.
|
||||
func NewContributorCount(
|
||||
m metric.Meter,
|
||||
@@ -756,12 +793,15 @@ func NewContributorCount(
|
||||
return ContributorCount{noop.Int64Gauge{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newContributorCountOpts
|
||||
} else {
|
||||
opt = append(opt, newContributorCountOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Gauge(
|
||||
"vcs.contributor.count",
|
||||
append([]metric.Int64GaugeOption{
|
||||
metric.WithDescription("The number of unique contributors to a repository."),
|
||||
metric.WithUnit("{contributor}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return ContributorCount{noop.Int64Gauge{}}, err
|
||||
@@ -872,6 +912,11 @@ type RefCount struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newRefCountOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The number of refs of type branch or tag in a repository."),
|
||||
metric.WithUnit("{ref}"),
|
||||
}
|
||||
|
||||
// NewRefCount returns a new RefCount instrument.
|
||||
func NewRefCount(
|
||||
m metric.Meter,
|
||||
@@ -882,12 +927,15 @@ func NewRefCount(
|
||||
return RefCount{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newRefCountOpts
|
||||
} else {
|
||||
opt = append(opt, newRefCountOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"vcs.ref.count",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The number of refs of type branch or tag in a repository."),
|
||||
metric.WithUnit("{ref}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return RefCount{noop.Int64UpDownCounter{}}, err
|
||||
@@ -1005,6 +1053,11 @@ type RefLinesDelta struct {
|
||||
metric.Int64Gauge
|
||||
}
|
||||
|
||||
var newRefLinesDeltaOpts = []metric.Int64GaugeOption{
|
||||
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}"),
|
||||
}
|
||||
|
||||
// NewRefLinesDelta returns a new RefLinesDelta instrument.
|
||||
func NewRefLinesDelta(
|
||||
m metric.Meter,
|
||||
@@ -1015,12 +1068,15 @@ func NewRefLinesDelta(
|
||||
return RefLinesDelta{noop.Int64Gauge{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newRefLinesDeltaOpts
|
||||
} else {
|
||||
opt = append(opt, newRefLinesDeltaOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Gauge(
|
||||
"vcs.ref.lines_delta",
|
||||
append([]metric.Int64GaugeOption{
|
||||
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}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return RefLinesDelta{noop.Int64Gauge{}}, err
|
||||
@@ -1181,6 +1237,11 @@ type RefRevisionsDelta struct {
|
||||
metric.Int64Gauge
|
||||
}
|
||||
|
||||
var newRefRevisionsDeltaOpts = []metric.Int64GaugeOption{
|
||||
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}"),
|
||||
}
|
||||
|
||||
// NewRefRevisionsDelta returns a new RefRevisionsDelta instrument.
|
||||
func NewRefRevisionsDelta(
|
||||
m metric.Meter,
|
||||
@@ -1191,12 +1252,15 @@ func NewRefRevisionsDelta(
|
||||
return RefRevisionsDelta{noop.Int64Gauge{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newRefRevisionsDeltaOpts
|
||||
} else {
|
||||
opt = append(opt, newRefRevisionsDeltaOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64Gauge(
|
||||
"vcs.ref.revisions_delta",
|
||||
append([]metric.Int64GaugeOption{
|
||||
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}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return RefRevisionsDelta{noop.Int64Gauge{}}, err
|
||||
@@ -1352,6 +1416,11 @@ type RefTime struct {
|
||||
metric.Float64Gauge
|
||||
}
|
||||
|
||||
var newRefTimeOpts = []metric.Float64GaugeOption{
|
||||
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"),
|
||||
}
|
||||
|
||||
// NewRefTime returns a new RefTime instrument.
|
||||
func NewRefTime(
|
||||
m metric.Meter,
|
||||
@@ -1362,12 +1431,15 @@ func NewRefTime(
|
||||
return RefTime{noop.Float64Gauge{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newRefTimeOpts
|
||||
} else {
|
||||
opt = append(opt, newRefTimeOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Float64Gauge(
|
||||
"vcs.ref.time",
|
||||
append([]metric.Float64GaugeOption{
|
||||
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"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return RefTime{noop.Float64Gauge{}}, err
|
||||
@@ -1489,6 +1561,11 @@ type RepositoryCount struct {
|
||||
metric.Int64UpDownCounter
|
||||
}
|
||||
|
||||
var newRepositoryCountOpts = []metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The number of repositories in an organization."),
|
||||
metric.WithUnit("{repository}"),
|
||||
}
|
||||
|
||||
// NewRepositoryCount returns a new RepositoryCount instrument.
|
||||
func NewRepositoryCount(
|
||||
m metric.Meter,
|
||||
@@ -1499,12 +1576,15 @@ func NewRepositoryCount(
|
||||
return RepositoryCount{noop.Int64UpDownCounter{}}, nil
|
||||
}
|
||||
|
||||
if len(opt) == 0 {
|
||||
opt = newRepositoryCountOpts
|
||||
} else {
|
||||
opt = append(opt, newRepositoryCountOpts...)
|
||||
}
|
||||
|
||||
i, err := m.Int64UpDownCounter(
|
||||
"vcs.repository.count",
|
||||
append([]metric.Int64UpDownCounterOption{
|
||||
metric.WithDescription("The number of repositories in an organization."),
|
||||
metric.WithUnit("{repository}"),
|
||||
}, opt...)...,
|
||||
opt...,
|
||||
)
|
||||
if err != nil {
|
||||
return RepositoryCount{noop.Int64UpDownCounter{}}, err
|
||||
|
||||
Reference in New Issue
Block a user