WARNING: Failed to export metrics. Server responded with HTTP status code 415

See original GitHub issue

I’ve been trying to periodically send a value as a metric to dynatrace using an OtlpHttpMetricExporter with a PeriodicMetricReader.

However, I’ve been getting the same error over and over again: WARNING: Failed to export metrics. Server responded with HTTP status code 415. Error message: Unable to parse response body, HTTP status message: Unsupported Media Type.

On the other hand, using a OtlpGrpcMetricExporter instead returns: WARNING: Failed to export metrics. Server responded with HTTP status code 200. Error message: OK

Both these warnings come from io.opentelemetry.sdk.internal.ThrottlingLogger doLog

What am I doing wrong?

Code:

MetricExporter metricExporter = OtlpHttpMetricExporter.builder()
				.setEndpoint(Constants.DYNATRACE_ENDPOINT_M)
			        .addHeader(Constants.DYNATRACE_AUTH,Constants.DYNATRACE_TOKEN)
				.build();

SdkMeterProvider sdkMeterProvider = SdkMeterProvider.builder()
				.registerMetricReader(PeriodicMetricReader.builder(metricExporter).build())
				.build();	
		
OpenTelemetry openTelemetry = OpenTelemetrySdk.builder()
					.setMeterProvider(sdkMeterProvider)
					.buildAndRegisterGlobal();

Meter meter = openTelemetry.meterBuilder(Constants.INSTRUMENTATION_LIB)
				.setInstrumentationVersion(Constants.INSTRUMENTATION_VERSION)
				.build();

// Builds set of metric's attributes
Attributes attributes = getAttributes();
		
// Builds gauge meter to record metric
meter.gaugeBuilder(metricStorage.getId()) // sets metric label
			.buildWithCallback(measurement -> { 
			measurement.record(5.00, attributes); // sets metric value and attributes
			});

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jkwatsoncommented, Aug 16, 2022

From what I understand, using OTLP metrics is one of the options available for dynatrace metrics ingestion.

They do publish their own exporter (and that one does work), however I am now interested in figuring out why the other two exporters do not work, if possible.

It sounds like you should probably work with Dynatrace on that, rather than opening an issue here.

0reactions
jack-bergcommented, Aug 17, 2022

I’m going to close this issue because it seems related to dynatrace’s implementation. Please reopen if you have reason to believe code from this repository is involved in the issue!

Read more comments on GitHub >

github_iconTop Results From Across the Web

415 Unsupported Media Type - HTTP - MDN Web Docs
The HTTP 415 Unsupported Media Type client error response code indicates that the server refuses to accept the request because the payload ...
Read more >
Error When exporting metrics while using OpenTelemetry ...
I configured Opentelemtry collector to export metrics and traces. I am getting access errors and unable to check any data come through(used ...
Read more >
How To Fix the HTTP 415 Error on Your Website - Kinsta
Regardless of what you call it – the “HTTP 415” error, the “415 Unsupported Media Type” error – it means that the server...
Read more >
OpenTelemetry autoinstrumentation. Error with export spans ...
As per the logs it is trying to export to localhost:55680 which refers to your application's container ,instead it should export to ...
Read more >
Anaplan Integration API V2 Guide and Reference · Apiary
Completion, failure, and data error/warning codes for import and export actions ... To view an example cURL request and server response:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found