Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres exception spans have wrong service tag #26

Open
bforchhammer opened this issue Oct 14, 2020 · 1 comment
Open

Postgres exception spans have wrong service tag #26

bforchhammer opened this issue Oct 14, 2020 · 1 comment

Comments

@bforchhammer
Copy link

bforchhammer commented Oct 14, 2020

Hello,

We're currently experiencing a strange issue which I've not been able to figure out: some of our spans are wrongly attributed the "parent service" tag instead of the defined "ecto service tag". On datadog, this is causing issues because we end up with spans of the wrong type (db in this case) being attributed to a service which is supposed to only deal with traces of type web. Here is an example trace showing the query span being attributed to the identity-api service instead of identity-ecto:

Screenshot 2020-10-14 at 08 18 03

I noticed that this only seems to happen for "error spans" with a Postgrex.Error; all other spans are correctly attributed to identity-ecto already.

We're using the telemetry integration, i.e. our tracer is configured this way:

Application.put_env(:spandex_ecto, SpandexEcto.EctoLogger, service: String.to_atom("identity-ecto"), tracer: MyTracer)

:ok =
  :telemetry.attach(
    "spandex-query-tracer-#{otp_app}-#{repo}",
    [otp_app, repo, :query],
    &SpandexEcto.TelemetryAdapter.handle_event/4,
    nil
  )

Any ideas, what might be causing this?


We're currently using these library versions:

  • spandex 3.0.2
  • spandex_datadog 1.0.0
  • spandex_ecto 0.6.2
  • spandex_phoenix 1.0.4
@GregMefford
Copy link
Member

My best guess is that it's using default options from your MyTracer when it shouldn't be. Let me see if I can figure out if that's the case and whether we can do something about it. 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants