File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,24 @@ void fetchOpenMetrics() {
239239 + "# EOF\n " );
240240 }
241241
242+ @ Test
243+ void fetchProtobuf () {
244+ AggregatedHttpResponse response =
245+ client
246+ .execute (
247+ RequestHeaders .of (
248+ HttpMethod .GET ,
249+ "/metrics" ,
250+ HttpHeaderNames .ACCEPT ,
251+ "Accept: application/vnd.google.protobuf;proto=io.prometheus.client.MetricFamily" ))
252+ .aggregate ()
253+ .join ();
254+ assertThat (response .status ()).isEqualTo (HttpStatus .OK );
255+ assertThat (response .headers ().get (HttpHeaderNames .CONTENT_TYPE ))
256+ .isEqualTo ("application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited" );
257+ // don't decode the protobuf, just verify it doesn't throw an exception
258+ }
259+
242260 @ SuppressWarnings ("ConcatenationWithEmptyString" )
243261 @ Test
244262 void fetchFiltered () {
You can’t perform that action at this time.
0 commit comments