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
Copy file name to clipboardExpand all lines: develop-docs/development-infrastructure/environment/index.mdx
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,13 +102,17 @@ Just like running `sentry` (see above), you can start the `devservices` using th
102
102
devservices up
103
103
```
104
104
105
-
You will also need to enable workers which you can do so by running the following command:
105
+
To run tasks, you will also need to start taskbroker:
106
106
107
107
```shell
108
-
devservices up taskbroker
108
+
# start just taskbroker
109
+
devservices up --mode=taskbroker
110
+
111
+
# start taskbroker and a backgrond worker
112
+
devservices up --mode=taskworker
109
113
```
110
114
111
-
or use a --mode that includes workers. If you use the --mode flag of devservices, any modes that started celery workers will now start taskbroker and a taskworker.
115
+
If you use the `--mode` flag of devservices, any modes that started celery workers will now start taskbroker and a taskworker.
112
116
113
117
After that, you can start the development server inside the `getsentry` folder:
: An optional stack trace object corresponding to the [Stack Trace Interface](/sdk/data-model/event-payloads/stacktrace/).
54
-
55
54
## Exception Mechanism
56
55
57
-
The exception mechanism is an optional field residing in the _Exception
58
-
Interface_. It carries additional information about the way the exception was
59
-
created on the target system. This includes general exception values obtained
60
-
from the operating system or runtime APIs, as well as mechanism-specific values.
56
+
The exception mechanism is an optional field residing in the _Exception Interface_.
57
+
It carries additional information about the way the exception was created and captured ("capturing mechanism") on the target system.
58
+
This includes general exception values obtained from the operating system or runtime APIs, as well as capturing mechanism-specific values.
61
59
62
60
### Attributes
63
61
64
-
`type`
62
+
#### `type`
63
+
64
+
Required (`string`)
65
+
66
+
The identifier of the capturing mechanism that captured the exception.
67
+
The chosen mechanism `type` MUST help users as well as Sentry employees determine the responsible mechanism for capturing the exception.
68
+
This is either instrumentation within our SDKs or users manually capturing exceptions (for example via `captureException`).
69
+
70
+
The `type` MUST be _reasonably unique_ to make it possible to identify the integration or SDK API that performed the capture.
71
+
There's no strict uniqueness requirement as in certain situations, multiple paths exist within one instrumentation, in which case it is fine to use a common mechanism `type`.
72
+
73
+
For user-invoked exception captures (e.g. via `captureException`), the `type` MUST be set to `'generic'`.
74
+
75
+
For SDK-invoked exception captures, the mechanism `type` value MUST NOT be set to `'generic'` and SHOULD follow the [Trace Origin](/sdk/performance/trace-origin/) naming scheme whenever applicable.
76
+
For example, if a span is wrapping the exception capture logic, `type` should be equal to this span's `sentry.origin` attribute.
77
+
If no (specific) span is present, the `type` SHOULD be set to an adequate value, following the Trace Origin naming scheme as closely as possible.
78
+
79
+
<Expandabletitle="Examples">
65
80
66
-
: Required unique identifier of this mechanism determining rendering and processing of the mechanism data.
Use `'generic'` for user-invoked exception captures (i.e. default value):
106
+
107
+
```js
108
+
functioncaptureException(error, context) {
109
+
constmechanism= {
110
+
type:'generic',
111
+
handled:true,
112
+
...context?.mechanism,
113
+
}
114
+
// ...
115
+
}
116
+
```
69
117
70
-
: Optional human-readable description of the error mechanism and a possible hint on how to solve this error.
71
118
72
-
`help_link`
119
+
</Expandable>
73
120
74
-
: Optional fully qualified URL to an online help resource, possibly interpolated with error parameters.
121
+
<Expandable title="Why Trace Origin?">
75
122
76
-
`handled`
123
+
Historically, there was no requirement for the `type` attribute naming scheme.
124
+
Consequently, different SDKs took diffferent approaches as to how they set the `type` attribute.
125
+
In some cases, the `type` attribute was/is not set at all.
126
+
Chosing [Trace Origin](/sdk/performance/trace-origin/) as the naming scheme for the `type` attribute means that we're using an already established and accepted naming scheme.
127
+
The scheme works well enough for the exception mechanism `type` attribute.
128
+
Slight deviations to accomodate for the applicability to exceptions are allowed and to be expected.
129
+
SDK maintainers are free to migrate to the new naming scheme for existing capturing mechanisms or use it when adding new mechanisms.
77
130
78
-
: Optional flag indicating whether the user has handled the exception (for example, via `try ... catch`).
131
+
</Expandable>
79
132
80
-
`synthetic`
133
+
#### `handled`
81
134
82
-
: An optional flag indicating that this error is synthetic. Synthetic errors are errors that
83
-
carry little meaning by themselves. This may be because they are created at a central
84
-
place (like a crash handler), and are all called the same: `Error`, `Segfault` etc.
85
-
When the flag is set, Sentry will then try to use other information (top in-app frame
86
-
function) rather than the exception type and value in the UI for the primary event display.
87
-
Furthermore, if this flag is set, Sentry will ignore the exception `type` when grouping the
88
-
exception into issues.
89
-
: This flag should be set for all "segfaults" for instance as every single error group would
90
-
look very similar otherwise. Also, errors the SDK creates to add a stack trace to events
91
-
that don't have one themselves should be marked as `synthetic` (This happens, for example,
92
-
when users set `attachStackTrace: true` and capture a string message via `captureException`
93
-
or `captureMessage`.)
135
+
Optional (`boolean`)
94
136
95
-
`exception_id`
137
+
Flag indicating whether the user has handled the exception (for example, via `try...catch`).
96
138
97
-
: An optional numeric value providing an ID for the exception relative
98
-
to this specific event. The SDK should assign simple incrementing integers
99
-
to each exception in the tree, starting with 0 for the root of the tree.
100
-
In other words, when flattened into the list provided in the exception
101
-
values on the event, the last exception in the list should have ID 0,
102
-
the previous one should have ID 1, the next previous should have ID 2, etc.
139
+
#### `description`
103
140
104
-
`parent_id`
141
+
Optional (`string`)
105
142
106
-
: An optional numeric value pointing at the exception_id that is the
107
-
parent of this exception. The SDK should assign this to all exceptions except
108
-
the root exception (the last to be listed in the exception values).
143
+
Human-readable description of the error mechanism and a possible hint on how to solve this error.
109
144
110
-
`is_exception_group`
145
+
#### `help_link`
111
146
112
-
: An optional flag indicating that this exception is part of an exception group type specific to the platform or language.
147
+
Optional (`string`)
113
148
114
-
`source`
149
+
Fully qualified URL to an online help resource, possibly interpolated with error parameters.
115
150
116
-
: An optional string value describing the source of the exception. The SDK should populate this with the name of the property or attribute of the parent exception that this exception was acquired from. In the case of an array, it should include the zero-based array index as well.
151
+
#### `synthetic`
152
+
153
+
Optional (`boolean`)
154
+
155
+
Flag indicating that this error is synthetic.
156
+
Synthetic errors are errors that carry little meaning by themselves.
157
+
This may be because they are all created at a central place (like a crash handler), and share the same title: `Error`, `Segfault` etc.
158
+
When the flag is set, Sentry will then try to use other information (top in-app frame function) rather than the exception type and value in the UI for the primary event display.
159
+
Furthermore, if this flag is set, Sentry will ignore the exception `type` when grouping the exception into issues.
160
+
This flag SHOULD be set for all "segfaults" for instance as every single error group would look very similar otherwise.
161
+
Also, errors the SDK creates to add a stack trace to events that don't have one themselves SHOULD be marked as `synthetic` (This happens, for example, when users set `attachStackTrace:true` and capture a string message via `captureException` or `captureMessage`.)
162
+
163
+
#### `exception_id`
164
+
165
+
Optional (`number`)
166
+
167
+
An optional numeric value providing an ID for the exception relative to this specific event.
168
+
The SDK SHOULD assign simple incrementing integers to each exception in the tree, starting with 0 for the root of the tree.
169
+
In other words, when flattened into the list provided in the exception values on the event, the last exception in the list SHOULD have ID 0,
170
+
the previous one SHOULD have ID 1, the next previous SHOULD have ID 2, etc.
171
+
172
+
#### `parent_id`
173
+
174
+
Optional (`number`)
175
+
176
+
An optional numeric value pointing at the exception_id that is the parent of this exception.
177
+
The SDK SHOULD assign this to all exceptions except the root exception (the last to be listed in the exception values).
178
+
179
+
#### `is_exception_group`
180
+
181
+
Optional (`boolean`)
182
+
183
+
Flag indicating that this exception is part of an exception group type specific to the platform or language.
184
+
185
+
#### `source`
186
+
187
+
Optional (`string`)
188
+
189
+
An optional string value describing the source of the exception.
190
+
The SDK SHOULD populate this with the name of the property or attribute of the parent exception that this exception was acquired from.
191
+
In the case of an array, it SHOULD include the zero-based array index as well.
Copy file name to clipboardExpand all lines: develop-docs/sdk/expected-features/index.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -233,7 +233,7 @@ Whenever possible, avoid adding the attachment altogether if taking the screensh
233
233
234
234
## Before-Send Hook
235
235
236
-
Hook called with the event (and on some platforms the hint) that allows the user to decide whether an event should be sent or not. This can also be used to further modify the event. This only works for `error` events. For `transactions` it is recommended to have `beforeSendTransaction` implemented in SDKs. To understand when you should call this in your SDK, please refer to the [error filter ordering of sessions](/sdk/telemetry/sessions/#filter-order).
236
+
Hook called with the event (and on some platforms the hint) that allows the user to decide whether an event should be sent or not. This can also be used to further modify the event. This only works for `error` events. Other event types like `transactions` and `check-ins`**should not** go through `beforeSend`. For `transactions` it is recommended to have `beforeSendTransaction` implemented in SDKs. For `check-ins` you can optionally implement `beforeSendCheckIn`. To understand when you should call this in your SDK, please refer to the [error filter ordering of sessions](/sdk/telemetry/sessions/#filter-order).
Copy file name to clipboardExpand all lines: develop-docs/sdk/platform-specifics/serverless-sdks/aws-lambda.mdx
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,11 @@ sidebar_order: 10
5
5
6
6
Lambda functions can be written in numerous programming languages (JavaScript,
7
7
Python, Ruby, Java, Go, ...). Sentry is currently supporting automatic
8
-
instrumentation of Lambda functions written in JavaScript and Python.
8
+
instrumentation of Lambda functions written in [JavaScript](https://docs.sentry.io/platforms/javascript/guides/aws-lambda/)
9
+
and [Python](https://docs.sentry.io/platforms/python/integrations/aws-lambda/).
9
10
10
-
See the [Sentry Documentation](https://docs.sentry.io/product/integrations/cloud-monitoring/) on how to set up serverless instrumentation.
11
+
See the [Sentry Documentation](https://docs.sentry.io/product/integrations/cloud-monitoring/)
12
+
on how to set up serverless instrumentation.
11
13
12
14
## A short primer into AWS Lambda functions, and layers.
13
15
@@ -79,3 +81,7 @@ this can be found [here](https://github.com/getsentry/sentry-javascript/blob/mas
79
81
80
82
To deploy a new version of the Lambda layer to AWS, you need to trigger a new
81
83
release of the JavaScript SDK.
84
+
85
+
### Development Environment
86
+
87
+
When working on the Sentry AWS Lambda layer, the workflow is that you have your example Lambda function in a dev account on AWS and then deploy your local layer and attach it to your example function. How to do this in Python is described in the [contribution guide](https://github.com/getsentry/sentry-python/blob/master/CONTRIBUTING.md#contributing-to-sentry-aws-lambda-layer) of the Python SDK.
Copy file name to clipboardExpand all lines: develop-docs/sdk/telemetry/check-ins.mdx
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -159,3 +159,7 @@ monitors frontend APIs.
159
159
`unit`
160
160
161
161
: **String, required**. The interval unit. Should be one of `year`, `month`, `week`, `day`, `hour`, `minute`.
162
+
163
+
## Interaction with `beforeSend`
164
+
165
+
Check-in events in the SDK should **not** go through `beforeSend`. SDKs can optionally implement a dedicated `beforeSendCheckIn` hook that only applies to check-in events.
description: "Learn how to view and stream logs using the Sentry CLI."
5
+
---
6
+
7
+
The `sentry-cli` tool can be used to view and stream logs from your Sentry projects. This allows you to monitor your application logs directly from the command line.
8
+
9
+
## Requirements
10
+
11
+
To use the logs command, you need to:
12
+
13
+
-[Install](/cli/installation) the Sentry CLI
14
+
-[Authenticate](/cli/configuration) with Sentry using an auth token
15
+
- Have logs enabled for your project
16
+
17
+
## Configuration
18
+
19
+
The logs command uses your Sentry auth token for authentication. You can configure this using:
20
+
21
+
```bash
22
+
sentry-cli login
23
+
```
24
+
25
+
Or by setting the `SENTRY_AUTH_TOKEN` environment variable:
26
+
27
+
```bash
28
+
export SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___
29
+
```
30
+
31
+
Learn more about the CLI's [configuration file](/cli/configuration#configuration-file).
32
+
33
+
## Basic Usage
34
+
35
+
The logs command supports two main operations: listing logs and streaming logs in real-time.
36
+
37
+
### List Logs
38
+
39
+
To fetch and display logs:
40
+
41
+
```bash
42
+
sentry-cli logs list --project=my-project --org=my-org
43
+
```
44
+
45
+
### Stream Logs
46
+
47
+
To continuously stream logs in real-time:
48
+
49
+
```bash
50
+
sentry-cli logs list --project=my-project --org=my-org --live
51
+
```
52
+
53
+
The live streaming mode will continuously poll for new logs and display them as they arrive.
54
+
55
+
## Command Options
56
+
57
+
### Project and Organization
58
+
59
+
Specify the project and organization explicitly:
60
+
61
+
```bash
62
+
sentry-cli logs list --project=my-project --org=my-org
63
+
```
64
+
65
+
Or use the default values from your configuration file.
66
+
67
+
## Examples
68
+
69
+
### Monitor Application Logs
70
+
71
+
Stream logs from your production application:
72
+
73
+
```bash
74
+
sentry-cli logs list --project=my-app --org=my-org --live
75
+
```
76
+
77
+
### View Recent Logs
78
+
79
+
Fetch and display logs from your project:
80
+
81
+
```bash
82
+
sentry-cli logs list --project=my-app --org=my-org
83
+
```
84
+
85
+
## Output Format
86
+
87
+
The logs command displays log entries with the following information:
88
+
89
+
- Timestamp
90
+
- Log level
91
+
- Message
92
+
- Trace ID (if present)
93
+
94
+
Log entries are displayed in a readable format, making it easy to monitor your application's logging output directly from the command line.
0 commit comments