Skip to content

Commit

Permalink
Drop db.connection_string attribute from opentelemetry_ecto
Browse files Browse the repository at this point in the history
  • Loading branch information
jhonndabi committed Nov 24, 2023
1 parent f724c9b commit b638a1d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
11 changes: 0 additions & 11 deletions instrumentation/opentelemetry_ecto/lib/opentelemetry_ecto.ex
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,6 @@ defmodule OpentelemetryEcto do
database = repo.config()[:database]
adapter = repo.__adapter__()

url =
case repo.config()[:url] do
nil ->
# TODO: add port
URI.to_string(%URI{scheme: "ecto", host: repo.config()[:hostname]})

url ->
url
end

span_prefix =
case Keyword.fetch(config, :span_prefix) do
{:ok, prefix} -> prefix
Expand All @@ -97,7 +87,6 @@ defmodule OpentelemetryEcto do
# TODO: need connection information to complete the required attributes
# net.peer.name or net.peer.ip and net.peer.port
base_attributes = %{
"db.connection_string": url,
"db.ecto.adapter": to_string(adapter),
"db.name": database,
"db.sql.table": source,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ defmodule OpentelemetryEctoTest do
)}

assert %{
"db.connection_string": "ecto://localhost",
"db.ecto.adapter": "Elixir.Ecto.Adapters.Postgres",
"db.name": "opentelemetry_ecto_test",
"db.sql.table": "users",
Expand Down Expand Up @@ -112,7 +111,6 @@ defmodule OpentelemetryEctoTest do
)}

assert %{
"db.connection_string": "ecto://localhost",
"db.ecto.adapter": "Elixir.Ecto.Adapters.Postgres",
"db.name": "opentelemetry_ecto_test",
"db.sql.table": "posts",
Expand Down

0 comments on commit b638a1d

Please sign in to comment.