@@ -16,7 +16,7 @@ import (
16
16
"go.opentelemetry.io/collector/component"
17
17
"go.opentelemetry.io/collector/component/componenttest"
18
18
"go.opentelemetry.io/collector/exporter"
19
- "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics "
19
+ "go.opentelemetry.io/collector/exporter/exporterhelper/internal "
20
20
)
21
21
22
22
var (
@@ -55,13 +55,13 @@ func TestExportTraceDataOp(t *testing.T) {
55
55
switch {
56
56
case params [i ].err == nil :
57
57
sentSpans += params [i ].items
58
- require .Contains (t , span .Attributes (), attribute.KeyValue {Key : obsmetrics .SentSpansKey , Value : attribute .Int64Value (int64 (params [i ].items ))})
59
- require .Contains (t , span .Attributes (), attribute.KeyValue {Key : obsmetrics .FailedToSendSpansKey , Value : attribute .Int64Value (0 )})
58
+ require .Contains (t , span .Attributes (), attribute.KeyValue {Key : internal .SentSpansKey , Value : attribute .Int64Value (int64 (params [i ].items ))})
59
+ require .Contains (t , span .Attributes (), attribute.KeyValue {Key : internal .FailedToSendSpansKey , Value : attribute .Int64Value (0 )})
60
60
assert .Equal (t , codes .Unset , span .Status ().Code )
61
61
case errors .Is (params [i ].err , errFake ):
62
62
failedToSendSpans += params [i ].items
63
- require .Contains (t , span .Attributes (), attribute.KeyValue {Key : obsmetrics .SentSpansKey , Value : attribute .Int64Value (0 )})
64
- require .Contains (t , span .Attributes (), attribute.KeyValue {Key : obsmetrics .FailedToSendSpansKey , Value : attribute .Int64Value (int64 (params [i ].items ))})
63
+ require .Contains (t , span .Attributes (), attribute.KeyValue {Key : internal .SentSpansKey , Value : attribute .Int64Value (0 )})
64
+ require .Contains (t , span .Attributes (), attribute.KeyValue {Key : internal .FailedToSendSpansKey , Value : attribute .Int64Value (int64 (params [i ].items ))})
65
65
assert .Equal (t , codes .Error , span .Status ().Code )
66
66
assert .Equal (t , params [i ].err .Error (), span .Status ().Description )
67
67
default :
@@ -104,13 +104,13 @@ func TestExportMetricsOp(t *testing.T) {
104
104
switch {
105
105
case params [i ].err == nil :
106
106
sentMetricPoints += params [i ].items
107
- require .Contains (t , span .Attributes (), attribute.KeyValue {Key : obsmetrics .SentMetricPointsKey , Value : attribute .Int64Value (int64 (params [i ].items ))})
108
- require .Contains (t , span .Attributes (), attribute.KeyValue {Key : obsmetrics .FailedToSendMetricPointsKey , Value : attribute .Int64Value (0 )})
107
+ require .Contains (t , span .Attributes (), attribute.KeyValue {Key : internal .SentMetricPointsKey , Value : attribute .Int64Value (int64 (params [i ].items ))})
108
+ require .Contains (t , span .Attributes (), attribute.KeyValue {Key : internal .FailedToSendMetricPointsKey , Value : attribute .Int64Value (0 )})
109
109
assert .Equal (t , codes .Unset , span .Status ().Code )
110
110
case errors .Is (params [i ].err , errFake ):
111
111
failedToSendMetricPoints += params [i ].items
112
- require .Contains (t , span .Attributes (), attribute.KeyValue {Key : obsmetrics .SentMetricPointsKey , Value : attribute .Int64Value (0 )})
113
- require .Contains (t , span .Attributes (), attribute.KeyValue {Key : obsmetrics .FailedToSendMetricPointsKey , Value : attribute .Int64Value (int64 (params [i ].items ))})
112
+ require .Contains (t , span .Attributes (), attribute.KeyValue {Key : internal .SentMetricPointsKey , Value : attribute .Int64Value (0 )})
113
+ require .Contains (t , span .Attributes (), attribute.KeyValue {Key : internal .FailedToSendMetricPointsKey , Value : attribute .Int64Value (int64 (params [i ].items ))})
114
114
assert .Equal (t , codes .Error , span .Status ().Code )
115
115
assert .Equal (t , params [i ].err .Error (), span .Status ().Description )
116
116
default :
@@ -153,13 +153,13 @@ func TestExportLogsOp(t *testing.T) {
153
153
switch {
154
154
case params [i ].err == nil :
155
155
sentLogRecords += params [i ].items
156
- require .Contains (t , span .Attributes (), attribute.KeyValue {Key : obsmetrics .SentLogRecordsKey , Value : attribute .Int64Value (int64 (params [i ].items ))})
157
- require .Contains (t , span .Attributes (), attribute.KeyValue {Key : obsmetrics .FailedToSendLogRecordsKey , Value : attribute .Int64Value (0 )})
156
+ require .Contains (t , span .Attributes (), attribute.KeyValue {Key : internal .SentLogRecordsKey , Value : attribute .Int64Value (int64 (params [i ].items ))})
157
+ require .Contains (t , span .Attributes (), attribute.KeyValue {Key : internal .FailedToSendLogRecordsKey , Value : attribute .Int64Value (0 )})
158
158
assert .Equal (t , codes .Unset , span .Status ().Code )
159
159
case errors .Is (params [i ].err , errFake ):
160
160
failedToSendLogRecords += params [i ].items
161
- require .Contains (t , span .Attributes (), attribute.KeyValue {Key : obsmetrics .SentLogRecordsKey , Value : attribute .Int64Value (0 )})
162
- require .Contains (t , span .Attributes (), attribute.KeyValue {Key : obsmetrics .FailedToSendLogRecordsKey , Value : attribute .Int64Value (int64 (params [i ].items ))})
161
+ require .Contains (t , span .Attributes (), attribute.KeyValue {Key : internal .SentLogRecordsKey , Value : attribute .Int64Value (0 )})
162
+ require .Contains (t , span .Attributes (), attribute.KeyValue {Key : internal .FailedToSendLogRecordsKey , Value : attribute .Int64Value (int64 (params [i ].items ))})
163
163
assert .Equal (t , codes .Error , span .Status ().Code )
164
164
assert .Equal (t , params [i ].err .Error (), span .Status ().Description )
165
165
default :
0 commit comments