Skip to content

Commit

Permalink
v1.4.9
Browse files Browse the repository at this point in the history
  • Loading branch information
marcdel committed Feb 14, 2024
1 parent 8695e40 commit 79b7084
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 17 deletions.
54 changes: 38 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# OpenTelemetryDecorator

## 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.
```elixir
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
```

## 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
Expand All @@ -12,26 +34,26 @@ 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
````
```elixir
@spec hello :: {:ok, :asdf}
@decorate with_span("hello")
def hello do
:world
end
````

After this change it fails as expected
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.
```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
Function:
SpecDemo.hello/0

Success typing:
@spec hello() :: :world
```
Success typing:
@spec hello() :: :world
```

## v1.4.7
- Fixes a bug causing the attribute prefix to be appended twice when using the include option
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule OpenTelemetryDecorator.MixProject do
use Mix.Project

@version "1.4.8"
@version "1.4.9"
@github_page "https://github.com/marcdel/open_telemetry_decorator"

def project do
Expand Down

0 comments on commit 79b7084

Please sign in to comment.