You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2026-06-03 18:35:08 +02:00
Return early in semconv generated packages if no attributes passed (#7222)
- Reduces unnecessary allocations for empty attribute - Fixes case where we were double recording for `Record` methods
This commit is contained in:
@@ -115,6 +115,11 @@ func (m {{ name }}) Add(
|
||||
incr {{ value_type(metric) | lower }},
|
||||
{{ params(metric.attributes, pkg=pkg, prefix="\t") }}
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.{{ inst }}.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -171,6 +176,11 @@ func (m {{ name }}) Record(
|
||||
val {{ value_type(metric) | lower }},
|
||||
{{ params(metric.attributes, pkg=pkg, prefix="\t") }}
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.{{ inst }}.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -205,6 +215,7 @@ func (m {{ name }}) Record(
|
||||
func (m {{ name }}) Record(ctx context.Context, val {{ value_type(metric) | lower }}, attrs ...attribute.KeyValue) {
|
||||
if len(attrs) == 0 {
|
||||
m.{{ inst }}.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
|
||||
@@ -113,6 +113,11 @@ func (m CosmosDBClientActiveInstanceCount) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -207,6 +212,11 @@ func (m CosmosDBClientOperationRequestCharge) Record(
|
||||
dbOperationName string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
|
||||
@@ -151,6 +151,11 @@ func (m PipelineRunActive) Add(
|
||||
pipelineRunState PipelineRunStateAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -237,6 +242,11 @@ func (m PipelineRunDuration) Record(
|
||||
pipelineRunState PipelineRunStateAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -339,6 +349,11 @@ func (m PipelineRunErrors) Add(
|
||||
errorType ErrorTypeAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -424,6 +439,11 @@ func (m SystemErrors) Add(
|
||||
errorType ErrorTypeAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -503,6 +523,11 @@ func (m WorkerCount) Add(
|
||||
workerState WorkerStateAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
|
||||
@@ -128,6 +128,11 @@ func (m CPUTime) Add(
|
||||
incr float64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -213,6 +218,11 @@ func (m CPUUsage) Record(
|
||||
val int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -298,6 +308,11 @@ func (m DiskIO) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -455,6 +470,11 @@ func (m NetworkIO) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -543,6 +563,7 @@ func (Uptime) Description() string {
|
||||
func (m Uptime) Record(ctx context.Context, val float64, attrs ...attribute.KeyValue) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
|
||||
@@ -282,6 +282,11 @@ func (m ClientConnectionCount) Add(
|
||||
clientConnectionState ClientConnectionStateAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -368,6 +373,11 @@ func (m ClientConnectionCreateTime) Record(
|
||||
clientConnectionPoolName string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -452,6 +462,11 @@ func (m ClientConnectionIdleMax) Add(
|
||||
clientConnectionPoolName string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -536,6 +551,11 @@ func (m ClientConnectionIdleMin) Add(
|
||||
clientConnectionPoolName string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -620,6 +640,11 @@ func (m ClientConnectionMax) Add(
|
||||
clientConnectionPoolName string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -706,6 +731,11 @@ func (m ClientConnectionPendingRequests) Add(
|
||||
clientConnectionPoolName string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -791,6 +821,11 @@ func (m ClientConnectionTimeouts) Add(
|
||||
clientConnectionPoolName string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -876,6 +911,11 @@ func (m ClientConnectionUseTime) Record(
|
||||
clientConnectionPoolName string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -960,6 +1000,11 @@ func (m ClientConnectionWaitTime) Record(
|
||||
clientConnectionPoolName string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -1043,6 +1088,11 @@ func (m ClientOperationDuration) Record(
|
||||
systemName SystemNameAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -1206,6 +1256,11 @@ func (m ClientResponseReturnedRows) Record(
|
||||
systemName SystemNameAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
|
||||
@@ -89,6 +89,11 @@ func (m LookupDuration) Record(
|
||||
questionName string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
|
||||
@@ -96,6 +96,11 @@ func (m Coldstarts) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -177,6 +182,11 @@ func (m CPUUsage) Record(
|
||||
val float64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -258,6 +268,11 @@ func (m Errors) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -339,6 +354,11 @@ func (m InitDuration) Record(
|
||||
val float64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -420,6 +440,11 @@ func (m Invocations) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -501,6 +526,11 @@ func (m InvokeDuration) Record(
|
||||
val float64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -582,6 +612,11 @@ func (m MemUsage) Record(
|
||||
val int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -663,6 +698,11 @@ func (m NetIO) Record(
|
||||
val int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -744,6 +784,11 @@ func (m Timeouts) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
|
||||
@@ -176,6 +176,11 @@ func (m ClientOperationDuration) Record(
|
||||
system SystemAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -297,6 +302,11 @@ func (m ClientTokenUsage) Record(
|
||||
tokenType TokenTypeAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -410,6 +420,11 @@ func (m ServerRequestDuration) Record(
|
||||
system SystemAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -529,6 +544,11 @@ func (m ServerTimePerOutputToken) Record(
|
||||
system SystemAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -640,6 +660,11 @@ func (m ServerTimeToFirstToken) Record(
|
||||
system SystemAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
|
||||
@@ -495,6 +495,7 @@ func (ScheduleDuration) Description() string {
|
||||
func (m ScheduleDuration) Record(ctx context.Context, val float64, attrs ...attribute.KeyValue) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
|
||||
@@ -149,6 +149,11 @@ func (m ClientActiveRequests) Add(
|
||||
serverPort int,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -262,6 +267,11 @@ func (m ClientConnectionDuration) Record(
|
||||
serverPort int,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -378,6 +388,11 @@ func (m ClientOpenConnections) Add(
|
||||
serverPort int,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -501,6 +516,11 @@ func (m ClientRequestBodySize) Record(
|
||||
serverPort int,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -644,6 +664,11 @@ func (m ClientRequestDuration) Record(
|
||||
serverPort int,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -794,6 +819,11 @@ func (m ClientResponseBodySize) Record(
|
||||
serverPort int,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -931,6 +961,11 @@ func (m ServerActiveRequests) Add(
|
||||
urlScheme string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -1038,6 +1073,11 @@ func (m ServerRequestBodySize) Record(
|
||||
urlScheme string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -1184,6 +1224,11 @@ func (m ServerRequestDuration) Record(
|
||||
urlScheme string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -1337,6 +1382,11 @@ func (m ServerResponseBodySize) Record(
|
||||
urlScheme string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
|
||||
@@ -141,6 +141,11 @@ func (m Energy) Add(
|
||||
hwType TypeAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -239,6 +244,11 @@ func (m Errors) Add(
|
||||
hwType TypeAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -340,6 +350,11 @@ func (m HostAmbientTemperature) Record(
|
||||
id string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -439,6 +454,11 @@ func (m HostEnergy) Add(
|
||||
id string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -534,6 +554,11 @@ func (m HostHeatingMargin) Record(
|
||||
id string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -633,6 +658,11 @@ func (m HostPower) Record(
|
||||
id string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -732,6 +762,11 @@ func (m Power) Record(
|
||||
hwType TypeAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -841,6 +876,11 @@ func (m Status) Add(
|
||||
hwType TypeAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
|
||||
@@ -788,6 +788,11 @@ func (m ContainerStatusReason) Add(
|
||||
containerStatusReason ContainerStatusReasonAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -873,6 +878,11 @@ func (m ContainerStatusState) Add(
|
||||
containerStatusState ContainerStatusStateAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -1833,6 +1843,11 @@ func (m HPAMetricTargetCPUAverageUtilization) Record(
|
||||
val int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -1933,6 +1948,11 @@ func (m HPAMetricTargetCPUAverageValue) Record(
|
||||
val int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -2031,6 +2051,11 @@ func (m HPAMetricTargetCPUValue) Record(
|
||||
val int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -2554,6 +2579,11 @@ func (m NamespacePhase) Add(
|
||||
namespacePhase NamespacePhaseAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -2910,6 +2940,11 @@ func (m NodeConditionStatus) Add(
|
||||
nodeConditionType NodeConditionTypeAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -3056,6 +3091,7 @@ func (NodeCPUUsage) Description() string {
|
||||
func (m NodeCPUUsage) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
@@ -3124,6 +3160,7 @@ func (NodeMemoryUsage) Description() string {
|
||||
func (m NodeMemoryUsage) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
@@ -3194,6 +3231,11 @@ func (m NodeNetworkErrors) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -3282,6 +3324,11 @@ func (m NodeNetworkIO) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -3370,6 +3417,7 @@ func (NodeUptime) Description() string {
|
||||
func (m NodeUptime) Record(ctx context.Context, val float64, attrs ...attribute.KeyValue) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
@@ -3508,6 +3556,7 @@ func (PodCPUUsage) Description() string {
|
||||
func (m PodCPUUsage) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
@@ -3576,6 +3625,7 @@ func (PodMemoryUsage) Description() string {
|
||||
func (m PodMemoryUsage) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
@@ -3646,6 +3696,11 @@ func (m PodNetworkErrors) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -3734,6 +3789,11 @@ func (m PodNetworkIO) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -3822,6 +3882,7 @@ func (PodUptime) Description() string {
|
||||
func (m PodUptime) Record(ctx context.Context, val float64, attrs ...attribute.KeyValue) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
@@ -4799,6 +4860,11 @@ func (m ResourceQuotaHugepageCountRequestHard) Add(
|
||||
hugepageSize string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -4886,6 +4952,11 @@ func (m ResourceQuotaHugepageCountRequestUsed) Add(
|
||||
hugepageSize string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -5273,6 +5344,11 @@ func (m ResourceQuotaObjectCountHard) Add(
|
||||
resourcequotaResourceName string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -5360,6 +5436,11 @@ func (m ResourceQuotaObjectCountUsed) Add(
|
||||
resourcequotaResourceName string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -5451,6 +5532,11 @@ func (m ResourceQuotaPersistentvolumeclaimCountHard) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -5548,6 +5634,11 @@ func (m ResourceQuotaPersistentvolumeclaimCountUsed) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -5643,6 +5734,11 @@ func (m ResourceQuotaStorageRequestHard) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -5738,6 +5834,11 @@ func (m ResourceQuotaStorageRequestUsed) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
|
||||
@@ -155,6 +155,11 @@ func (m ClientConsumedMessages) Add(
|
||||
system SystemAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -300,6 +305,11 @@ func (m ClientOperationDuration) Record(
|
||||
system SystemAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -451,6 +461,11 @@ func (m ClientSentMessages) Add(
|
||||
system SystemAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -581,6 +596,11 @@ func (m ProcessDuration) Record(
|
||||
system SystemAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
|
||||
@@ -228,6 +228,11 @@ func (m SDKExporterLogExported) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -340,6 +345,11 @@ func (m SDKExporterLogInflight) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -451,6 +461,11 @@ func (m SDKExporterMetricDataPointExported) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -565,6 +580,11 @@ func (m SDKExporterMetricDataPointInflight) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -677,6 +697,11 @@ func (m SDKExporterOperationDuration) Record(
|
||||
val float64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -808,6 +833,11 @@ func (m SDKExporterSpanExported) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -920,6 +950,11 @@ func (m SDKExporterSpanInflight) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -1096,6 +1131,11 @@ func (m SDKMetricReaderCollectionDuration) Record(
|
||||
val float64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -1198,6 +1238,11 @@ func (m SDKProcessorLogProcessed) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -1433,6 +1478,11 @@ func (m SDKProcessorSpanProcessed) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -1662,6 +1712,11 @@ func (m SDKSpanLive) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -1746,6 +1801,11 @@ func (m SDKSpanStarted) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
|
||||
@@ -155,6 +155,11 @@ func (m ContextSwitches) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -295,6 +300,11 @@ func (m CPUUtilization) Record(
|
||||
val int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -376,6 +386,11 @@ func (m DiskIO) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -590,6 +605,11 @@ func (m NetworkIO) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -738,6 +758,11 @@ func (m PagingFaults) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -887,6 +912,7 @@ func (Uptime) Description() string {
|
||||
func (m Uptime) Record(ctx context.Context, val float64, attrs ...attribute.KeyValue) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
|
||||
@@ -77,6 +77,7 @@ func (ClientDuration) Description() string {
|
||||
func (m ClientDuration) Record(ctx context.Context, val float64, attrs ...attribute.KeyValue) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
@@ -145,6 +146,7 @@ func (ClientRequestSize) Description() string {
|
||||
func (m ClientRequestSize) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
@@ -215,6 +217,7 @@ func (ClientRequestsPerRPC) Description() string {
|
||||
func (m ClientRequestsPerRPC) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
@@ -283,6 +286,7 @@ func (ClientResponseSize) Description() string {
|
||||
func (m ClientResponseSize) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
@@ -353,6 +357,7 @@ func (ClientResponsesPerRPC) Description() string {
|
||||
func (m ClientResponsesPerRPC) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
@@ -424,6 +429,7 @@ func (ServerDuration) Description() string {
|
||||
func (m ServerDuration) Record(ctx context.Context, val float64, attrs ...attribute.KeyValue) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
@@ -492,6 +498,7 @@ func (ServerRequestSize) Description() string {
|
||||
func (m ServerRequestSize) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
@@ -562,6 +569,7 @@ func (ServerRequestsPerRPC) Description() string {
|
||||
func (m ServerRequestsPerRPC) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
@@ -630,6 +638,7 @@ func (ServerResponseSize) Description() string {
|
||||
func (m ServerResponseSize) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
@@ -700,6 +709,7 @@ func (ServerResponsesPerRPC) Description() string {
|
||||
func (m ServerResponsesPerRPC) Record(ctx context.Context, val int64, attrs ...attribute.KeyValue) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
|
||||
@@ -109,6 +109,11 @@ func (m ServerActiveConnections) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -201,6 +206,11 @@ func (m ServerConnectionDuration) Record(
|
||||
val float64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Histogram.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
|
||||
@@ -304,6 +304,11 @@ func (m CPUFrequency) Record(
|
||||
val int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -590,6 +595,11 @@ func (m CPUUtilization) Record(
|
||||
val int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -671,6 +681,11 @@ func (m DiskIO) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -769,6 +784,11 @@ func (m DiskIOTime) Add(
|
||||
incr float64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -849,6 +869,11 @@ func (m DiskLimit) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -923,6 +948,11 @@ func (m DiskMerged) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -1019,6 +1049,11 @@ func (m DiskOperationTime) Add(
|
||||
incr float64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -1099,6 +1134,11 @@ func (m DiskOperations) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -1185,6 +1225,11 @@ func (m FilesystemLimit) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -1292,6 +1337,11 @@ func (m FilesystemUsage) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -1395,6 +1445,11 @@ func (m FilesystemUtilization) Record(
|
||||
val int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -1592,6 +1647,11 @@ func (m LinuxMemorySlabUsage) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -1915,6 +1975,11 @@ func (m NetworkConnectionCount) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -2024,6 +2089,11 @@ func (m NetworkDropped) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -2123,6 +2193,11 @@ func (m NetworkErrors) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -2263,6 +2338,11 @@ func (m NetworkPackets) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -2344,6 +2424,11 @@ func (m PagingFaults) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -2418,6 +2503,11 @@ func (m PagingOperations) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Counter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -2505,6 +2595,11 @@ func (m PagingUsage) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -2586,6 +2681,11 @@ func (m PagingUtilization) Record(
|
||||
val int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -2673,6 +2773,11 @@ func (m ProcessCount) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -2823,6 +2928,7 @@ func (Uptime) Description() string {
|
||||
func (m Uptime) Record(ctx context.Context, val float64, attrs ...attribute.KeyValue) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
|
||||
@@ -212,6 +212,11 @@ func (m ChangeCount) Add(
|
||||
repositoryUrlFull string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -327,6 +332,11 @@ func (m ChangeDuration) Record(
|
||||
repositoryUrlFull string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -440,6 +450,11 @@ func (m ChangeTimeToApproval) Record(
|
||||
repositoryUrlFull string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -581,6 +596,11 @@ func (m ChangeTimeToMerge) Record(
|
||||
repositoryUrlFull string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -716,6 +736,11 @@ func (m ContributorCount) Record(
|
||||
repositoryUrlFull string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -825,6 +850,11 @@ func (m RefCount) Add(
|
||||
repositoryUrlFull string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -961,6 +991,11 @@ func (m RefLinesDelta) Record(
|
||||
repositoryUrlFull string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -1106,6 +1141,11 @@ func (m RefRevisionsDelta) Record(
|
||||
revisionDeltaDirection RevisionDeltaDirectionAttr,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -1234,6 +1274,11 @@ func (m RefTime) Record(
|
||||
repositoryUrlFull string,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Float64Gauge.Record(ctx, val)
|
||||
return
|
||||
}
|
||||
|
||||
o := recOptPool.Get().(*[]metric.RecordOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
@@ -1334,6 +1379,11 @@ func (m RepositoryCount) Add(
|
||||
incr int64,
|
||||
attrs ...attribute.KeyValue,
|
||||
) {
|
||||
if len(attrs) == 0 {
|
||||
m.Int64UpDownCounter.Add(ctx, incr)
|
||||
return
|
||||
}
|
||||
|
||||
o := addOptPool.Get().(*[]metric.AddOption)
|
||||
defer func() {
|
||||
*o = (*o)[:0]
|
||||
|
||||
Reference in New Issue
Block a user