Releases: marcdel/open_telemetry_decorator
v1.4.12
v1.4.12
- Updates decorator to use the o11y version of start and end span
- Refactor tests to use
O11y.TestHelper
and the available structs for asserting on span conents.
Full Changelog: v1.4.11...v1.4.12
v1.4.11
v1.4.11
Clean up after ourselves instead of right before setting the status
I didn't realize Span.end_span
does not change the current span, which is why when the parent catches the reraise it had the wrong span as the current span.
We're starting the span in a place where we can hold on to it so we can manually update the current span to the parent so that callers that aren't using the decorator have the correct current span.
Full Changelog: v1.4.10...v1.4.11
v1.4.10
v1.4.10
Addresses an issue setting error status on parent spans after exception
When two functions that are decorated with the with_span function are nested and the child throws, the current span was not being set back to the parent as expected.
Calling Tracer.set_status would attempt to set the status on the child span which has been closed at that point and fail meaning the parent's status would be undefined.
v1.4.9
Adds the ability to pass links to a function decorated with with_span
or trace
. This is done by passing a links
option to the decorator.
The links
option should be the atom names of variables containing linked spans. You can create a link to a span with OpenTelemetry.link/1
e.g.
require OpenTelemetry.Tracer, as: Tracer
def parent do
parent_span = Tracer.start_span("parent")
link = OpenTelemetry.link(parent_span)
child(link)
end
@decorate with_span("child", links: [:parent_link])
def child(parent_link) do
# ...
:ok
end
Full Changelog: v1.4.8...v1.4.9
v1.4.8
- Adds a v2 of the attributes module and the ability to toggle between. The v2 version is more limited, but simpler and (hopefully) easier to understand.
- Changes with_span to use start/end span
Previously dyalizer would not error on invalid contracts for functions
annotated with the decorator. presumably this was because the return
actually happens in a closure.
So, for example, the following code would pass dialyzer successfully
```elixir
@spec hello :: {:ok, :asdf}
@decorate with_span("hello")
def hello do
:world
end
````
After this change it fails as expected
```shell
lib/spec_demo.ex:17:invalid_contract
The @spec for the function does not match the success typing of the function.
Function:
SpecDemo.hello/0
Success typing:
@spec hello() :: :world
```
Full Changelog: v1.4.7...v1.4.8
v1.4.7
v1.4.6
- Updates dependencies, notably minor versions of the opentelemetry api and sdk
mix hex.outdated
Dependency Current Latest Status
credo 1.7.0 1.7.1 Update possible
decorator 1.4.0 1.4.0 Up-to-date
dialyxir 1.3.0 1.4.1 Update possible
ex_doc 0.30.3 0.30.6 Update possible
excoveralls 0.16.1 0.17.1 Update not possible
opentelemetry 1.3.0 1.3.1 Update possible
opentelemetry_api 1.2.1 1.2.2 Update possible
opentelemetry_exporter 1.6.0 1.6.0 Up-to-date
Full Changelog: v1.4.5...v1.4.6
v1.4.5
What's Changed
- Bump ex_doc from 0.29.4 to 0.30.3 by @dependabot in #118
- Fixes an issue with included input parameters not being recorded in the span attributes when an exception is raised. Included body parameters will still not be included since they are not available from the rescue block.
Full Changelog: v1.4.4...v1.4.5
v1.4.4
What Changed
- Fixes an issue with error not being recorded in the span attributes when using
Attributes.set
since it was being passed as an atom.
Full Changelog: v1.4.3...v1.4.4
v1.4.3
What's Changed
- Do not prefix "error" attributes with the configured prefix since these have special meaning in open telemetry
Full Changelog: v1.4.2...v1.4.3