Commit Graph

97 Commits

Author SHA1 Message Date
Bryan Naegele f34f95fff2
Update cowboy to opentelemetry_api 1.2 (#230)
* Update to opentelemetry_api 1.2

* Fix application deps
2024-01-17 11:11:09 -07:00
Bryan Naegele 18dfcadb07
Update to opentelemetry_api 1.2 (#231) 2024-01-17 11:07:04 -07:00
Bryan Naegele 8407ad98bd
Update to opentelemetry_api 1.2 (#232)
Co-authored-by: Tristan Sloughter <t@crashfast.com>
2023-12-01 13:48:32 -07:00
renovate[bot] e4fc50d5e5
chore(deps): update postgres docker tag to v16 (#242)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Bryan Naegele <bryannaegele@users.noreply.github.com>
2023-11-15 11:14:43 -07:00
renovate[bot] 06278d7e9a
chore(deps): update postgres docker tag to v13.13 (#244)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-15 11:00:46 -07:00
Bryan Naegele 1bf2f7f295
Req v0.2.0 (#243) 2023-11-10 17:03:08 -07:00
Bryan Naegele 5bf935bd3c
Don't package dataloader (#240) 2023-11-10 09:17:06 -07:00
Tristan Sloughter fa7ba30ca8
fix elli readme excluded_paths doc (#174) 2023-11-09 22:04:01 -07:00
renovate[bot] 473f27aea9
chore(deps): update postgres docker tag to v13.12 (#235)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-09 21:37:36 -07:00
renovate[bot] f87d07990f
chore(deps): update dependency finch to ~> 0.16 (#234)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-09 21:30:02 -07:00
Bryan Naegele 9fd5f14e2a
Update elixir-test-matrix.json (#228)
* Update elixir-test-matrix.json

* Update erlang-test-matrix.json
2023-11-09 19:56:35 -07:00
Derek Kraan 5caf10ae82
Add tests to cover new liveview integration (#221) 2023-11-09 18:20:07 -07:00
rlopzc 66326e7f42
Update Oban's README.md (#222)
The published version is 1.0.0

https://hex.pm/packages/opentelemetry_oban
2023-11-09 16:53:32 -07:00
Bryan Naegele 5be23037ce
Update Req deps (#216) 2023-11-04 12:34:53 -06:00
Wojtek Mach e1f4a02d5e
opentelemetry_req: Don't assume `request.headers` shape (#193)
* opentelemetry_req: Don't assume `request.headers` shape

* Update instrumentation/opentelemetry_req/test/opentelemetry_req_test.exs

---------

Co-authored-by: Bryan Naegele <bryannaegele@users.noreply.github.com>
2023-10-16 14:40:01 -06:00
Bryan Naegele 24e823cd23
Revert span name change to pre-1.18 spec (#214) 2023-10-16 14:16:40 -06:00
Bryan Naegele 318c68d63d
Tesla 2.3.0 (#213) 2023-10-16 13:30:40 -06:00
Artem Solomatin 4250e0b99f
Fixup doc version and typo (#211) 2023-10-03 07:39:45 -06:00
Tom Taylor 8068002c17
Include `db.system` attribute in `opentelemetry_ecto` (#187)
* 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>
2023-09-23 05:56:42 -06:00
Tom Taylor 17d31cc594
Improve test matrix and add support for Elixir 1.15 and OTP 26 (#188)
* 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>
2023-08-25 14:11:23 -06:00
Derek Kraan 79aae558fe
Add the ability to trace Liveviews to the Phoenix instrumentation (#198) 2023-08-23 05:35:31 -06:00
Bryan Naegele 0b6ccafab5
Relax Req's elixir version (#196)
Failing on the test matrix update PR.
2023-08-22 10:13:32 -06:00
Wojtek Mach 5380a94bc9
opentelemetry_req: Don't assume `request.options` is a map (#192) 2023-08-18 16:29:00 -06:00
Tom Taylor cd2a6cca91
Redis: propagate the span context if available (#180)
Behave in a similar way to Ecto, which is to attach the context of the
connection, falling back to the calling process context if available.

Co-authored-by: Tristan Sloughter <t@crashfast.com>
2023-07-13 17:15:26 -06:00
Derek Kraan 7119c4bd42
Record an exception as an error only when Plug.Exception.status/1 (#165)
returns 500..599.

It is encouraged in the Phoenix docs to use `Plug.Exception` with
custom exceptions to generate for example 404 responses at certain
places. These 404s should not be marked as error, since simple "route
not found" 404s are also not marked as error.

Co-authored-by: Tristan Sloughter <t@crashfast.com>
2023-07-06 13:44:16 -06:00
Tristan Sloughter 4dfda22cef
bump opentelemetry_phoenix to 1.1.1 (#181) 2023-06-20 08:39:50 -06:00
Josh Lee b85420afed
Don't record DB statements without sanitizaiton (#166)
* 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
2023-06-13 05:13:01 -06:00
Cristiano Piemontese 12532e5ff5
Post-PR opentelemetry_httpoison fixup (#178)
* Update opentelemetry_httpoison CODEOWNERS

Add Shared Services team as a CODEOWNER for opentelemetry_httpoison

* add CHANGELOG & fix license
2023-06-05 19:26:31 -06:00
Cristiano Piemontese 0cc8c760d0
Add telepoison (#148)
* add telepoison

* rename

* rename file too, duh

* rename test file

* port updates

* add standard workflow
2023-06-04 08:23:03 -06:00
Guilherme de Maio 901b571b07
[opentelemetry_tesla] Conditionally override propagator (#176)
* Optionally disable trace propagation for Tesla

While we always want spans being produced, trace progation is not
desirable in all cases - namely, when calling external parties, as that
may leak sensitive information, like one present on Baggage.

This patch introduces a new option `:propagate`, that defaults to
`true`.

Some tweaks are made to existing propagation test, fixing how options
are used. The approach here is closer to what we see in some middleware
tests of Tesla itself.

* change to propagator override

* change propagator to it uses global default

* mix format

* improve docs

---------

Co-authored-by: Andrew Rosa <dev@andrewhr.io>
2023-05-29 04:53:21 -06:00
Cedric Ziel 6a5fc4c884
Bump version to 1.1.1 (#175) 2023-05-23 05:04:01 -06:00
Cedric Ziel 8292870b66
Add db.name to ecto spans (#172)
* Add db.name to ecto spans

As per the spec, the db.name attribute is required on database spans. This changes adds it.

Ref: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/database.md#call-level-attributes

* Add db.name attribute to tests

* Changelog update

* Update instrumentation/opentelemetry_ecto/test/opentelemetry_ecto_test.exs

* Update instrumentation/opentelemetry_ecto/test/opentelemetry_ecto_test.exs
2023-05-23 04:49:29 -06:00
Patrik Stenmark ddf0706bf1
Make exdocs settings a bit more similar between different packages (#168)
* 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.
2023-04-30 12:10:03 -06:00
Andrey Chernykh 1230271580
[Tesla middleware] `non_error_statuses` option (#154)
* [Tesla middleware] `non_error_statuses` option

* :mark_status_ok option instead of :non_error_statuses

---------

Co-authored-by: Tristan Sloughter <t@crashfast.com>
2023-04-21 10:07:21 -06:00
Romario López 19a44fbd68
Improve Req with OTel http spec (#163)
* Improve span_name

Use span_name if provided. Fallback to url.path if there is no
path_params.

* Add unreleased changelog

* Update examples and module description

* Change span_name and http.url to follow OTEL spec

* Remove unused function

* Improve changelog

* Fix reading span_name from request.options

* Don't use URI.path

* address changelog
2023-04-20 05:04:18 -06:00
Maarten van Vliet 1de26cce1a
Add Dataloader instrumentation library (#137)
* Add Dataloader instrumentation library

* Move call to set context to @run_start event

---------

Co-authored-by: Tristan Sloughter <t@crashfast.com>
2023-04-05 10:34:49 -06:00
Bryan Naegele de17c31194
OpentelemetryReq plugin (#160)
* OpentelemetryReq plugin

* Split span handling

* version bump

* Remove set

* Unused var

* Set parent ctx back on completion
2023-03-31 09:51:27 -06:00
Ty Bekiares a59f399155
[grpcbox] bump version (#156)
Co-authored-by: Tristan Sloughter <t@crashfast.com>
2023-03-31 05:35:27 -06:00
Damir Vandic 7db602b9d7
Relax nimble_options (#161) 2023-03-21 06:45:01 -06:00
Bryan Naegele 760ba56809
propagator v0.2.2 (#158)
* propagator v0.2.2

* update changelog

* Publish cowboy
2023-03-17 10:36:26 -06:00
Erick Dennis bc11851360
Tesla.Middleware.OpenTelemetry: handle 400 as error (#153) 2023-03-06 10:51:05 -07:00
Bryan Naegele 8897400d4e
Phoenix 1.1.0 (#145)
* Phoenix 1.1.0

* Fix docs

* Publish tesla with updated sem conventions
2023-01-13 14:38:05 -07:00
Bryan Naegele e6c8cc6289
Phoenix Plug.Cowboy adapter support (#144)
* wip

* Cowboy adapter support

* Use path deps to keep things updated

* fix doc

* Fix example project
2023-01-06 13:46:06 -07:00
Yordis Prieto 7971f2fdaa
chore: add sc to finch (#141) 2022-12-15 04:36:52 -07:00
Andrew Rosa dfed96874f
Add Nebulex instrumentation library (#83)
Add instrumentation for Nebulex, a distributed cache library. This
library provides solid telemetry support for this initial
implementation.

Caching implementation is mostly based on in-memory storage (like ETS)
and RPC calls for distribution (via OTP libraries, like :erpc). AFAICT,
there is not much specifics for how to translate into Semantic
Attributes: those caches are not quite a DB, except maybe for the one
which implements the storage; the RPC can't be reliably captured
either.

Given the above constraints, this initial implementation instruments the
library via custom attributes (namespaced as `nebulex.*`). It's not 100%
clear the behaviour of OTel for actual distributed caches - from my
tests, that may create some orphan spans. I think that's fine as first
release.

Nebulex follow the patterns of Ecto, so this instrumentation follows a
similar pattern of OpentelemetryEcto. It does include a `setup_all/1`
function for convenience, that leverages the :init events Nebulex emit
on process start.

Co-authored-by: Tristan Sloughter <t@crashfast.com>
2022-12-14 17:38:18 -07:00
Yordis Prieto 1e2ae6707c
chore: add sc to oban (#138) 2022-12-14 16:48:27 -07:00
Yordis Prieto d1ec189362
chore: add semantic conventions to phoenix (#121)
* fix: redix missing dep

* chore: add sc dep

* chore: use semantic conventions in phoenix
2022-12-12 13:51:54 -07:00
Ty Bekiares f04340aff4
[grpcbox] add grpc conventions (#130)
Co-authored-by: Tristan Sloughter <t@crashfast.com>
2022-12-01 15:37:47 -07:00
Bryan Naegele c8b760e776
publish latest updates (#127) 2022-11-16 19:07:23 -07:00
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