You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
of the same name and version of the Tracer -- the version also matches the
54
+
`opentelemetry_oban` Application version.
55
+
56
+
#### Context
57
+
58
+
[Context](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.8.0/specification/context/context.md) is used to pass values associated with the current [execution
associated with the OTP Application the module is in, starting the Span, setting
80
+
it as the currently active Span in the Context stored in the process dictionary
81
+
and ending the Span when the `Fun` or body of the Elixir macro finish, even if
82
+
an exception is thrown -- however, the exception is not caught, so it does not
83
+
change how user code should deal with raised exceptions. After the Span is
84
+
ended the Context in the process dictionary is reset to its value before the
85
+
newly started Span was set as the active Span. This handling of the active Span
86
+
in the process dictionary ensures proper lineage of Spans is kept when starting
87
+
and ending child Spans.
88
+
89
+
``` erlang
90
+
?with_span(SpanName, StartOpts, Fun)
91
+
```
92
+
93
+
``` elixir
94
+
OpenTelemetry.Tracer.with_span name, start_opts do
95
+
...
96
+
end
97
+
```
98
+
99
+
`StartOpts`/`start_opts` is a map of [Span creation options](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.8.0/specification/trace/api.md#span-creation):
for details about Attributes. Default is an empty list of attributes.
109
+
- `links`: List of [Links](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.8.0/specification/overview.md#links-between-spans) to causally related Spans from the same or a different Trace.
110
+
- `start_time`: The start time of the Span operation. Defaults to the current
111
+
time. The option should only be set if the start of the operation described by
112
+
the Span has already passed.
113
+
114
+
current_span_ctx(ctx)
115
+
116
+
set_current_span(span_ctx)
117
+
118
+
When using `start_span` instead of `with_span` there must be a corresponding
all at once. Setting an attribute with a key that already exists in the Span's
141
+
map of attributes will result in that key's value being overwritten.
142
+
143
+
``` erlang
144
+
?set_attribute(Key, Value)
145
+
?set_attributes(Attributes)
146
+
```
147
+
148
+
``` elixir
149
+
OpenTelemetry.Tracer.set_attribute(key, value)
150
+
OpenTelemetry.Tracer.set_attributes(attributes)
151
+
```
152
+
153
+
Be aware that there are [configurable limits](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.8.0/specification/common/common.md#attribute-limits) on the number and size of
0 commit comments