Skip to content

Commit 88ba37f

Browse files
authored
Merge branch 'main' into trace_sdk_processor_metrics
2 parents fceaf98 + b7610a7 commit 88ba37f

File tree

139 files changed

+509
-467
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+509
-467
lines changed

.golangci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ linters:
9494
- dupArg
9595
- hugeParam
9696
- importShadow
97-
- paramTypeCombine
9897
- ptrToRefParam
9998
- preferDecodeRune
10099
- rangeValCopy
@@ -182,6 +181,7 @@ linters:
182181
- fmt.Print
183182
- fmt.Printf
184183
- fmt.Println
184+
- name: unused-parameter
185185
- name: unnecessary-stmt
186186
- name: use-any
187187
- name: useless-break
@@ -249,9 +249,11 @@ formatters:
249249
- goimports
250250
- golines
251251
settings:
252+
gofumpt:
253+
extra-rules: true
252254
goimports:
253255
local-prefixes:
254-
- go.opentelemetry.io
256+
- go.opentelemetry.io/otel
255257
golines:
256258
max-len: 120
257259
exclusions:

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,14 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
4141
- `RPCGRPCResponseMetadata`
4242
- Add `ErrorType` attribute helper function to the `go.opentelmetry.io/otel/semconv/v1.34.0` package. (#6962)
4343
- Add `WithAllowKeyDuplication` in `go.opentelemetry.io/otel/sdk/log` which can be used to disable deduplication for log records. (#6968)
44-
- Add `WithCardinalityLimit` option to configure the cardinality limit in `go.opentelemetry.io/otel/sdk/metric`. (#6996, #7065)
44+
- Add `WithCardinalityLimit` option to configure the cardinality limit in `go.opentelemetry.io/otel/sdk/metric`. (#6996, #7065, #7081)
4545
- Add `Clone` method to `Record` in `go.opentelemetry.io/otel/log` that returns a copy of the record with no shared state. (#7001)
4646
- The `go.opentelemetry.io/otel/semconv/v1.36.0` package.
4747
The package contains semantic conventions from the `v1.36.0` version of the OpenTelemetry Semantic Conventions.
4848
See the [migration documentation](./semconv/v1.36.0/MIGRATION.md) for information on how to upgrade from `go.opentelemetry.io/otel/semconv/v1.34.0.`(#7032)
49+
- Add experimental self-observability span metrics in `go.opentelemetry.io/otel/sdk/trace`.
50+
Check the `go.opentelemetry.io/otel/sdk/trace/internal/x` package documentation for more information. (#7027)
51+
- Add native histogram exemplar support in `go.opentelemetry.io/otel/exporters/prometheus`. (#6772)
4952
- Add experimental self-observability span and batch span processor metrics in `go.opentelemetry.io/otel/sdk/trace`.
5053
Check the `go.opentelemetry.io/otel/sdk/trace/internal/x` package documentation for more information. (#7027, #6393)
5154

@@ -55,6 +58,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
5558
- Change `SDKProcessorLogQueueCapacity`, `SDKProcessorLogQueueSize`, `SDKProcessorSpanQueueSize`, and `SDKProcessorSpanQueueCapacity` in `go.opentelemetry.io/otel/semconv/v1.36.0/otelconv` to use a `Int64ObservableUpDownCounter`. (#7041)
5659
- Change `DefaultExemplarReservoirProviderSelector` in `go.opentelemetry.io/otel/sdk/metric` to use `runtime.GOMAXPROCS(0)` instead of `runtime.NumCPU()` for the `FixedSizeReservoirProvider` default size. (#7094)
5760

61+
### Fixed
62+
63+
- Fix `go.opentelemetry.io/otel/exporters/prometheus` to deduplicate suffixes if already present in metric name when UTF8 is enabled. (#7088)
64+
5865
<!-- Released section -->
5966
<!-- Don't change this section unless doing release -->
6067

attribute/filter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type Filter func(KeyValue) bool
1616
// If keys is empty a deny-all filter is returned.
1717
func NewAllowKeysFilter(keys ...Key) Filter {
1818
if len(keys) == 0 {
19-
return func(kv KeyValue) bool { return false }
19+
return func(KeyValue) bool { return false }
2020
}
2121

2222
allowed := make(map[Key]struct{}, len(keys))
@@ -35,7 +35,7 @@ func NewAllowKeysFilter(keys ...Key) Filter {
3535
// If keys is empty an allow-all filter is returned.
3636
func NewDenyKeysFilter(keys ...Key) Filter {
3737
if len(keys) == 0 {
38-
return func(kv KeyValue) bool { return true }
38+
return func(KeyValue) bool { return true }
3939
}
4040

4141
forbid := make(map[Key]struct{}, len(keys))

attribute/set_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,21 +214,21 @@ func TestFiltering(t *testing.T) {
214214
{
215215
name: "None",
216216
in: []attribute.KeyValue{a, b, c},
217-
filter: func(kv attribute.KeyValue) bool { return false },
217+
filter: func(attribute.KeyValue) bool { return false },
218218
kept: nil,
219219
drop: []attribute.KeyValue{a, b, c},
220220
},
221221
{
222222
name: "All",
223223
in: []attribute.KeyValue{a, b, c},
224-
filter: func(kv attribute.KeyValue) bool { return true },
224+
filter: func(attribute.KeyValue) bool { return true },
225225
kept: []attribute.KeyValue{a, b, c},
226226
drop: nil,
227227
},
228228
{
229229
name: "Empty",
230230
in: []attribute.KeyValue{},
231-
filter: func(kv attribute.KeyValue) bool { return true },
231+
filter: func(attribute.KeyValue) bool { return true },
232232
kept: nil,
233233
drop: nil,
234234
},

bridge/opencensus/internal/oc2otel/span_context_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ import (
88

99
"github.com/stretchr/testify/assert"
1010
"go.opencensus.io/plugin/ochttp/propagation/tracecontext"
11-
12-
"go.opentelemetry.io/otel/bridge/opencensus/internal/otel2oc"
13-
1411
octrace "go.opencensus.io/trace"
1512
"go.opencensus.io/trace/tracestate"
1613

14+
"go.opentelemetry.io/otel/bridge/opencensus/internal/otel2oc"
1715
"go.opentelemetry.io/otel/trace"
1816
)
1917

bridge/opencensus/internal/otel2oc/span_context_test.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,12 @@ package otel2oc
66
import (
77
"testing"
88

9-
"go.opencensus.io/plugin/ochttp/propagation/tracecontext"
10-
11-
"go.opentelemetry.io/otel/bridge/opencensus/internal/oc2otel"
12-
139
"github.com/stretchr/testify/assert"
14-
15-
"go.opencensus.io/trace/tracestate"
16-
10+
"go.opencensus.io/plugin/ochttp/propagation/tracecontext"
1711
octrace "go.opencensus.io/trace"
12+
"go.opencensus.io/trace/tracestate"
1813

14+
"go.opentelemetry.io/otel/bridge/opencensus/internal/oc2otel"
1915
"go.opentelemetry.io/otel/trace"
2016
)
2117

bridge/opencensus/internal/span.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (s *Span) Annotatef(attributes []octrace.Attribute, format string, a ...any
8080
}
8181

8282
// AddMessageSendEvent adds a message send event to this span.
83-
func (s *Span) AddMessageSendEvent(messageID, uncompressedByteSize, compressedByteSize int64) {
83+
func (s *Span) AddMessageSendEvent(_, uncompressedByteSize, compressedByteSize int64) {
8484
s.otelSpan.AddEvent(MessageSendEvent,
8585
trace.WithAttributes(
8686
attribute.KeyValue{
@@ -95,7 +95,7 @@ func (s *Span) AddMessageSendEvent(messageID, uncompressedByteSize, compressedBy
9595
}
9696

9797
// AddMessageReceiveEvent adds a message receive event to this span.
98-
func (s *Span) AddMessageReceiveEvent(messageID, uncompressedByteSize, compressedByteSize int64) {
98+
func (s *Span) AddMessageReceiveEvent(_, uncompressedByteSize, compressedByteSize int64) {
9999
s.otelSpan.AddEvent(MessageReceiveEvent,
100100
trace.WithAttributes(
101101
attribute.KeyValue{

bridge/opencensus/metric.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type MetricProducer struct {
2323

2424
// NewMetricProducer returns a metric.Producer that fetches metrics from
2525
// OpenCensus.
26-
func NewMetricProducer(opts ...MetricOption) *MetricProducer {
26+
func NewMetricProducer(...MetricOption) *MetricProducer {
2727
return &MetricProducer{
2828
manager: metricproducer.GlobalManager(),
2929
}

bridge/opencensus/trace_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010

1111
"github.com/stretchr/testify/assert"
1212
"github.com/stretchr/testify/require"
13-
1413
octrace "go.opencensus.io/trace"
1514

1615
"go.opentelemetry.io/otel/sdk/trace"

bridge/opentracing/bridge.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,10 @@ var (
321321
func NewBridgeTracer() *BridgeTracer {
322322
return &BridgeTracer{
323323
setTracer: bridgeSetTracer{
324-
warningHandler: func(msg string) {},
324+
warningHandler: func(string) {},
325325
otelTracer: noopTracer,
326326
},
327-
warningHandler: func(msg string) {},
327+
warningHandler: func(string) {},
328328
propagator: nil,
329329
}
330330
}
@@ -647,7 +647,7 @@ func (s fakeSpan) SpanContext() trace.SpanContext {
647647
// interface.
648648
//
649649
// Currently only the HTTPHeaders and TextMap formats are supported.
650-
func (t *BridgeTracer) Inject(sm ot.SpanContext, format any, carrier any) error {
650+
func (t *BridgeTracer) Inject(sm ot.SpanContext, format, carrier any) error {
651651
bridgeSC, ok := sm.(*bridgeSpanContext)
652652
if !ok {
653653
return ot.ErrInvalidSpanContext
@@ -696,7 +696,7 @@ func (t *BridgeTracer) Inject(sm ot.SpanContext, format any, carrier any) error
696696
// interface.
697697
//
698698
// Currently only the HTTPHeaders and TextMap formats are supported.
699-
func (t *BridgeTracer) Extract(format any, carrier any) (ot.SpanContext, error) {
699+
func (t *BridgeTracer) Extract(format, carrier any) (ot.SpanContext, error) {
700700
builtinFormat, ok := format.(ot.BuiltinFormat)
701701
if !ok {
702702
return nil, ot.ErrUnsupportedFormat
@@ -763,7 +763,7 @@ func (t *textMapWrapper) Get(key string) string {
763763
return t.readerMap[key]
764764
}
765765

766-
func (t *textMapWrapper) Set(key string, value string) {
766+
func (t *textMapWrapper) Set(key, value string) {
767767
t.TextMapWriter.Set(key, value)
768768
}
769769

@@ -832,12 +832,12 @@ func newTextMapWrapperForInject(carrier any) (*textMapWrapper, error) {
832832

833833
type textMapWriter struct{}
834834

835-
func (t *textMapWriter) Set(key string, value string) {
835+
func (t *textMapWriter) Set(string, string) {
836836
// maybe print a warning log.
837837
}
838838

839839
type textMapReader struct{}
840840

841-
func (t *textMapReader) ForeachKey(handler func(key, val string) error) error {
841+
func (t *textMapReader) ForeachKey(func(string, string) error) error {
842842
return nil // maybe print a warning log.
843843
}

0 commit comments

Comments
 (0)