Error: missing ‘x-honeycomb-dataset’ header

TL;DR – go create a new environment in Honeycomb, and get a new API Key.

If you get this error from Honeycomb, it means that you’re sending data, and your API Key is working, but…

illustration of one account with two teams; one team has a single environment and dataset. One team has two environments each with the same three datasets. x-honeycomb-team=(bunch of letters) points to one of those environments.
One Honeycomb account can have multiple teams. Each team can have several environments (such as “production” or “dev”). Each environment has a dataset for every service that has ever sent trace data to it. The API key in the x-honeycomb-team header points to a team and environment.

Your API Key (in the x-honeycomb-team header) tells Honeycomb where to put your traces. It specifies a team and an environment. Then Honeycomb figures out which dataset to put each event in, based on the field in the event. Except…

Back in the day (before April 2022), Honeycomb didn’t look at events to figure out where to put them. It looked at a header instead, so right next to x-honeycomb-team was x-honeycomb-dataset. All the events went in there together.

Back then, the concept of environment didn’t exist in Honeycomb, so every team effectively had just one. That legacy environment is now called “Classic.” If you really want to send to it, populate that x-honeycomb-dataset header. No guarantees on how long this will be supported.

So go to Honeycomb and create a new environment. (instructions here) Call it “prod” or “test” or “local-jessitron” according to where you’re running your app. When you use an API Key for that new environment, Honeycomb will figure out the dataset itself.

caveat: if you’re sending metrics to Honeycomb, then you do need to send x-honeycomb-dataset. Set it to “something-metrics” where “something” describes your setup.

sneaky hint: when you look at the Honeycomb API Key in your x-honeycomb-team header, you can tell it’s a Classic environment if it’s long (over 30 characters) and all lowercase hex digits. The up-to-date ones are shorter and have capital letters.

FYI: if you’re sending over GRPC, you might get status code 16. Over HTTP, this is a 401, OTLPExporterError: Unauthorized.