v0.5.2
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