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

chore(deps): update module mvdan.cc/gofumpt to v0.10.0 (#8304)

This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [mvdan.cc/gofumpt](https://redirect.github.com/mvdan/gofumpt) |
`v0.9.2` → `v0.10.0` |
![age](https://developer.mend.io/api/mc/badges/age/go/mvdan.cc%2fgofumpt/v0.10.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/go/mvdan.cc%2fgofumpt/v0.9.2/v0.10.0?slim=true)
|

---

### Release Notes

<details>
<summary>mvdan/gofumpt (mvdan.cc/gofumpt)</summary>

###
[`v0.10.0`](https://redirect.github.com/mvdan/gofumpt/blob/HEAD/CHANGELOG.md#v0100---2026-05-04)

[Compare
Source](https://redirect.github.com/mvdan/gofumpt/compare/v0.9.2...v0.10.0)

This release is based on Go 1.26's gofmt, and requires Go 1.25 or later.

A new rule is introduced to drop unnecessary parentheses around
expressions
where the inner expression is unambiguous on its own, such as `f((3))`.
Parentheses are kept where they are useful, such as on binary
expressions. See
[#&#8203;44](https://redirect.github.com/mvdan/gofumpt/issues/44).

A new rule is introduced to require multi-line function calls to match
the opening and closing parenthesis in terms of the use of newlines. See
[#&#8203;74](https://redirect.github.com/mvdan/gofumpt/issues/74).

The `-extra` flag now accepts a comma-separated list of rule names to
enable
individual extra rules, rather than enabling all of them at once. See
[#&#8203;339](https://redirect.github.com/mvdan/gofumpt/issues/339).

The following changes are included as well:

- Avoid crashing on `go.mod` files without a `module` directive -
[#&#8203;350](https://redirect.github.com/mvdan/gofumpt/issues/350)
- Avoid failing when an ignored directory cannot be read -
[#&#8203;351](https://redirect.github.com/mvdan/gofumpt/issues/351)
- Avoid prefixing more kinds of commented-out Go code with spaces -
[#&#8203;230](https://redirect.github.com/mvdan/gofumpt/issues/230)
- Avoid prefixing a shebang comment with a space -
[#&#8203;237](https://redirect.github.com/mvdan/gofumpt/issues/237)
- Narrow the newlines on assignments rule to ignore complex cases -
[#&#8203;354](https://redirect.github.com/mvdan/gofumpt/issues/354)
- Fix three bugs which caused a second gofumpt run to make changes -
[#&#8203;132](https://redirect.github.com/mvdan/gofumpt/issues/132),
[#&#8203;345](https://redirect.github.com/mvdan/gofumpt/issues/345)

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/open-telemetry/opentelemetry-go).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNTkuMiIsInVwZGF0ZWRJblZlciI6IjQzLjE1OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tyler Yahn <codingalias@gmail.com>
This commit is contained in:
renovate[bot]
2026-05-08 12:50:12 -07:00
committed by GitHub
parent 2f358df8e0
commit cf2a4a180f
179 changed files with 5937 additions and 5982 deletions
+8 -4
View File
@@ -58,14 +58,16 @@ var keyVals = []keyVal{
{name: "SliceLen1", kv: func(k string) KeyValue { return Slice(k, BoolValue(true)) }}, {name: "SliceLen1", kv: func(k string) KeyValue { return Slice(k, BoolValue(true)) }},
{name: "SliceLen2", kv: func(k string) KeyValue { return Slice(k, BoolValue(true), IntValue(42)) }}, {name: "SliceLen2", kv: func(k string) KeyValue { return Slice(k, BoolValue(true), IntValue(42)) }},
{name: "SliceLen3", kv: func(k string) KeyValue { {name: "SliceLen3", kv: func(k string) KeyValue {
return Slice(k, return Slice(
k,
StringValue("triad"), StringValue("triad"),
IntValue(3), IntValue(3),
BoolValue(false), BoolValue(false),
) )
}}, }},
{name: "SliceLen4", kv: func(k string) KeyValue { {name: "SliceLen4", kv: func(k string) KeyValue {
return Slice(k, return Slice(
k,
StringValue("quad"), StringValue("quad"),
IntValue(4), IntValue(4),
BoolValue(false), BoolValue(false),
@@ -73,7 +75,8 @@ var keyVals = []keyVal{
) )
}}, }},
{name: "SliceLen5", kv: func(k string) KeyValue { {name: "SliceLen5", kv: func(k string) KeyValue {
return Slice(k, return Slice(
k,
StringValue("penta"), StringValue("penta"),
IntValue(5), IntValue(5),
BoolValue(true), BoolValue(true),
@@ -82,7 +85,8 @@ var keyVals = []keyVal{
) )
}}, }},
{name: "SliceNested", kv: func(k string) KeyValue { {name: "SliceNested", kv: func(k string) KeyValue {
return Slice(k, return Slice(
k,
StringValue("nested"), StringValue("nested"),
SliceValue(Float64Value(math.Inf(1)), ByteSliceValue([]byte("bin"))), SliceValue(Float64Value(math.Inf(1)), ByteSliceValue([]byte("bin"))),
BoolValue(true), BoolValue(true),
+1 -1
View File
@@ -401,7 +401,7 @@ func computeDataFixed(kvs []KeyValue) any {
func computeDataReflect(kvs []KeyValue) any { func computeDataReflect(kvs []KeyValue) any {
at := reflect.New(reflect.ArrayOf(len(kvs), keyValueType)).Elem() at := reflect.New(reflect.ArrayOf(len(kvs), keyValueType)).Elem()
for i, keyValue := range kvs { for i, keyValue := range kvs {
*(at.Index(i).Addr().Interface().(*KeyValue)) = keyValue *at.Index(i).Addr().Interface().(*KeyValue) = keyValue
} }
return at.Interface() return at.Interface()
} }
+4 -2
View File
@@ -165,12 +165,14 @@ func TestEquivalence(t *testing.T) {
attribute.ByteSlice("ByteSlice", []byte("one")), attribute.ByteSlice("ByteSlice", []byte("one")),
}, },
{ {
attribute.Slice("Slice", attribute.Slice(
"Slice",
attribute.BoolValue(true), attribute.BoolValue(true),
attribute.IntValue(42), attribute.IntValue(42),
attribute.SliceValue(attribute.StringValue("nested")), attribute.SliceValue(attribute.StringValue("nested")),
), ),
attribute.Slice("Slice", attribute.Slice(
"Slice",
attribute.BoolValue(true), attribute.BoolValue(true),
attribute.IntValue(42), attribute.IntValue(42),
attribute.SliceValue(attribute.StringValue("nested")), attribute.SliceValue(attribute.StringValue("nested")),
@@ -16,7 +16,8 @@ import (
) )
func TestSpanContextConversion(t *testing.T) { func TestSpanContextConversion(t *testing.T) {
tsOc, _ := tracestate.New(nil, tsOc, _ := tracestate.New(
nil,
tracestate.Entry{Key: "key1", Value: "value1"}, tracestate.Entry{Key: "key1", Value: "value1"},
tracestate.Entry{Key: "key2", Value: "value2"}, tracestate.Entry{Key: "key2", Value: "value2"},
) )
@@ -16,7 +16,8 @@ import (
) )
func TestSpanContextConversion(t *testing.T) { func TestSpanContextConversion(t *testing.T) {
tsOc, _ := tracestate.New(nil, tsOc, _ := tracestate.New(
nil,
// Oc has a reverse order of TraceState entries compared to OTel // Oc has a reverse order of TraceState entries compared to OTel
tracestate.Entry{Key: "key1", Value: "value1"}, tracestate.Entry{Key: "key1", Value: "value1"},
tracestate.Entry{Key: "key2", Value: "value2"}, tracestate.Entry{Key: "key2", Value: "value2"},
+8 -4
View File
@@ -81,7 +81,8 @@ func (s *Span) Annotatef(attributes []octrace.Attribute, format string, a ...any
// AddMessageSendEvent adds a message send event to this span. // AddMessageSendEvent adds a message send event to this span.
func (s *Span) AddMessageSendEvent(_, uncompressedByteSize, compressedByteSize int64) { func (s *Span) AddMessageSendEvent(_, uncompressedByteSize, compressedByteSize int64) {
s.otelSpan.AddEvent(MessageSendEvent, s.otelSpan.AddEvent(
MessageSendEvent,
trace.WithAttributes( trace.WithAttributes(
attribute.KeyValue{ attribute.KeyValue{
Key: UncompressedKey, Key: UncompressedKey,
@@ -90,13 +91,15 @@ func (s *Span) AddMessageSendEvent(_, uncompressedByteSize, compressedByteSize i
attribute.KeyValue{ attribute.KeyValue{
Key: CompressedKey, Key: CompressedKey,
Value: attribute.Int64Value(compressedByteSize), Value: attribute.Int64Value(compressedByteSize),
}), },
),
) )
} }
// AddMessageReceiveEvent adds a message receive event to this span. // AddMessageReceiveEvent adds a message receive event to this span.
func (s *Span) AddMessageReceiveEvent(_, uncompressedByteSize, compressedByteSize int64) { func (s *Span) AddMessageReceiveEvent(_, uncompressedByteSize, compressedByteSize int64) {
s.otelSpan.AddEvent(MessageReceiveEvent, s.otelSpan.AddEvent(
MessageReceiveEvent,
trace.WithAttributes( trace.WithAttributes(
attribute.KeyValue{ attribute.KeyValue{
Key: UncompressedKey, Key: UncompressedKey,
@@ -105,7 +108,8 @@ func (s *Span) AddMessageReceiveEvent(_, uncompressedByteSize, compressedByteSiz
attribute.KeyValue{ attribute.KeyValue{
Key: CompressedKey, Key: CompressedKey,
Value: attribute.Int64Value(compressedByteSize), Value: attribute.Int64Value(compressedByteSize),
}), },
),
) )
} }
+2 -1
View File
@@ -80,7 +80,8 @@ func TestBridgeTracer_ExtractAndInject_gRPC(t *testing.T) {
return len(tracer.FinishedSpans) == 2 return len(tracer.FinishedSpans) == 2
} }
require.Eventuallyf(t, checkSpans, 5*time.Second, 5*time.Millisecond, "expecting two spans") require.Eventuallyf(t, checkSpans, 5*time.Second, 5*time.Millisecond, "expecting two spans")
assert.Equal(t, assert.Equal(
t,
tracer.FinishedSpans[0].SpanContext().TraceID(), tracer.FinishedSpans[0].SpanContext().TraceID(),
tracer.FinishedSpans[1].SpanContext().TraceID(), tracer.FinishedSpans[1].SpanContext().TraceID(),
"expecting same trace ID", "expecting same trace ID",
+5 -3
View File
@@ -689,9 +689,11 @@ func TestBridgeCarrierBaggagePropagation(t *testing.T) {
t.Run(fmt.Sprintf("%s %s", c.name, tc.name), func(t *testing.T) { t.Run(fmt.Sprintf("%s %s", c.name, tc.name), func(t *testing.T) {
mockOtelTracer := newMockTracer() mockOtelTracer := newMockTracer()
b, _ := NewTracerPair(mockOtelTracer) b, _ := NewTracerPair(mockOtelTracer)
b.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator( b.SetTextMapPropagator(
propagation.TraceContext{}, propagation.NewCompositeTextMapPropagator(
propagation.Baggage{}), // Required for baggage propagation. propagation.TraceContext{},
propagation.Baggage{},
), // Required for baggage propagation.
) )
// Set baggage items. // Set baggage items.
@@ -749,7 +749,8 @@ func TestConfig(t *testing.T) {
}) })
t.Run("WithInsecureAndTLSClientConfig", func(t *testing.T) { t.Run("WithInsecureAndTLSClientConfig", func(t *testing.T) {
exp, err := New(t.Context(), exp, err := New(
t.Context(),
WithEndpoint("localhost:4318"), WithEndpoint("localhost:4318"),
WithInsecure(), WithInsecure(),
WithTLSClientConfig(&tls.Config{}), WithTLSClientConfig(&tls.Config{}),
@@ -255,7 +255,8 @@ func TestConfig(t *testing.T) {
}) })
t.Run("WithInsecureAndTLSClientConfig", func(t *testing.T) { t.Run("WithInsecureAndTLSClientConfig", func(t *testing.T) {
exp, err := New(t.Context(), exp, err := New(
t.Context(),
WithEndpoint("localhost:4318"), WithEndpoint("localhost:4318"),
WithInsecure(), WithInsecure(),
WithTLSClientConfig(&tls.Config{}), WithTLSClientConfig(&tls.Config{}),
@@ -780,7 +781,8 @@ func TestClientInstrumentationStaleStatusCode(t *testing.T) {
} }
ctx := t.Context() ctx := t.Context()
exp, err := New(ctx, exp, err := New(
ctx,
WithHTTPClient(client), WithHTTPClient(client),
WithInsecure(), WithInsecure(),
WithRetry(RetryConfig{ WithRetry(RetryConfig{
@@ -27,7 +27,8 @@ func TestAttributes(t *testing.T) {
attribute.Float64("float64 to double", 1.61), attribute.Float64("float64 to double", 1.61),
attribute.String("string to string", "string"), attribute.String("string to string", "string"),
attribute.ByteSlice("bytes to bytes", []byte("bytes")), attribute.ByteSlice("bytes to bytes", []byte("bytes")),
attribute.Slice("slice to array", attribute.Slice(
"slice to array",
attribute.BoolValue(true), attribute.BoolValue(true),
attribute.ByteSliceValue([]byte("bytes")), attribute.ByteSliceValue([]byte("bytes")),
attribute.SliceValue(attribute.IntValue(2), attribute.Value{}), attribute.SliceValue(attribute.IntValue(2), attribute.Value{}),
@@ -93,7 +93,8 @@ func TestNewEndToEnd(t *testing.T) {
grpc.WithConnectParams(grpc.ConnectParams{ grpc.WithConnectParams(grpc.ConnectParams{
Backoff: backoff.DefaultConfig, Backoff: backoff.DefaultConfig,
MinConnectTimeout: time.Second, MinConnectTimeout: time.Second,
})), }),
),
}, },
}, },
} }
+2 -1
View File
@@ -455,7 +455,8 @@ func addExponentialHistogramMetric[N int64 | float64](
scale, scale,
dp.ZeroThreshold, dp.ZeroThreshold,
dp.StartTime, dp.StartTime,
values...) values...,
)
if e != nil { if e != nil {
reportError(ch, desc, e) reportError(ch, desc, e)
err = errors.Join( err = errors.Join(
+47 -33
View File
@@ -713,7 +713,8 @@ func TestPrometheusExporter(t *testing.T) {
if tc.emptyResource { if tc.emptyResource {
res = resource.Empty() res = resource.Empty()
} else { } else {
res, err = resource.New(ctx, res, err = resource.New(
ctx,
// always specify service.name because the default depends on the running OS // always specify service.name because the default depends on the running OS
resource.WithAttributes(semconv.ServiceName("prometheus_test")), resource.WithAttributes(semconv.ServiceName("prometheus_test")),
// Overwrite the semconv.TelemetrySDKVersionKey value so we don't need to update every version // Overwrite the semconv.TelemetrySDKVersionKey value so we don't need to update every version
@@ -729,12 +730,13 @@ func TestPrometheusExporter(t *testing.T) {
provider := metric.NewMeterProvider( provider := metric.NewMeterProvider(
metric.WithResource(res), metric.WithResource(res),
metric.WithReader(exporter), metric.WithReader(exporter),
metric.WithView(metric.NewView( metric.WithView(
metric.Instrument{Name: "histogram_*"}, metric.NewView(
metric.Stream{Aggregation: metric.AggregationExplicitBucketHistogram{ metric.Instrument{Name: "histogram_*"},
Boundaries: []float64{0, 5, 10, 25, 50, 75, 100, 250, 500, 1000}, metric.Stream{Aggregation: metric.AggregationExplicitBucketHistogram{
}}, Boundaries: []float64{0, 5, 10, 25, 50, 75, 100, 250, 500, 1000},
), }},
),
metric.NewView( metric.NewView(
metric.Instrument{Name: "exponential_histogram_*"}, metric.Instrument{Name: "exponential_histogram_*"},
metric.Stream{Aggregation: metric.AggregationBase2ExponentialHistogram{ metric.Stream{Aggregation: metric.AggregationBase2ExponentialHistogram{
@@ -779,7 +781,8 @@ func TestMultiScopes(t *testing.T) {
) )
require.NoError(t, err) require.NoError(t, err)
res, err := resource.New(ctx, res, err := resource.New(
ctx,
// always specify service.name because the default depends on the running OS // always specify service.name because the default depends on the running OS
resource.WithAttributes(semconv.ServiceName("prometheus_test")), resource.WithAttributes(semconv.ServiceName("prometheus_test")),
// Overwrite the semconv.TelemetrySDKVersionKey value so we don't need to update every version // Overwrite the semconv.TelemetrySDKVersionKey value so we don't need to update every version
@@ -798,7 +801,8 @@ func TestMultiScopes(t *testing.T) {
Int64Counter( Int64Counter(
"foo", "foo",
otelmetric.WithUnit("s"), otelmetric.WithUnit("s"),
otelmetric.WithDescription("meter foo counter")) otelmetric.WithDescription("meter foo counter"),
)
assert.NoError(t, err) assert.NoError(t, err)
fooCounter.Add(ctx, 100, otelmetric.WithAttributes(attribute.String("type", "foo"))) fooCounter.Add(ctx, 100, otelmetric.WithAttributes(attribute.String("type", "foo")))
@@ -806,7 +810,8 @@ func TestMultiScopes(t *testing.T) {
Int64Counter( Int64Counter(
"bar", "bar",
otelmetric.WithUnit("s"), otelmetric.WithUnit("s"),
otelmetric.WithDescription("meter bar counter")) otelmetric.WithDescription("meter bar counter"),
)
assert.NoError(t, err) assert.NoError(t, err)
barCounter.Add(ctx, 200, otelmetric.WithAttributes(attribute.String("type", "bar"))) barCounter.Add(ctx, 200, otelmetric.WithAttributes(attribute.String("type", "bar")))
@@ -876,7 +881,8 @@ func TestBridgeScopeIgnored(t *testing.T) {
) )
require.NoError(t, err) require.NoError(t, err)
res, err := resource.New(ctx, res, err := resource.New(
ctx,
// always specify service.name because the default depends on the running OS // always specify service.name because the default depends on the running OS
resource.WithAttributes(semconv.ServiceName("prometheus_test")), resource.WithAttributes(semconv.ServiceName("prometheus_test")),
// Overwrite the semconv.TelemetrySDKVersionKey value so we don't need to update every version // Overwrite the semconv.TelemetrySDKVersionKey value so we don't need to update every version
@@ -895,7 +901,8 @@ func TestBridgeScopeIgnored(t *testing.T) {
Int64Counter( Int64Counter(
"foo", "foo",
otelmetric.WithUnit("s"), otelmetric.WithUnit("s"),
otelmetric.WithDescription("meter foo counter")) otelmetric.WithDescription("meter foo counter"),
)
assert.NoError(t, err) assert.NoError(t, err)
fooCounter.Add(ctx, 100, otelmetric.WithAttributes(attribute.String("type", "foo"))) fooCounter.Add(ctx, 100, otelmetric.WithAttributes(attribute.String("type", "foo")))
@@ -1151,7 +1158,8 @@ func TestDuplicateMetrics(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
// initialize resource // initialize resource
res, err := resource.New(ctx, res, err := resource.New(
ctx,
resource.WithAttributes(semconv.ServiceName("prometheus_test")), resource.WithAttributes(semconv.ServiceName("prometheus_test")),
resource.WithAttributes(semconv.TelemetrySDKVersion("latest")), resource.WithAttributes(semconv.TelemetrySDKVersion("latest")),
) )
@@ -1290,7 +1298,8 @@ func TestShutdownExporter(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
provider := metric.NewMeterProvider( provider := metric.NewMeterProvider(
metric.WithResource(resource.Default()), metric.WithResource(resource.Default()),
metric.WithReader(exporter)) metric.WithReader(exporter),
)
meter := provider.Meter("testmeter") meter := provider.Meter("testmeter")
cnt, err := meter.Int64Counter("foo") cnt, err := meter.Int64Counter("foo")
require.NoError(t, err) require.NoError(t, err)
@@ -1409,7 +1418,8 @@ func TestExemplars(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
// initialize resource // initialize resource
res, err := resource.New(ctx, res, err := resource.New(
ctx,
resource.WithAttributes(semconv.ServiceName("prometheus_test")), resource.WithAttributes(semconv.ServiceName("prometheus_test")),
resource.WithAttributes(semconv.TelemetrySDKVersion("latest")), resource.WithAttributes(semconv.TelemetrySDKVersion("latest")),
) )
@@ -1421,24 +1431,26 @@ func TestExemplars(t *testing.T) {
provider := metric.NewMeterProvider( provider := metric.NewMeterProvider(
metric.WithReader(exporter), metric.WithReader(exporter),
metric.WithResource(res), metric.WithResource(res),
metric.WithView(metric.NewView( metric.WithView(
metric.Instrument{Name: "foo"}, metric.NewView(
metric.Stream{ metric.Instrument{Name: "foo"},
// filter out all attributes so they are added as filtered metric.Stream{
// attributes to the exemplar // filter out all attributes so they are added as filtered
AttributeFilter: attribute.NewAllowKeysFilter(), // attributes to the exemplar
}, AttributeFilter: attribute.NewAllowKeysFilter(),
),
),
metric.WithView(metric.NewView(
metric.Instrument{Name: "exponential_histogram"},
metric.Stream{
Aggregation: metric.AggregationBase2ExponentialHistogram{
MaxSize: 20,
}, },
AttributeFilter: attribute.NewAllowKeysFilter(), ),
},
), ),
metric.WithView(
metric.NewView(
metric.Instrument{Name: "exponential_histogram"},
metric.Stream{
Aggregation: metric.AggregationBase2ExponentialHistogram{
MaxSize: 20,
},
AttributeFilter: attribute.NewAllowKeysFilter(),
},
),
), ),
) )
meter := provider.Meter("meter", otelmetric.WithInstrumentationVersion("v0.1.0")) meter := provider.Meter("meter", otelmetric.WithInstrumentationVersion("v0.1.0"))
@@ -2425,7 +2437,8 @@ func TestEscapingErrorHandling(t *testing.T) {
} }
require.NoError(t, err) require.NoError(t, err)
if !tc.skipInstrument { if !tc.skipInstrument {
res, err := resource.New(ctx, res, err := resource.New(
ctx,
resource.WithAttributes(semconv.ServiceName("prometheus_test")), resource.WithAttributes(semconv.ServiceName("prometheus_test")),
resource.WithAttributes(semconv.TelemetrySDKVersion("latest")), resource.WithAttributes(semconv.TelemetrySDKVersion("latest")),
resource.WithAttributes(tc.customResourceAttrs...), resource.WithAttributes(tc.customResourceAttrs...),
@@ -2447,7 +2460,8 @@ func TestEscapingErrorHandling(t *testing.T) {
fooCounter, err := meter.Int64Counter( fooCounter, err := meter.Int64Counter(
tc.counterName, tc.counterName,
otelmetric.WithUnit("s"), otelmetric.WithUnit("s"),
otelmetric.WithDescription(fmt.Sprintf(`meter %q counter`, tc.counterName))) otelmetric.WithDescription(fmt.Sprintf(`meter %q counter`, tc.counterName)),
)
if tc.expectMetricErr != "" { if tc.expectMetricErr != "" {
require.ErrorContains(t, err, tc.expectMetricErr) require.ErrorContains(t, err, tc.expectMetricErr)
return return
+4 -2
View File
@@ -434,13 +434,15 @@ func TestValueMarshalJSON(t *testing.T) {
log.Int("three", 3), log.Int("three", 3),
log.String("four", "4"), log.String("four", "4"),
log.Bytes("five", []byte{5}), log.Bytes("five", []byte{5}),
log.Slice("six", log.Slice(
"six",
log.IntValue(6), log.IntValue(6),
log.MapValue( log.MapValue(
log.Int("seven", 7), log.Int("seven", 7),
), ),
), ),
log.Map("eight", log.Map(
"eight",
log.Int("nine", 9), log.Int("nine", 9),
), ),
), ),
+2 -1
View File
@@ -352,7 +352,8 @@ func TestObservability(t *testing.T) {
otel.SetMeterProvider(mp) otel.SetMeterProvider(mp)
exporter, err := stdouttrace.New( exporter, err := stdouttrace.New(
stdouttrace.WithWriter(io.Discard)) stdouttrace.WithWriter(io.Discard),
)
require.NoError(t, err) require.NoError(t, err)
tt.callExportSpans(t, exporter) tt.callExportSpans(t, exporter)
+2 -1
View File
@@ -992,7 +992,8 @@ func TestAttributeToStringPairByteSlice(t *testing.T) {
} }
func TestAttributeToStringPairSlice(t *testing.T) { func TestAttributeToStringPairSlice(t *testing.T) {
k, v := attributeToStringPair(attribute.Slice("slice", k, v := attributeToStringPair(attribute.Slice(
"slice",
attribute.BoolValue(true), attribute.BoolValue(true),
attribute.ByteSliceValue([]byte("bin")), attribute.ByteSliceValue([]byte("bin")),
attribute.SliceValue(attribute.IntValue(2), attribute.Value{}), attribute.SliceValue(attribute.IntValue(2), attribute.Value{}),
+1 -1
View File
@@ -244,6 +244,6 @@ require (
gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
honnef.co/go/tools v0.7.0 // indirect honnef.co/go/tools v0.7.0 // indirect
mvdan.cc/gofumpt v0.9.2 // indirect mvdan.cc/gofumpt v0.10.0 // indirect
mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15 // indirect mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15 // indirect
) )
+4 -4
View File
@@ -174,8 +174,8 @@ github.com/go-git/go-git/v5 v5.19.0 h1:+WkVUQZSy/F1Gb13udrMKjIM2PrzsNfDKFSfo5tkM
github.com/go-git/go-git/v5 v5.19.0/go.mod h1:Pb1v0c7/g8aGQJwx9Us09W85yGoyvSwuhEGMH7zjDKQ= github.com/go-git/go-git/v5 v5.19.0/go.mod h1:Pb1v0c7/g8aGQJwx9Us09W85yGoyvSwuhEGMH7zjDKQ=
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= github.com/go-quicktest/qt v1.102.0 h1:HSQxCeh5YZH3EL3W39ixjtyaEhcWSXQHtHnMBzSs474=
github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= github.com/go-quicktest/qt v1.102.0/go.mod h1:p4lGIVX+8Wa6ZPNDvqcxq36XpUDLh42FLetFU7odllI=
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
github.com/go-toolsmith/astcast v1.1.0 h1:+JN9xZV1A+Re+95pgnMgDboWNVnIMMQXwfBwLRPgSC8= github.com/go-toolsmith/astcast v1.1.0 h1:+JN9xZV1A+Re+95pgnMgDboWNVnIMMQXwfBwLRPgSC8=
@@ -655,7 +655,7 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.7.0 h1:w6WUp1VbkqPEgLz4rkBzH/CSU6HkoqNLp6GstyTx3lU= honnef.co/go/tools v0.7.0 h1:w6WUp1VbkqPEgLz4rkBzH/CSU6HkoqNLp6GstyTx3lU=
honnef.co/go/tools v0.7.0/go.mod h1:pm29oPxeP3P82ISxZDgIYeOaf9ta6Pi0EWvCFoLG2vc= honnef.co/go/tools v0.7.0/go.mod h1:pm29oPxeP3P82ISxZDgIYeOaf9ta6Pi0EWvCFoLG2vc=
mvdan.cc/gofumpt v0.9.2 h1:zsEMWL8SVKGHNztrx6uZrXdp7AX8r421Vvp23sz7ik4= mvdan.cc/gofumpt v0.10.0 h1:yGGpRS2pBN2OQIi7b21IXknJna7faPkFaVfHLrN6Euo=
mvdan.cc/gofumpt v0.9.2/go.mod h1:iB7Hn+ai8lPvofHd9ZFGVg2GOr8sBUw1QUWjNbmIL/s= mvdan.cc/gofumpt v0.10.0/go.mod h1:sU2ElXHzOEmvoPqfutYG7uunlueR4K2T1JFml40SzP4=
mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15 h1:ssMzja7PDPJV8FStj7hq9IKiuiKhgz9ErWw+m68e7DI= mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15 h1:ssMzja7PDPJV8FStj7hq9IKiuiKhgz9ErWw+m68e7DI=
mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15/go.mod h1:4M5MMXl2kW6fivUT6yRGpLLPNfuGtU2Z0cPvFquGDYU= mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15/go.mod h1:4M5MMXl2kW6fivUT6yRGpLLPNfuGtU2Z0cPvFquGDYU=
+2 -1
View File
@@ -277,7 +277,8 @@ func BenchmarkKeyValueFromAttribute(b *testing.B) {
}, },
{ {
desc: "Slice", desc: "Slice",
kv: attribute.Slice("k", kv: attribute.Slice(
"k",
attribute.BoolValue(true), attribute.BoolValue(true),
attribute.StringValue("foo"), attribute.StringValue("foo"),
attribute.SliceValue(attribute.IntValue(7)), attribute.SliceValue(attribute.IntValue(7)),
+2 -1
View File
@@ -443,7 +443,8 @@ func TestKeyValueFromAttribute(t *testing.T) {
}, },
{ {
desc: "Slice", desc: "Slice",
kv: attribute.Slice("k", kv: attribute.Slice(
"k",
attribute.BoolValue(true), attribute.BoolValue(true),
attribute.StringValue("foo"), attribute.StringValue("foo"),
attribute.SliceValue(attribute.IntValue(7)), attribute.SliceValue(attribute.IntValue(7)),
+2 -1
View File
@@ -41,7 +41,8 @@ func Example() {
}, },
} }
got := rec.Result() got := rec.Result()
logtest.AssertEqual(t, want, got, logtest.AssertEqual(
t, want, got,
logtest.Transform(func(r logtest.Record) logtest.Record { logtest.Transform(func(r logtest.Record) logtest.Record {
r = r.Clone() r = r.Clone()
r.Context = nil // Ignore context. r.Context = nil // Ignore context.
+2 -1
View File
@@ -24,7 +24,8 @@ func ExampleMeter_synchronous() {
// Create a histogram using the global MeterProvider. // Create a histogram using the global MeterProvider.
workDuration, err := meter.Int64Histogram( workDuration, err := meter.Int64Histogram(
"workDuration", "workDuration",
metric.WithUnit("ms")) metric.WithUnit("ms"),
)
if err != nil { if err != nil {
fmt.Println("Failed to register instrument") fmt.Println("Failed to register instrument")
panic(err) panic(err)
+70 -36
View File
@@ -100,13 +100,15 @@ func TestRecordBody(t *testing.T) {
{ {
name: "nested map", name: "nested map",
body: log.MapValue( body: log.MapValue(
log.Map("key", log.Map(
"key",
log.Int64("key", 1), log.Int64("key", 1),
log.Int64("key", 2), log.Int64("key", 2),
), ),
), ),
want: log.MapValue( want: log.MapValue(
log.Map("key", log.Map(
"key",
log.Int64("key", 2), log.Int64("key", 2),
), ),
), ),
@@ -175,7 +177,8 @@ func TestRecordBody(t *testing.T) {
body: log.SliceValue( body: log.SliceValue(
log.MapValue( log.MapValue(
log.String("outer", "value"), log.String("outer", "value"),
log.Slice("inner_slice", log.Slice(
"inner_slice",
log.MapValue(log.String("deep", "value1"), log.String("deep", "value2")), log.MapValue(log.String("deep", "value1"), log.String("deep", "value2")),
), ),
), ),
@@ -183,7 +186,8 @@ func TestRecordBody(t *testing.T) {
want: log.SliceValue( want: log.SliceValue(
log.MapValue( log.MapValue(
log.String("outer", "value"), log.String("outer", "value"),
log.Slice("inner_slice", log.Slice(
"inner_slice",
log.MapValue(log.String("deep", "value2")), log.MapValue(log.String("deep", "value2")),
), ),
), ),
@@ -272,7 +276,8 @@ func TestRecordBody(t *testing.T) {
name: "deeply nested structure with deduplication", name: "deeply nested structure with deduplication",
body: log.SliceValue( body: log.SliceValue(
log.MapValue( log.MapValue(
log.Map("nested", log.Map(
"nested",
log.String("key", "value1"), log.String("key", "value1"),
log.String("key", "value2"), log.String("key", "value2"),
), ),
@@ -280,7 +285,8 @@ func TestRecordBody(t *testing.T) {
), ),
want: log.SliceValue( want: log.SliceValue(
log.MapValue( log.MapValue(
log.Map("nested", log.Map(
"nested",
log.String("key", "value2"), log.String("key", "value2"),
), ),
), ),
@@ -290,7 +296,8 @@ func TestRecordBody(t *testing.T) {
name: "deeply nested structure without deduplication", name: "deeply nested structure without deduplication",
body: log.SliceValue( body: log.SliceValue(
log.MapValue( log.MapValue(
log.Map("nested", log.Map(
"nested",
log.String("key1", "value1"), log.String("key1", "value1"),
log.String("key2", "value2"), log.String("key2", "value2"),
), ),
@@ -298,7 +305,8 @@ func TestRecordBody(t *testing.T) {
), ),
want: log.SliceValue( want: log.SliceValue(
log.MapValue( log.MapValue(
log.Map("nested", log.Map(
"nested",
log.String("key1", "value1"), log.String("key1", "value1"),
log.String("key2", "value2"), log.String("key2", "value2"),
), ),
@@ -358,13 +366,15 @@ func TestRecordBody(t *testing.T) {
name: "map with nested slice containing duplicates", name: "map with nested slice containing duplicates",
body: log.MapValue( body: log.MapValue(
log.String("outer", "value"), log.String("outer", "value"),
log.Slice("nested_slice", log.Slice(
"nested_slice",
log.MapValue(log.String("inner", "val1"), log.String("inner", "val2")), log.MapValue(log.String("inner", "val1"), log.String("inner", "val2")),
), ),
), ),
want: log.MapValue( want: log.MapValue(
log.String("outer", "value"), log.String("outer", "value"),
log.Slice("nested_slice", log.Slice(
"nested_slice",
log.MapValue(log.String("inner", "val2")), log.MapValue(log.String("inner", "val2")),
), ),
), ),
@@ -374,13 +384,15 @@ func TestRecordBody(t *testing.T) {
body: log.MapValue( body: log.MapValue(
log.String("key1", "value1"), log.String("key1", "value1"),
log.String("key1", "value2"), // key dedup log.String("key1", "value2"), // key dedup
log.Slice("slice", log.Slice(
"slice",
log.MapValue(log.String("nested", "val1"), log.String("nested", "val2")), // nested value dedup log.MapValue(log.String("nested", "val1"), log.String("nested", "val2")), // nested value dedup
), ),
), ),
want: log.MapValue( want: log.MapValue(
log.String("key1", "value2"), log.String("key1", "value2"),
log.Slice("slice", log.Slice(
"slice",
log.MapValue(log.String("nested", "val2")), log.MapValue(log.String("nested", "val2")),
), ),
), ),
@@ -1008,12 +1020,14 @@ func TestApplyAttrLimitsDeduplication(t *testing.T) {
{ {
name: "NestedSliceInMap", name: "NestedSliceInMap",
input: log.MapValue( input: log.MapValue(
log.Slice("slice_key", log.Slice(
"slice_key",
log.MapValue(log.String("nested", "value1"), log.String("nested", "value2")), log.MapValue(log.String("nested", "value1"), log.String("nested", "value2")),
), ),
), ),
want: log.MapValue( want: log.MapValue(
log.Slice("slice_key", log.Slice(
"slice_key",
log.MapValue(log.String("nested", "value2")), log.MapValue(log.String("nested", "value2")),
), ),
), ),
@@ -1022,18 +1036,24 @@ func TestApplyAttrLimitsDeduplication(t *testing.T) {
{ {
name: "DeeplyNestedStructure", name: "DeeplyNestedStructure",
input: log.MapValue( input: log.MapValue(
log.Map("level1", log.Map(
log.Map("level2", "level1",
log.Slice("level3", log.Map(
"level2",
log.Slice(
"level3",
log.MapValue(log.String("deep", "value1"), log.String("deep", "value2")), log.MapValue(log.String("deep", "value1"), log.String("deep", "value2")),
), ),
), ),
), ),
), ),
want: log.MapValue( want: log.MapValue(
log.Map("level1", log.Map(
log.Map("level2", "level1",
log.Slice("level3", log.Map(
"level2",
log.Slice(
"level3",
log.MapValue(log.String("deep", "value2")), log.MapValue(log.String("deep", "value2")),
), ),
), ),
@@ -1043,10 +1063,10 @@ func TestApplyAttrLimitsDeduplication(t *testing.T) {
}, },
{ {
name: "NestedMapWithoutDuplicateKeys", name: "NestedMapWithoutDuplicateKeys",
input: log.SliceValue((log.MapValue( input: log.SliceValue(log.MapValue(
log.String("key1", "value1"), log.String("key1", "value1"),
log.String("key2", "value2"), log.String("key2", "value2"),
))), )),
want: log.SliceValue(log.MapValue( want: log.SliceValue(log.MapValue(
log.String("key1", "value1"), log.String("key1", "value1"),
log.String("key2", "value2"), log.String("key2", "value2"),
@@ -1513,12 +1533,14 @@ func TestRecordAddAttributesDoesNotMutateInput(t *testing.T) {
} }
func TestRecordMethodsInputConcurrentSafe(t *testing.T) { func TestRecordMethodsInputConcurrentSafe(t *testing.T) {
nestedSlice := log.Slice("nested_slice", nestedSlice := log.Slice(
"nested_slice",
log.SliceValue(log.StringValue("nested_inner1"), log.StringValue("nested_inner2")), log.SliceValue(log.StringValue("nested_inner1"), log.StringValue("nested_inner2")),
log.StringValue("nested_outer"), log.StringValue("nested_outer"),
) )
nestedMap := log.Map("nested_map", nestedMap := log.Map(
"nested_map",
log.String("nested_key1", "nested_value1"), log.String("nested_key1", "nested_value1"),
log.Map("nested_map", log.String("nested_inner_key", "nested_inner_value")), log.Map("nested_map", log.String("nested_inner_key", "nested_inner_value")),
log.String("nested_key1", "duplicate"), // This will trigger dedup. log.String("nested_key1", "duplicate"), // This will trigger dedup.
@@ -1551,11 +1573,13 @@ func TestRecordMethodsInputConcurrentSafe(t *testing.T) {
return true return true
}) })
wantAttr := []log.KeyValue{ wantAttr := []log.KeyValue{
log.Slice("nested_slice", log.Slice(
"nested_slice",
log.SliceValue(log.StringValue("nested_inn"), log.StringValue("nested_inn")), log.SliceValue(log.StringValue("nested_inn"), log.StringValue("nested_inn")),
log.StringValue("nested_out"), log.StringValue("nested_out"),
), ),
log.Map("nested_map", log.Map(
"nested_map",
log.String("nested_key1", "duplicate"), log.String("nested_key1", "duplicate"),
log.Map("nested_map", log.String("nested_inner_key", "nested_inn")), log.Map("nested_map", log.String("nested_inner_key", "nested_inn")),
), ),
@@ -1677,21 +1701,25 @@ func BenchmarkAddAttributes(b *testing.B) {
// Attributes with nested maps that have duplicates (triggers recursive deduplication). // Attributes with nested maps that have duplicates (triggers recursive deduplication).
nestedDupAttrs := []log.KeyValue{ nestedDupAttrs := []log.KeyValue{
log.String("simple", "value"), log.String("simple", "value"),
log.Map("map1", log.Map(
"map1",
log.String("inner1", "value1"), log.String("inner1", "value1"),
log.String("inner2", "value2"), log.String("inner2", "value2"),
log.String("inner1", "duplicate"), // duplicate in nested map log.String("inner1", "duplicate"), // duplicate in nested map
), ),
log.Map("map2", log.Map(
"map2",
log.String("key", "original"), log.String("key", "original"),
log.Map("deeply_nested", log.Map(
"deeply_nested",
log.String("deep1", "value1"), log.String("deep1", "value1"),
log.String("deep2", "value2"), log.String("deep2", "value2"),
log.String("deep1", "duplicate_deep"), // duplicate in deeply nested map log.String("deep1", "duplicate_deep"), // duplicate in deeply nested map
), ),
log.String("key", "overwrite"), // duplicate key at this level log.String("key", "overwrite"), // duplicate key at this level
), ),
log.Slice("slice_with_maps", log.Slice(
"slice_with_maps",
log.MapValue( log.MapValue(
log.String("slice_key", "value1"), log.String("slice_key", "value1"),
log.String("slice_key", "duplicate"), // duplicate in slice element log.String("slice_key", "duplicate"), // duplicate in slice element
@@ -1910,21 +1938,25 @@ func BenchmarkSetAttributes(b *testing.B) {
// Attributes with nested maps that have duplicates (triggers recursive deduplication). // Attributes with nested maps that have duplicates (triggers recursive deduplication).
nestedDupAttrs := []log.KeyValue{ nestedDupAttrs := []log.KeyValue{
log.String("simple", "value"), log.String("simple", "value"),
log.Map("map1", log.Map(
"map1",
log.String("inner1", "value1"), log.String("inner1", "value1"),
log.String("inner2", "value2"), log.String("inner2", "value2"),
log.String("inner1", "duplicate"), // duplicate in nested map log.String("inner1", "duplicate"), // duplicate in nested map
), ),
log.Map("map2", log.Map(
"map2",
log.String("key", "original"), log.String("key", "original"),
log.Map("deeply_nested", log.Map(
"deeply_nested",
log.String("deep1", "value1"), log.String("deep1", "value1"),
log.String("deep2", "value2"), log.String("deep2", "value2"),
log.String("deep1", "duplicate_deep"), // duplicate in deeply nested map log.String("deep1", "duplicate_deep"), // duplicate in deeply nested map
), ),
log.String("key", "overwrite"), // duplicate key at this level log.String("key", "overwrite"), // duplicate key at this level
), ),
log.Slice("slice_with_maps", log.Slice(
"slice_with_maps",
log.MapValue( log.MapValue(
log.String("slice_key", "value1"), log.String("slice_key", "value1"),
log.String("slice_key", "duplicate"), // duplicate in slice element log.String("slice_key", "duplicate"), // duplicate in slice element
@@ -2150,12 +2182,14 @@ func BenchmarkSetBody(b *testing.B) {
// Nested map with duplicates. // Nested map with duplicates.
nestedDupMapValue := log.MapValue( nestedDupMapValue := log.MapValue(
log.String("outer1", "value1"), log.String("outer1", "value1"),
log.Map("nested", log.Map(
"nested",
log.String("inner1", "value1"), log.String("inner1", "value1"),
log.String("inner2", "value2"), log.String("inner2", "value2"),
log.String("inner1", "duplicate"), // duplicate in nested map log.String("inner1", "duplicate"), // duplicate in nested map
), ),
log.Slice("slice_with_maps", log.Slice(
"slice_with_maps",
log.MapValue( log.MapValue(
log.String("slice_key", "value1"), log.String("slice_key", "value1"),
log.String("slice_key", "duplicate"), // duplicate in slice element log.String("slice_key", "duplicate"), // duplicate in slice element
+8 -5
View File
@@ -476,7 +476,7 @@ func BenchmarkExemplars(b *testing.B) {
{Exemplars: make([]metricdata.Exemplar[int64], 0, nCPU)}, {Exemplars: make([]metricdata.Exemplar[int64], 0, nCPU)},
}, },
}) })
e := &(rm.ScopeMetrics[0].Metrics[0].Data.(metricdata.Sum[int64]).DataPoints[0].Exemplars) e := &rm.ScopeMetrics[0].Metrics[0].Data.(metricdata.Sum[int64]).DataPoints[0].Exemplars
b.ReportAllocs() b.ReportAllocs()
b.ResetTimer() b.ResetTimer()
@@ -501,7 +501,7 @@ func BenchmarkExemplars(b *testing.B) {
{Exemplars: make([]metricdata.Exemplar[int64], 0, 1)}, {Exemplars: make([]metricdata.Exemplar[int64], 0, 1)},
}, },
}) })
e := &(rm.ScopeMetrics[0].Metrics[0].Data.(metricdata.Histogram[int64]).DataPoints[0].Exemplars) e := &rm.ScopeMetrics[0].Metrics[0].Data.(metricdata.Histogram[int64]).DataPoints[0].Exemplars
b.ReportAllocs() b.ReportAllocs()
b.ResetTimer() b.ResetTimer()
@@ -736,11 +736,13 @@ func attributes(number int) []attribute.KeyValue {
func appendAttributes(kvs []attribute.KeyValue, number int) []attribute.KeyValue { func appendAttributes(kvs []attribute.KeyValue, number int) []attribute.KeyValue {
switch number { switch number {
case 1: case 1:
return append(kvs, return append(
kvs,
attribute.String("a", "a"), attribute.String("a", "a"),
) )
case 5: case 5:
return append(kvs, return append(
kvs,
attribute.String("a", "a"), attribute.String("a", "a"),
attribute.String("b", "b"), attribute.String("b", "b"),
attribute.String("c", "c"), attribute.String("c", "c"),
@@ -748,7 +750,8 @@ func appendAttributes(kvs []attribute.KeyValue, number int) []attribute.KeyValue
attribute.String("e", "e"), attribute.String("e", "e"),
) )
case 10: case 10:
return append(kvs, return append(
kvs,
attribute.String("a", "a"), attribute.String("a", "a"),
attribute.String("b", "b"), attribute.String("b", "b"),
attribute.String("c", "c"), attribute.String("c", "c"),
+1
View File
@@ -42,6 +42,7 @@ func (r *reader) aggregation(
func (r *reader) register(p sdkProducer) { r.producer = p } func (r *reader) register(p sdkProducer) { r.producer = p }
func (r *reader) RegisterProducer(p Producer) { r.externalProducers = append(r.externalProducers, p) } func (r *reader) RegisterProducer(p Producer) { r.externalProducers = append(r.externalProducers, p) }
func (r *reader) temporality(kind InstrumentKind) metricdata.Temporality { func (r *reader) temporality(kind InstrumentKind) metricdata.Temporality {
return r.temporalityFunc(kind) return r.temporalityFunc(kind)
} }
+2 -1
View File
@@ -26,7 +26,8 @@ import (
func Example() { func Example() {
// Create resource. // Create resource.
res, err := resource.Merge(resource.Default(), res, err := resource.Merge(resource.Default(),
resource.NewWithAttributes(semconv.SchemaURL, resource.NewWithAttributes(
semconv.SchemaURL,
semconv.ServiceName("my-service"), semconv.ServiceName("my-service"),
semconv.ServiceVersion("0.1.0"), semconv.ServiceVersion("0.1.0"),
)) ))
@@ -1028,7 +1028,8 @@ func validateExponentialHistogram[N int64 | float64](t *testing.T, aggs []metric
} }
require.LessOrEqual(t, len(s.DataPoints), 3, "AggregationLimit of 3 exceeded in a single cycle") require.LessOrEqual(t, len(s.DataPoints), 3, "AggregationLimit of 3 exceeded in a single cycle")
for _, dp := range s.DataPoints { for _, dp := range s.DataPoints {
assert.False(t, assert.False(
t,
dp.Time.Before(dp.StartTime), dp.Time.Before(dp.StartTime),
"Timestamp %v must not be before start time %v", dp.Time, dp.StartTime, "Timestamp %v must not be before start time %v", dp.Time, dp.StartTime,
) )
+4 -2
View File
@@ -582,7 +582,8 @@ func (r observer) ObserveFloat64(o metric.Float64Observable, v float64, opts ...
if _, registered := r.float64[oImpl.observableID]; !registered { if _, registered := r.float64[oImpl.observableID]; !registered {
if !oImpl.dropAggregation { if !oImpl.dropAggregation {
global.Error(errUnregObserver, "failed to record", global.Error(
errUnregObserver, "failed to record",
"name", oImpl.name, "name", oImpl.name,
"description", oImpl.description, "description", oImpl.description,
"unit", oImpl.unit, "unit", oImpl.unit,
@@ -612,7 +613,8 @@ func (r observer) ObserveInt64(o metric.Int64Observable, v int64, opts ...metric
if _, registered := r.int64[oImpl.observableID]; !registered { if _, registered := r.int64[oImpl.observableID]; !registered {
if !oImpl.dropAggregation { if !oImpl.dropAggregation {
global.Error(errUnregObserver, "failed to record", global.Error(
errUnregObserver, "failed to record",
"name", oImpl.name, "name", oImpl.name,
"description", oImpl.description, "description", oImpl.description,
"unit", oImpl.unit, "unit", oImpl.unit,
+12 -6
View File
@@ -2820,7 +2820,8 @@ func TestMeterDefaultAttributes(t *testing.T) {
name: "Int64ObservableCounter", name: "Int64ObservableCounter",
instName: "aint", instName: "aint",
record: func(t *testing.T, m metric.Meter) { record: func(t *testing.T, m metric.Meter) {
_, err := m.Int64ObservableCounter("aint", _, err := m.Int64ObservableCounter(
"aint",
x.WithDefaultAttributes(k1), x.WithDefaultAttributes(k1),
metric.WithInt64Callback(func(_ context.Context, o metric.Int64Observer) error { metric.WithInt64Callback(func(_ context.Context, o metric.Int64Observer) error {
o.Observe(4, metric.WithAttributes(k1.String("alice"), k2.String("bob"))) o.Observe(4, metric.WithAttributes(k1.String("alice"), k2.String("bob")))
@@ -2841,7 +2842,8 @@ func TestMeterDefaultAttributes(t *testing.T) {
name: "Float64ObservableCounter", name: "Float64ObservableCounter",
instName: "afloat", instName: "afloat",
record: func(t *testing.T, m metric.Meter) { record: func(t *testing.T, m metric.Meter) {
_, err := m.Float64ObservableCounter("afloat", _, err := m.Float64ObservableCounter(
"afloat",
x.WithDefaultAttributes(k1), x.WithDefaultAttributes(k1),
metric.WithFloat64Callback(func(_ context.Context, o metric.Float64Observer) error { metric.WithFloat64Callback(func(_ context.Context, o metric.Float64Observer) error {
o.Observe(4.5, metric.WithAttributes(k1.String("alice"), k2.String("bob"))) o.Observe(4.5, metric.WithAttributes(k1.String("alice"), k2.String("bob")))
@@ -2862,7 +2864,8 @@ func TestMeterDefaultAttributes(t *testing.T) {
name: "Int64ObservableUpDownCounter", name: "Int64ObservableUpDownCounter",
instName: "aud", instName: "aud",
record: func(t *testing.T, m metric.Meter) { record: func(t *testing.T, m metric.Meter) {
_, err := m.Int64ObservableUpDownCounter("aud", _, err := m.Int64ObservableUpDownCounter(
"aud",
x.WithDefaultAttributes(k1), x.WithDefaultAttributes(k1),
metric.WithInt64Callback(func(_ context.Context, o metric.Int64Observer) error { metric.WithInt64Callback(func(_ context.Context, o metric.Int64Observer) error {
o.Observe(4, metric.WithAttributes(k1.String("alice"), k2.String("bob"))) o.Observe(4, metric.WithAttributes(k1.String("alice"), k2.String("bob")))
@@ -2883,7 +2886,8 @@ func TestMeterDefaultAttributes(t *testing.T) {
name: "Float64ObservableUpDownCounter", name: "Float64ObservableUpDownCounter",
instName: "aud_float", instName: "aud_float",
record: func(t *testing.T, m metric.Meter) { record: func(t *testing.T, m metric.Meter) {
_, err := m.Float64ObservableUpDownCounter("aud_float", _, err := m.Float64ObservableUpDownCounter(
"aud_float",
x.WithDefaultAttributes(k1), x.WithDefaultAttributes(k1),
metric.WithFloat64Callback(func(_ context.Context, o metric.Float64Observer) error { metric.WithFloat64Callback(func(_ context.Context, o metric.Float64Observer) error {
o.Observe(4.5, metric.WithAttributes(k1.String("alice"), k2.String("bob"))) o.Observe(4.5, metric.WithAttributes(k1.String("alice"), k2.String("bob")))
@@ -2904,7 +2908,8 @@ func TestMeterDefaultAttributes(t *testing.T) {
name: "Int64ObservableGauge", name: "Int64ObservableGauge",
instName: "agauge_async", instName: "agauge_async",
record: func(t *testing.T, m metric.Meter) { record: func(t *testing.T, m metric.Meter) {
_, err := m.Int64ObservableGauge("agauge_async", _, err := m.Int64ObservableGauge(
"agauge_async",
x.WithDefaultAttributes(k1), x.WithDefaultAttributes(k1),
metric.WithInt64Callback(func(_ context.Context, o metric.Int64Observer) error { metric.WithInt64Callback(func(_ context.Context, o metric.Int64Observer) error {
o.Observe(4, metric.WithAttributes(k1.String("alice"), k2.String("bob"))) o.Observe(4, metric.WithAttributes(k1.String("alice"), k2.String("bob")))
@@ -2923,7 +2928,8 @@ func TestMeterDefaultAttributes(t *testing.T) {
name: "Float64ObservableGauge", name: "Float64ObservableGauge",
instName: "agauge_float_async", instName: "agauge_float_async",
record: func(t *testing.T, m metric.Meter) { record: func(t *testing.T, m metric.Meter) {
_, err := m.Float64ObservableGauge("agauge_float_async", _, err := m.Float64ObservableGauge(
"agauge_float_async",
x.WithDefaultAttributes(k1), x.WithDefaultAttributes(k1),
metric.WithFloat64Callback(func(_ context.Context, o metric.Float64Observer) error { metric.WithFloat64Callback(func(_ context.Context, o metric.Float64Observer) error {
o.Observe(4.5, metric.WithAttributes(k1.String("alice"), k2.String("bob"))) o.Observe(4.5, metric.WithAttributes(k1.String("alice"), k2.String("bob")))
+4 -2
View File
@@ -553,7 +553,8 @@ func TestAddingAndObservingMeasureConcurrentSafe(t *testing.T) {
func(_ context.Context, o metric.Observer) error { func(_ context.Context, o metric.Observer) error {
o.ObserveInt64(oc1, 2) o.ObserveInt64(oc1, 2)
return nil return nil
}, oc1) }, oc1,
)
require.NoError(t, err) require.NoError(t, err)
}) })
@@ -581,7 +582,8 @@ func TestPipelineWithMultipleReaders(t *testing.T) {
func(_ context.Context, o metric.Observer) error { func(_ context.Context, o metric.Observer) error {
o.ObserveInt64(oc, val.Load()) o.ObserveInt64(oc, val.Load())
return nil return nil
}, oc) }, oc,
)
require.NoError(t, err) require.NoError(t, err)
t.Cleanup(func() { assert.NoError(t, reg.Unregister()) }) t.Cleanup(func() { assert.NoError(t, reg.Unregister()) })
ctx := t.Context() ctx := t.Context()
+4 -2
View File
@@ -47,7 +47,8 @@ func NewMeterProvider(options ...Option) *MeterProvider {
shutdown: sdown, shutdown: sdown,
} }
// Log after creation so all readers show correctly they are registered. // Log after creation so all readers show correctly they are registered.
global.Info("MeterProvider created", global.Info(
"MeterProvider created",
"Resource", conf.res, "Resource", conf.res,
"Readers", conf.readers, "Readers", conf.readers,
"Views", len(conf.views), "Views", len(conf.views),
@@ -82,7 +83,8 @@ func (mp *MeterProvider) Meter(name string, options ...metric.MeterOption) metri
Attributes: c.InstrumentationAttributes(), Attributes: c.InstrumentationAttributes(),
} }
global.Info("Meter created", global.Info(
"Meter created",
"Name", s.Name, "Name", s.Name,
"Version", s.Version, "Version", s.Version,
"SchemaURL", s.SchemaURL, "SchemaURL", s.SchemaURL,
+2 -1
View File
@@ -55,7 +55,8 @@ func uname() (string, error) {
return "", err return "", err
} }
return fmt.Sprintf("%s %s %s %s %s", return fmt.Sprintf(
"%s %s %s %s %s",
unix.ByteSliceToString(utsName.Sysname[:]), unix.ByteSliceToString(utsName.Sysname[:]),
unix.ByteSliceToString(utsName.Nodename[:]), unix.ByteSliceToString(utsName.Nodename[:]),
unix.ByteSliceToString(utsName.Release[:]), unix.ByteSliceToString(utsName.Release[:]),
+4 -2
View File
@@ -16,7 +16,8 @@ import (
// resembles the one displayed by the Version Reporter Applet (winver.exe). // resembles the one displayed by the Version Reporter Applet (winver.exe).
func platformOSDescription() (string, error) { func platformOSDescription() (string, error) {
k, err := registry.OpenKey( k, err := registry.OpenKey(
registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE) registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE,
)
if err != nil { if err != nil {
return "", err return "", err
} }
@@ -37,7 +38,8 @@ func platformOSDescription() (string, error) {
displayVersion += " " displayVersion += " "
} }
return fmt.Sprintf("%s %s(%s) [Version %s.%s.%s.%s]", return fmt.Sprintf(
"%s %s(%s) [Version %s.%s.%s.%s]",
productName, productName,
displayVersion, displayVersion,
releaseID, releaseID,
+2 -1
View File
@@ -22,7 +22,8 @@ func TestPlatformOSDescription(t *testing.T) {
func TestReadRegistryValues(t *testing.T) { func TestReadRegistryValues(t *testing.T) {
k, err := registry.OpenKey( k, err := registry.OpenKey(
registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE) registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE,
)
require.NoError(t, err, "should open Windows CurrentVersion registry key") require.NoError(t, err, "should open Windows CurrentVersion registry key")
+2 -1
View File
@@ -164,7 +164,8 @@ func (processRuntimeVersionDetector) Detect(context.Context) (*Resource, error)
// Detect returns a *Resource that describes the runtime of this process. // Detect returns a *Resource that describes the runtime of this process.
func (processRuntimeDescriptionDetector) Detect(context.Context) (*Resource, error) { func (processRuntimeDescriptionDetector) Detect(context.Context) (*Resource, error) {
runtimeDescription := fmt.Sprintf( runtimeDescription := fmt.Sprintf(
"go version %s %s/%s", runtimeVersion(), runtimeOS(), runtimeArch()) "go version %s %s/%s", runtimeVersion(), runtimeOS(), runtimeArch(),
)
return NewWithAttributes( return NewWithAttributes(
semconv.SchemaURL, semconv.SchemaURL,
+4 -2
View File
@@ -125,7 +125,8 @@ func TestRuntimeArch(t *testing.T) {
func testWithProcessExecutablePathError(t *testing.T) { func testWithProcessExecutablePathError(t *testing.T) {
ctx := t.Context() ctx := t.Context()
res, err := resource.New(ctx, res, err := resource.New(
ctx,
resource.WithProcessExecutablePath(), resource.WithProcessExecutablePath(),
) )
@@ -136,7 +137,8 @@ func testWithProcessExecutablePathError(t *testing.T) {
func testWithProcessOwnerError(t *testing.T) { func testWithProcessOwnerError(t *testing.T) {
ctx := t.Context() ctx := t.Context()
res, err := resource.New(ctx, res, err := resource.New(
ctx,
resource.WithProcessOwner(), resource.WithProcessOwner(),
) )
+38 -19
View File
@@ -62,7 +62,8 @@ func TestNewWithAttributes(t *testing.T) {
if diff := cmp.Diff( if diff := cmp.Diff(
res.Attributes(), res.Attributes(),
c.want, c.want,
cmp.AllowUnexported(attribute.Value{})); diff != "" { cmp.AllowUnexported(attribute.Value{}),
); diff != "" {
t.Fatalf("unwanted result: diff %+v,", diff) t.Fatalf("unwanted result: diff %+v,", diff)
} }
}) })
@@ -189,7 +190,8 @@ func TestMerge(t *testing.T) {
if diff := cmp.Diff( if diff := cmp.Diff(
res.Attributes(), res.Attributes(),
c.want, c.want,
cmp.AllowUnexported(attribute.Value{})); diff != "" { cmp.AllowUnexported(attribute.Value{}),
); diff != "" {
t.Fatalf("unwanted result: diff %+v,", diff) t.Fatalf("unwanted result: diff %+v,", diff)
} }
}) })
@@ -541,7 +543,8 @@ func TestWithHostID(t *testing.T) {
ctx := t.Context() ctx := t.Context()
res, err := resource.New(ctx, res, err := resource.New(
ctx,
resource.WithHostID(), resource.WithHostID(),
) )
@@ -557,7 +560,8 @@ func TestWithHostIDError(t *testing.T) {
ctx := t.Context() ctx := t.Context()
res, err := resource.New(ctx, res, err := resource.New(
ctx,
resource.WithHostID(), resource.WithHostID(),
) )
@@ -571,7 +575,8 @@ func TestWithOSType(t *testing.T) {
ctx := t.Context() ctx := t.Context()
res, err := resource.New(ctx, res, err := resource.New(
ctx,
resource.WithOSType(), resource.WithOSType(),
) )
@@ -587,7 +592,8 @@ func TestWithOSDescription(t *testing.T) {
ctx := t.Context() ctx := t.Context()
res, err := resource.New(ctx, res, err := resource.New(
ctx,
resource.WithOSDescription(), resource.WithOSDescription(),
) )
@@ -603,7 +609,8 @@ func TestWithOS(t *testing.T) {
ctx := t.Context() ctx := t.Context()
res, err := resource.New(ctx, res, err := resource.New(
ctx,
resource.WithOS(), resource.WithOS(),
) )
@@ -618,7 +625,8 @@ func TestWithProcessPID(t *testing.T) {
mockProcessAttributesProvidersWithErrors() mockProcessAttributesProvidersWithErrors()
ctx := t.Context() ctx := t.Context()
res, err := resource.New(ctx, res, err := resource.New(
ctx,
resource.WithProcessPID(), resource.WithProcessPID(),
) )
@@ -632,7 +640,8 @@ func TestWithProcessExecutableName(t *testing.T) {
mockProcessAttributesProvidersWithErrors() mockProcessAttributesProvidersWithErrors()
ctx := t.Context() ctx := t.Context()
res, err := resource.New(ctx, res, err := resource.New(
ctx,
resource.WithProcessExecutableName(), resource.WithProcessExecutableName(),
) )
@@ -646,7 +655,8 @@ func TestWithProcessExecutablePath(t *testing.T) {
mockProcessAttributesProviders() mockProcessAttributesProviders()
ctx := t.Context() ctx := t.Context()
res, err := resource.New(ctx, res, err := resource.New(
ctx,
resource.WithProcessExecutablePath(), resource.WithProcessExecutablePath(),
) )
@@ -660,7 +670,8 @@ func TestWithProcessCommandArgs(t *testing.T) {
mockProcessAttributesProvidersWithErrors() mockProcessAttributesProvidersWithErrors()
ctx := t.Context() ctx := t.Context()
res, err := resource.New(ctx, res, err := resource.New(
ctx,
resource.WithProcessCommandArgs(), resource.WithProcessCommandArgs(),
) )
@@ -675,7 +686,8 @@ func TestWithProcessOwner(t *testing.T) {
mockProcessAttributesProviders() mockProcessAttributesProviders()
ctx := t.Context() ctx := t.Context()
res, err := resource.New(ctx, res, err := resource.New(
ctx,
resource.WithProcessOwner(), resource.WithProcessOwner(),
) )
@@ -689,7 +701,8 @@ func TestWithProcessRuntimeName(t *testing.T) {
mockProcessAttributesProvidersWithErrors() mockProcessAttributesProvidersWithErrors()
ctx := t.Context() ctx := t.Context()
res, err := resource.New(ctx, res, err := resource.New(
ctx,
resource.WithProcessRuntimeName(), resource.WithProcessRuntimeName(),
) )
@@ -703,7 +716,8 @@ func TestWithProcessRuntimeVersion(t *testing.T) {
mockProcessAttributesProvidersWithErrors() mockProcessAttributesProvidersWithErrors()
ctx := t.Context() ctx := t.Context()
res, err := resource.New(ctx, res, err := resource.New(
ctx,
resource.WithProcessRuntimeVersion(), resource.WithProcessRuntimeVersion(),
) )
@@ -717,7 +731,8 @@ func TestWithProcessRuntimeDescription(t *testing.T) {
mockProcessAttributesProvidersWithErrors() mockProcessAttributesProvidersWithErrors()
ctx := t.Context() ctx := t.Context()
res, err := resource.New(ctx, res, err := resource.New(
ctx,
resource.WithProcessRuntimeDescription(), resource.WithProcessRuntimeDescription(),
) )
@@ -731,7 +746,8 @@ func TestWithProcess(t *testing.T) {
mockProcessAttributesProviders() mockProcessAttributesProviders()
ctx := t.Context() ctx := t.Context()
res, err := resource.New(ctx, res, err := resource.New(
ctx,
resource.WithProcess(), resource.WithProcess(),
) )
@@ -806,7 +822,8 @@ func TestWithContainerID(t *testing.T) {
t.Run(tc.name, func(t *testing.T) { t.Run(tc.name, func(t *testing.T) {
resource.SetContainerProviders(tc.containerIDProvider) resource.SetContainerProviders(tc.containerIDProvider)
res, err := resource.New(t.Context(), res, err := resource.New(
t.Context(),
resource.WithContainerID(), resource.WithContainerID(),
) )
@@ -826,7 +843,8 @@ func TestWithContainer(t *testing.T) {
return fakeContainerID, nil return fakeContainerID, nil
}) })
res, err := resource.New(t.Context(), res, err := resource.New(
t.Context(),
resource.WithContainer(), resource.WithContainer(),
) )
@@ -837,7 +855,8 @@ func TestWithContainer(t *testing.T) {
} }
func TestWithService(t *testing.T) { func TestWithService(t *testing.T) {
res, err := resource.New(t.Context(), res, err := resource.New(
t.Context(),
resource.WithService(), resource.WithService(),
) )
+2 -1
View File
@@ -886,7 +886,8 @@ func assertObsScopeMetrics(
} }
if len(wantProcessedDataPoints) > 0 { if len(wantProcessedDataPoints) > 0 {
wantMetrics = append(wantMetrics, wantMetrics = append(
wantMetrics,
metricdata.Metrics{ metricdata.Metrics{
Name: otelconv.SDKProcessorSpanProcessed{}.Name(), Name: otelconv.SDKProcessorSpanProcessed{}.Name(),
Description: otelconv.SDKProcessorSpanProcessed{}.Description(), Description: otelconv.SDKProcessorSpanProcessed{}.Description(),
+4 -2
View File
@@ -38,7 +38,8 @@ func benchmarkSpanLimits(b *testing.B, limits sdktrace.SpanLimits) {
attribute.String("string", "value"), attribute.String("string", "value"),
attribute.ByteSlice("byteSlice", []byte("value")), attribute.ByteSlice("byteSlice", []byte("value")),
attribute.StringSlice("stringSlice", []string{"value", "value-1"}), attribute.StringSlice("stringSlice", []string{"value", "value-1"}),
attribute.Slice("slice", attribute.Slice(
"slice",
attribute.StringValue("value"), attribute.StringValue("value"),
attribute.StringSliceValue([]string{"value", "value-1"}), attribute.StringSliceValue([]string{"value", "value-1"}),
attribute.ByteSliceValue([]byte{1, 2, 3}), attribute.ByteSliceValue([]byte{1, 2, 3}),
@@ -423,7 +424,8 @@ func BenchmarkSpanProcessorVerboseLogging(b *testing.B) {
sdktrace.WithBatcher( sdktrace.WithBatcher(
tracetest.NewNoopExporter(), tracetest.NewNoopExporter(),
sdktrace.WithMaxExportBatchSize(10), sdktrace.WithMaxExportBatchSize(10),
)) ),
)
b.Cleanup(func() { b.Cleanup(func() {
//nolint:usetesting // required to avoid getting a canceled context at cleanup. //nolint:usetesting // required to avoid getting a canceled context at cleanup.
_ = tp.Shutdown(context.Background()) _ = tp.Shutdown(context.Background())
+2 -1
View File
@@ -164,7 +164,8 @@ func TestTracerRemoteParent(t *testing.T) {
SpanID: tapi.SpanID{0x01}, SpanID: tapi.SpanID{0x01},
TraceFlags: 0x1, TraceFlags: 0x1,
Remote: true, Remote: true,
})) }),
)
_, _ = tracer.Start(ctx, "span") _, _ = tracer.Start(ctx, "span")
check(t, collect(), sampledLive(1), remoteStarted(1)) check(t, collect(), sampledLive(1), remoteStarted(1))
+1 -1
View File
@@ -317,7 +317,7 @@ func (p *TracerProvider) Shutdown(ctx context.Context) error {
} }
func (p *TracerProvider) getSpanProcessors() spanProcessorStates { func (p *TracerProvider) getSpanProcessors() spanProcessorStates {
return *(p.spanProcessors.Load()) return *p.spanProcessors.Load()
} }
// TracerProviderOption configures a TracerProvider. // TracerProviderOption configures a TracerProvider.
+3 -2
View File
@@ -297,8 +297,9 @@ func (pb parentBased) ShouldSample(p SamplingParameters) SamplingResult {
} }
func (pb parentBased) Description() string { func (pb parentBased) Description() string {
return fmt.Sprintf("ParentBased{root:%s,remoteParentSampled:%s,"+ return fmt.Sprintf(
"remoteParentNotSampled:%s,localParentSampled:%s,localParentNotSampled:%s}", "ParentBased{root:%s,remoteParentSampled:%s,"+
"remoteParentNotSampled:%s,localParentSampled:%s,localParentNotSampled:%s}",
pb.root.Description(), pb.root.Description(),
pb.config.remoteParentSampled.Description(), pb.config.remoteParentSampled.Description(),
pb.config.remoteParentNotSampled.Description(), pb.config.remoteParentNotSampled.Description(),
+6 -3
View File
@@ -160,7 +160,8 @@ func TestParentBasedDefaultDescription(t *testing.T) {
NeverSample().Description()) NeverSample().Description())
if sampler.Description() != expectedDescription { if sampler.Description() != expectedDescription {
t.Errorf("Sampler description should be %s, got '%s' instead", t.Errorf(
"Sampler description should be %s, got '%s' instead",
expectedDescription, expectedDescription,
sampler.Description(), sampler.Description(),
) )
@@ -285,7 +286,8 @@ func TestAlwaysRecordSamplingDecision(t *testing.T) {
) )
samplingResult := sampler.ShouldSample(SamplingParameters{ParentContext: parentCtx}) samplingResult := sampler.ShouldSample(SamplingParameters{ParentContext: parentCtx})
if samplingResult.Decision != tc.expectedDecision { if samplingResult.Decision != tc.expectedDecision {
t.Errorf("Sampling decision should be %v, got %v instead", t.Errorf(
"Sampling decision should be %v, got %v instead",
tc.expectedDecision, tc.expectedDecision,
samplingResult.Decision, samplingResult.Decision,
) )
@@ -300,7 +302,8 @@ func TestAlwaysRecordDefaultDescription(t *testing.T) {
expectedDescription := fmt.Sprintf("AlwaysRecord{root:%s}", NeverSample().Description()) expectedDescription := fmt.Sprintf("AlwaysRecord{root:%s}", NeverSample().Description())
if sampler.Description() != expectedDescription { if sampler.Description() != expectedDescription {
t.Errorf("Sampler description should be %s, got '%s' instead", t.Errorf(
"Sampler description should be %s, got '%s' instead",
expectedDescription, expectedDescription,
sampler.Description(), sampler.Description(),
) )
+8 -8
View File
@@ -52,37 +52,37 @@ func TestSettingSpanLimits(t *testing.T) {
{ {
name: "env", name: "env",
env: envLimits("42"), env: envLimits("42"),
want: *(limits(42)), want: *limits(42),
}, },
{ {
name: "opt", name: "opt",
opt: limits(42), opt: limits(42),
want: *(limits(42)), want: *limits(42),
}, },
{ {
name: "raw-opt", name: "raw-opt",
rawOpt: limits(42), rawOpt: limits(42),
want: *(limits(42)), want: *limits(42),
}, },
{ {
name: "opt-override", name: "opt-override",
env: envLimits("-2"), env: envLimits("-2"),
// Option take priority. // Option take priority.
opt: limits(43), opt: limits(43),
want: *(limits(43)), want: *limits(43),
}, },
{ {
name: "raw-opt-override", name: "raw-opt-override",
env: envLimits("-2"), env: envLimits("-2"),
// Option take priority. // Option take priority.
rawOpt: limits(43), rawOpt: limits(43),
want: *(limits(43)), want: *limits(43),
}, },
{ {
name: "last-opt-wins", name: "last-opt-wins",
opt: limits(-2), opt: limits(-2),
rawOpt: limits(-3), rawOpt: limits(-3),
want: *(limits(-3)), want: *limits(-3),
}, },
{ {
name: "env(unlimited)", name: "env(unlimited)",
@@ -91,7 +91,7 @@ func TestSettingSpanLimits(t *testing.T) {
// negative values to signal this than this value is expected to // negative values to signal this than this value is expected to
// pass through. // pass through.
env: envLimits("-1"), env: envLimits("-1"),
want: *(limits(-1)), want: *limits(-1),
}, },
{ {
name: "opt(unlimited)", name: "opt(unlimited)",
@@ -102,7 +102,7 @@ func TestSettingSpanLimits(t *testing.T) {
{ {
name: "raw-opt(unlimited)", name: "raw-opt(unlimited)",
rawOpt: limits(-1), rawOpt: limits(-1),
want: *(limits(-1)), want: *limits(-1),
}, },
} }
@@ -51,7 +51,9 @@ type InstrumentationBlacklist struct {
func (f InstrumentationBlacklist) OnStart(parent context.Context, s ReadWriteSpan) { func (f InstrumentationBlacklist) OnStart(parent context.Context, s ReadWriteSpan) {
f.Next.OnStart(parent, s) f.Next.OnStart(parent, s)
} }
func (f InstrumentationBlacklist) Shutdown(ctx context.Context) error { return f.Next.Shutdown(ctx) } func (f InstrumentationBlacklist) Shutdown(ctx context.Context) error { return f.Next.Shutdown(ctx) }
func (f InstrumentationBlacklist) ForceFlush(ctx context.Context) error { func (f InstrumentationBlacklist) ForceFlush(ctx context.Context) error {
return f.Next.ForceFlush(ctx) return f.Next.ForceFlush(ctx)
} }
+12 -6
View File
@@ -289,11 +289,13 @@ func TestTruncateAttr(t *testing.T) {
// STRINGSLICE element remains unchanged because each string fits // STRINGSLICE element remains unchanged because each string fits
// within the limit, while the sibling STRING element is truncated. // within the limit, while the sibling STRING element is truncated.
limit: 3, limit: 3,
attr: attribute.Slice(key, attr: attribute.Slice(
key,
attribute.StringSliceValue([]string{"ab", "cd"}), attribute.StringSliceValue([]string{"ab", "cd"}),
attribute.StringValue("toolong"), attribute.StringValue("toolong"),
), ),
want: attribute.Slice(key, want: attribute.Slice(
key,
attribute.StringSliceValue([]string{"ab", "cd"}), attribute.StringSliceValue([]string{"ab", "cd"}),
attribute.StringValue("too"), attribute.StringValue("too"),
), ),
@@ -304,11 +306,13 @@ func TestTruncateAttr(t *testing.T) {
// is called recursively on the nested SLICE but returns it unchanged because // is called recursively on the nested SLICE but returns it unchanged because
// none of its elements require truncation. // none of its elements require truncation.
limit: 3, limit: 3,
attr: attribute.Slice(key, attr: attribute.Slice(
key,
attribute.SliceValue(attribute.BoolValue(true)), attribute.SliceValue(attribute.BoolValue(true)),
attribute.StringValue("toolong"), attribute.StringValue("toolong"),
), ),
want: attribute.Slice(key, want: attribute.Slice(
key,
attribute.SliceValue(attribute.BoolValue(true)), attribute.SliceValue(attribute.BoolValue(true)),
attribute.StringValue("too"), attribute.StringValue("too"),
), ),
@@ -342,11 +346,13 @@ func TestTruncateAttr(t *testing.T) {
{ {
// Mixed SLICE: BYTESLICE + STRING (both need truncation). // Mixed SLICE: BYTESLICE + STRING (both need truncation).
limit: 2, limit: 2,
attr: attribute.Slice(key, attr: attribute.Slice(
key,
attribute.ByteSliceValue([]byte{1, 2, 3}), attribute.ByteSliceValue([]byte{1, 2, 3}),
attribute.StringValue("abc"), attribute.StringValue("abc"),
), ),
want: attribute.Slice(key, want: attribute.Slice(
key,
attribute.ByteSliceValue([]byte{1, 2}), attribute.ByteSliceValue([]byte{1, 2}),
attribute.StringValue("ab"), attribute.StringValue("ab"),
), ),
+6 -3
View File
@@ -402,7 +402,8 @@ func TestStartSpanNewRootNotSampled(t *testing.T) {
func TestSetSpanAttributesOnStart(t *testing.T) { func TestSetSpanAttributesOnStart(t *testing.T) {
te := NewTestExporter() te := NewTestExporter()
tp := NewTracerProvider(WithSyncer(te), WithResource(resource.Empty())) tp := NewTracerProvider(WithSyncer(te), WithResource(resource.Empty()))
span := startSpan(tp, span := startSpan(
tp,
"StartSpanAttribute", "StartSpanAttribute",
trace.WithAttributes(attribute.String("key1", "value1")), trace.WithAttributes(attribute.String("key1", "value1")),
trace.WithAttributes(attribute.String("key2", "value2")), trace.WithAttributes(attribute.String("key2", "value2")),
@@ -806,7 +807,8 @@ func TestLinksOverLimit(t *testing.T) {
sl.LinkCountLimit = 2 sl.LinkCountLimit = 2
tp := NewTracerProvider(WithSpanLimits(sl), WithSyncer(te), WithResource(resource.Empty())) tp := NewTracerProvider(WithSpanLimits(sl), WithSyncer(te), WithResource(resource.Empty()))
span := startSpan(tp, "LinksOverLimit", span := startSpan(
tp, "LinksOverLimit",
trace.WithLinks( trace.WithLinks(
trace.Link{SpanContext: sc1, Attributes: []attribute.KeyValue{attribute.String("key1", "value1")}}, trace.Link{SpanContext: sc1, Attributes: []attribute.KeyValue{attribute.String("key1", "value1")}},
trace.Link{SpanContext: sc2, Attributes: []attribute.KeyValue{attribute.String("key2", "value2")}}, trace.Link{SpanContext: sc2, Attributes: []attribute.KeyValue{attribute.String("key2", "value2")}},
@@ -921,7 +923,8 @@ func TestSetSpanStatusWithoutMessageWhenStatusIsNotError(t *testing.T) {
} }
func cmpDiff(x, y any) string { func cmpDiff(x, y any) string {
return cmp.Diff(x, y, return cmp.Diff(
x, y,
cmp.AllowUnexported(snapshot{}), cmp.AllowUnexported(snapshot{}),
cmp.AllowUnexported(attribute.Value{}), cmp.AllowUnexported(attribute.Value{}),
cmp.AllowUnexported(Event{}), cmp.AllowUnexported(Event{}),
+2 -1
View File
@@ -572,7 +572,8 @@ func TestNetAttributesFromHTTPRequest(t *testing.T) {
if diff := cmp.Diff( if diff := cmp.Diff(
tc.expected, tc.expected,
got, got,
cmp.AllowUnexported(attribute.Value{})); diff != "" { cmp.AllowUnexported(attribute.Value{}),
); diff != "" {
t.Fatalf("attributes differ: diff %+v,", diff) t.Fatalf("attributes differ: diff %+v,", diff)
} }
}) })
+2 -4
View File
@@ -403,10 +403,8 @@ const (
ErrorTypeKey = attribute.Key("error.type") ErrorTypeKey = attribute.Key("error.type")
) )
var ( // A fallback error value to be used when the instrumentation does not define a custom value for it
// A fallback error value to be used when the instrumentation does not define a custom value for it var ErrorTypeOther = ErrorTypeKey.String("_OTHER")
ErrorTypeOther = ErrorTypeKey.String("_OTHER")
)
// Describes FaaS attributes. // Describes FaaS attributes.
const ( const (
+2 -4
View File
@@ -142,10 +142,8 @@ const (
ErrorTypeKey = attribute.Key("error.type") ErrorTypeKey = attribute.Key("error.type")
) )
var ( // A fallback error value to be used when the instrumentation doesn't define a custom value
// A fallback error value to be used when the instrumentation doesn't define a custom value var ErrorTypeOther = ErrorTypeKey.String("_OTHER")
ErrorTypeOther = ErrorTypeKey.String("_OTHER")
)
// Describes FaaS attributes. // Describes FaaS attributes.
const ( const (
+2 -4
View File
@@ -142,10 +142,8 @@ const (
ErrorTypeKey = attribute.Key("error.type") ErrorTypeKey = attribute.Key("error.type")
) )
var ( // A fallback error value to be used when the instrumentation doesn't define a custom value
// A fallback error value to be used when the instrumentation doesn't define a custom value var ErrorTypeOther = ErrorTypeKey.String("_OTHER")
ErrorTypeOther = ErrorTypeKey.String("_OTHER")
)
// Describes FaaS attributes. // Describes FaaS attributes.
const ( const (
+2 -4
View File
@@ -2076,10 +2076,8 @@ const (
ErrorTypeKey = attribute.Key("error.type") ErrorTypeKey = attribute.Key("error.type")
) )
var ( // A fallback error value to be used when the instrumentation doesn't define a custom value
// A fallback error value to be used when the instrumentation doesn't define a custom value var ErrorTypeOther = ErrorTypeKey.String("_OTHER")
ErrorTypeOther = ErrorTypeKey.String("_OTHER")
)
// The shared attributes used to report a single exception associated with a // The shared attributes used to report a single exception associated with a
// span or log. // span or log.
+2 -4
View File
@@ -3418,10 +3418,8 @@ const (
ErrorTypeKey = attribute.Key("error.type") ErrorTypeKey = attribute.Key("error.type")
) )
var ( // A fallback error value to be used when the instrumentation doesn't define a custom value
// A fallback error value to be used when the instrumentation doesn't define a custom value var ErrorTypeOther = ErrorTypeKey.String("_OTHER")
ErrorTypeOther = ErrorTypeKey.String("_OTHER")
)
// The shared attributes used to report a single exception associated with a // The shared attributes used to report a single exception associated with a
// span or log. // span or log.
+4 -8
View File
@@ -2786,10 +2786,8 @@ const (
ErrorTypeKey = attribute.Key("error.type") ErrorTypeKey = attribute.Key("error.type")
) )
var ( // A fallback error value to be used when the instrumentation doesn't define a custom value
// A fallback error value to be used when the instrumentation doesn't define a custom value var ErrorTypeOther = ErrorTypeKey.String("_OTHER")
ErrorTypeOther = ErrorTypeKey.String("_OTHER")
)
// Attributes for Events represented using Log Records. // Attributes for Events represented using Log Records.
const ( const (
@@ -3655,10 +3653,8 @@ const (
GenAiUsagePromptTokensKey = attribute.Key("gen_ai.usage.prompt_tokens") GenAiUsagePromptTokensKey = attribute.Key("gen_ai.usage.prompt_tokens")
) )
var ( // OpenAI
// OpenAI var GenAiSystemOpenai = GenAiSystemKey.String("openai")
GenAiSystemOpenai = GenAiSystemKey.String("openai")
)
// GenAiCompletion returns an attribute KeyValue conforming to the // GenAiCompletion returns an attribute KeyValue conforming to the
// "gen_ai.completion" semantic conventions. It represents the full response // "gen_ai.completion" semantic conventions. It represents the full response
+2 -4
View File
@@ -3135,10 +3135,8 @@ const (
ErrorTypeKey = attribute.Key("error.type") ErrorTypeKey = attribute.Key("error.type")
) )
var ( // A fallback error value to be used when the instrumentation doesn't define a custom value
// A fallback error value to be used when the instrumentation doesn't define a custom value var ErrorTypeOther = ErrorTypeKey.String("_OTHER")
ErrorTypeOther = ErrorTypeKey.String("_OTHER")
)
// Attributes for Events represented using Log Records. // Attributes for Events represented using Log Records.
const ( const (
+5 -3
View File
@@ -1044,7 +1044,8 @@ func AWSEKSClusterARN(val string) attribute.KeyValue {
// "aws.lambda.invoked_arn" semantic conventions. It represents the full invoked // "aws.lambda.invoked_arn" semantic conventions. It represents the full invoked
// ARN as provided on the `Context` passed to the function ( // ARN as provided on the `Context` passed to the function (
// `Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` // `Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next`
// applicable). //
// applicable).
func AWSLambdaInvokedARN(val string) attribute.KeyValue { func AWSLambdaInvokedARN(val string) attribute.KeyValue {
return AWSLambdaInvokedARNKey.String(val) return AWSLambdaInvokedARNKey.String(val)
} }
@@ -1609,7 +1610,8 @@ func CloudRegion(val string) attribute.KeyValue {
// "cloud.resource_id" semantic conventions. It represents the cloud // "cloud.resource_id" semantic conventions. It represents the cloud
// provider-specific native identifier of the monitored cloud resource (e.g. an // provider-specific native identifier of the monitored cloud resource (e.g. an
// [ARN] on AWS, a [fully qualified resource ID] on Azure, a [full resource name] // [ARN] on AWS, a [fully qualified resource ID] on Azure, a [full resource name]
// on GCP). //
// on GCP).
// //
// [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html // [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
// [fully qualified resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id // [fully qualified resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id
@@ -11245,4 +11247,4 @@ func WebEngineName(val string) attribute.KeyValue {
// engine. // engine.
func WebEngineVersion(val string) attribute.KeyValue { func WebEngineVersion(val string) attribute.KeyValue {
return WebEngineVersionKey.String(val) return WebEngineVersionKey.String(val)
} }
+1250 -1250
View File
File diff suppressed because it is too large Load Diff
+5 -3
View File
@@ -1063,7 +1063,8 @@ func AWSExtendedRequestID(val string) attribute.KeyValue {
// "aws.lambda.invoked_arn" semantic conventions. It represents the full invoked // "aws.lambda.invoked_arn" semantic conventions. It represents the full invoked
// ARN as provided on the `Context` passed to the function ( // ARN as provided on the `Context` passed to the function (
// `Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` // `Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next`
// applicable). //
// applicable).
func AWSLambdaInvokedARN(val string) attribute.KeyValue { func AWSLambdaInvokedARN(val string) attribute.KeyValue {
return AWSLambdaInvokedARNKey.String(val) return AWSLambdaInvokedARNKey.String(val)
} }
@@ -2037,7 +2038,8 @@ func CloudRegion(val string) attribute.KeyValue {
// "cloud.resource_id" semantic conventions. It represents the cloud // "cloud.resource_id" semantic conventions. It represents the cloud
// provider-specific native identifier of the monitored cloud resource (e.g. an // provider-specific native identifier of the monitored cloud resource (e.g. an
// [ARN] on AWS, a [fully qualified resource ID] on Azure, a [full resource name] // [ARN] on AWS, a [fully qualified resource ID] on Azure, a [full resource name]
// on GCP). //
// on GCP).
// //
// [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html // [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
// [fully qualified resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id // [fully qualified resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id
@@ -12330,4 +12332,4 @@ func WebEngineName(val string) attribute.KeyValue {
// engine. // engine.
func WebEngineVersion(val string) attribute.KeyValue { func WebEngineVersion(val string) attribute.KeyValue {
return WebEngineVersionKey.String(val) return WebEngineVersionKey.String(val)
} }
+1742 -1742
View File
File diff suppressed because it is too large Load Diff
+5 -3
View File
@@ -1100,7 +1100,8 @@ func AWSExtendedRequestID(val string) attribute.KeyValue {
// "aws.lambda.invoked_arn" semantic conventions. It represents the full invoked // "aws.lambda.invoked_arn" semantic conventions. It represents the full invoked
// ARN as provided on the `Context` passed to the function ( // ARN as provided on the `Context` passed to the function (
// `Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` // `Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next`
// applicable). //
// applicable).
func AWSLambdaInvokedARN(val string) attribute.KeyValue { func AWSLambdaInvokedARN(val string) attribute.KeyValue {
return AWSLambdaInvokedARNKey.String(val) return AWSLambdaInvokedARNKey.String(val)
} }
@@ -2099,7 +2100,8 @@ func CloudRegion(val string) attribute.KeyValue {
// "cloud.resource_id" semantic conventions. It represents the cloud // "cloud.resource_id" semantic conventions. It represents the cloud
// provider-specific native identifier of the monitored cloud resource (e.g. an // provider-specific native identifier of the monitored cloud resource (e.g. an
// [ARN] on AWS, a [fully qualified resource ID] on Azure, a [full resource name] // [ARN] on AWS, a [fully qualified resource ID] on Azure, a [full resource name]
// on GCP). //
// on GCP).
// //
// [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html // [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
// [fully qualified resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id // [fully qualified resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id
@@ -12899,4 +12901,4 @@ func WebEngineName(val string) attribute.KeyValue {
// engine. // engine.
func WebEngineVersion(val string) attribute.KeyValue { func WebEngineVersion(val string) attribute.KeyValue {
return WebEngineVersionKey.String(val) return WebEngineVersionKey.String(val)
} }
+1670 -1670
View File
File diff suppressed because it is too large Load Diff
+5 -3
View File
@@ -1153,7 +1153,8 @@ func AWSExtendedRequestID(val string) attribute.KeyValue {
// "aws.lambda.invoked_arn" semantic conventions. It represents the full invoked // "aws.lambda.invoked_arn" semantic conventions. It represents the full invoked
// ARN as provided on the `Context` passed to the function ( // ARN as provided on the `Context` passed to the function (
// `Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` // `Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next`
// applicable). //
// applicable).
func AWSLambdaInvokedARN(val string) attribute.KeyValue { func AWSLambdaInvokedARN(val string) attribute.KeyValue {
return AWSLambdaInvokedARNKey.String(val) return AWSLambdaInvokedARNKey.String(val)
} }
@@ -2152,7 +2153,8 @@ func CloudRegion(val string) attribute.KeyValue {
// "cloud.resource_id" semantic conventions. It represents the cloud // "cloud.resource_id" semantic conventions. It represents the cloud
// provider-specific native identifier of the monitored cloud resource (e.g. an // provider-specific native identifier of the monitored cloud resource (e.g. an
// [ARN] on AWS, a [fully qualified resource ID] on Azure, a [full resource name] // [ARN] on AWS, a [fully qualified resource ID] on Azure, a [full resource name]
// on GCP). //
// on GCP).
// //
// [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html // [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
// [fully qualified resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id // [fully qualified resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id
@@ -13314,4 +13316,4 @@ func WebEngineName(val string) attribute.KeyValue {
// engine. // engine.
func WebEngineVersion(val string) attribute.KeyValue { func WebEngineVersion(val string) attribute.KeyValue {
return WebEngineVersionKey.String(val) return WebEngineVersionKey.String(val)
} }
+3 -5
View File
@@ -46,11 +46,9 @@ var (
// with. // with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// CosmosDBClientActiveInstanceCount is an instrument used to record metric // CosmosDBClientActiveInstanceCount is an instrument used to record metric
// values conforming to the "azure.cosmosdb.client.active_instance.count" // values conforming to the "azure.cosmosdb.client.active_instance.count"
+3 -5
View File
@@ -84,11 +84,9 @@ var (
// with. // with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// PipelineRunActive is an instrument used to record metric values conforming to // PipelineRunActive is an instrument used to record metric values conforming to
// the "cicd.pipeline.run.active" semantic conventions. It represents the number // the "cicd.pipeline.run.active" semantic conventions. It represents the number
+3 -5
View File
@@ -238,11 +238,9 @@ var (
// with. // with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// ClientConnectionCount is an instrument used to record metric values conforming // ClientConnectionCount is an instrument used to record metric values conforming
// to the "db.client.connection.count" semantic conventions. It represents the // to the "db.client.connection.count" semantic conventions. It represents the
+3 -5
View File
@@ -25,11 +25,9 @@ var (
// conventions. It represents the describes the error the DNS lookup failed with. // conventions. It represents the describes the error the DNS lookup failed with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// LookupDuration is an instrument used to record metric values conforming to the // LookupDuration is an instrument used to record metric values conforming to the
// "dns.lookup.duration" semantic conventions. It represents the measures the // "dns.lookup.duration" semantic conventions. It represents the measures the
+3 -5
View File
@@ -26,11 +26,9 @@ var (
// with. // with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// OperationNameAttr is an attribute conforming to the gen_ai.operation.name // OperationNameAttr is an attribute conforming to the gen_ai.operation.name
// semantic conventions. It represents the name of the operation being performed. // semantic conventions. It represents the name of the operation being performed.
+12 -15
View File
@@ -26,11 +26,9 @@ var (
// with. // with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// ConnectionStateAttr is an attribute conforming to the http.connection.state // ConnectionStateAttr is an attribute conforming to the http.connection.state
// semantic conventions. It represents the state of the HTTP connection in the // semantic conventions. It represents the state of the HTTP connection in the
@@ -487,15 +485,15 @@ func (ClientRequestBodySize) Description() string {
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
//
// The size of the request payload body in bytes. This is the number of bytes // The size of the request payload body in bytes. This is the number of bytes
// transferred excluding headers and is often, but not always, present as the // transferred excluding headers and is often, but not always, present as the
// [Content-Length] header. For requests using transport encoding, this should be // [Content-Length] header. For requests using transport encoding, this should be
// the compressed size. // the compressed size.
// //
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length
//
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
func (m ClientRequestBodySize) Record( func (m ClientRequestBodySize) Record(
ctx context.Context, ctx context.Context,
val int64, val int64,
@@ -638,6 +636,7 @@ func (ClientRequestDuration) Description() string {
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin // ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
//
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin // ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
func (m ClientRequestDuration) Record( func (m ClientRequestDuration) Record(
ctx context.Context, ctx context.Context,
@@ -780,15 +779,15 @@ func (ClientResponseBodySize) Description() string {
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
//
// The size of the response payload body in bytes. This is the number of bytes // The size of the response payload body in bytes. This is the number of bytes
// transferred excluding headers and is often, but not always, present as the // transferred excluding headers and is often, but not always, present as the
// [Content-Length] header. For requests using transport encoding, this should be // [Content-Length] header. For requests using transport encoding, this should be
// the compressed size. // the compressed size.
// //
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length
//
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
func (m ClientResponseBodySize) Record( func (m ClientResponseBodySize) Record(
ctx context.Context, ctx context.Context,
val int64, val int64,
@@ -1026,13 +1025,12 @@ func (ServerRequestBodySize) Description() string {
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1
//
// The size of the request payload body in bytes. This is the number of bytes // The size of the request payload body in bytes. This is the number of bytes
// transferred excluding headers and is often, but not always, present as the // transferred excluding headers and is often, but not always, present as the
// [Content-Length] header. For requests using transport encoding, this should be // [Content-Length] header. For requests using transport encoding, this should be
// the compressed size. // the compressed size.
// //
// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1
// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length
func (m ServerRequestBodySize) Record( func (m ServerRequestBodySize) Record(
ctx context.Context, ctx context.Context,
@@ -1325,13 +1323,12 @@ func (ServerResponseBodySize) Description() string {
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1
//
// The size of the response payload body in bytes. This is the number of bytes // The size of the response payload body in bytes. This is the number of bytes
// transferred excluding headers and is often, but not always, present as the // transferred excluding headers and is often, but not always, present as the
// [Content-Length] header. For requests using transport encoding, this should be // [Content-Length] header. For requests using transport encoding, this should be
// the compressed size. // the compressed size.
// //
// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1
// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length
func (m ServerResponseBodySize) Record( func (m ServerResponseBodySize) Record(
ctx context.Context, ctx context.Context,
+8 -10
View File
@@ -25,11 +25,9 @@ var (
// conventions. It represents the type of error encountered by the component. // conventions. It represents the type of error encountered by the component.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// StateAttr is an attribute conforming to the hw.state semantic conventions. It // StateAttr is an attribute conforming to the hw.state semantic conventions. It
// represents the current state of the component. // represents the current state of the component.
@@ -134,7 +132,7 @@ func (Energy) Description() string {
// The id is the an identifier for the hardware component, unique within the // The id is the an identifier for the hardware component, unique within the
// monitored host // monitored host
// //
// The hwType is the type of the component // # The hwType is the type of the component
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
func (m Energy) Add( func (m Energy) Add(
@@ -232,7 +230,7 @@ func (Errors) Description() string {
// The id is the an identifier for the hardware component, unique within the // The id is the an identifier for the hardware component, unique within the
// monitored host // monitored host
// //
// The hwType is the type of the component // # The hwType is the type of the component
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
func (m Errors) Add( func (m Errors) Add(
@@ -723,7 +721,7 @@ func (Power) Description() string {
// The id is the an identifier for the hardware component, unique within the // The id is the an identifier for the hardware component, unique within the
// monitored host // monitored host
// //
// The hwType is the type of the component // # The hwType is the type of the component
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
@@ -823,9 +821,9 @@ func (Status) Description() string {
// The id is the an identifier for the hardware component, unique within the // The id is the an identifier for the hardware component, unique within the
// monitored host // monitored host
// //
// The state is the the current state of the component // # The state is the the current state of the component
// //
// The hwType is the type of the component // # The hwType is the type of the component
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
+3 -5
View File
@@ -26,11 +26,9 @@ var (
// with. // with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// OperationTypeAttr is an attribute conforming to the messaging.operation.type // OperationTypeAttr is an attribute conforming to the messaging.operation.type
// semantic conventions. It represents a string identifying the type of the // semantic conventions. It represents a string identifying the type of the
+3 -5
View File
@@ -26,11 +26,9 @@ var (
// with. // with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// ComponentTypeAttr is an attribute conforming to the otel.component.type // ComponentTypeAttr is an attribute conforming to the otel.component.type
// semantic conventions. It represents a name identifying the type of the // semantic conventions. It represents a name identifying the type of the
-4
View File
@@ -487,7 +487,6 @@ func (DiskIOTime) Description() string {
// ["Disk% Idle Time"] // ["Disk% Idle Time"]
// performance counter: `uptime * (100 - "Disk\% Idle Time") / 100` // performance counter: `uptime * (100 - "Disk\% Idle Time") / 100`
// //
//
// [procfs-diskstats]: https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats // [procfs-diskstats]: https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats
// ["Disk% Idle Time"]: https://learn.microsoft.com/archive/blogs/askcore/windows-performance-monitor-disk-counters-explained#windows-performance-monitor-disk-counters-explained // ["Disk% Idle Time"]: https://learn.microsoft.com/archive/blogs/askcore/windows-performance-monitor-disk-counters-explained#windows-performance-monitor-disk-counters-explained
func (m DiskIOTime) Add( func (m DiskIOTime) Add(
@@ -738,7 +737,6 @@ func (DiskOperationTime) Description() string {
// - Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec" // - Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec"
// perf counter (similar for Writes) // perf counter (similar for Writes)
// //
//
// [procfs-diskstats]: https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats // [procfs-diskstats]: https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats
func (m DiskOperationTime) Add( func (m DiskOperationTime) Add(
ctx context.Context, ctx context.Context,
@@ -1741,7 +1739,6 @@ func (NetworkDropped) Description() string {
// - Windows: [`InDiscards`/`OutDiscards`] // - Windows: [`InDiscards`/`OutDiscards`]
// from [`GetIfEntry2`] // from [`GetIfEntry2`]
// //
//
// [source]: https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html // [source]: https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html
// [`InDiscards`/`OutDiscards`]: https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2 // [`InDiscards`/`OutDiscards`]: https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2
// [`GetIfEntry2`]: https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2 // [`GetIfEntry2`]: https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2
@@ -1840,7 +1837,6 @@ func (NetworkErrors) Description() string {
// - Windows: [`InErrors`/`OutErrors`] // - Windows: [`InErrors`/`OutErrors`]
// from [`GetIfEntry2`]. // from [`GetIfEntry2`].
// //
//
// [source]: https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html // [source]: https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html
// [`InErrors`/`OutErrors`]: https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2 // [`InErrors`/`OutErrors`]: https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2
// [`GetIfEntry2`]: https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2 // [`GetIfEntry2`]: https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2
+16 -13
View File
@@ -941,18 +941,19 @@ func (RefLinesDelta) Description() string {
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical.
//
// This metric should be reported for each `vcs.line_change.type` value. For // This metric should be reported for each `vcs.line_change.type` value. For
// example if a ref added 3 lines and removed 2 lines, // example if a ref added 3 lines and removed 2 lines,
// instrumentation SHOULD report two measurements: 3 and 2 (both positive // instrumentation SHOULD report two measurements: 3 and 2 (both positive
// numbers). // numbers).
// If number of lines added/removed should be calculated from the start of time, // If number of lines added/removed should be calculated from the start of time,
// then `vcs.ref.base.name` SHOULD be set to an empty string. // then `vcs.ref.base.name` SHOULD be set to an empty string.
//
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical.
//
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
func (m RefLinesDelta) Record( func (m RefLinesDelta) Record(
ctx context.Context, ctx context.Context,
val int64, val int64,
@@ -1088,16 +1089,17 @@ func (RefRevisionsDelta) Description() string {
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical.
//
// This metric should be reported for each `vcs.revision_delta.direction` value. // This metric should be reported for each `vcs.revision_delta.direction` value.
// For example if branch `a` is 3 commits behind and 2 commits ahead of `trunk`, // For example if branch `a` is 3 commits behind and 2 commits ahead of `trunk`,
// instrumentation SHOULD report two measurements: 3 and 2 (both positive // instrumentation SHOULD report two measurements: 3 and 2 (both positive
// numbers) and `vcs.ref.base.name` is set to `trunk`. // numbers) and `vcs.ref.base.name` is set to `trunk`.
//
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical.
//
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
func (m RefRevisionsDelta) Record( func (m RefRevisionsDelta) Record(
ctx context.Context, ctx context.Context,
val int64, val int64,
@@ -1227,8 +1229,9 @@ func (RefTime) Description() string {
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// [reference]: https://git-scm.com/docs/gitglossary#def_ref // [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical. // [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical.
//
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
func (m RefTime) Record( func (m RefTime) Record(
ctx context.Context, ctx context.Context,
val float64, val float64,
+5 -3
View File
@@ -1228,7 +1228,8 @@ func AWSExtendedRequestID(val string) attribute.KeyValue {
// "aws.lambda.invoked_arn" semantic conventions. It represents the full invoked // "aws.lambda.invoked_arn" semantic conventions. It represents the full invoked
// ARN as provided on the `Context` passed to the function ( // ARN as provided on the `Context` passed to the function (
// `Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` // `Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next`
// applicable). //
// applicable).
func AWSLambdaInvokedARN(val string) attribute.KeyValue { func AWSLambdaInvokedARN(val string) attribute.KeyValue {
return AWSLambdaInvokedARNKey.String(val) return AWSLambdaInvokedARNKey.String(val)
} }
@@ -2347,7 +2348,8 @@ func CloudRegion(val string) attribute.KeyValue {
// "cloud.resource_id" semantic conventions. It represents the cloud // "cloud.resource_id" semantic conventions. It represents the cloud
// provider-specific native identifier of the monitored cloud resource (e.g. an // provider-specific native identifier of the monitored cloud resource (e.g. an
// [ARN] on AWS, a [fully qualified resource ID] on Azure, a [full resource name] // [ARN] on AWS, a [fully qualified resource ID] on Azure, a [full resource name]
// on GCP). //
// on GCP).
// //
// [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html // [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
// [fully qualified resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id // [fully qualified resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id
@@ -13564,4 +13566,4 @@ func WebEngineName(val string) attribute.KeyValue {
// engine. // engine.
func WebEngineVersion(val string) attribute.KeyValue { func WebEngineVersion(val string) attribute.KeyValue {
return WebEngineVersionKey.String(val) return WebEngineVersionKey.String(val)
} }
+3 -5
View File
@@ -46,11 +46,9 @@ var (
// with. // with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// CosmosDBClientActiveInstanceCount is an instrument used to record metric // CosmosDBClientActiveInstanceCount is an instrument used to record metric
// values conforming to the "azure.cosmosdb.client.active_instance.count" // values conforming to the "azure.cosmosdb.client.active_instance.count"
+3 -5
View File
@@ -84,11 +84,9 @@ var (
// with. // with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// PipelineRunActive is an instrument used to record metric values conforming to // PipelineRunActive is an instrument used to record metric values conforming to
// the "cicd.pipeline.run.active" semantic conventions. It represents the number // the "cicd.pipeline.run.active" semantic conventions. It represents the number
+3 -5
View File
@@ -238,11 +238,9 @@ var (
// with. // with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// ClientConnectionCount is an instrument used to record metric values conforming // ClientConnectionCount is an instrument used to record metric values conforming
// to the "db.client.connection.count" semantic conventions. It represents the // to the "db.client.connection.count" semantic conventions. It represents the
+3 -5
View File
@@ -25,11 +25,9 @@ var (
// conventions. It represents the describes the error the DNS lookup failed with. // conventions. It represents the describes the error the DNS lookup failed with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// LookupDuration is an instrument used to record metric values conforming to the // LookupDuration is an instrument used to record metric values conforming to the
// "dns.lookup.duration" semantic conventions. It represents the measures the // "dns.lookup.duration" semantic conventions. It represents the measures the
+3 -5
View File
@@ -26,11 +26,9 @@ var (
// with. // with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// OperationNameAttr is an attribute conforming to the gen_ai.operation.name // OperationNameAttr is an attribute conforming to the gen_ai.operation.name
// semantic conventions. It represents the name of the operation being performed. // semantic conventions. It represents the name of the operation being performed.
+12 -15
View File
@@ -26,11 +26,9 @@ var (
// with. // with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// ConnectionStateAttr is an attribute conforming to the http.connection.state // ConnectionStateAttr is an attribute conforming to the http.connection.state
// semantic conventions. It represents the state of the HTTP connection in the // semantic conventions. It represents the state of the HTTP connection in the
@@ -487,15 +485,15 @@ func (ClientRequestBodySize) Description() string {
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
//
// The size of the request payload body in bytes. This is the number of bytes // The size of the request payload body in bytes. This is the number of bytes
// transferred excluding headers and is often, but not always, present as the // transferred excluding headers and is often, but not always, present as the
// [Content-Length] header. For requests using transport encoding, this should be // [Content-Length] header. For requests using transport encoding, this should be
// the compressed size. // the compressed size.
// //
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length
//
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
func (m ClientRequestBodySize) Record( func (m ClientRequestBodySize) Record(
ctx context.Context, ctx context.Context,
val int64, val int64,
@@ -638,6 +636,7 @@ func (ClientRequestDuration) Description() string {
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin // ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
//
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin // ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
func (m ClientRequestDuration) Record( func (m ClientRequestDuration) Record(
ctx context.Context, ctx context.Context,
@@ -780,15 +779,15 @@ func (ClientResponseBodySize) Description() string {
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
//
// The size of the response payload body in bytes. This is the number of bytes // The size of the response payload body in bytes. This is the number of bytes
// transferred excluding headers and is often, but not always, present as the // transferred excluding headers and is often, but not always, present as the
// [Content-Length] header. For requests using transport encoding, this should be // [Content-Length] header. For requests using transport encoding, this should be
// the compressed size. // the compressed size.
// //
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length
//
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
func (m ClientResponseBodySize) Record( func (m ClientResponseBodySize) Record(
ctx context.Context, ctx context.Context,
val int64, val int64,
@@ -1026,13 +1025,12 @@ func (ServerRequestBodySize) Description() string {
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1
//
// The size of the request payload body in bytes. This is the number of bytes // The size of the request payload body in bytes. This is the number of bytes
// transferred excluding headers and is often, but not always, present as the // transferred excluding headers and is often, but not always, present as the
// [Content-Length] header. For requests using transport encoding, this should be // [Content-Length] header. For requests using transport encoding, this should be
// the compressed size. // the compressed size.
// //
// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1
// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length
func (m ServerRequestBodySize) Record( func (m ServerRequestBodySize) Record(
ctx context.Context, ctx context.Context,
@@ -1325,13 +1323,12 @@ func (ServerResponseBodySize) Description() string {
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1
//
// The size of the response payload body in bytes. This is the number of bytes // The size of the response payload body in bytes. This is the number of bytes
// transferred excluding headers and is often, but not always, present as the // transferred excluding headers and is often, but not always, present as the
// [Content-Length] header. For requests using transport encoding, this should be // [Content-Length] header. For requests using transport encoding, this should be
// the compressed size. // the compressed size.
// //
// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1
// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length
func (m ServerResponseBodySize) Record( func (m ServerResponseBodySize) Record(
ctx context.Context, ctx context.Context,
+8 -10
View File
@@ -25,11 +25,9 @@ var (
// conventions. It represents the type of error encountered by the component. // conventions. It represents the type of error encountered by the component.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// StateAttr is an attribute conforming to the hw.state semantic conventions. It // StateAttr is an attribute conforming to the hw.state semantic conventions. It
// represents the current state of the component. // represents the current state of the component.
@@ -134,7 +132,7 @@ func (Energy) Description() string {
// The id is the an identifier for the hardware component, unique within the // The id is the an identifier for the hardware component, unique within the
// monitored host // monitored host
// //
// The hwType is the type of the component // # The hwType is the type of the component
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
func (m Energy) Add( func (m Energy) Add(
@@ -232,7 +230,7 @@ func (Errors) Description() string {
// The id is the an identifier for the hardware component, unique within the // The id is the an identifier for the hardware component, unique within the
// monitored host // monitored host
// //
// The hwType is the type of the component // # The hwType is the type of the component
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
func (m Errors) Add( func (m Errors) Add(
@@ -723,7 +721,7 @@ func (Power) Description() string {
// The id is the an identifier for the hardware component, unique within the // The id is the an identifier for the hardware component, unique within the
// monitored host // monitored host
// //
// The hwType is the type of the component // # The hwType is the type of the component
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
@@ -823,9 +821,9 @@ func (Status) Description() string {
// The id is the an identifier for the hardware component, unique within the // The id is the an identifier for the hardware component, unique within the
// monitored host // monitored host
// //
// The state is the the current state of the component // # The state is the the current state of the component
// //
// The hwType is the type of the component // # The hwType is the type of the component
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
+3 -5
View File
@@ -26,11 +26,9 @@ var (
// with. // with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// OperationTypeAttr is an attribute conforming to the messaging.operation.type // OperationTypeAttr is an attribute conforming to the messaging.operation.type
// semantic conventions. It represents a string identifying the type of the // semantic conventions. It represents a string identifying the type of the
+3 -5
View File
@@ -26,11 +26,9 @@ var (
// with. // with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// ComponentTypeAttr is an attribute conforming to the otel.component.type // ComponentTypeAttr is an attribute conforming to the otel.component.type
// semantic conventions. It represents a name identifying the type of the // semantic conventions. It represents a name identifying the type of the
-4
View File
@@ -487,7 +487,6 @@ func (DiskIOTime) Description() string {
// ["Disk% Idle Time"] // ["Disk% Idle Time"]
// performance counter: `uptime * (100 - "Disk\% Idle Time") / 100` // performance counter: `uptime * (100 - "Disk\% Idle Time") / 100`
// //
//
// [procfs-diskstats]: https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats // [procfs-diskstats]: https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats
// ["Disk% Idle Time"]: https://learn.microsoft.com/archive/blogs/askcore/windows-performance-monitor-disk-counters-explained#windows-performance-monitor-disk-counters-explained // ["Disk% Idle Time"]: https://learn.microsoft.com/archive/blogs/askcore/windows-performance-monitor-disk-counters-explained#windows-performance-monitor-disk-counters-explained
func (m DiskIOTime) Add( func (m DiskIOTime) Add(
@@ -738,7 +737,6 @@ func (DiskOperationTime) Description() string {
// - Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec" // - Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec"
// perf counter (similar for Writes) // perf counter (similar for Writes)
// //
//
// [procfs-diskstats]: https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats // [procfs-diskstats]: https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats
func (m DiskOperationTime) Add( func (m DiskOperationTime) Add(
ctx context.Context, ctx context.Context,
@@ -1741,7 +1739,6 @@ func (NetworkDropped) Description() string {
// - Windows: [`InDiscards`/`OutDiscards`] // - Windows: [`InDiscards`/`OutDiscards`]
// from [`GetIfEntry2`] // from [`GetIfEntry2`]
// //
//
// [source]: https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html // [source]: https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html
// [`InDiscards`/`OutDiscards`]: https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2 // [`InDiscards`/`OutDiscards`]: https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2
// [`GetIfEntry2`]: https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2 // [`GetIfEntry2`]: https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2
@@ -1840,7 +1837,6 @@ func (NetworkErrors) Description() string {
// - Windows: [`InErrors`/`OutErrors`] // - Windows: [`InErrors`/`OutErrors`]
// from [`GetIfEntry2`]. // from [`GetIfEntry2`].
// //
//
// [source]: https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html // [source]: https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html
// [`InErrors`/`OutErrors`]: https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2 // [`InErrors`/`OutErrors`]: https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2
// [`GetIfEntry2`]: https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2 // [`GetIfEntry2`]: https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2
+16 -13
View File
@@ -941,18 +941,19 @@ func (RefLinesDelta) Description() string {
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical.
//
// This metric should be reported for each `vcs.line_change.type` value. For // This metric should be reported for each `vcs.line_change.type` value. For
// example if a ref added 3 lines and removed 2 lines, // example if a ref added 3 lines and removed 2 lines,
// instrumentation SHOULD report two measurements: 3 and 2 (both positive // instrumentation SHOULD report two measurements: 3 and 2 (both positive
// numbers). // numbers).
// If number of lines added/removed should be calculated from the start of time, // If number of lines added/removed should be calculated from the start of time,
// then `vcs.ref.base.name` SHOULD be set to an empty string. // then `vcs.ref.base.name` SHOULD be set to an empty string.
//
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical.
//
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
func (m RefLinesDelta) Record( func (m RefLinesDelta) Record(
ctx context.Context, ctx context.Context,
val int64, val int64,
@@ -1088,16 +1089,17 @@ func (RefRevisionsDelta) Description() string {
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical.
//
// This metric should be reported for each `vcs.revision_delta.direction` value. // This metric should be reported for each `vcs.revision_delta.direction` value.
// For example if branch `a` is 3 commits behind and 2 commits ahead of `trunk`, // For example if branch `a` is 3 commits behind and 2 commits ahead of `trunk`,
// instrumentation SHOULD report two measurements: 3 and 2 (both positive // instrumentation SHOULD report two measurements: 3 and 2 (both positive
// numbers) and `vcs.ref.base.name` is set to `trunk`. // numbers) and `vcs.ref.base.name` is set to `trunk`.
//
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical.
//
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
func (m RefRevisionsDelta) Record( func (m RefRevisionsDelta) Record(
ctx context.Context, ctx context.Context,
val int64, val int64,
@@ -1227,8 +1229,9 @@ func (RefTime) Description() string {
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// [reference]: https://git-scm.com/docs/gitglossary#def_ref // [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical. // [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical.
//
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
func (m RefTime) Record( func (m RefTime) Record(
ctx context.Context, ctx context.Context,
val float64, val float64,
+8 -4
View File
@@ -1370,9 +1370,11 @@ func AWSExtendedRequestID(val string) attribute.KeyValue {
// AWSKinesisStreamName returns an attribute KeyValue conforming to the // AWSKinesisStreamName returns an attribute KeyValue conforming to the
// "aws.kinesis.stream_name" semantic conventions. It represents the name of the // "aws.kinesis.stream_name" semantic conventions. It represents the name of the
// AWS Kinesis [stream] the request refers to. Corresponds to the `--stream-name` // AWS Kinesis [stream] the request refers to. Corresponds to the `--stream-name`
// parameter of the Kinesis [describe-stream] operation. //
// parameter of the Kinesis [describe-stream] operation.
// //
// [stream]: https://docs.aws.amazon.com/streams/latest/dev/introduction.html // [stream]: https://docs.aws.amazon.com/streams/latest/dev/introduction.html
//
// [describe-stream]: https://docs.aws.amazon.com/cli/latest/reference/kinesis/describe-stream.html // [describe-stream]: https://docs.aws.amazon.com/cli/latest/reference/kinesis/describe-stream.html
func AWSKinesisStreamName(val string) attribute.KeyValue { func AWSKinesisStreamName(val string) attribute.KeyValue {
return AWSKinesisStreamNameKey.String(val) return AWSKinesisStreamNameKey.String(val)
@@ -1382,7 +1384,8 @@ func AWSKinesisStreamName(val string) attribute.KeyValue {
// "aws.lambda.invoked_arn" semantic conventions. It represents the full invoked // "aws.lambda.invoked_arn" semantic conventions. It represents the full invoked
// ARN as provided on the `Context` passed to the function ( // ARN as provided on the `Context` passed to the function (
// `Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` // `Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next`
// applicable). //
// applicable).
func AWSLambdaInvokedARN(val string) attribute.KeyValue { func AWSLambdaInvokedARN(val string) attribute.KeyValue {
return AWSLambdaInvokedARNKey.String(val) return AWSLambdaInvokedARNKey.String(val)
} }
@@ -2561,7 +2564,8 @@ func CloudRegion(val string) attribute.KeyValue {
// "cloud.resource_id" semantic conventions. It represents the cloud // "cloud.resource_id" semantic conventions. It represents the cloud
// provider-specific native identifier of the monitored cloud resource (e.g. an // provider-specific native identifier of the monitored cloud resource (e.g. an
// [ARN] on AWS, a [fully qualified resource ID] on Azure, a [full resource name] // [ARN] on AWS, a [fully qualified resource ID] on Azure, a [full resource name]
// on GCP). //
// on GCP).
// //
// [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html // [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
// [fully qualified resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id // [fully qualified resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id
@@ -14058,4 +14062,4 @@ func WebEngineName(val string) attribute.KeyValue {
// engine. // engine.
func WebEngineVersion(val string) attribute.KeyValue { func WebEngineVersion(val string) attribute.KeyValue {
return WebEngineVersionKey.String(val) return WebEngineVersionKey.String(val)
} }
+3 -5
View File
@@ -46,11 +46,9 @@ var (
// with. // with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// CosmosDBClientActiveInstanceCount is an instrument used to record metric // CosmosDBClientActiveInstanceCount is an instrument used to record metric
// values conforming to the "azure.cosmosdb.client.active_instance.count" // values conforming to the "azure.cosmosdb.client.active_instance.count"
+3 -5
View File
@@ -84,11 +84,9 @@ var (
// with. // with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// PipelineRunActive is an instrument used to record metric values conforming to // PipelineRunActive is an instrument used to record metric values conforming to
// the "cicd.pipeline.run.active" semantic conventions. It represents the number // the "cicd.pipeline.run.active" semantic conventions. It represents the number
+3 -5
View File
@@ -238,11 +238,9 @@ var (
// with. // with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// ClientConnectionCount is an instrument used to record metric values conforming // ClientConnectionCount is an instrument used to record metric values conforming
// to the "db.client.connection.count" semantic conventions. It represents the // to the "db.client.connection.count" semantic conventions. It represents the
+3 -5
View File
@@ -25,11 +25,9 @@ var (
// conventions. It represents the describes the error the DNS lookup failed with. // conventions. It represents the describes the error the DNS lookup failed with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// LookupDuration is an instrument used to record metric values conforming to the // LookupDuration is an instrument used to record metric values conforming to the
// "dns.lookup.duration" semantic conventions. It represents the measures the // "dns.lookup.duration" semantic conventions. It represents the measures the
+3 -5
View File
@@ -26,11 +26,9 @@ var (
// with. // with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// OperationNameAttr is an attribute conforming to the gen_ai.operation.name // OperationNameAttr is an attribute conforming to the gen_ai.operation.name
// semantic conventions. It represents the name of the operation being performed. // semantic conventions. It represents the name of the operation being performed.
+12 -15
View File
@@ -26,11 +26,9 @@ var (
// with. // with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// ConnectionStateAttr is an attribute conforming to the http.connection.state // ConnectionStateAttr is an attribute conforming to the http.connection.state
// semantic conventions. It represents the state of the HTTP connection in the // semantic conventions. It represents the state of the HTTP connection in the
@@ -487,15 +485,15 @@ func (ClientRequestBodySize) Description() string {
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
//
// The size of the request payload body in bytes. This is the number of bytes // The size of the request payload body in bytes. This is the number of bytes
// transferred excluding headers and is often, but not always, present as the // transferred excluding headers and is often, but not always, present as the
// [Content-Length] header. For requests using transport encoding, this should be // [Content-Length] header. For requests using transport encoding, this should be
// the compressed size. // the compressed size.
// //
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length
//
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
func (m ClientRequestBodySize) Record( func (m ClientRequestBodySize) Record(
ctx context.Context, ctx context.Context,
val int64, val int64,
@@ -638,6 +636,7 @@ func (ClientRequestDuration) Description() string {
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin // ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
//
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin // ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
func (m ClientRequestDuration) Record( func (m ClientRequestDuration) Record(
ctx context.Context, ctx context.Context,
@@ -780,15 +779,15 @@ func (ClientResponseBodySize) Description() string {
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
//
// The size of the response payload body in bytes. This is the number of bytes // The size of the response payload body in bytes. This is the number of bytes
// transferred excluding headers and is often, but not always, present as the // transferred excluding headers and is often, but not always, present as the
// [Content-Length] header. For requests using transport encoding, this should be // [Content-Length] header. For requests using transport encoding, this should be
// the compressed size. // the compressed size.
// //
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length
//
// ["URI origin"]: https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin
func (m ClientResponseBodySize) Record( func (m ClientResponseBodySize) Record(
ctx context.Context, ctx context.Context,
val int64, val int64,
@@ -1026,13 +1025,12 @@ func (ServerRequestBodySize) Description() string {
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1
//
// The size of the request payload body in bytes. This is the number of bytes // The size of the request payload body in bytes. This is the number of bytes
// transferred excluding headers and is often, but not always, present as the // transferred excluding headers and is often, but not always, present as the
// [Content-Length] header. For requests using transport encoding, this should be // [Content-Length] header. For requests using transport encoding, this should be
// the compressed size. // the compressed size.
// //
// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1
// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length
func (m ServerRequestBodySize) Record( func (m ServerRequestBodySize) Record(
ctx context.Context, ctx context.Context,
@@ -1325,13 +1323,12 @@ func (ServerResponseBodySize) Description() string {
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1
//
// The size of the response payload body in bytes. This is the number of bytes // The size of the response payload body in bytes. This is the number of bytes
// transferred excluding headers and is often, but not always, present as the // transferred excluding headers and is often, but not always, present as the
// [Content-Length] header. For requests using transport encoding, this should be // [Content-Length] header. For requests using transport encoding, this should be
// the compressed size. // the compressed size.
// //
// [URI scheme]: https://www.rfc-editor.org/rfc/rfc3986#section-3.1
// [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length // [Content-Length]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length
func (m ServerResponseBodySize) Record( func (m ServerResponseBodySize) Record(
ctx context.Context, ctx context.Context,
+8 -10
View File
@@ -25,11 +25,9 @@ var (
// conventions. It represents the type of error encountered by the component. // conventions. It represents the type of error encountered by the component.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// StateAttr is an attribute conforming to the hw.state semantic conventions. It // StateAttr is an attribute conforming to the hw.state semantic conventions. It
// represents the current state of the component. // represents the current state of the component.
@@ -134,7 +132,7 @@ func (Energy) Description() string {
// The id is the an identifier for the hardware component, unique within the // The id is the an identifier for the hardware component, unique within the
// monitored host // monitored host
// //
// The hwType is the type of the component // # The hwType is the type of the component
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
func (m Energy) Add( func (m Energy) Add(
@@ -232,7 +230,7 @@ func (Errors) Description() string {
// The id is the an identifier for the hardware component, unique within the // The id is the an identifier for the hardware component, unique within the
// monitored host // monitored host
// //
// The hwType is the type of the component // # The hwType is the type of the component
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
func (m Errors) Add( func (m Errors) Add(
@@ -723,7 +721,7 @@ func (Power) Description() string {
// The id is the an identifier for the hardware component, unique within the // The id is the an identifier for the hardware component, unique within the
// monitored host // monitored host
// //
// The hwType is the type of the component // # The hwType is the type of the component
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
@@ -823,9 +821,9 @@ func (Status) Description() string {
// The id is the an identifier for the hardware component, unique within the // The id is the an identifier for the hardware component, unique within the
// monitored host // monitored host
// //
// The state is the the current state of the component // # The state is the the current state of the component
// //
// The hwType is the type of the component // # The hwType is the type of the component
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
+3 -5
View File
@@ -26,11 +26,9 @@ var (
// with. // with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// OperationTypeAttr is an attribute conforming to the messaging.operation.type // OperationTypeAttr is an attribute conforming to the messaging.operation.type
// semantic conventions. It represents a string identifying the type of the // semantic conventions. It represents a string identifying the type of the
+3 -5
View File
@@ -26,11 +26,9 @@ var (
// with. // with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// ComponentTypeAttr is an attribute conforming to the otel.component.type // ComponentTypeAttr is an attribute conforming to the otel.component.type
// semantic conventions. It represents a name identifying the type of the // semantic conventions. It represents a name identifying the type of the
-4
View File
@@ -487,7 +487,6 @@ func (DiskIOTime) Description() string {
// ["Disk% Idle Time"] // ["Disk% Idle Time"]
// performance counter: `uptime * (100 - "Disk\% Idle Time") / 100` // performance counter: `uptime * (100 - "Disk\% Idle Time") / 100`
// //
//
// [procfs-diskstats]: https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats // [procfs-diskstats]: https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats
// ["Disk% Idle Time"]: https://learn.microsoft.com/archive/blogs/askcore/windows-performance-monitor-disk-counters-explained#windows-performance-monitor-disk-counters-explained // ["Disk% Idle Time"]: https://learn.microsoft.com/archive/blogs/askcore/windows-performance-monitor-disk-counters-explained#windows-performance-monitor-disk-counters-explained
func (m DiskIOTime) Add( func (m DiskIOTime) Add(
@@ -738,7 +737,6 @@ func (DiskOperationTime) Description() string {
// - Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec" // - Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec"
// perf counter (similar for Writes) // perf counter (similar for Writes)
// //
//
// [procfs-diskstats]: https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats // [procfs-diskstats]: https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats
func (m DiskOperationTime) Add( func (m DiskOperationTime) Add(
ctx context.Context, ctx context.Context,
@@ -1741,7 +1739,6 @@ func (NetworkDropped) Description() string {
// - Windows: [`InDiscards`/`OutDiscards`] // - Windows: [`InDiscards`/`OutDiscards`]
// from [`GetIfEntry2`] // from [`GetIfEntry2`]
// //
//
// [source]: https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html // [source]: https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html
// [`InDiscards`/`OutDiscards`]: https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2 // [`InDiscards`/`OutDiscards`]: https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2
// [`GetIfEntry2`]: https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2 // [`GetIfEntry2`]: https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2
@@ -1840,7 +1837,6 @@ func (NetworkErrors) Description() string {
// - Windows: [`InErrors`/`OutErrors`] // - Windows: [`InErrors`/`OutErrors`]
// from [`GetIfEntry2`]. // from [`GetIfEntry2`].
// //
//
// [source]: https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html // [source]: https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html
// [`InErrors`/`OutErrors`]: https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2 // [`InErrors`/`OutErrors`]: https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2
// [`GetIfEntry2`]: https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2 // [`GetIfEntry2`]: https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2
+16 -13
View File
@@ -941,18 +941,19 @@ func (RefLinesDelta) Description() string {
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical.
//
// This metric should be reported for each `vcs.line_change.type` value. For // This metric should be reported for each `vcs.line_change.type` value. For
// example if a ref added 3 lines and removed 2 lines, // example if a ref added 3 lines and removed 2 lines,
// instrumentation SHOULD report two measurements: 3 and 2 (both positive // instrumentation SHOULD report two measurements: 3 and 2 (both positive
// numbers). // numbers).
// If number of lines added/removed should be calculated from the start of time, // If number of lines added/removed should be calculated from the start of time,
// then `vcs.ref.base.name` SHOULD be set to an empty string. // then `vcs.ref.base.name` SHOULD be set to an empty string.
//
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical.
//
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
func (m RefLinesDelta) Record( func (m RefLinesDelta) Record(
ctx context.Context, ctx context.Context,
val int64, val int64,
@@ -1088,16 +1089,17 @@ func (RefRevisionsDelta) Description() string {
// //
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical.
//
// This metric should be reported for each `vcs.revision_delta.direction` value. // This metric should be reported for each `vcs.revision_delta.direction` value.
// For example if branch `a` is 3 commits behind and 2 commits ahead of `trunk`, // For example if branch `a` is 3 commits behind and 2 commits ahead of `trunk`,
// instrumentation SHOULD report two measurements: 3 and 2 (both positive // instrumentation SHOULD report two measurements: 3 and 2 (both positive
// numbers) and `vcs.ref.base.name` is set to `trunk`. // numbers) and `vcs.ref.base.name` is set to `trunk`.
//
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical.
//
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
func (m RefRevisionsDelta) Record( func (m RefRevisionsDelta) Record(
ctx context.Context, ctx context.Context,
val int64, val int64,
@@ -1227,8 +1229,9 @@ func (RefTime) Description() string {
// All additional attrs passed are included in the recorded value. // All additional attrs passed are included in the recorded value.
// //
// [reference]: https://git-scm.com/docs/gitglossary#def_ref // [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
// [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical. // [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical.
//
// [reference]: https://git-scm.com/docs/gitglossary#def_ref
func (m RefTime) Record( func (m RefTime) Record(
ctx context.Context, ctx context.Context,
val float64, val float64,
+8 -4
View File
@@ -1370,9 +1370,11 @@ func AWSExtendedRequestID(val string) attribute.KeyValue {
// AWSKinesisStreamName returns an attribute KeyValue conforming to the // AWSKinesisStreamName returns an attribute KeyValue conforming to the
// "aws.kinesis.stream_name" semantic conventions. It represents the name of the // "aws.kinesis.stream_name" semantic conventions. It represents the name of the
// AWS Kinesis [stream] the request refers to. Corresponds to the `--stream-name` // AWS Kinesis [stream] the request refers to. Corresponds to the `--stream-name`
// parameter of the Kinesis [describe-stream] operation. //
// parameter of the Kinesis [describe-stream] operation.
// //
// [stream]: https://docs.aws.amazon.com/streams/latest/dev/introduction.html // [stream]: https://docs.aws.amazon.com/streams/latest/dev/introduction.html
//
// [describe-stream]: https://docs.aws.amazon.com/cli/latest/reference/kinesis/describe-stream.html // [describe-stream]: https://docs.aws.amazon.com/cli/latest/reference/kinesis/describe-stream.html
func AWSKinesisStreamName(val string) attribute.KeyValue { func AWSKinesisStreamName(val string) attribute.KeyValue {
return AWSKinesisStreamNameKey.String(val) return AWSKinesisStreamNameKey.String(val)
@@ -1382,7 +1384,8 @@ func AWSKinesisStreamName(val string) attribute.KeyValue {
// "aws.lambda.invoked_arn" semantic conventions. It represents the full invoked // "aws.lambda.invoked_arn" semantic conventions. It represents the full invoked
// ARN as provided on the `Context` passed to the function ( // ARN as provided on the `Context` passed to the function (
// `Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` // `Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next`
// applicable). //
// applicable).
func AWSLambdaInvokedARN(val string) attribute.KeyValue { func AWSLambdaInvokedARN(val string) attribute.KeyValue {
return AWSLambdaInvokedARNKey.String(val) return AWSLambdaInvokedARNKey.String(val)
} }
@@ -2558,7 +2561,8 @@ func CloudRegion(val string) attribute.KeyValue {
// "cloud.resource_id" semantic conventions. It represents the cloud // "cloud.resource_id" semantic conventions. It represents the cloud
// provider-specific native identifier of the monitored cloud resource (e.g. an // provider-specific native identifier of the monitored cloud resource (e.g. an
// [ARN] on AWS, a [fully qualified resource ID] on Azure, a [full resource name] // [ARN] on AWS, a [fully qualified resource ID] on Azure, a [full resource name]
// on GCP). //
// on GCP).
// //
// [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html // [ARN]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
// [fully qualified resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id // [fully qualified resource ID]: https://learn.microsoft.com/rest/api/resources/resources/get-by-id
@@ -14461,4 +14465,4 @@ func ZOSSmfID(val string) attribute.KeyValue {
// to which the z/OS system belongs too. // to which the z/OS system belongs too.
func ZOSSysplexName(val string) attribute.KeyValue { func ZOSSysplexName(val string) attribute.KeyValue {
return ZOSSysplexNameKey.String(val) return ZOSSysplexNameKey.String(val)
} }
+3 -5
View File
@@ -51,11 +51,9 @@ var (
// with. // with.
type ErrorTypeAttr string type ErrorTypeAttr string
var ( // ErrorTypeOther is a fallback error value to be used when the instrumentation
// ErrorTypeOther is a fallback error value to be used when the instrumentation // doesn't define a custom value.
// doesn't define a custom value. var ErrorTypeOther ErrorTypeAttr = "_OTHER"
ErrorTypeOther ErrorTypeAttr = "_OTHER"
)
// CosmosDBClientActiveInstanceCount is an instrument used to record metric // CosmosDBClientActiveInstanceCount is an instrument used to record metric
// values conforming to the "azure.cosmosdb.client.active_instance.count" // values conforming to the "azure.cosmosdb.client.active_instance.count"

Some files were not shown because too many files have changed in this diff Show More