Skip to content

Commit 361f3af

Browse files
authored
Merge branch 'main' into receiver/cloudfoundryreceiver
2 parents b6334c7 + 6c15654 commit 361f3af

File tree

560 files changed

+12202
-11514
lines changed

Some content is hidden

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

560 files changed

+12202
-11514
lines changed
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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. filelogreceiver)
7+
component: statsdreceiver
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: update statsd receiver to use mdatagen
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [33524]
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+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: []

.chloggen/codeboten_rm-deprecate.yaml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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: breaking
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: stanza
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: remove deprecated code
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [33519]
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+
This change removes:
20+
- adapter.LogEmitter, use helper.LogEmitter instead
21+
- adapter.NewLogEmitter, use helper.NewLogEmitter instead
22+
- fileconsumer.Manager's SugaredLogger struct member
23+
- pipeline.DirectedPipeline's SugaredLogger struct member
24+
- testutil.Logger, use zaptest.NewLogger instead
25+
26+
# If your change doesn't affect end users or the exported elements of any package,
27+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
28+
# Optional: The change log or logs in which this entry should be included.
29+
# e.g. '[user]' or '[user, api]'
30+
# Include 'user' if the change is relevant to end users.
31+
# Include 'api' if there is a change to a library API.
32+
# Default: '[user]'
33+
change_logs: [api]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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. filelogreceiver)
7+
component: elasticsearchexporter
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Add support for confighttp options, notably "auth".
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [33367]
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+
Add support for confighttp and related configuration settings, such as "auth".
20+
This change also means that the Elasticsearch URL may be specified as "endpoint",
21+
like the otlphttp exporter.
22+
23+
# If your change doesn't affect end users or the exported elements of any package,
24+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
25+
# Optional: The change log or logs in which this entry should be included.
26+
# e.g. '[user]' or '[user, api]'
27+
# Include 'user' if the change is relevant to end users.
28+
# Include 'api' if there is a change to a library API.
29+
# Default: '[user]'
30+
change_logs: [user]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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. filelogreceiver)
7+
component: exporter/datadog
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Prevents collector shut down when Datadog logs pipeline fails to validate API key
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [33195]
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+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: []
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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. filelogreceiver)
7+
component: cmd/opampsupervisor
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Receive and report effective config to the OpAMP server
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [30622]
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+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: []

.github/workflows/e2e-tests.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,8 @@ jobs:
120120
fail-fast: false
121121
matrix:
122122
k8s-version:
123-
- "v1.26.0"
124-
- "v1.25.3"
125-
- "v1.24.7"
126-
- "v1.23.13"
123+
- "v1.30.0"
124+
- "v1.23.17"
127125
component:
128126
- receiver/k8sclusterreceiver
129127
- processor/k8sattributesprocessor

cmd/githubgen/go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ go 1.21.0
44

55
require (
66
github.com/google/go-github/v62 v62.0.0
7-
go.opentelemetry.io/collector/confmap v0.102.2-0.20240606174409-6888f8f7a45f
8-
go.opentelemetry.io/collector/confmap/provider/fileprovider v0.102.2-0.20240606174409-6888f8f7a45f
7+
go.opentelemetry.io/collector/confmap v0.102.2-0.20240611143128-7dfb57b9ad1c
8+
go.opentelemetry.io/collector/confmap/provider/fileprovider v0.102.2-0.20240611143128-7dfb57b9ad1c
99
gopkg.in/yaml.v3 v3.0.1
1010
)
1111

cmd/githubgen/go.sum

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

cmd/opampsupervisor/e2e_test.go

+85-7
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (tl testLogger) Errorf(_ context.Context, format string, args ...any) {
5656
}
5757

5858
func defaultConnectingHandler(connectionCallbacks server.ConnectionCallbacksStruct) func(request *http.Request) types.ConnectionResponse {
59-
return func(request *http.Request) types.ConnectionResponse {
59+
return func(_ *http.Request) types.ConnectionResponse {
6060
return types.ConnectionResponse{
6161
Accept: true,
6262
ConnectionCallbacks: connectionCallbacks,
@@ -125,7 +125,8 @@ func newOpAMPServer(t *testing.T, connectingCallback onConnectingFuncFactory, ca
125125
require.Fail(t, "Agent connection has not been established")
126126
}
127127

128-
agentConn.Load().(types.Connection).Send(context.Background(), msg)
128+
err = agentConn.Load().(types.Connection).Send(context.Background(), msg)
129+
require.NoError(t, err)
129130
}
130131
t.Cleanup(func() {
131132
shutdown()
@@ -217,8 +218,9 @@ func TestSupervisorStartsCollectorWithRemoteConfig(t *testing.T) {
217218
cfg, ok := agentConfig.Load().(string)
218219
if ok {
219220
// The effective config may be structurally different compared to what was sent,
220-
// so just check that it includes some strings we know to be unique to the remote config.
221-
return strings.Contains(cfg, inputFile.Name()) && strings.Contains(cfg, outputFile.Name())
221+
// and will also have some data redacted,
222+
// so just check that it includes the filelog receiver
223+
return strings.Contains(cfg, "filelog")
222224
}
223225

224226
return false
@@ -340,9 +342,9 @@ func TestSupervisorConfiguresCapabilities(t *testing.T) {
340342
waitForSupervisorConnection(server.supervisorConnected, true)
341343

342344
require.Eventually(t, func() bool {
343-
cap := capabilities.Load()
345+
caps := capabilities.Load()
344346

345-
return cap == uint64(protobufs.AgentCapabilities_AgentCapabilities_ReportsStatus)
347+
return caps == uint64(protobufs.AgentCapabilities_AgentCapabilities_ReportsStatus)
346348
}, 5*time.Second, 250*time.Millisecond)
347349
}
348350

@@ -418,6 +420,82 @@ func TestSupervisorBootstrapsCollector(t *testing.T) {
418420
}, 5*time.Second, 250*time.Millisecond)
419421
}
420422

423+
func TestSupervisorReportsEffectiveConfig(t *testing.T) {
424+
var agentConfig atomic.Value
425+
server := newOpAMPServer(
426+
t,
427+
defaultConnectingHandler,
428+
server.ConnectionCallbacksStruct{
429+
OnMessageFunc: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent {
430+
if message.EffectiveConfig != nil {
431+
config := message.EffectiveConfig.ConfigMap.ConfigMap[""]
432+
if config != nil {
433+
agentConfig.Store(string(config.Body))
434+
}
435+
}
436+
437+
return &protobufs.ServerToAgent{}
438+
},
439+
})
440+
441+
s := newSupervisor(t, "basic", map[string]string{"url": server.addr})
442+
defer s.Shutdown()
443+
444+
waitForSupervisorConnection(server.supervisorConnected, true)
445+
446+
// Create input and output files so we can "communicate" with a Collector binary.
447+
// The testing package will automatically clean these up after each test.
448+
tempDir := t.TempDir()
449+
testKeyFile, err := os.CreateTemp(tempDir, "confKey")
450+
require.NoError(t, err)
451+
n, err := testKeyFile.Write([]byte(testKeyFile.Name()))
452+
require.NoError(t, err)
453+
require.NotZero(t, n)
454+
455+
colCfgTpl, err := os.ReadFile(path.Join("testdata", "collector", "split_config.yaml"))
456+
require.NoError(t, err)
457+
458+
templ, err := template.New("").Parse(string(colCfgTpl))
459+
require.NoError(t, err)
460+
461+
var cfg bytes.Buffer
462+
err = templ.Execute(
463+
&cfg,
464+
map[string]string{
465+
"TestKeyFile": testKeyFile.Name(),
466+
},
467+
)
468+
require.NoError(t, err)
469+
470+
h := sha256.New()
471+
if _, err := io.Copy(h, bytes.NewBuffer(cfg.Bytes())); err != nil {
472+
t.Fatal(err)
473+
}
474+
475+
server.sendToSupervisor(&protobufs.ServerToAgent{
476+
RemoteConfig: &protobufs.AgentRemoteConfig{
477+
Config: &protobufs.AgentConfigMap{
478+
ConfigMap: map[string]*protobufs.AgentConfigFile{
479+
"": {Body: cfg.Bytes()},
480+
},
481+
},
482+
ConfigHash: h.Sum(nil),
483+
},
484+
})
485+
486+
require.Eventually(t, func() bool {
487+
cfg, ok := agentConfig.Load().(string)
488+
if ok {
489+
// The effective config may be structurally different compared to what was sent,
490+
// and currently has most values redacted,
491+
// so just check that it includes some strings we know to be unique to the remote config.
492+
return strings.Contains(cfg, "test_key:")
493+
}
494+
495+
return false
496+
}, 5*time.Second, 500*time.Millisecond, "Collector never reported effective config")
497+
}
498+
421499
func TestSupervisorAgentDescriptionConfigApplies(t *testing.T) {
422500
// Load the Supervisor config so we can get the location of
423501
// the Collector that will be run.
@@ -673,7 +751,7 @@ func TestSupervisorOpAMPConnectionSettings(t *testing.T) {
673751
OnConnectedFunc: func(_ context.Context, _ types.Connection) {
674752
connectedToNewServer.Store(true)
675753
},
676-
OnMessageFunc: func(_ context.Context, _ types.Connection, message *protobufs.AgentToServer) *protobufs.ServerToAgent {
754+
OnMessageFunc: func(_ context.Context, _ types.Connection, _ *protobufs.AgentToServer) *protobufs.ServerToAgent {
677755
return &protobufs.ServerToAgent{}
678756
},
679757
})

cmd/opampsupervisor/examples/supervisor_darwin.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ server:
33
tls:
44
# Disable verification to test locally.
55
# Don't do this in production.
6-
insecure_skip_verify: true
6+
insecure_skip_verify: true
77
# For more TLS settings see config/configtls.ClientConfig
88

99
capabilities:
@@ -15,3 +15,6 @@ capabilities:
1515

1616
agent:
1717
executable: ../../bin/otelcontribcol_darwin_amd64
18+
19+
storage:
20+
directory: .

cmd/opampsupervisor/examples/supervisor_linux.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ server:
33
tls:
44
# Disable verification to test locally.
55
# Don't do this in production.
6-
insecure_skip_verify: true
6+
insecure_skip_verify: true
77
# For more TLS settings see config/configtls.ClientConfig
88

99
capabilities:
@@ -15,3 +15,6 @@ capabilities:
1515

1616
agent:
1717
executable: ../../bin/otelcontribcol_linux_amd64
18+
19+
storage:
20+
directory: .

cmd/opampsupervisor/examples/supervisor_windows.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ server:
33
tls:
44
# Disable verification to test locally.
55
# Don't do this in production.
6-
insecure_skip_verify: true
6+
insecure_skip_verify: true
77
# For more TLS settings see config/configtls.ClientConfig
88

99
capabilities:
@@ -15,3 +15,6 @@ capabilities:
1515

1616
agent:
1717
executable: ../../bin/otelcontribcol_windows_amd64.exe
18+
19+
storage:
20+
directory: .

cmd/opampsupervisor/go.mod

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@ go 1.21.0
55
require (
66
github.com/cenkalti/backoff/v4 v4.3.0
77
github.com/google/uuid v1.6.0
8+
github.com/knadh/koanf/maps v0.1.1
89
github.com/knadh/koanf/parsers/yaml v0.1.0
910
github.com/knadh/koanf/providers/file v0.1.0
1011
github.com/knadh/koanf/providers/rawbytes v0.1.0
1112
github.com/knadh/koanf/v2 v2.1.1
1213
github.com/open-telemetry/opamp-go v0.15.0
1314
github.com/stretchr/testify v1.9.0
14-
go.opentelemetry.io/collector/config/configopaque v1.9.1-0.20240606174409-6888f8f7a45f
15-
go.opentelemetry.io/collector/config/configtls v0.102.2-0.20240606174409-6888f8f7a45f
16-
go.opentelemetry.io/collector/semconv v0.102.2-0.20240606174409-6888f8f7a45f
15+
go.opentelemetry.io/collector/config/configopaque v1.9.1-0.20240611143128-7dfb57b9ad1c
16+
go.opentelemetry.io/collector/config/configtls v0.102.2-0.20240611143128-7dfb57b9ad1c
17+
go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c
1718
go.uber.org/goleak v1.3.0
1819
go.uber.org/zap v1.27.0
1920
google.golang.org/protobuf v1.34.2
@@ -26,7 +27,6 @@ require (
2627
github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
2728
github.com/google/go-cmp v0.6.0 // indirect
2829
github.com/gorilla/websocket v1.5.1 // indirect
29-
github.com/knadh/koanf/maps v0.1.1 // indirect
3030
github.com/mitchellh/copystructure v1.2.0 // indirect
3131
github.com/mitchellh/reflectwalk v1.0.2 // indirect
3232
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect

0 commit comments

Comments
 (0)