Skip to content

Commit

Permalink
chore: PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziinc committed Apr 25, 2024
1 parent 29a4da1 commit c582a09
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/logflare/backends/adaptor/datadog_adaptor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ defmodule Logflare.Backends.Adaptor.DatadogAdaptor do

alias Logflare.Backends.Adaptor.WebhookAdaptor

# https://docs.datadoghq.com/api/latest/logs/#send-logs
@api_url "https://http-intake.logs.datadoghq.com/api/v2/logs"

typedstruct enforce: true do
field(:api_key, String.t())
end
Expand All @@ -26,10 +29,8 @@ defmodule Logflare.Backends.Adaptor.DatadogAdaptor do
backend = %{
backend
| config: %{
url: "https://http-intake.logs.datadoghq.com/api/v2/logs",
headers: %{
"dd-api-key" => backend.config.api_key
}
url: @api_url,
headers: %{"dd-api-key" => backend.config.api_key}
}
}

Expand All @@ -55,10 +56,8 @@ defmodule Logflare.Backends.Adaptor.DatadogAdaptor do

@impl Logflare.Backends.Adaptor
def validate_config(changeset) do
import Ecto.Changeset

changeset
|> validate_required([:api_key])
|> Ecto.Changeset.validate_required([:api_key])
end

defp translate_event(%Logflare.LogEvent{} = le) do
Expand Down

0 comments on commit c582a09

Please sign in to comment.