File: capture.md

package info (click to toggle)
ruby-traces 0.18.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 156 kB
  • sloc: ruby: 375; makefile: 4
file content (39 lines) | stat: -rw-r--r-- 923 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Capture

This guide explains how to use `traces` for exporting traces from your application. This can be used to document all possible traces.

## With Test Suite

If your application defines one or more traces and emits them as part of a test suite, you can export them using the `bake traces:capture` command.

```bash
$ cd test/traces/backend/.capture/
$ bake traces:capture run traces:capture:list output --format json
[
  {
    "name": "my_trace",
    "attributes": {
      "foo": "baz"
    },
    "context": {
      "trace_id": "038d110379a499a8ebcfb2b77cd69e1a",
      "parent_id": "bf134b25de4f4a82",
      "flags": 0,
      "state": null,
      "remote": false
    }
  },
  {
    "name": "nested",
    "attributes": {
    },
    "context": {
      "trace_id": "038d110379a499a8ebcfb2b77cd69e1a",
      "parent_id": "2dd5510eb8fffc5f",
      "flags": 0,
      "state": null,
      "remote": false
    }
  }
]
```