diff --git a/CHANGELOG.md b/CHANGELOG.md index a52de51111f..c58d2d9a88b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Fixed - Fix missing `request.GetBody` in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` to correctly handle HTTP2 GOAWAY frame. (#7931) +- Fix semconv v1.39.0 generated metric helpers skipping required attributes when extra attributes were empty. (#7964) ### Removed diff --git a/semconv/templates/registry/go/instrument.j2 b/semconv/templates/registry/go/instrument.j2 index c924368581d..f8d5488598d 100644 --- a/semconv/templates/registry/go/instrument.j2 +++ b/semconv/templates/registry/go/instrument.j2 @@ -116,7 +116,15 @@ func (m {{ name }}) Add( {{ params(metric.attributes, pkg=pkg, prefix="\t") }} ) { if len(attrs) == 0 { +{%- if req_attr | length > 0 %} + m.{{ inst }}.Add(ctx, incr, metric.WithAttributes( +{%- for attr in req_attr %} + {{ to_attribute(attr, pkg) }} +{%- endfor %} + )) +{%- else %} m.{{ inst }}.Add(ctx, incr) +{%- endif %} return } @@ -201,7 +209,15 @@ func (m {{ name }}) Record( {{ params(metric.attributes, pkg=pkg, prefix="\t") }} ) { if len(attrs) == 0 { +{%- if req_attr | length > 0 %} + m.{{ inst }}.Record(ctx, val, metric.WithAttributes( +{%- for attr in req_attr %} + {{ to_attribute(attr, pkg) }} +{%- endfor %} + )) +{%- else %} m.{{ inst }}.Record(ctx, val) +{%- endif %} return } diff --git a/semconv/v1.39.0/azureconv/metric.go b/semconv/v1.39.0/azureconv/metric.go index 56ec72f08ea..48be2c6f90d 100644 --- a/semconv/v1.39.0/azureconv/metric.go +++ b/semconv/v1.39.0/azureconv/metric.go @@ -244,7 +244,9 @@ func (m CosmosDBClientOperationRequestCharge) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Histogram.Record(ctx, val) + m.Int64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("db.operation.name", dbOperationName), + )) return } diff --git a/semconv/v1.39.0/cicdconv/metric.go b/semconv/v1.39.0/cicdconv/metric.go index 2e73424dd2b..9b4cde8574a 100644 --- a/semconv/v1.39.0/cicdconv/metric.go +++ b/semconv/v1.39.0/cicdconv/metric.go @@ -163,7 +163,10 @@ func (m PipelineRunActive) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("cicd.pipeline.name", pipelineName), + attribute.String("cicd.pipeline.run.state", string(pipelineRunState)), + )) return } @@ -279,7 +282,10 @@ func (m PipelineRunDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("cicd.pipeline.name", pipelineName), + attribute.String("cicd.pipeline.run.state", string(pipelineRunState)), + )) return } @@ -411,7 +417,10 @@ func (m PipelineRunErrors) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("cicd.pipeline.name", pipelineName), + attribute.String("error.type", string(errorType)), + )) return } @@ -531,7 +540,10 @@ func (m SystemErrors) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("cicd.system.component", systemComponent), + attribute.String("error.type", string(errorType)), + )) return } @@ -643,7 +655,9 @@ func (m WorkerCount) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("cicd.worker.state", string(workerState)), + )) return } diff --git a/semconv/v1.39.0/dbconv/metric.go b/semconv/v1.39.0/dbconv/metric.go index 417ee833445..a539e80a57f 100644 --- a/semconv/v1.39.0/dbconv/metric.go +++ b/semconv/v1.39.0/dbconv/metric.go @@ -294,7 +294,10 @@ func (m ClientConnectionCount) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("db.client.connection.pool.name", clientConnectionPoolName), + attribute.String("db.client.connection.state", string(clientConnectionState)), + )) return } @@ -410,7 +413,9 @@ func (m ClientConnectionCreateTime) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("db.client.connection.pool.name", clientConnectionPoolName), + )) return } @@ -524,7 +529,9 @@ func (m ClientConnectionIdleMax) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("db.client.connection.pool.name", clientConnectionPoolName), + )) return } @@ -638,7 +645,9 @@ func (m ClientConnectionIdleMin) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("db.client.connection.pool.name", clientConnectionPoolName), + )) return } @@ -752,7 +761,9 @@ func (m ClientConnectionMax) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("db.client.connection.pool.name", clientConnectionPoolName), + )) return } @@ -868,7 +879,9 @@ func (m ClientConnectionPendingRequests) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("db.client.connection.pool.name", clientConnectionPoolName), + )) return } @@ -983,7 +996,9 @@ func (m ClientConnectionTimeouts) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("db.client.connection.pool.name", clientConnectionPoolName), + )) return } @@ -1098,7 +1113,9 @@ func (m ClientConnectionUseTime) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("db.client.connection.pool.name", clientConnectionPoolName), + )) return } @@ -1212,7 +1229,9 @@ func (m ClientConnectionWaitTime) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("db.client.connection.pool.name", clientConnectionPoolName), + )) return } @@ -1325,7 +1344,9 @@ func (m ClientOperationDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("db.system.name", string(systemName)), + )) return } @@ -1520,7 +1541,9 @@ func (m ClientResponseReturnedRows) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Histogram.Record(ctx, val) + m.Int64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("db.system.name", string(systemName)), + )) return } diff --git a/semconv/v1.39.0/dnsconv/metric.go b/semconv/v1.39.0/dnsconv/metric.go index 67005ad665e..437713fa307 100644 --- a/semconv/v1.39.0/dnsconv/metric.go +++ b/semconv/v1.39.0/dnsconv/metric.go @@ -101,7 +101,9 @@ func (m LookupDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("dns.question.name", questionName), + )) return } diff --git a/semconv/v1.39.0/genaiconv/metric.go b/semconv/v1.39.0/genaiconv/metric.go index 77c82c42429..3b724f9d4bb 100644 --- a/semconv/v1.39.0/genaiconv/metric.go +++ b/semconv/v1.39.0/genaiconv/metric.go @@ -214,7 +214,10 @@ func (m ClientOperationDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("gen_ai.operation.name", string(operationName)), + attribute.String("gen_ai.provider.name", string(providerName)), + )) return } @@ -365,7 +368,11 @@ func (m ClientTokenUsage) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Histogram.Record(ctx, val) + m.Int64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("gen_ai.operation.name", string(operationName)), + attribute.String("gen_ai.provider.name", string(providerName)), + attribute.String("gen_ai.token.type", string(tokenType)), + )) return } @@ -508,7 +515,10 @@ func (m ServerRequestDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("gen_ai.operation.name", string(operationName)), + attribute.String("gen_ai.provider.name", string(providerName)), + )) return } @@ -657,7 +667,10 @@ func (m ServerTimePerOutputToken) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("gen_ai.operation.name", string(operationName)), + attribute.String("gen_ai.provider.name", string(providerName)), + )) return } @@ -798,7 +811,10 @@ func (m ServerTimeToFirstToken) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("gen_ai.operation.name", string(operationName)), + attribute.String("gen_ai.provider.name", string(providerName)), + )) return } diff --git a/semconv/v1.39.0/httpconv/metric.go b/semconv/v1.39.0/httpconv/metric.go index cb993812a8d..d6ad8735a9c 100644 --- a/semconv/v1.39.0/httpconv/metric.go +++ b/semconv/v1.39.0/httpconv/metric.go @@ -160,7 +160,10 @@ func (m ClientActiveRequests) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )) return } @@ -300,7 +303,10 @@ func (m ClientConnectionDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )) return } @@ -443,7 +449,11 @@ func (m ClientOpenConnections) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("http.connection.state", string(connectionState)), + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )) return } @@ -592,7 +602,11 @@ func (m ClientRequestBodySize) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Histogram.Record(ctx, val) + m.Int64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("http.request.method", string(requestMethod)), + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )) return } @@ -768,7 +782,11 @@ func (m ClientRequestDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("http.request.method", string(requestMethod)), + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )) return } @@ -944,7 +962,11 @@ func (m ClientResponseBodySize) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Histogram.Record(ctx, val) + m.Int64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("http.request.method", string(requestMethod)), + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )) return } @@ -1118,7 +1140,10 @@ func (m ServerActiveRequests) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("http.request.method", string(requestMethod)), + attribute.String("url.scheme", urlScheme), + )) return } @@ -1255,7 +1280,10 @@ func (m ServerRequestBodySize) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Histogram.Record(ctx, val) + m.Int64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("http.request.method", string(requestMethod)), + attribute.String("url.scheme", urlScheme), + )) return } @@ -1439,7 +1467,10 @@ func (m ServerRequestDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("http.request.method", string(requestMethod)), + attribute.String("url.scheme", urlScheme), + )) return } @@ -1623,7 +1654,10 @@ func (m ServerResponseBodySize) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Histogram.Record(ctx, val) + m.Int64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("http.request.method", string(requestMethod)), + attribute.String("url.scheme", urlScheme), + )) return } diff --git a/semconv/v1.39.0/hwconv/metric.go b/semconv/v1.39.0/hwconv/metric.go index a798030ed0c..8fc865bd869 100644 --- a/semconv/v1.39.0/hwconv/metric.go +++ b/semconv/v1.39.0/hwconv/metric.go @@ -256,7 +256,9 @@ func (m BatteryCharge) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -409,7 +411,9 @@ func (m BatteryChargeLimit) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -575,7 +579,10 @@ func (m BatteryTimeLeft) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Gauge.Record(ctx, val) + m.Float64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + attribute.String("hw.state", string(state)), + )) return } @@ -734,7 +741,9 @@ func (m CPUSpeed) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -871,7 +880,9 @@ func (m CPUSpeedLimit) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -1017,7 +1028,10 @@ func (m Energy) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + attribute.String("hw.type", string(hwType)), + )) return } @@ -1145,7 +1159,10 @@ func (m Errors) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + attribute.String("hw.type", string(hwType)), + )) return } @@ -1283,7 +1300,9 @@ func (m FanSpeed) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -1413,7 +1432,9 @@ func (m FanSpeedLimit) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -1549,7 +1570,9 @@ func (m FanSpeedRatio) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -1682,7 +1705,10 @@ func (m GpuIO) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + attribute.String("network.io.direction", string(networkIoDirection)), + )) return } @@ -1841,7 +1867,9 @@ func (m GpuMemoryLimit) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -1998,7 +2026,9 @@ func (m GpuMemoryUsage) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -2156,7 +2186,9 @@ func (m GpuMemoryUtilization) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -2314,7 +2346,9 @@ func (m GpuUtilization) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -2478,7 +2512,9 @@ func (m HostAmbientTemperature) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -2607,7 +2643,9 @@ func (m HostEnergy) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -2737,7 +2775,9 @@ func (m HostHeatingMargin) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -2866,7 +2906,9 @@ func (m HostPower) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -2995,7 +3037,9 @@ func (m LogicalDiskLimit) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -3129,7 +3173,10 @@ func (m LogicalDiskUsage) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + attribute.String("hw.logical_disk.state", string(logicalDiskState)), + )) return } @@ -3264,7 +3311,10 @@ func (m LogicalDiskUtilization) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + attribute.String("hw.logical_disk.state", string(logicalDiskState)), + )) return } @@ -3396,7 +3446,9 @@ func (m MemorySize) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -3546,7 +3598,9 @@ func (m NetworkBandwidthLimit) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -3705,7 +3759,9 @@ func (m NetworkBandwidthUtilization) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -3866,7 +3922,10 @@ func (m NetworkIO) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + attribute.String("network.io.direction", string(networkIoDirection)), + )) return } @@ -4028,7 +4087,10 @@ func (m NetworkPackets) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + attribute.String("network.io.direction", string(networkIoDirection)), + )) return } @@ -4187,7 +4249,9 @@ func (m NetworkUp) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -4349,7 +4413,10 @@ func (m PhysicalDiskEnduranceUtilization) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + attribute.String("hw.physical_disk.state", string(physicalDiskState)), + )) return } @@ -4508,7 +4575,9 @@ func (m PhysicalDiskSize) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -4669,7 +4738,9 @@ func (m PhysicalDiskSmart) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -4842,7 +4913,10 @@ func (m Power) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + attribute.String("hw.type", string(hwType)), + )) return } @@ -4969,7 +5043,9 @@ func (m PowerSupplyLimit) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -5119,7 +5195,9 @@ func (m PowerSupplyUsage) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -5264,7 +5342,9 @@ func (m PowerSupplyUtilization) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -5422,7 +5502,11 @@ func (m Status) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + attribute.String("hw.state", string(state)), + attribute.String("hw.type", string(hwType)), + )) return } @@ -5556,7 +5640,9 @@ func (m TapeDriveOperations) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -5707,7 +5793,9 @@ func (m Temperature) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -5837,7 +5925,9 @@ func (m TemperatureLimit) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -5973,7 +6063,9 @@ func (m Voltage) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -6103,7 +6195,9 @@ func (m VoltageLimit) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -6239,7 +6333,9 @@ func (m VoltageNominal) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } diff --git a/semconv/v1.39.0/k8sconv/metric.go b/semconv/v1.39.0/k8sconv/metric.go index a3a2f106f65..53d4f380d9c 100644 --- a/semconv/v1.39.0/k8sconv/metric.go +++ b/semconv/v1.39.0/k8sconv/metric.go @@ -1332,7 +1332,9 @@ func (m ContainerStatusReason) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.container.status.reason", string(containerStatusReason)), + )) return } @@ -1451,7 +1453,9 @@ func (m ContainerStatusState) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.container.status.state", string(containerStatusState)), + )) return } @@ -3821,7 +3825,9 @@ func (m NamespacePhase) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.namespace.phase", string(namespacePhase)), + )) return } @@ -3937,7 +3943,10 @@ func (m NodeConditionStatus) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.node.condition.status", string(nodeConditionStatus)), + attribute.String("k8s.node.condition.type", string(nodeConditionType)), + )) return } @@ -7139,7 +7148,9 @@ func (m PodStatusPhase) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.pod.status.phase", string(podStatusPhase)), + )) return } @@ -7258,7 +7269,9 @@ func (m PodStatusReason) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.pod.status.reason", string(podStatusReason)), + )) return } @@ -7480,7 +7493,9 @@ func (m PodVolumeAvailable) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.volume.name", volumeName), + )) return } @@ -7612,7 +7627,9 @@ func (m PodVolumeCapacity) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.volume.name", volumeName), + )) return } @@ -7744,7 +7761,9 @@ func (m PodVolumeInodeCount) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.volume.name", volumeName), + )) return } @@ -7876,7 +7895,9 @@ func (m PodVolumeInodeFree) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.volume.name", volumeName), + )) return } @@ -8011,7 +8032,9 @@ func (m PodVolumeInodeUsed) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.volume.name", volumeName), + )) return } @@ -8148,7 +8171,9 @@ func (m PodVolumeUsage) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.volume.name", volumeName), + )) return } @@ -9538,7 +9563,9 @@ func (m ResourceQuotaHugepageCountRequestHard) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.hugepage.size", hugepageSize), + )) return } @@ -9660,7 +9687,9 @@ func (m ResourceQuotaHugepageCountRequestUsed) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.hugepage.size", hugepageSize), + )) return } @@ -10202,7 +10231,9 @@ func (m ResourceQuotaObjectCountHard) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.resourcequota.resource_name", resourcequotaResourceName), + )) return } @@ -10324,7 +10355,9 @@ func (m ResourceQuotaObjectCountUsed) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.resourcequota.resource_name", resourcequotaResourceName), + )) return } diff --git a/semconv/v1.39.0/mcpconv/metric.go b/semconv/v1.39.0/mcpconv/metric.go index 0cd7dfdcdf0..26a22861434 100644 --- a/semconv/v1.39.0/mcpconv/metric.go +++ b/semconv/v1.39.0/mcpconv/metric.go @@ -224,7 +224,9 @@ func (m ClientOperationDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("mcp.method.name", string(methodName)), + )) return } @@ -592,7 +594,9 @@ func (m ServerOperationDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("mcp.method.name", string(methodName)), + )) return } diff --git a/semconv/v1.39.0/messagingconv/metric.go b/semconv/v1.39.0/messagingconv/metric.go index 824fb84baa1..c6ffc00bb88 100644 --- a/semconv/v1.39.0/messagingconv/metric.go +++ b/semconv/v1.39.0/messagingconv/metric.go @@ -169,7 +169,10 @@ func (m ClientConsumedMessages) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("messaging.operation.name", operationName), + attribute.String("messaging.system", string(system)), + )) return } @@ -351,7 +354,10 @@ func (m ClientOperationDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("messaging.operation.name", operationName), + attribute.String("messaging.system", string(system)), + )) return } @@ -535,7 +541,10 @@ func (m ClientSentMessages) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("messaging.operation.name", operationName), + attribute.String("messaging.system", string(system)), + )) return } @@ -698,7 +707,10 @@ func (m ProcessDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("messaging.operation.name", operationName), + attribute.String("messaging.system", string(system)), + )) return } diff --git a/semconv/v1.39.0/openshiftconv/metric.go b/semconv/v1.39.0/openshiftconv/metric.go index 585ba21a026..4d73525279d 100644 --- a/semconv/v1.39.0/openshiftconv/metric.go +++ b/semconv/v1.39.0/openshiftconv/metric.go @@ -978,7 +978,9 @@ func (m ClusterquotaHugepageCountRequestHard) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.hugepage.size", k8sHugepageSize), + )) return } @@ -1104,7 +1106,9 @@ func (m ClusterquotaHugepageCountRequestUsed) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.hugepage.size", k8sHugepageSize), + )) return } @@ -1671,7 +1675,9 @@ func (m ClusterquotaObjectCountHard) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.resourcequota.resource_name", k8sResourcequotaResourceName), + )) return } @@ -1798,7 +1804,9 @@ func (m ClusterquotaObjectCountUsed) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.resourcequota.resource_name", k8sResourcequotaResourceName), + )) return } diff --git a/semconv/v1.39.0/rpcconv/metric.go b/semconv/v1.39.0/rpcconv/metric.go index 813782a8de5..526ebaa009b 100644 --- a/semconv/v1.39.0/rpcconv/metric.go +++ b/semconv/v1.39.0/rpcconv/metric.go @@ -149,7 +149,9 @@ func (m ClientCallDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("rpc.system.name", string(systemName)), + )) return } @@ -325,7 +327,9 @@ func (m ClientRequestSize) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Histogram.Record(ctx, val) + m.Int64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("rpc.system.name", string(systemName)), + )) return } @@ -500,7 +504,9 @@ func (m ClientResponseSize) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Histogram.Record(ctx, val) + m.Int64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("rpc.system.name", string(systemName)), + )) return } @@ -676,7 +682,9 @@ func (m ServerCallDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("rpc.system.name", string(systemName)), + )) return } @@ -852,7 +860,9 @@ func (m ServerRequestSize) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Histogram.Record(ctx, val) + m.Int64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("rpc.system.name", string(systemName)), + )) return } @@ -1027,7 +1037,9 @@ func (m ServerResponseSize) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Histogram.Record(ctx, val) + m.Int64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("rpc.system.name", string(systemName)), + )) return } diff --git a/semconv/v1.39.0/vcsconv/metric.go b/semconv/v1.39.0/vcsconv/metric.go index 2f660689e37..398418d6e45 100644 --- a/semconv/v1.39.0/vcsconv/metric.go +++ b/semconv/v1.39.0/vcsconv/metric.go @@ -224,7 +224,10 @@ func (m ChangeCount) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("vcs.change.state", string(changeState)), + attribute.String("vcs.repository.url.full", repositoryUrlFull), + )) return } @@ -369,7 +372,11 @@ func (m ChangeDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Gauge.Record(ctx, val) + m.Float64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("vcs.change.state", string(changeState)), + attribute.String("vcs.ref.head.name", refHeadName), + attribute.String("vcs.repository.url.full", repositoryUrlFull), + )) return } @@ -512,7 +519,10 @@ func (m ChangeTimeToApproval) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Gauge.Record(ctx, val) + m.Float64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("vcs.ref.head.name", refHeadName), + attribute.String("vcs.repository.url.full", repositoryUrlFull), + )) return } @@ -683,7 +693,10 @@ func (m ChangeTimeToMerge) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Gauge.Record(ctx, val) + m.Float64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("vcs.ref.head.name", refHeadName), + attribute.String("vcs.repository.url.full", repositoryUrlFull), + )) return } @@ -848,7 +861,9 @@ func (m ContributorCount) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("vcs.repository.url.full", repositoryUrlFull), + )) return } @@ -987,7 +1002,10 @@ func (m RefCount) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("vcs.ref.type", string(refType)), + attribute.String("vcs.repository.url.full", repositoryUrlFull), + )) return } @@ -1153,7 +1171,14 @@ func (m RefLinesDelta) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("vcs.line_change.type", string(lineChangeType)), + attribute.String("vcs.ref.base.name", refBaseName), + attribute.String("vcs.ref.base.type", string(refBaseType)), + attribute.String("vcs.ref.head.name", refHeadName), + attribute.String("vcs.ref.head.type", string(refHeadType)), + attribute.String("vcs.repository.url.full", repositoryUrlFull), + )) return } @@ -1335,7 +1360,14 @@ func (m RefRevisionsDelta) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("vcs.ref.base.name", refBaseName), + attribute.String("vcs.ref.base.type", string(refBaseType)), + attribute.String("vcs.ref.head.name", refHeadName), + attribute.String("vcs.ref.head.type", string(refHeadType)), + attribute.String("vcs.repository.url.full", repositoryUrlFull), + attribute.String("vcs.revision_delta.direction", string(revisionDeltaDirection)), + )) return } @@ -1498,7 +1530,11 @@ func (m RefTime) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Gauge.Record(ctx, val) + m.Float64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("vcs.ref.head.name", refHeadName), + attribute.String("vcs.ref.head.type", string(refHeadType)), + attribute.String("vcs.repository.url.full", repositoryUrlFull), + )) return } diff --git a/semconv/v1.40.0/azureconv/metric.go b/semconv/v1.40.0/azureconv/metric.go index 56ec72f08ea..48be2c6f90d 100644 --- a/semconv/v1.40.0/azureconv/metric.go +++ b/semconv/v1.40.0/azureconv/metric.go @@ -244,7 +244,9 @@ func (m CosmosDBClientOperationRequestCharge) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Histogram.Record(ctx, val) + m.Int64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("db.operation.name", dbOperationName), + )) return } diff --git a/semconv/v1.40.0/cicdconv/metric.go b/semconv/v1.40.0/cicdconv/metric.go index 2e73424dd2b..9b4cde8574a 100644 --- a/semconv/v1.40.0/cicdconv/metric.go +++ b/semconv/v1.40.0/cicdconv/metric.go @@ -163,7 +163,10 @@ func (m PipelineRunActive) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("cicd.pipeline.name", pipelineName), + attribute.String("cicd.pipeline.run.state", string(pipelineRunState)), + )) return } @@ -279,7 +282,10 @@ func (m PipelineRunDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("cicd.pipeline.name", pipelineName), + attribute.String("cicd.pipeline.run.state", string(pipelineRunState)), + )) return } @@ -411,7 +417,10 @@ func (m PipelineRunErrors) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("cicd.pipeline.name", pipelineName), + attribute.String("error.type", string(errorType)), + )) return } @@ -531,7 +540,10 @@ func (m SystemErrors) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("cicd.system.component", systemComponent), + attribute.String("error.type", string(errorType)), + )) return } @@ -643,7 +655,9 @@ func (m WorkerCount) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("cicd.worker.state", string(workerState)), + )) return } diff --git a/semconv/v1.40.0/dbconv/metric.go b/semconv/v1.40.0/dbconv/metric.go index 417ee833445..a539e80a57f 100644 --- a/semconv/v1.40.0/dbconv/metric.go +++ b/semconv/v1.40.0/dbconv/metric.go @@ -294,7 +294,10 @@ func (m ClientConnectionCount) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("db.client.connection.pool.name", clientConnectionPoolName), + attribute.String("db.client.connection.state", string(clientConnectionState)), + )) return } @@ -410,7 +413,9 @@ func (m ClientConnectionCreateTime) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("db.client.connection.pool.name", clientConnectionPoolName), + )) return } @@ -524,7 +529,9 @@ func (m ClientConnectionIdleMax) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("db.client.connection.pool.name", clientConnectionPoolName), + )) return } @@ -638,7 +645,9 @@ func (m ClientConnectionIdleMin) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("db.client.connection.pool.name", clientConnectionPoolName), + )) return } @@ -752,7 +761,9 @@ func (m ClientConnectionMax) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("db.client.connection.pool.name", clientConnectionPoolName), + )) return } @@ -868,7 +879,9 @@ func (m ClientConnectionPendingRequests) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("db.client.connection.pool.name", clientConnectionPoolName), + )) return } @@ -983,7 +996,9 @@ func (m ClientConnectionTimeouts) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("db.client.connection.pool.name", clientConnectionPoolName), + )) return } @@ -1098,7 +1113,9 @@ func (m ClientConnectionUseTime) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("db.client.connection.pool.name", clientConnectionPoolName), + )) return } @@ -1212,7 +1229,9 @@ func (m ClientConnectionWaitTime) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("db.client.connection.pool.name", clientConnectionPoolName), + )) return } @@ -1325,7 +1344,9 @@ func (m ClientOperationDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("db.system.name", string(systemName)), + )) return } @@ -1520,7 +1541,9 @@ func (m ClientResponseReturnedRows) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Histogram.Record(ctx, val) + m.Int64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("db.system.name", string(systemName)), + )) return } diff --git a/semconv/v1.40.0/dnsconv/metric.go b/semconv/v1.40.0/dnsconv/metric.go index 67005ad665e..437713fa307 100644 --- a/semconv/v1.40.0/dnsconv/metric.go +++ b/semconv/v1.40.0/dnsconv/metric.go @@ -101,7 +101,9 @@ func (m LookupDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("dns.question.name", questionName), + )) return } diff --git a/semconv/v1.40.0/genaiconv/metric.go b/semconv/v1.40.0/genaiconv/metric.go index 36a6830b444..80b4f4858ad 100644 --- a/semconv/v1.40.0/genaiconv/metric.go +++ b/semconv/v1.40.0/genaiconv/metric.go @@ -219,7 +219,10 @@ func (m ClientOperationDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("gen_ai.operation.name", string(operationName)), + attribute.String("gen_ai.provider.name", string(providerName)), + )) return } @@ -370,7 +373,11 @@ func (m ClientTokenUsage) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Histogram.Record(ctx, val) + m.Int64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("gen_ai.operation.name", string(operationName)), + attribute.String("gen_ai.provider.name", string(providerName)), + attribute.String("gen_ai.token.type", string(tokenType)), + )) return } @@ -513,7 +520,10 @@ func (m ServerRequestDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("gen_ai.operation.name", string(operationName)), + attribute.String("gen_ai.provider.name", string(providerName)), + )) return } @@ -662,7 +672,10 @@ func (m ServerTimePerOutputToken) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("gen_ai.operation.name", string(operationName)), + attribute.String("gen_ai.provider.name", string(providerName)), + )) return } @@ -803,7 +816,10 @@ func (m ServerTimeToFirstToken) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("gen_ai.operation.name", string(operationName)), + attribute.String("gen_ai.provider.name", string(providerName)), + )) return } diff --git a/semconv/v1.40.0/httpconv/metric.go b/semconv/v1.40.0/httpconv/metric.go index cb993812a8d..d6ad8735a9c 100644 --- a/semconv/v1.40.0/httpconv/metric.go +++ b/semconv/v1.40.0/httpconv/metric.go @@ -160,7 +160,10 @@ func (m ClientActiveRequests) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )) return } @@ -300,7 +303,10 @@ func (m ClientConnectionDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )) return } @@ -443,7 +449,11 @@ func (m ClientOpenConnections) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("http.connection.state", string(connectionState)), + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )) return } @@ -592,7 +602,11 @@ func (m ClientRequestBodySize) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Histogram.Record(ctx, val) + m.Int64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("http.request.method", string(requestMethod)), + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )) return } @@ -768,7 +782,11 @@ func (m ClientRequestDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("http.request.method", string(requestMethod)), + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )) return } @@ -944,7 +962,11 @@ func (m ClientResponseBodySize) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Histogram.Record(ctx, val) + m.Int64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("http.request.method", string(requestMethod)), + attribute.String("server.address", serverAddress), + attribute.Int("server.port", serverPort), + )) return } @@ -1118,7 +1140,10 @@ func (m ServerActiveRequests) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("http.request.method", string(requestMethod)), + attribute.String("url.scheme", urlScheme), + )) return } @@ -1255,7 +1280,10 @@ func (m ServerRequestBodySize) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Histogram.Record(ctx, val) + m.Int64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("http.request.method", string(requestMethod)), + attribute.String("url.scheme", urlScheme), + )) return } @@ -1439,7 +1467,10 @@ func (m ServerRequestDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("http.request.method", string(requestMethod)), + attribute.String("url.scheme", urlScheme), + )) return } @@ -1623,7 +1654,10 @@ func (m ServerResponseBodySize) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Histogram.Record(ctx, val) + m.Int64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("http.request.method", string(requestMethod)), + attribute.String("url.scheme", urlScheme), + )) return } diff --git a/semconv/v1.40.0/hwconv/metric.go b/semconv/v1.40.0/hwconv/metric.go index a798030ed0c..8fc865bd869 100644 --- a/semconv/v1.40.0/hwconv/metric.go +++ b/semconv/v1.40.0/hwconv/metric.go @@ -256,7 +256,9 @@ func (m BatteryCharge) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -409,7 +411,9 @@ func (m BatteryChargeLimit) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -575,7 +579,10 @@ func (m BatteryTimeLeft) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Gauge.Record(ctx, val) + m.Float64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + attribute.String("hw.state", string(state)), + )) return } @@ -734,7 +741,9 @@ func (m CPUSpeed) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -871,7 +880,9 @@ func (m CPUSpeedLimit) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -1017,7 +1028,10 @@ func (m Energy) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + attribute.String("hw.type", string(hwType)), + )) return } @@ -1145,7 +1159,10 @@ func (m Errors) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + attribute.String("hw.type", string(hwType)), + )) return } @@ -1283,7 +1300,9 @@ func (m FanSpeed) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -1413,7 +1432,9 @@ func (m FanSpeedLimit) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -1549,7 +1570,9 @@ func (m FanSpeedRatio) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -1682,7 +1705,10 @@ func (m GpuIO) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + attribute.String("network.io.direction", string(networkIoDirection)), + )) return } @@ -1841,7 +1867,9 @@ func (m GpuMemoryLimit) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -1998,7 +2026,9 @@ func (m GpuMemoryUsage) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -2156,7 +2186,9 @@ func (m GpuMemoryUtilization) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -2314,7 +2346,9 @@ func (m GpuUtilization) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -2478,7 +2512,9 @@ func (m HostAmbientTemperature) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -2607,7 +2643,9 @@ func (m HostEnergy) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -2737,7 +2775,9 @@ func (m HostHeatingMargin) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -2866,7 +2906,9 @@ func (m HostPower) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -2995,7 +3037,9 @@ func (m LogicalDiskLimit) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -3129,7 +3173,10 @@ func (m LogicalDiskUsage) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + attribute.String("hw.logical_disk.state", string(logicalDiskState)), + )) return } @@ -3264,7 +3311,10 @@ func (m LogicalDiskUtilization) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + attribute.String("hw.logical_disk.state", string(logicalDiskState)), + )) return } @@ -3396,7 +3446,9 @@ func (m MemorySize) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -3546,7 +3598,9 @@ func (m NetworkBandwidthLimit) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -3705,7 +3759,9 @@ func (m NetworkBandwidthUtilization) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -3866,7 +3922,10 @@ func (m NetworkIO) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + attribute.String("network.io.direction", string(networkIoDirection)), + )) return } @@ -4028,7 +4087,10 @@ func (m NetworkPackets) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + attribute.String("network.io.direction", string(networkIoDirection)), + )) return } @@ -4187,7 +4249,9 @@ func (m NetworkUp) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -4349,7 +4413,10 @@ func (m PhysicalDiskEnduranceUtilization) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + attribute.String("hw.physical_disk.state", string(physicalDiskState)), + )) return } @@ -4508,7 +4575,9 @@ func (m PhysicalDiskSize) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -4669,7 +4738,9 @@ func (m PhysicalDiskSmart) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -4842,7 +4913,10 @@ func (m Power) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + attribute.String("hw.type", string(hwType)), + )) return } @@ -4969,7 +5043,9 @@ func (m PowerSupplyLimit) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -5119,7 +5195,9 @@ func (m PowerSupplyUsage) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -5264,7 +5342,9 @@ func (m PowerSupplyUtilization) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -5422,7 +5502,11 @@ func (m Status) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + attribute.String("hw.state", string(state)), + attribute.String("hw.type", string(hwType)), + )) return } @@ -5556,7 +5640,9 @@ func (m TapeDriveOperations) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -5707,7 +5793,9 @@ func (m Temperature) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -5837,7 +5925,9 @@ func (m TemperatureLimit) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -5973,7 +6063,9 @@ func (m Voltage) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -6103,7 +6195,9 @@ func (m VoltageLimit) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } @@ -6239,7 +6333,9 @@ func (m VoltageNominal) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("hw.id", id), + )) return } diff --git a/semconv/v1.40.0/k8sconv/metric.go b/semconv/v1.40.0/k8sconv/metric.go index 3173e1a5216..004fdb340c4 100644 --- a/semconv/v1.40.0/k8sconv/metric.go +++ b/semconv/v1.40.0/k8sconv/metric.go @@ -1363,7 +1363,9 @@ func (m ContainerStatusReason) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.container.status.reason", string(containerStatusReason)), + )) return } @@ -1482,7 +1484,9 @@ func (m ContainerStatusState) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.container.status.state", string(containerStatusState)), + )) return } @@ -3852,7 +3856,9 @@ func (m NamespacePhase) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.namespace.phase", string(namespacePhase)), + )) return } @@ -3968,7 +3974,10 @@ func (m NodeConditionStatus) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.node.condition.status", string(nodeConditionStatus)), + attribute.String("k8s.node.condition.type", string(nodeConditionType)), + )) return } @@ -7170,7 +7179,9 @@ func (m PodStatusPhase) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.pod.status.phase", string(podStatusPhase)), + )) return } @@ -7289,7 +7300,9 @@ func (m PodStatusReason) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.pod.status.reason", string(podStatusReason)), + )) return } @@ -7511,7 +7524,9 @@ func (m PodVolumeAvailable) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.volume.name", volumeName), + )) return } @@ -7643,7 +7658,9 @@ func (m PodVolumeCapacity) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.volume.name", volumeName), + )) return } @@ -7775,7 +7792,9 @@ func (m PodVolumeInodeCount) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.volume.name", volumeName), + )) return } @@ -7907,7 +7926,9 @@ func (m PodVolumeInodeFree) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.volume.name", volumeName), + )) return } @@ -8042,7 +8063,9 @@ func (m PodVolumeInodeUsed) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.volume.name", volumeName), + )) return } @@ -8179,7 +8202,9 @@ func (m PodVolumeUsage) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.volume.name", volumeName), + )) return } @@ -9569,7 +9594,9 @@ func (m ResourceQuotaHugepageCountRequestHard) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.hugepage.size", hugepageSize), + )) return } @@ -9691,7 +9718,9 @@ func (m ResourceQuotaHugepageCountRequestUsed) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.hugepage.size", hugepageSize), + )) return } @@ -10233,7 +10262,9 @@ func (m ResourceQuotaObjectCountHard) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.resourcequota.resource_name", resourcequotaResourceName), + )) return } @@ -10355,7 +10386,9 @@ func (m ResourceQuotaObjectCountUsed) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.resourcequota.resource_name", resourcequotaResourceName), + )) return } @@ -11044,7 +11077,10 @@ func (m ServiceEndpointCount) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("k8s.service.endpoint.address_type", string(serviceEndpointAddressType)), + attribute.String("k8s.service.endpoint.condition", string(serviceEndpointCondition)), + )) return } diff --git a/semconv/v1.40.0/mcpconv/metric.go b/semconv/v1.40.0/mcpconv/metric.go index 7dc0d31c261..f78a3d653d5 100644 --- a/semconv/v1.40.0/mcpconv/metric.go +++ b/semconv/v1.40.0/mcpconv/metric.go @@ -229,7 +229,9 @@ func (m ClientOperationDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("mcp.method.name", string(methodName)), + )) return } @@ -597,7 +599,9 @@ func (m ServerOperationDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("mcp.method.name", string(methodName)), + )) return } diff --git a/semconv/v1.40.0/messagingconv/metric.go b/semconv/v1.40.0/messagingconv/metric.go index 824fb84baa1..c6ffc00bb88 100644 --- a/semconv/v1.40.0/messagingconv/metric.go +++ b/semconv/v1.40.0/messagingconv/metric.go @@ -169,7 +169,10 @@ func (m ClientConsumedMessages) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("messaging.operation.name", operationName), + attribute.String("messaging.system", string(system)), + )) return } @@ -351,7 +354,10 @@ func (m ClientOperationDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("messaging.operation.name", operationName), + attribute.String("messaging.system", string(system)), + )) return } @@ -535,7 +541,10 @@ func (m ClientSentMessages) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) + m.Int64Counter.Add(ctx, incr, metric.WithAttributes( + attribute.String("messaging.operation.name", operationName), + attribute.String("messaging.system", string(system)), + )) return } @@ -698,7 +707,10 @@ func (m ProcessDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("messaging.operation.name", operationName), + attribute.String("messaging.system", string(system)), + )) return } diff --git a/semconv/v1.40.0/openshiftconv/metric.go b/semconv/v1.40.0/openshiftconv/metric.go index 585ba21a026..4d73525279d 100644 --- a/semconv/v1.40.0/openshiftconv/metric.go +++ b/semconv/v1.40.0/openshiftconv/metric.go @@ -978,7 +978,9 @@ func (m ClusterquotaHugepageCountRequestHard) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.hugepage.size", k8sHugepageSize), + )) return } @@ -1104,7 +1106,9 @@ func (m ClusterquotaHugepageCountRequestUsed) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.hugepage.size", k8sHugepageSize), + )) return } @@ -1671,7 +1675,9 @@ func (m ClusterquotaObjectCountHard) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.resourcequota.resource_name", k8sResourcequotaResourceName), + )) return } @@ -1798,7 +1804,9 @@ func (m ClusterquotaObjectCountUsed) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("k8s.resourcequota.resource_name", k8sResourcequotaResourceName), + )) return } diff --git a/semconv/v1.40.0/rpcconv/metric.go b/semconv/v1.40.0/rpcconv/metric.go index d9b81789aca..cdee1cf6074 100644 --- a/semconv/v1.40.0/rpcconv/metric.go +++ b/semconv/v1.40.0/rpcconv/metric.go @@ -128,7 +128,9 @@ func (m ClientCallDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("rpc.system.name", string(systemName)), + )) return } @@ -278,7 +280,9 @@ func (m ServerCallDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) + m.Float64Histogram.Record(ctx, val, metric.WithAttributes( + attribute.String("rpc.system.name", string(systemName)), + )) return } diff --git a/semconv/v1.40.0/vcsconv/metric.go b/semconv/v1.40.0/vcsconv/metric.go index 2f660689e37..398418d6e45 100644 --- a/semconv/v1.40.0/vcsconv/metric.go +++ b/semconv/v1.40.0/vcsconv/metric.go @@ -224,7 +224,10 @@ func (m ChangeCount) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("vcs.change.state", string(changeState)), + attribute.String("vcs.repository.url.full", repositoryUrlFull), + )) return } @@ -369,7 +372,11 @@ func (m ChangeDuration) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Gauge.Record(ctx, val) + m.Float64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("vcs.change.state", string(changeState)), + attribute.String("vcs.ref.head.name", refHeadName), + attribute.String("vcs.repository.url.full", repositoryUrlFull), + )) return } @@ -512,7 +519,10 @@ func (m ChangeTimeToApproval) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Gauge.Record(ctx, val) + m.Float64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("vcs.ref.head.name", refHeadName), + attribute.String("vcs.repository.url.full", repositoryUrlFull), + )) return } @@ -683,7 +693,10 @@ func (m ChangeTimeToMerge) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Gauge.Record(ctx, val) + m.Float64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("vcs.ref.head.name", refHeadName), + attribute.String("vcs.repository.url.full", repositoryUrlFull), + )) return } @@ -848,7 +861,9 @@ func (m ContributorCount) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("vcs.repository.url.full", repositoryUrlFull), + )) return } @@ -987,7 +1002,10 @@ func (m RefCount) Add( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) + m.Int64UpDownCounter.Add(ctx, incr, metric.WithAttributes( + attribute.String("vcs.ref.type", string(refType)), + attribute.String("vcs.repository.url.full", repositoryUrlFull), + )) return } @@ -1153,7 +1171,14 @@ func (m RefLinesDelta) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("vcs.line_change.type", string(lineChangeType)), + attribute.String("vcs.ref.base.name", refBaseName), + attribute.String("vcs.ref.base.type", string(refBaseType)), + attribute.String("vcs.ref.head.name", refHeadName), + attribute.String("vcs.ref.head.type", string(refHeadType)), + attribute.String("vcs.repository.url.full", repositoryUrlFull), + )) return } @@ -1335,7 +1360,14 @@ func (m RefRevisionsDelta) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Int64Gauge.Record(ctx, val) + m.Int64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("vcs.ref.base.name", refBaseName), + attribute.String("vcs.ref.base.type", string(refBaseType)), + attribute.String("vcs.ref.head.name", refHeadName), + attribute.String("vcs.ref.head.type", string(refHeadType)), + attribute.String("vcs.repository.url.full", repositoryUrlFull), + attribute.String("vcs.revision_delta.direction", string(revisionDeltaDirection)), + )) return } @@ -1498,7 +1530,11 @@ func (m RefTime) Record( attrs ...attribute.KeyValue, ) { if len(attrs) == 0 { - m.Float64Gauge.Record(ctx, val) + m.Float64Gauge.Record(ctx, val, metric.WithAttributes( + attribute.String("vcs.ref.head.name", refHeadName), + attribute.String("vcs.ref.head.type", string(refHeadType)), + attribute.String("vcs.repository.url.full", repositoryUrlFull), + )) return }