Skip to content

Commit 9e6cbfa

Browse files
authored
Merge branch 'main' into upgrade_otelcol_chef
2 parents d30cbd8 + 602f284 commit 9e6cbfa

File tree

8 files changed

+64
-14
lines changed

8 files changed

+64
-14
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
- A common replacement for Fluentd's functionality is the [filelog receiver](https://help.splunk.com/en/splunk-observability-cloud/manage-data/available-data-sources/supported-integrations-in-splunk-observability-cloud/opentelemetry-receivers/filelog-receiver).
1010
Many common configuration examples of the `filelog` receiver can be found in the [logs_config_linux.yaml](https://github.com/signalfx/splunk-otel-collector/blob/87bee7ae45b08be8d143a758d0f7004fd92d8f60/cmd/otelcol/config/collector/logs_config_linux.yaml) file.
1111

12+
### 💡 Enhancements 💡
13+
14+
- (Splunk) Add an install property, `COLLECTOR_SVC_ARGS`, to the Windows MSI to
15+
configure the command-line arguments used to launch the collector service on Windows.
16+
1217
## v0.126.0
1318

1419
This Splunk OpenTelemetry Collector release includes changes from the [opentelemetry-collector v0.126.0](https://github.com/open-telemetry/opentelemetry-collector/releases/tag/v0.126.0)

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/alecthomas/participle/v2 v2.1.4
77
github.com/antonmedv/expr v1.15.5
88
github.com/cenkalti/backoff/v4 v4.3.0
9-
github.com/expr-lang/expr v1.17.3
9+
github.com/expr-lang/expr v1.17.4
1010
github.com/fsnotify/fsnotify v1.9.0
1111
github.com/go-zookeeper/zk v1.0.4
1212
github.com/gogo/protobuf v1.3.2
@@ -128,7 +128,7 @@ require (
128128
github.com/signalfx/splunk-otel-collector/pkg/processor/timestampprocessor v0.83.0
129129
github.com/signalfx/splunk-otel-collector/pkg/receiver/smartagentreceiver v0.0.0-00010101000000-000000000000
130130
github.com/signalfx/splunk-otel-collector/tests v0.83.0
131-
github.com/spf13/cast v1.8.0
131+
github.com/spf13/cast v1.9.1
132132
github.com/spf13/pflag v1.0.6
133133
github.com/stretchr/testify v1.10.0
134134
go.etcd.io/bbolt v1.4.0

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,8 @@ github.com/euank/go-kmsg-parser v2.0.0+incompatible h1:cHD53+PLQuuQyLZeriD1V/esu
502502
github.com/euank/go-kmsg-parser v2.0.0+incompatible/go.mod h1:MhmAMZ8V4CYH4ybgdRwPr2TU5ThnS43puaKEMpja1uw=
503503
github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU=
504504
github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM=
505-
github.com/expr-lang/expr v1.17.3 h1:myeTTuDFz7k6eFe/JPlep/UsiIjVhG61FMHFu63U7j0=
506-
github.com/expr-lang/expr v1.17.3/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4=
505+
github.com/expr-lang/expr v1.17.4 h1:qhTVftZ2Z3WpOEXRHWErEl2xf1Kq011MnQmWgLq06CY=
506+
github.com/expr-lang/expr v1.17.4/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4=
507507
github.com/facebook/time v0.0.0-20240510113249-fa89cc575891 h1:x6T9k2Jw0IPzSdM2i4tVWmnJ3KJ1fEKwWJ++IzDvPDU=
508508
github.com/facebook/time v0.0.0-20240510113249-fa89cc575891/go.mod h1:2UFAomOuD2vAK1x68czUtCVjAqmyWCEnAXOlmGqf+G0=
509509
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A=
@@ -1852,8 +1852,8 @@ github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2
18521852
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
18531853
github.com/spf13/afero v1.2.1/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
18541854
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
1855-
github.com/spf13/cast v1.8.0 h1:gEN9K4b8Xws4EX0+a0reLmhq8moKn7ntRlQYgjPeCDk=
1856-
github.com/spf13/cast v1.8.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
1855+
github.com/spf13/cast v1.9.1 h1:LxnjuHJpEjFUlBvGDef9duW2jIfjfm9a2f4tCgyvsEw=
1856+
github.com/spf13/cast v1.9.1/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=
18571857
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
18581858
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
18591859
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=

packaging/bundle/java/jmx/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@
5151
<dependency>
5252
<groupId>org.codehaus.groovy</groupId>
5353
<artifactId>groovy</artifactId>
54-
<version>3.0.24</version>
54+
<version>3.0.25</version>
5555
</dependency>
5656
<dependency>
5757
<groupId>org.codehaus.groovy</groupId>
5858
<artifactId>groovy-jmx</artifactId>
59-
<version>3.0.24</version>
59+
<version>3.0.25</version>
6060
</dependency>
6161
<dependency>
6262
<groupId>org.apache.commons</groupId>

packaging/msi/splunk-otel-collector.wxs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
Execute="deferred"
2424
Impersonate="no" />
2525

26+
<!-- Following name convention for this property to match upstream -->
27+
<!-- On upstream it is required and has a default value, here it is optional -->
28+
<Property Id="COLLECTOR_SVC_ARGS" Secure="yes" />
29+
2630
<!-- SPLUNK setup control properties -->
2731
<Property Id="SPLUNK_SETUP_COLLECTOR_MODE" Value="agent" Secure="yes" />
2832

@@ -79,6 +83,7 @@
7983
Start="auto"
8084
Account="LocalSystem"
8185
ErrorControl="normal"
86+
Arguments="[COLLECTOR_SVC_ARGS]"
8287
Interactive="no" />
8388
<ServiceControl
8489
Id="StartStopRemoveService"

packaging/release/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
PyGithub==2.6.1
2-
boto3==1.38.23
2+
boto3==1.38.27
33
docker==7.1.0
44
requests==2.32.3

packaging/tests/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ iterators==0.2.0
33
psutil==7.0.0
44
pytest==8.3.5
55
pytest-html==4.1.1
6-
pytest-xdist==3.6.1
6+
pytest-xdist==3.7.0
77
py>=1.8.2
88
requests<2.33.0
99
six==1.17.0

tests/msi/msi_test.go

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ func TestMSI(t *testing.T) {
5252
"SPLUNK_ACCESS_TOKEN": "fakeToken",
5353
},
5454
},
55+
{
56+
name: "default-plus-cli-args",
57+
collectorMSIProperties: map[string]string{
58+
"SPLUNK_ACCESS_TOKEN": "fakeToken",
59+
"COLLECTOR_SVC_ARGS": "--discovery --set=processors.batch.timeout=10s",
60+
},
61+
},
5562
{
5663
name: "gateway",
5764
collectorMSIProperties: map[string]string{
@@ -205,10 +212,13 @@ func runMsiTest(t *testing.T, test msiTest, msiInstallerPath string) {
205212
return status.State == svc.Running
206213
}, 10*time.Second, 500*time.Millisecond, "Failed to start the service")
207214

208-
assertServiceConfiguration(t, test.collectorMSIProperties)
215+
svcConfig, err := service.Config()
216+
require.NoError(t, err, "Failed to get service configuration")
217+
218+
assertServiceConfiguration(t, test.collectorMSIProperties, svcConfig)
209219
}
210220

211-
func assertServiceConfiguration(t *testing.T, msiProperties map[string]string) {
221+
func assertServiceConfiguration(t *testing.T, msiProperties map[string]string, svcConfig mgr.Config) {
212222
programDataDir := os.Getenv("PROGRAMDATA")
213223
require.NotEmpty(t, programDataDir, "PROGRAMDATA environment variable is not set")
214224
programFilesDir := os.Getenv("PROGRAMFILES")
@@ -241,8 +251,12 @@ func assertServiceConfiguration(t *testing.T, msiProperties map[string]string) {
241251
}
242252

243253
// Verify the environment variables set for the service
244-
svcConfig := getServiceEnvVars(t, "splunk-otel-collector")
245-
assert.Equal(t, expectedEnvVars, svcConfig)
254+
svcEnvVars := getServiceEnvVars(t, "splunk-otel-collector")
255+
assert.Equal(t, expectedEnvVars, svcEnvVars)
256+
257+
if svcArgs, ok := msiProperties["COLLECTOR_SVC_ARGS"]; ok {
258+
assert.Equal(t, expectedServiceCommand(t, svcArgs), svcConfig.BinaryPathName)
259+
}
246260
}
247261

248262
func optionalInstallPropertyOrDefault(msiProperties map[string]string, key, defaultValue string) string {
@@ -282,3 +296,29 @@ func getInstallerPath(t *testing.T) string {
282296
}
283297
return msiInstallerPath
284298
}
299+
300+
func expectedServiceCommand(t *testing.T, collectorServiceArgs string) string {
301+
programFilesDir := os.Getenv("PROGRAMFILES")
302+
require.NotEmpty(t, programFilesDir, "PROGRAMFILES environment variable is not set")
303+
304+
collectorDir := filepath.Join(programFilesDir, "Splunk", "OpenTelemetry Collector")
305+
collectorExe := filepath.Join(collectorDir, "otelcol") + ".exe"
306+
307+
if collectorServiceArgs == "" {
308+
return quotedIfRequired(collectorExe)
309+
}
310+
311+
// Remove any quotation added for the msiexec command line
312+
collectorServiceArgs = strings.Trim(collectorServiceArgs, "\"")
313+
collectorServiceArgs = strings.ReplaceAll(collectorServiceArgs, "\"\"", "\"")
314+
315+
return quotedIfRequired(collectorExe) + " " + collectorServiceArgs
316+
}
317+
318+
func quotedIfRequired(s string) string {
319+
if strings.Contains(s, "\"") || strings.Contains(s, " ") {
320+
s = strings.ReplaceAll(s, "\"", "\"\"")
321+
return "\"" + s + "\""
322+
}
323+
return s
324+
}

0 commit comments

Comments
 (0)