Skip to content

Commit 13d2031

Browse files
authored
feat: add datadog meta headers (#60)
* feat: add datadog meta headers * feat: add missing header * fix: fix tests
1 parent ba1c67a commit 13d2031

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/spandex_datadog/api_server.ex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ defmodule SpandexDatadog.ApiServer do
3535
# Same as HTTPoison.headers
3636
@type headers :: [{atom, binary}] | [{binary, binary}] | %{binary => binary} | any
3737

38-
@headers [{"Content-Type", "application/msgpack"}]
38+
@headers [
39+
{"Content-Type", "application/msgpack"},
40+
{"Datadog-Meta-Lang", "elixir"},
41+
{"Datadog-Meta-Lang-Version", System.version()},
42+
{"Datadog-Meta-Tracer-Version", Application.spec(:spandex_datadog)[:vsn]}
43+
]
3944

4045
@default_opts [
4146
host: "localhost",

test/api_server_test.exs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@ defmodule SpandexDatadog.ApiServerTest do
233233

234234
headers = [
235235
{"Content-Type", "application/msgpack"},
236+
{"Datadog-Meta-Lang", "elixir"},
237+
{"Datadog-Meta-Lang-Version", System.version()},
238+
{"Datadog-Meta-Tracer-Version", nil},
236239
{"X-Datadog-Trace-Count", 1}
237240
]
238241

0 commit comments

Comments
 (0)