Skip to content

Commit 06627f8

Browse files
committed
Merge branch 'master' of github.com:getsentry/sentry-docs into txiao/docs/update-python-continuous-profiling-docs
2 parents 04497bd + 849c7f1 commit 06627f8

File tree

82 files changed

+875
-600
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+875
-600
lines changed

develop-docs/sdk/data-model/event-payloads/contexts.mdx

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -674,30 +674,6 @@ Additional information that allows Sentry to connect multiple transactions, span
674674
| `data_loss` | Unrecoverable data loss or corruption | 500 |
675675
| `unauthenticated` | The requester doesn't have valid authentication credentials for the operation | 401 |
676676

677-
`exclusive_time`
678-
679-
: _Optional_. The amount of time in milliseconds spent in this transaction span, excluding its immediate child spans.
680-
681-
- Example: `1.035`
682-
683-
`client_sample_rate`
684-
685-
: _Optional_. The client-side sample rate.
686-
687-
- Example: `0.1`
688-
689-
`tags`
690-
691-
: _Optional_. A map or list of tags for this event. Each tag must be less than 200 characters.
692-
693-
- Example: `{ "deviceMemory": "8 GB", "effectiveConnectionType": "4g", "routing.instrumentation": "react-router-v3" }`
694-
695-
`dynamic_sampling_context`
696-
697-
: _Optional_. The [Dynamic Sampling Context](/sdk/performance/dynamic-sampling-context/).
698-
699-
- Example: `{ "trace_id": "12312012123120121231201212312012", "sample_rate": "1.0", "public_key": "93D0D1125146288EAEE2A9B3AF4F96CCBE3CB316" },`
700-
701677
`origin`
702678

703679
: _Optional_. The origin of the trace indicates what created the trace. For more details, see [trace origin](/sdk/performance/trace-origin/).
@@ -731,16 +707,6 @@ If the route is set to a string (e.g. `"route": "foo"`), it will be normalized i
731707
"parent_span_id": null,
732708
"description": "<OrganizationContext>",
733709
"op": "http.server",
734-
"tags": {
735-
"deviceMemory": "8 GB",
736-
"effectiveConnectionType": "4g",
737-
"routing.instrumentation": "react-router-v3"
738-
},
739-
"dynamic_sampling_context": {
740-
"trace_id": "12312012123120121231201212312012",
741-
"sample_rate": "1.0",
742-
"public_key": "93D0D1125146288EAEE2A9B3AF4F96CCBE3CB316"
743-
},
744710
"origin": "auto.http.http_client_5",
745711
"data": {
746712
"route": {
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
title: Batch Processor
3+
---
4+
5+
<Alert level="warning">
6+
🚧 This document is work in progress.
7+
</Alert>
8+
9+
<Alert>
10+
This document uses key words such as "MUST", "SHOULD", and "MAY" as defined in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt) to indicate requirement levels.
11+
</Alert>
12+
13+
The BatchProcessor batches spans and logs into one envelope to reduce the number of HTTP requests. When an SDK implements span streaming or logs, it MUST use a BatchProcessor, which is similar to [OpenTelemetry's Batch Processor](https://github.com/open-telemetry/opentelemetry-collector/blob/main/processor/batchprocessor/README.md). The BatchProcessor holds logs and finished spans in memory and batches them together into envelopes. It uses a combination of time and size-based batching. When writing this, the BatchProcessor only handles spans and logs, but an SDK MAY use it for other telemetry data in the future.
14+
15+
## Specification
16+
17+
Whenever the SDK finishes a span or captures a log, it MUST put it into the BatchProcessor. The SDK MUST NOT put unfinished spans into the BatchProcessor.
18+
19+
The BatchProcessor MUST start a timeout of 5 seconds when the SDK adds the first span or log. When the timeout exceeds, the BatchProcessor MUST send all spans or logs, no matter how many items it contains. The SDK MAY choose a different value for the timeout, but it MUST NOT exceed 30 seconds, as this can lead to problems with the span buffer on the backend, which uses a time interval of 60 seconds for determining segments for spans.
20+
21+
The BatchProcessor MUST send all items after the SDK when containing spans or logs exceeding 1MiB in size. The SDK MAY choose a different value for the max batch size keeping the [envelope max sizes](/sdk/data-model/envelopes/#size-limits) in mind. The SDK MUST calculate the size of a span or a log to manage the BatchProcessor's memory footprint. The SDK MUST serialize the span or log and calculate the size based on the serialized JSON bytes. As serialization is expensive, the BatchProcessor SHOULD keep track of the serialized spans and logs and pass these to the envelope to avoid serializing multiple times.
22+
23+
When the BatchProcessor sends all spans or logs, it MUST reset its timeout and remove all spans and logs. The SDK MUST apply filtering and sampling before adding spans or logs to the BatchProcessor. The SDK MUST apply rate limits to spans and logs after they leave the BatchProcessor to send as much data as possible by dropping data as late as possible.
24+
25+
The detailed specification is written in the [Gherkin syntax](https://cucumber.io/docs/gherkin/reference/). The specification uses spans as an example, but the same applies to logs or any other future telemetry data.
26+
27+
28+
```Gherkin
29+
Scenario: No spans in BatchProcessor 1 span added
30+
Given no spans in the BatchProcessor
31+
When the SDK finishes 1 span
32+
Then the SDK puts this span to the BatchProcessor
33+
And starts a timeout of 5 seconds
34+
And doesn't send the span to Sentry
35+
36+
Scenario: Span added before timeout exceeds
37+
Given span A in the BatchProcessor
38+
Given 4.9 seconds pass
39+
When the SDK finishes span B
40+
Then the SDK adds span B to the BatchProcessor
41+
And doesn't reset the timeout
42+
And doesn't send the spans A and B in the BatchProcessor to Sentry
43+
44+
Scenario: Spans with size of 1 MiB - 1 byte added, timeout exceeds
45+
Given spans with size of 1 MiB - 1 byte in the BatchProcessor
46+
When the timeout exceeds
47+
Then the SDK adds all the spans to one envelope
48+
And sends them to Sentry
49+
And resets the timeout
50+
And clears the BatchProcessor
51+
52+
Scenario: Spans with size of 1 MiB - 1 byte added within 4.9 seconds
53+
Given spans with size of 1 MiB - 1 byte in the BatchProcessor
54+
When the SDK finishes another span and puts it into the BatchProcessor
55+
Then the BatchProcessor puts all spans into one envelope
56+
And sends the envelope to Sentry
57+
And resets the timeout
58+
And clears the BatchProcessor
59+
60+
Scenario: Unfinished spans
61+
Given no span is in the BatchProcessor
62+
When the SDK starts a span but doesn't finish it
63+
Then the BatchProcessor is empty
64+
65+
Scenario: Span filtered out
66+
Given no span is in the BatchProcessor
67+
When the finishes a span
68+
And the span is filtered out
69+
Then the BatchProcessor is empty
70+
71+
Scenario: Span not sampled
72+
Given no span is in the BatchProcessor
73+
When the finishes a span
74+
And the span is not sampled
75+
Then the BatchProcessor is empty
76+
77+
Scenario: 1 span added application crashes
78+
Given 1 span in the SpansAggregator
79+
When the SDK detects a crash
80+
Then the SDK does nothing with the items in the BatchProcessor
81+
And loses the spans in the BatchProcessor
82+
83+
```

develop-docs/self-hosted/troubleshooting/docker.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ sidebar_title: Docker
44
sidebar_order: 3
55
---
66

7+
## `FAIL: Docker Compose is required to run self-hosted` error but Docker Compose is installed
8+
9+
Around version 25.1.0 to 25.4.0, users which did not have `docker compose` plugin installed, and relied only on `docker-compose` will face some issues. Notably for Amazon Linux 2023 distro that does not have `docker-compose-plugin` packaged, you may need to install the standalone `docker-compose` separately. See [docker/compose installation guide](https://github.com/docker/compose?tab=readme-ov-file#linux) for more details.
10+
711
## Container Healthcheck
812

913
There may be some circumstances which you may want to increase or decrease healthcheck interval, timeout or retries for your custom needs. This can be achieved by editing `HEALTHCHECK_INTERVAL`, `HEALTHCHECK_TIMEOUT`, `HEALTHCHECK_RETRIES` variables' values in `.env`.

docs/platforms/go/common/tracing/instrumentation/custom-instrumentation/index.mdx

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,94 @@ To capture transactions and spans customized to your organization's needs, you m
1515
<PlatformContent includePath="performance/add-spans-example" />
1616

1717
<PlatformContent includePath="performance/retrieve-transaction" />
18+
19+
## Adding Span & Transaction Data Attributes
20+
21+
You can capture data attributes along with your spans and transactions. You can specify data attributes when starting a span or transaction:
22+
23+
```go
24+
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
25+
ctx := r.Context()
26+
27+
options := []sentry.SpanOption{
28+
// Set the OP based on values from https://develop.sentry.dev/sdk/performance/span-operations/
29+
sentry.WithOpName("http.server"),
30+
sentry.ContinueFromRequest(r),
31+
sentry.WithTransactionSource(sentry.SourceURL),
32+
}
33+
34+
// Create a transaction and assign data attributes
35+
transaction := sentry.StartTransaction(ctx,
36+
fmt.Sprintf("%s %s", r.Method, r.URL.Path),
37+
options...,
38+
)
39+
transaction.SetData("dataAttr1", 42)
40+
transaction.SetData("dataAttr2", true)
41+
// omitted code ...
42+
transaction.Finish()
43+
44+
// ... or create a span and assign data attributes
45+
span := sentry.StartSpan(ctx, "span1")
46+
span.SetData("dataAttr1", 42)
47+
span.SetData("dataAttr2", true)
48+
// omitted code ...
49+
span.Finish()
50+
})
51+
```
52+
53+
Or you can add data attributes to an existing transaction or span:
54+
55+
```go
56+
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
57+
ctx := r.Context()
58+
transaction := sentry.TransactionFromContext(ctx)
59+
60+
if transaction != nil {
61+
transaction.SetData("dataAttr1", 42)
62+
transaction.SetData("dataAttr2", true)
63+
}
64+
65+
span := sentry.SpanFromContext(ctx)
66+
span.SetData("dataAttr1", 42)
67+
span.SetData("dataAttr2", true)
68+
})
69+
```
70+
71+
Or you can update existing transaction and span data by:
72+
73+
```go
74+
if d, found := transaction.Data["dataAttr1"]; found {
75+
if dataAttr1, ok := d.(int); ok {
76+
transaction.SetData("dataAttr1", dataAttr1.(int)+42)
77+
}
78+
}
79+
80+
if d, found := span.Data["dataAttr1"]; found {
81+
if dataAttr1, ok := d.(int); ok {
82+
span.SetData("dataAttr1", dataAttr1.(int)+42)
83+
}
84+
}
85+
})
86+
```
87+
88+
To attach data attributes to the transaction and all its spans, you can use `BeforeSendTransaction`:
89+
90+
```go
91+
sentry.Init(sentry.ClientOptions{
92+
Dsn: "___PUBLIC_DSN___",
93+
BeforeSendTransaction: func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event {
94+
for _, sp := range event.Spans {
95+
sp.SetData("dataAttr1", 42)
96+
sp.SetData("dataAttr2", true)
97+
}
98+
99+
dataCtx, ok := event.Contexts["trace"]["data"].(map[string]any)
100+
if !ok {
101+
dataCtx = make(map[string]any)
102+
event.Contexts["trace"]["data"] = dataCtx
103+
}
104+
dataCtx["num"] = 42
105+
return event
106+
},
107+
})
108+
```

docs/platforms/godot/configuration/options.mdx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,18 @@ Learn more about [DSN utilization](/product/sentry-basics/dsn-explainer/#dsn-uti
2222

2323
<ConfigKey name="debug">
2424

25-
Turns debug mode on or off. If `debug` is enabled, the SDK will print useful debugging information to standard output. These messages do not appear in the Godot console or log file but can be seen when launching Godot application from a terminal. It's generally not recommended to turn it on in production, though turning `debug` mode on will not cause any safety concerns.
25+
Turns debug mode on or off. If `debug` is enabled, the SDK will print useful debugging information. You can see it in the Output panel of the Godot editor. It's generally not recommended to turn it on in production, though turning `debug` mode on will not cause any safety concerns.
2626

2727
In the Project Settings, this option appears as `Debug Printing` and defaults to `Auto`. When set to `Auto`, the `debug` is enabled in debug builds (such as the editor and debug exports), and disabled in release export.
2828

29+
You can control the verbosity using the `diagnostic_level` option.
30+
31+
</ConfigKey>
32+
33+
<ConfigKey name="diagnostic_level">
34+
35+
Specifies the minimum level of messages to be printed if `debug` is turned on.
36+
2937
</ConfigKey>
3038

3139
<ConfigKey name="release">

docs/platforms/javascript/common/best-practices/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Special Use Cases
33
description: "Learn how to set up Sentry for several specific use cases with these best practice guides."
4-
sidebar_order: 6
4+
sidebar_order: 8000
55
notSupported:
66
- javascript.node
77
- javascript.aws-lambda

0 commit comments

Comments
 (0)