@@ -14,6 +14,7 @@ import (
14
14
"github.com/stretchr/testify/assert"
15
15
"go.opentelemetry.io/collector/component"
16
16
"go.opentelemetry.io/collector/otelcol"
17
+ "go.opentelemetry.io/collector/pipeline"
17
18
"go.opentelemetry.io/collector/service"
18
19
"go.opentelemetry.io/collector/service/pipelines"
19
20
@@ -23,16 +24,15 @@ import (
23
24
)
24
25
25
26
func TestSetComponents (t * testing.T ) {
26
- metricsType , _ := component .NewType ("metrics" )
27
27
telegrafCPUType , _ := component .NewType (adapter .TelegrafPrefix + "cpu" )
28
28
prometheusType , _ := component .NewType ("prometheus" )
29
29
batchType , _ := component .NewType ("batch" )
30
30
filterType , _ := component .NewType ("filter" )
31
31
cloudwatchType , _ := component .NewType ("cloudwatch" )
32
32
otelCfg := & otelcol.Config {
33
33
Service : service.Config {
34
- Pipelines : map [component .ID ]* pipelines.PipelineConfig {
35
- component .NewID (metricsType ): {
34
+ Pipelines : map [pipeline .ID ]* pipelines.PipelineConfig {
35
+ pipeline .NewID (pipeline . SignalMetrics ): {
36
36
Receivers : []component.ID {
37
37
component .NewID (telegrafCPUType ),
38
38
component .NewID (prometheusType ),
@@ -108,13 +108,12 @@ func TestAlternateUserAgent(t *testing.T) {
108
108
}
109
109
110
110
func TestEmf (t * testing.T ) {
111
- metricsType , _ := component .NewType ("metrics" )
112
111
nopType , _ := component .NewType ("nop" )
113
112
awsEMFType , _ := component .NewType ("awsemf" )
114
113
otelCfg := & otelcol.Config {
115
114
Service : service.Config {
116
- Pipelines : map [component .ID ]* pipelines.PipelineConfig {
117
- component .NewID (metricsType ): {
115
+ Pipelines : map [pipeline .ID ]* pipelines.PipelineConfig {
116
+ pipeline .NewID (pipeline . SignalMetrics ): {
118
117
Receivers : []component.ID {
119
118
component .NewID (nopType ),
120
119
},
@@ -142,8 +141,8 @@ func TestEmf(t *testing.T) {
142
141
func TestMissingEmfExporterConfig (t * testing.T ) {
143
142
otelCfg := & otelcol.Config {
144
143
Service : service.Config {
145
- Pipelines : map [component .ID ]* pipelines.PipelineConfig {
146
- component .NewID (component . MustNewType ( "metrics" ) ): {
144
+ Pipelines : map [pipeline .ID ]* pipelines.PipelineConfig {
145
+ pipeline .NewID (pipeline . SignalMetrics ): {
147
146
Receivers : []component.ID {
148
147
component .NewID (component .MustNewType ("nop" )),
149
148
},
@@ -170,18 +169,18 @@ func TestJmx(t *testing.T) {
170
169
jmxOther := "jmxOther"
171
170
nopType , _ := component .NewType ("nop" )
172
171
jmxType , _ := component .NewType (jmx )
173
- pipelineType , _ := component . NewType ( "pipeline" )
174
- pipelineTypeOther , _ := component . NewType ( "pipelineOther" )
172
+ pipelineID := pipeline . NewIDWithName ( pipeline . SignalMetrics , "pipeline" )
173
+ pipelineIDOther := pipeline . NewIDWithName ( pipeline . SignalMetrics , "pipelineOther" )
175
174
pls := make (pipelines.Config )
176
- pls [component . NewID ( pipelineType ) ] = & pipelines.PipelineConfig {
175
+ pls [pipelineID ] = & pipelines.PipelineConfig {
177
176
Receivers : []component.ID {
178
177
component .NewIDWithName (jmxType , jmx ),
179
178
},
180
179
Exporters : []component.ID {
181
180
component .NewID (nopType ),
182
181
},
183
182
}
184
- pls [component . NewID ( pipelineTypeOther ) ] = & pipelines.PipelineConfig {
183
+ pls [pipelineIDOther ] = & pipelines.PipelineConfig {
185
184
Receivers : []component.ID {
186
185
component .NewIDWithName (jmxType , jmxOther ),
187
186
},
0 commit comments