@@ -28,6 +28,7 @@ import (
2828 "go.opentelemetry.io/collector/component"
2929 "go.opentelemetry.io/collector/component/componenttest"
3030 "go.opentelemetry.io/collector/config/confighttp"
31+ "go.opentelemetry.io/collector/config/configoptional"
3132 "go.opentelemetry.io/collector/config/configretry"
3233 "go.opentelemetry.io/collector/config/configtls"
3334 "go.opentelemetry.io/collector/consumer/consumererror"
@@ -56,7 +57,7 @@ func Test_NewPRWExporter(t *testing.T) {
5657 Namespace : "" ,
5758 ExternalLabels : map [string ]string {},
5859 ClientConfig : confighttp .NewDefaultClientConfig (),
59- TargetInfo : & TargetInfo {
60+ TargetInfo : TargetInfo {
6061 Enabled : true ,
6162 },
6263 }
@@ -150,7 +151,7 @@ func Test_Start(t *testing.T) {
150151 MaxBatchSizeBytes : 3000000 ,
151152 Namespace : "" ,
152153 ExternalLabels : map [string ]string {},
153- TargetInfo : & TargetInfo {
154+ TargetInfo : TargetInfo {
154155 Enabled : true ,
155156 },
156157 }
@@ -740,7 +741,7 @@ func Test_PushMetrics(t *testing.T) {
740741 ClientConfig : clientConfig ,
741742 MaxBatchSizeBytes : 3000000 ,
742743 RemoteWriteQueue : RemoteWriteQueue {NumConsumers : 1 },
743- TargetInfo : & TargetInfo {
744+ TargetInfo : TargetInfo {
744745 Enabled : true ,
745746 },
746747 BackOffConfig : retrySettings ,
@@ -756,9 +757,9 @@ func Test_PushMetrics(t *testing.T) {
756757 }
757758
758759 if useWAL {
759- cfg .WAL = & WALConfig {
760+ cfg .WAL = configoptional . Some ( WALConfig {
760761 Directory : t .TempDir (),
761- }
762+ })
762763 }
763764
764765 assert .NotNil (t , cfg )
@@ -969,11 +970,11 @@ func TestWALOnExporterRoundTrip(t *testing.T) {
969970 Namespace : "test_ns" ,
970971 ClientConfig : clientConfig ,
971972 RemoteWriteQueue : RemoteWriteQueue {NumConsumers : 1 },
972- WAL : & WALConfig {
973+ WAL : configoptional . Some ( WALConfig {
973974 Directory : tempDir ,
974975 BufferSize : 1 ,
975- },
976- TargetInfo : & TargetInfo {
976+ }) ,
977+ TargetInfo : TargetInfo {
977978 Enabled : true ,
978979 },
979980 }
@@ -1017,7 +1018,7 @@ func TestWALOnExporterRoundTrip(t *testing.T) {
10171018
10181019 // 3. Let's now read back all of the WAL records and ensure
10191020 // that all the prompb.WriteRequest values exist as we sent them.
1020- wal , _ , werr := cfg .WAL .createWAL ()
1021+ wal , _ , werr := cfg .WAL .Get (). createWAL ()
10211022 assert .NoError (t , werr )
10221023 assert .NotNil (t , wal )
10231024 t .Cleanup (func () {
@@ -1350,7 +1351,7 @@ func benchmarkPushMetrics(b *testing.B, numMetrics, numConsumers int) {
13501351 MaxBatchSizeBytes : 3000 ,
13511352 RemoteWriteQueue : RemoteWriteQueue {NumConsumers : numConsumers },
13521353 BackOffConfig : retrySettings ,
1353- TargetInfo : & TargetInfo {Enabled : true },
1354+ TargetInfo : TargetInfo {Enabled : true },
13541355 }
13551356 exporter , err := newPRWExporter (cfg , set )
13561357 require .NoError (b , err )
0 commit comments