Commit Graph

3 Commits

Author SHA1 Message Date
Andrew Rosa 56c6503a93
Fix two use cases of Ecto span propagation (#82)
First one is related to `OpenTelemetry.Ctx` API. I've noticed in a few
scenarios the current span of a trace may get lost after Ecto calls.

Looking at the The `attach/1` typespec, it's a Ctx -> Token, while
`dettach/1` as Token -> Ctx function. That made me assume the expected
input of dettach is the return type of attach. Indeed, after this change
we got the behavior of Ecto calls preserve the parent span untouched.

That leads to a second bug found. When ecto does simple calls within a
Task, due the special propagation code for preloads that means it will
skip the current span, if any.  The solution here is to first check the
current process.

One test was added to reproduce this bug.
2022-11-15 17:55:32 -07:00
Bryan Naegele 2f2b31c1ce
Otel 1.0.0-rc.3 support (#27) 2021-10-13 21:11:26 -06:00
Bryan Naegele bfee0f71a4
Migrate otel ecto (#16)
* Migrate otel ecto
2021-10-08 15:38:18 -06:00