Skip to content

Commit

Permalink
feat: add datadog meta headers (#60)
Browse files Browse the repository at this point in the history
* feat: add datadog meta headers

* feat: add missing header

* fix: fix tests
  • Loading branch information
DReigada authored Aug 26, 2023
1 parent ba1c67a commit 13d2031
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/spandex_datadog/api_server.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ defmodule SpandexDatadog.ApiServer do
# Same as HTTPoison.headers
@type headers :: [{atom, binary}] | [{binary, binary}] | %{binary => binary} | any

@headers [{"Content-Type", "application/msgpack"}]
@headers [
{"Content-Type", "application/msgpack"},
{"Datadog-Meta-Lang", "elixir"},
{"Datadog-Meta-Lang-Version", System.version()},
{"Datadog-Meta-Tracer-Version", Application.spec(:spandex_datadog)[:vsn]}
]

@default_opts [
host: "localhost",
Expand Down
3 changes: 3 additions & 0 deletions test/api_server_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ defmodule SpandexDatadog.ApiServerTest do

headers = [
{"Content-Type", "application/msgpack"},
{"Datadog-Meta-Lang", "elixir"},
{"Datadog-Meta-Lang-Version", System.version()},
{"Datadog-Meta-Tracer-Version", nil},
{"X-Datadog-Trace-Count", 1}
]

Expand Down

0 comments on commit 13d2031

Please sign in to comment.