Commit Graph

214 Commits

Author SHA1 Message Date
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
Antonio 3f26975ae9
Allow start_link/1 to be delegated (#157) 2023-03-13 10:14:37 -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 f5b138f297
Bryannaegele patch 1 (#135)
* Update elixir.yml

* Update erlang.yml (#134)
2022-11-25 14:35:36 -07:00
Bryan Naegele 62219a28f1
Update elixir.yml 2022-11-25 14:31:43 -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
Bryan Naegele 4d39f47b03
update elixir package deps (#126)
* update elixir package deps

* Oban test updates
2022-11-15 17:48:50 -07:00
Yordis Prieto ed49b0c4bb
chore: add semantic conventions pkg (#118)
Co-authored-by: Tristan Sloughter <t@crashfast.com>
2022-11-15 16:39:22 -07:00
Yordis Prieto 0c509f4ebc
chore: ran formatter (#123)
* chore: ran formatter

* Delete .formatter.exs

Co-authored-by: Bryan Naegele <bryannaegele@users.noreply.github.com>
2022-11-15 16:25:04 -07:00
Bryan Naegele 0e6a776ffb
Fix CI errors, update GHA deps, update versions (#125)
* Fix CI errors, update GHA deps, update versions

* output syntax

* remove OTP 22 tests

* set concurrency to cancel in progress

* whitespace

* incompatible vsns and failed test

* Try pulling excludes out

* Escaping

* Just drop < 1.13 until this can move to workflows

* quote
2022-11-15 16:22:28 -07:00
Bryan Naegele a71bf882cc
Fix Tesla's test nam (#113) 2022-11-15 12:12:27 -07:00
Yordis Prieto 24499cbae1
fix: missing deps in redix (#122) 2022-11-15 04:43:44 -07:00
Yordis Prieto 01fc804ab2
chore: add semantic conventions pgk to redix (#119) 2022-11-14 15:33:48 -07:00
Alberto Sartori a72305f574
Add server span kind to otel cowboy (#116)
* Add server span kind to otel cowboy

* Upgrade deps
2022-11-10 04:15:15 -07:00
John Mauricio Carmona E 4358c75b99
finch-instrumentation (#115)
* finch-instrumentation

* Span attributes update

* Readme update

* Readme update
2022-11-09 12:27:40 -07:00
Aaron Renner 8e5d373477
Fix ctx return types for process_propagator functions (#114) 2022-10-19 17:52:52 -06:00
Bryan Naegele da912fd08b
Publish process propagator v0.2.0 (#111)
* Publish process propagator v0.2.0

* Fix docs
2022-10-12 15:59:20 -06:00
Ricardo Paiva b10af6e987
Bump opentelemetry_tesla version (#112) 2022-10-12 15:25:08 -06:00
Guilherme de Maio c69a3c7b49
[opentelemetry-tesla] add custom span name override as middleware opt (#105)
* fix remove extra bracket in mix.exs

* use capture log for less verbose test output

* add span_name opt for overriding span name

* add moduledoc

* allow function for span_name opt
2022-10-04 16:32:36 -06:00
Damir Vandic 7a4c33ef7c
Relax dependencies for opentelemtry_tesla (#106) 2022-09-03 07:59:03 -06:00
cevado a9e6fa0c84
opentelemetry_ecto - add possibility to setup additional attributes. (#94)
* Make possible to include additional attributes to the span through setup

* Adjust code review changes
2022-09-02 13:47:34 -06:00
Bryan Naegele d5bae4d624
Update elixir.yml 2022-09-02 13:42:19 -06:00
David White 2b5eb14cca
Fix bug in OpentelemetryOban.insert_all/4 (#103)
Co-authored-by: Tristan Sloughter <t@crashfast.com>
2022-08-28 05:45:02 -06:00
Bryan Naegele fb6c3d2985
Conveniences for Tasks (#80)
* Conveniences for Tasks

* Finish Task module functions

* Complete Task and add Task.Supervisor

* Check if new funs added

* Remove with_ctx in favor of wrapping default

* Fix docs
2022-08-26 14:10:57 -06:00
Ricardo Paiva e8d1462f46
Add otel tesla library (#90)
* Add Tesla HTTP client instrumentation library

* Update workflows configuration

* Update labeler.yml

* Update CODEOWNERS

* Add LICENSE file

Co-authored-by: Bryan Naegele <bryannaegele@users.noreply.github.com>
2022-08-25 12:47:59 -06:00
Ygor Castor 59664d87c8
Implemented AWS X-Ray TraceId Generator (#95) 2022-07-21 11:40:47 -06:00