Skip to content

Commit afe82aa

Browse files
authored
Merge branch 'main' into telemetry-async-err-ch
2 parents 0623c6f + df99547 commit afe82aa

Some content is hidden

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

58 files changed

+1135
-1536
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
7+
component: service
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: remove custom code and instead use config package to instantiate meter provider.
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [11611]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# Optional: The change log or logs in which this entry should be included.
21+
# e.g. '[user]' or '[user, api]'
22+
# Include 'user' if the change is relevant to end users.
23+
# Include 'api' if there is a change to a library API.
24+
# Default: '[user]'
25+
change_logs: []
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: bug_fix
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
7+
component: mdatagen
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: apply fieldalignment to generated code
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [12125]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# Optional: The change log or logs in which this entry should be included.
21+
# e.g. '[user]' or '[user, api]'
22+
# Include 'user' if the change is relevant to end users.
23+
# Include 'api' if there is a change to a library API.
24+
# Default: '[user]'
25+
change_logs: []
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: deprecation
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
7+
component: component
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Deprecate `component.TelemetrySettings.MetricsLevel` in favor of using views and 'Enabled' method.
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [12159]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext: |
19+
- Components will temporarily need the service to support using views.
20+
21+
# Optional: The change log or logs in which this entry should be included.
22+
# e.g. '[user]' or '[user, api]'
23+
# Include 'user' if the change is relevant to end users.
24+
# Include 'api' if there is a change to a library API.
25+
# Default: '[user]'
26+
change_logs: [api]

cmd/mdatagen/internal/sampleprocessor/generated_component_test.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/mdatagen/internal/samplereceiver/generated_component_test.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/mdatagen/internal/samplescraper/generated_component_test.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/mdatagen/internal/templates/component_test.go.tmpl

+4-4
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ func TestComponentLifecycle(t *testing.T) {
171171
factory := NewFactory()
172172

173173
tests := []struct{
174-
name string
175174
createFn func(ctx context.Context, set processor.Settings, cfg component.Config) (component.Component, error)
175+
name string
176176
}{
177177
{{ if supportsLogs }}
178178
{
@@ -266,8 +266,8 @@ func TestComponentLifecycle(t *testing.T) {
266266
factory := NewFactory()
267267

268268
tests := []struct{
269-
name string
270269
createFn func(ctx context.Context, set receiver.Settings, cfg component.Config) (component.Component, error)
270+
name string
271271
}{
272272
{{ if supportsLogs }}
273273
{
@@ -335,8 +335,8 @@ func TestComponentLifecycle(t *testing.T) {
335335
factory := NewFactory()
336336

337337
tests := []struct{
338-
name string
339338
createFn func(ctx context.Context, set scraper.Settings, cfg component.Config) (component.Component, error)
339+
name string
340340
}{
341341
{{ if supportsLogs }}
342342
{
@@ -440,8 +440,8 @@ func TestComponentLifecycle(t *testing.T) {
440440
factory := NewFactory()
441441

442442
tests := []struct{
443-
name string
444443
createFn func(ctx context.Context, set connector.Settings, cfg component.Config) (component.Component, error)
444+
name string
445445
}{
446446
{{ if supportsLogsToLogs }}
447447
{

cmd/otelcorecol/go.mod

+9-8
Original file line numberDiff line numberDiff line change
@@ -123,26 +123,27 @@ require (
123123
go.opentelemetry.io/collector/semconv v0.118.0 // indirect
124124
go.opentelemetry.io/collector/service v0.118.0 // indirect
125125
go.opentelemetry.io/contrib/bridges/otelzap v0.9.0 // indirect
126-
go.opentelemetry.io/contrib/config v0.10.0 // indirect
126+
go.opentelemetry.io/contrib/config v0.14.0 // indirect
127127
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 // indirect
128128
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect
129129
go.opentelemetry.io/contrib/propagators/b3 v1.34.0 // indirect
130130
go.opentelemetry.io/contrib/zpages v0.59.0 // indirect
131131
go.opentelemetry.io/otel v1.34.0 // indirect
132-
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.7.0 // indirect
132+
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.10.0 // indirect
133+
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.10.0 // indirect
133134
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0 // indirect
134135
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.34.0 // indirect
135-
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0 // indirect
136-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.31.0 // indirect
137-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.31.0 // indirect
136+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect
137+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect
138+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0 // indirect
138139
go.opentelemetry.io/otel/exporters/prometheus v0.56.0 // indirect
139-
go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.7.0 // indirect
140+
go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.10.0 // indirect
140141
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.34.0 // indirect
141-
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.31.0 // indirect
142+
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.34.0 // indirect
142143
go.opentelemetry.io/otel/log v0.10.0 // indirect
143144
go.opentelemetry.io/otel/metric v1.34.0 // indirect
144145
go.opentelemetry.io/otel/sdk v1.34.0 // indirect
145-
go.opentelemetry.io/otel/sdk/log v0.7.0 // indirect
146+
go.opentelemetry.io/otel/sdk/log v0.10.0 // indirect
146147
go.opentelemetry.io/otel/sdk/metric v1.34.0 // indirect
147148
go.opentelemetry.io/otel/trace v1.34.0 // indirect
148149
go.opentelemetry.io/proto/otlp v1.5.0 // indirect

cmd/otelcorecol/go.sum

+18-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

component/componenttest/configtest.go

+3
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ func checkStructFieldTags(f reflect.StructField) error {
122122
default:
123123
fieldTag := tagParts[0]
124124
if !configFieldTagRegExp.MatchString(fieldTag) {
125+
if f.Name == "AdditionalProperties" {
126+
return nil
127+
}
125128
return fmt.Errorf(
126129
"field %q has config tag %q which doesn't satisfy %q",
127130
f.Name,

component/componenttest/nop_telemetry_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ func TestNewNopTelemetrySettings(t *testing.T) {
2222
assert.NotPanics(t, func() {
2323
nts.MeterProvider.Meter("test")
2424
})
25-
assert.Equal(t, configtelemetry.LevelNone, nts.MetricsLevel)
25+
assert.Equal(t, configtelemetry.LevelNone, nts.MetricsLevel) //nolint:staticcheck
2626
assert.Equal(t, 0, nts.Resource.Attributes().Len())
2727
}

component/componenttest/telemetry.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func NewTelemetry(opts ...TelemetryOption) Telemetry {
6868
func (tt *Telemetry) NewTelemetrySettings() component.TelemetrySettings {
6969
set := NewNopTelemetrySettings()
7070
set.MeterProvider = tt.meterProvider
71-
set.MetricsLevel = configtelemetry.LevelDetailed
71+
set.MetricsLevel = configtelemetry.LevelDetailed //nolint:staticcheck //SA1019
7272
set.TracerProvider = tt.traceProvider
7373
return set
7474
}

component/componenttest/telemetry_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func TestNewTelemetry(t *testing.T) {
2020
assert.NotNil(t, tel.Reader)
2121
assert.NotNil(t, tel.SpanRecorder)
2222
set := tel.NewTelemetrySettings()
23-
assert.Equal(t, configtelemetry.LevelDetailed, set.MetricsLevel)
23+
assert.Equal(t, configtelemetry.LevelDetailed, set.MetricsLevel) //nolint:staticcheck //SA1019
2424
assert.IsType(t, &sdktrace.TracerProvider{}, set.TracerProvider)
2525
assert.IsType(t, &sdkmetric.MeterProvider{}, set.MeterProvider)
2626
require.NoError(t, tel.Shutdown(context.Background()))

component/telemetry.go

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ type TelemetrySettings struct {
2727
// MetricsLevel represents the configuration value set when the collector
2828
// is configured. Components may use this level to decide whether it is
2929
// appropriate to avoid computationally expensive calculations.
30+
//
31+
// Deprecated: [v0.119.0] Use https://pkg.go.dev/go.opentelemetry.io/otel/sdk/[email protected]/internal/x#readme-instrument-enabled instead.
32+
// Components will temporarily need to add a view to `service/telemetry` to drop metrics based on the level.
3033
MetricsLevel configtelemetry.Level
3134

3235
// Resource contains the resource attributes for the collector's telemetry.

config/confighttp/confighttp_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
"go.opentelemetry.io/collector/config/configauth"
3030
"go.opentelemetry.io/collector/config/configcompression"
3131
"go.opentelemetry.io/collector/config/configopaque"
32-
"go.opentelemetry.io/collector/config/configtelemetry"
3332
"go.opentelemetry.io/collector/config/configtls"
3433
"go.opentelemetry.io/collector/extension/auth"
3534
"go.opentelemetry.io/collector/extension/auth/authtest"
@@ -49,7 +48,7 @@ var (
4948
dummyID = component.MustNewID("dummy")
5049
nonExistingID = component.MustNewID("nonexisting")
5150
// Omit TracerProvider and MeterProvider in TelemetrySettings as otelhttp.Transport cannot be introspected
52-
nilProvidersSettings = component.TelemetrySettings{Logger: zap.NewNop(), MetricsLevel: configtelemetry.LevelNone}
51+
nilProvidersSettings = component.TelemetrySettings{Logger: zap.NewNop()}
5352
)
5453

5554
func TestAllHTTPClientSettings(t *testing.T) {

config/confighttp/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ require (
1414
go.opentelemetry.io/collector/config/configauth v0.118.0
1515
go.opentelemetry.io/collector/config/configcompression v1.24.0
1616
go.opentelemetry.io/collector/config/configopaque v1.24.0
17-
go.opentelemetry.io/collector/config/configtelemetry v0.118.0
1817
go.opentelemetry.io/collector/config/configtls v1.24.0
1918
go.opentelemetry.io/collector/extension/auth v0.118.0
2019
go.opentelemetry.io/collector/extension/auth/authtest v0.118.0
@@ -35,6 +34,7 @@ require (
3534
github.com/google/uuid v1.6.0 // indirect
3635
github.com/pmezard/go-difflib v1.0.0 // indirect
3736
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
37+
go.opentelemetry.io/collector/config/configtelemetry v0.118.0 // indirect
3838
go.opentelemetry.io/collector/extension v0.118.0 // indirect
3939
go.opentelemetry.io/collector/pdata v1.24.0 // indirect
4040
go.opentelemetry.io/otel/metric v1.34.0 // indirect

connector/forwardconnector/generated_component_test.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)