@@ -49,7 +49,7 @@ func TestVerifyPromMetric(t *testing.T) {
4949 otelcol_exporter_sent_log_records{exporter="googlecloud"} 631
5050 ` ,
5151 testCase : testCase {
52- exporter : "googlecloud" ,
52+ exporters : [] string { "googlecloud" } ,
5353 metricName : "otelcol_exporter_sent_log_records" ,
5454 threshold : 100 ,
5555 },
@@ -63,7 +63,7 @@ func TestVerifyPromMetric(t *testing.T) {
6363 ` ,
6464 expectFail : true ,
6565 testCase : testCase {
66- exporter : "googlecloud" ,
66+ exporters : [] string { "googlecloud" } ,
6767 metricName : "otelcol_exporter_sent_log_records" ,
6868 threshold : 100 ,
6969 },
@@ -72,7 +72,7 @@ func TestVerifyPromMetric(t *testing.T) {
7272 name : "metric is not present fail" ,
7373 textFormat : `` ,
7474 testCase : testCase {
75- exporter : "googlecloud" ,
75+ exporters : [] string { "googlecloud" } ,
7676 metricName : "otelcol_exporter_sent_log_records" ,
7777 threshold : 100 ,
7878 },
@@ -87,7 +87,7 @@ func TestVerifyPromMetric(t *testing.T) {
8787 ` ,
8888 expectFail : true ,
8989 testCase : testCase {
90- exporter : "fooexporter" ,
90+ exporters : [] string { "fooexporter" } ,
9191 metricName : "otelcol_exporter_sent_log_records" ,
9292 threshold : 100 ,
9393 },
@@ -131,6 +131,27 @@ func TestVerifyPromRealTestCasesSuccess(t *testing.T) {
131131 }
132132}
133133
134+ func TestVerifyPromRealTestCasesSuccessOTLP (t * testing.T ) {
135+ parser := expfmt .NewTextParser (model .UTF8Validation )
136+ // Taken from a real run of the quickstart with OTLP exporters
137+ actual , err := parser .TextToMetricFamilies (strings .NewReader (`
138+ # HELP otelcol_exporter_sent_log_records Number of log record successfully sent to destination.
139+ # TYPE otelcol_exporter_sent_log_records counter
140+ otelcol_exporter_sent_log_records{exporter="otlphttp",service_instance_id="cc2396b4-e313-4c5a-8c35-0cb221a02fa8",service_name="otelcol-contrib",service_version="0.155.0"} 437
141+ # HELP otelcol_exporter_sent_metric_points Number of metric points successfully sent to destination.
142+ # TYPE otelcol_exporter_sent_metric_points counter
143+ otelcol_exporter_sent_metric_points{exporter="otlphttp",service_instance_id="cc2396b4-e313-4c5a-8c35-0cb221a02fa8",service_name="otelcol-contrib",service_version="0.155.0"} 333
144+ # HELP otelcol_exporter_sent_spans Number of spans successfully sent to destination.
145+ # TYPE otelcol_exporter_sent_spans counter
146+ otelcol_exporter_sent_spans{exporter="otlphttp",service_instance_id="cc2396b4-e313-4c5a-8c35-0cb221a02fa8",service_name="otelcol-contrib",service_version="0.155.0"} 499
147+ ` ))
148+ require .NoError (t , err )
149+
150+ for _ , tc := range testCases {
151+ verifyPromMetric (t , actual , tc )
152+ }
153+ }
154+
134155func TestVerifyPromRealTestCasesFails (t * testing.T ) {
135156 parser := expfmt .NewTextParser (model .UTF8Validation )
136157 // Taken from a real run of the quickstart
0 commit comments