Skip to content

Commit 91a4df2

Browse files
authored
docs: Updates telemetry documentation to include span changes (#482)
Co-authored-by: Isaac Sanders <[email protected]>
1 parent 3b06c3c commit 91a4df2

File tree

1 file changed

+10
-32
lines changed

1 file changed

+10
-32
lines changed

pages/telemetry.md

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -32,42 +32,20 @@ A Telemetry event is made up of the following:
3232
* `metadata` - A map of key/value pairs that can be used
3333
for tagging metrics.
3434

35-
### A Quantum Example
36-
37-
Here is an example of an event from your endpoint:
38-
39-
* `[:quantum, :job, :stop]` - dispatched whenever a job
40-
execution is done
41-
42-
* Measurement: `%{duration: native_time}`
43-
44-
* Metadata: `%{job: Quantum.Job.t(), node: Node.t(), scheduler: atom()}`
45-
46-
This means that after each job execution, `Quantum`, via `:telemetry`,
47-
will emit a "stop" event, with a measurement of how long it
48-
took to execute the job:
49-
50-
```elixir
51-
:telemetry.execute([:quantum, :job, :start], %{system_time: system_time}, %{
52-
job: job,
53-
node: node,
54-
scheduler: scheduler
55-
})
56-
```
57-
5835
### Quantum Telemetry Events
5936

6037
The following events are published by Quantum with the following measurements and metadata:
6138

62-
* `[:quantum, :job, :start]` - dispatched on job execution start
63-
* Measurement: `%{system_time: system_time}`
64-
* Metadata: `%{job: Quantum.Job.t(), node: Node.t(), scheduler: atom()}`
65-
* `[:quantum, :job, :exception]` - dispatched on job execution fail
66-
* Measurement: `%{duration: native_time}`
67-
* Metadata: `%{job: Quantum.Job.t(), node: Node.t(), scheduler: atom(), reason: term(), stacktrace: __STACKTRACE__}`
68-
* `[:quantum, :job, :stop]` - dispatched on job execution end
69-
* Measurement: `%{duration: native_time}`
70-
* Metadata: `%{job: Quantum.Job.t(), node: Node.t(), scheduler: atom(), result: term()}`
39+
* `[:quantum, :job]` - A span generated by `:telemetry.span/3` around the execution of a job
40+
* `[:quantum, :job, :start]` - dispatched on job execution start
41+
* Measurement: `%{system_time: native_time}`
42+
* Metadata: `%{telemetry_span_context: term(), job: Quantum.Job.t(), node: Node.t(), scheduler: atom()}`
43+
* `[:quantum, :job, :exception]` - dispatched on job execution fail
44+
* Measurement: `%{duration: native_time}`
45+
* Metadata: `%{telemetry_span_context: term(), job: Quantum.Job.t(), node: Node.t(), scheduler: atom(), kind: :throw | :error | :exit, reason: term(), stacktrace: list()}`
46+
* `[:quantum, :job, :stop]` - dispatched on job execution end
47+
* Measurement: `%{duration: native_time}`
48+
* Metadata: `%{telemetry_span_context: term(), job: Quantum.Job.t(), node: Node.t(), scheduler: atom(), result: term()}`
7149
* `[:quantum, :job, :add]` - dispatched when a job is added
7250
* Measurement: `%{}`
7351
* Metadata: `%{job: Quantum.Job.t(), scheduler: atom()}`

0 commit comments

Comments
 (0)