Unable to set K6_DYNATRACE_HEADER properly

Hello!

I’m trying to add K6_DYNATRACE_HEADER as an environment variable, but I did not find any documentation on how it should be set exactly. According to the text, it says:

|NAME|VALUE|
|K6_DYNATRACE_HEADER|Pair of key/value headers to add to Dynatrace requests.|

But no matter how I try, e.g.:

export K6_DYNATRACE_HEADER=test:test
export K6_DYNATRACE_HEADER=test/test
export K6_DYNATRACE_HEADER=‘test’:‘test’
export K6_DYNATRACE_HEADER={‘test’:‘test’}
etc.

it is just giving me the following error message:

FATA[0001] Failed to send timeseries. error=“Post "[dynatrace-url]”: net/http: invalid header field name """

Does anyone happen to know how to tackle this?

Thanks. Have a nice day!

Hi @tiszaazs. welcome to the communtiy forum :tada:

This wasn’t well explained and I have opened a PR to fix it.

The short is that it should be K6_DYNATRACE_HEADER_TEST_HEADER="test value"

Sorry for the confusion :frowning:

1 Like

Hello! Thanks for the reply.
Unfortunately I still get the error:

export K6_DYNATRACE_HEADER_TEST_HEADER=“test value”
./k6 run script.js -o output-dynatrace
… FATA[0001] Failed to send timeseries. error=“Post "[endpoint-url]”: net/http: invalid header field name """

Is it working for you?

Thanks. Have a nice day!

@tiszaazs does running env still show you the old env variables you exported K6_DYNATRACE_HEADER specifically.

If so you need to unset them

1 Like

@mstoykov Oh, my bad then…
Looks good now, thanks.
Have a nice day!

1 Like

@tiszaazs are you able to see your headers at Dynatrace. I am also trying similar way and could not fine those headers under dimensions. Please add your inputs here

hello @ppyneni , also have the same issue on my side :frowning: got no luck still how to filter down on headers added like this…

Thank you for your response @tiszaazs . Reported an issue and let’s see how soon it can be addressed.

1 Like