* Run mix format
* Upgrade dependencies to build on OTP 26
* Add db.system attribute
* Add support for mssql and fallback to other_sql
* Fallback to not including db_system if adapter is unrecognised
---------
Co-authored-by: Tristan Sloughter <t@crashfast.com>
* Use test matrix from file
* Only check formatting on specific Elixir version
* Use latest patch version of each Elixir/OTP release in test matrix
* Test on Elixir 1.15 and OTP 26
* Run formatter on opentelemetry_httpoison
* Run formatter on opentelemetry_phoenix
* Run formatter on opentelemetry_tesla
* Fix building opentelemetry_ecto on Elixir 1.15
Upgraded deps to fix ssl_verify_fun not compiling
* Fix building opentelemetry_dataloader on Elixir 1.15
Upgraded deps to fix ssl_verify_fun and ecto_sql not compiling
* Upgrade opentelemetry_finch to build on Elixir 1.15
* Upgrade opentelemetry_httpoison deps to build on 1.15
* Upgrade opentelemetry_nebulex to build on Elixir 1.15
* Upgrade opentelemetry_oban to build on Elixir 1.15
* Upgrade opentelemetry_phoenix deps to build on 1.15
* Upgrade opentelemetry_redix deps to build on 1.15
* Fix warning about <> being ambiguous
* Fix assertion on attributes keys
These are always atoms, not strings.
* Upgrade ssl_verify_fun in opentelemetry_telemetry
* Deterministically sort keys before asserting in tests
* Upgrade opentelemetry_process_propogator to build on Elixir 1.15
* Run mix format on opentelemetry_process_propogator
* Assert keys are atoms, not strings
* Use matrix.os to define runs-on parameter
* Pin test matrix to specific OTP + Elixir versions
* Run formatter on telemetry and process_propagator
* Run formatter over opentelemetry_phoenix
---------
Co-authored-by: Tristan Sloughter <t@crashfast.com>
* Don't record DB statements without sanitizaiton
This adds an option to OpentelemetryEcto.setup/1 that allows a query
sanitization function to be provided. If it is not provided, queries
are not captured (this is the default).
* test that db.statement isnt present unless query sanitizer is configured
* rename option to `:db_statement`
* run mix format
* Add source_url_pattern to be able to use the "link to source" button
* Add README.md as an "extra" where it wasn't already
* Add a `main` setting. They all have a very obvious main module. Set
that as `main`, so a user is shown this immediately instead of a list
of usually only this module.
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.
Default exporter immediately attempts on start connect to
`:otel-collector` default port. As we don't have any collector running
on our test environment, this results in a few warnings. That's not an
issue in itself, as code immediately switches to another export, but
creates a lot of noise.
This patch moves the exporter setup to `config/test.exs`, essentially
removing the need to restart opentelemetry applicationn for each test
case. The only work setup blocks do is update the exporter's target pid.
The processor was changed to simple mode, available now, which also remove
another vector of (unlikely but theoretically possible) race-conditions.
* Set error status on error instead of just adding attribute
* Use Exception.message if error is an exception
Co-authored-by: Bryan Naegele <bryannaegele@users.noreply.github.com>
As it stands, when source is nil (which, for example, can happen if there is a
call to `Repo.transaction`), the name of the span ends in an odd ':'. This
removes that ':'.
Co-authored-by: Bryan Naegele <bryannaegele@users.noreply.github.com>