Skip to content

Releases: marcdel/open_telemetry_decorator

v1.4.2

16 Jul 01:51
Compare
Choose a tag to compare

What's Changed

  • Bump opentelemetry_exporter from 1.4.1 to 1.5.0 by @dependabot in #111
  • Ensure that keys are strings before we call Span.set_attributes (#114)
  • Adds with_span decorator (delegates to trace, so you can use either)
  • Ensure attributes set with the helper get prefixed

Full Changelog: v1.4.1...v1.4.2

v.1.4.1

18 May 00:57
Compare
Choose a tag to compare

v1.4.1

Features

  • Adds span set attribute helper that treats attributes the same way :include does (currently inspects anything it doesn't know how to handle) (thanks @ulissesalmeida)
  • Updates :include attribute validator to allow nested string keys (thanks @leggebroten)

Bug fixes

  • Fixes an issue where indexing into a nested struct via :include would crash due to a *Struct* does not implement the Access behaviour error
  • Protect against context corruption (thanks @leggebroten)

Full Changelog: v1.4.0...v1.4.1

v1.4.0

04 May 05:00
Compare
Choose a tag to compare

What's Changed

  • You're now able to :include nested result elements e.g. include: [[:result, :name]]
  • You're now able to index into string keyed maps e.g. include: [[:user, "id"]]
  • Complex object attributes (lists, maps, tuples, etc.) are now inspected rather than omitted from the trace
  • 🚨The default joiner for nested attributes is now . rather than _ e.g. user.id=1 rather than user_id=1🚨
    • You can change this behavior via configuration e.g. config :open_telemetry_decorator, attr_joiner: "_"

New Contributors

Full Changelog: v1.3.0...v1.4.0

v1.3.0

28 Apr 21:28
Compare
Choose a tag to compare

Introduces a breaking (kind of) change. The API hasn't changed at all, but it will no longer overwrite function input parameters in the span attributes if they are rebound in the body of the function.

e.g. this param_override(3, 2) will add x=3 to the span, where previously it would have been x=4

@decorate trace("param_override", include: [:x, :y])
def param_override(x, y) do
  x = x + 1

  {:ok, x + y}
end

v1.2.7

12 Apr 20:38
Compare
Choose a tag to compare
  • The trace decorator will no longer eat your stack traces 🥞

v1.0.0-rc.3

20 Oct 05:07
7a7992f
Compare
Choose a tag to compare

Update dependencies opentelemetry, opentelemetry_api, and opentelemetry_exporter to version 1.0.0-rc.3 and bump the version of this project to match.

v0.5.3

15 Feb 00:37
Compare
Choose a tag to compare

Breaking changes

  • Removes the simple_trace decorator.

v0.5.2

14 Feb 06:35
Compare
Choose a tag to compare

Updates to otel 5.0

Breaking changes with opentelemetry 0.5.0:

You'll need to change ot_batch_processor to otel_batch_processor in your config. For example:

config :opentelemetry,
  processors: [
-    ot_batch_processor: %{
+    otel_batch_processor: %{
      exporter:
        {OpenTelemetry.Honeycomb.Exporter,
         write_key: Map.fetch!(System.get_env(), "HONEYCOMB_KEY"), dataset: "dataset_name"}
    }
  ]

If you're using OpenTelemetry.Span.set_attribute/2 or OpenTelemetry.Span.set_attributes/1, they now take the span context you want to set attributes on as the first argument. If you have existing wrapper functions, you can updated them to maintain the same functionality.

-  def set_attribute(key, value), do: OpenTelemetry.Span.set_attribute(key, value)
+  def set_attribute(key, value) do
+    ctx = Tracer.current_span_ctx()
+    Span.set_attribute(ctx, key, value)
+  end

-  def set_attributes(attrs), do: OpenTelemetry.Span.set_attributes(attrs)
+  def set_attributes(attrs) do
+    ctx = Tracer.current_span_ctx()
+    Span.set_attributes(ctx, attrs)
+  end

v0.5.1

18 Oct 07:07
Compare
Choose a tag to compare
v0.5.1 Pre-release
Pre-release
handle nils as well as missing objects

v0.4.1

05 Oct 16:26
Compare
Choose a tag to compare
v0.4.1 Pre-release
Pre-release

Fixes a bug with String.to_existing_atom. Since these atoms are added at compile time, and not generated from input, we should be able to use String.to_atom.