I am facing a challenge in developing an OpenTelemetry implementation that can efficiently send traces directly to Honeycomb.io.
// tracer.js
import { SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base';
import { WebTracerProvider } from '@opentelemetry/sdk-trace-web';
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
const HONEYCOMB_DATASET = '<DATA_SET>';
const HONEYCOMB_TEAM = '<API_KEY>';
const HONEYCOMB_URL = `https://api.honeycomb.io:443/v1/traces/`;
const exporter = new OTLPTraceExporter({
url: HONEYCOMB_URL,
headers: {
'X-Honeycomb-Team': HONEYCOMB_TEAM,
'X-Honeycomb-Dataset': HONEYCOMB_DATASET,
},
});
const provider = new WebTracerProvider();
provider.addSpanProcessor(new SimpleSpanProcessor(exporter));
export const tracer = provider.getTracer('default tracer');
When I make the call:
tracer.startSpan('link click').setAttributes(attributes).end();
I receive a 501 response from
https://api.honeycomb.io/v1/traces/
stating:
{
"message": "Invalid content-type. Only application/protobuf is supported."
}
I would like to know how I can successfully send my traces as Protobufs?