-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(flutter): document how to add data to spans/transactions (#12367)
* add span data info to dart * update flutter page * Apply suggestions from code review Co-authored-by: Karl Heinz Struggl <[email protected]> * Apply suggestions from code review Co-authored-by: Alex Krawiec <[email protected]> * Update dart.mdx * Update dart.mdx --------- Co-authored-by: Karl Heinz Struggl <[email protected]> Co-authored-by: Alex Krawiec <[email protected]>
- Loading branch information
1 parent
c5c59c5
commit 7de987d
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
## Adding Data Attributes to Transactions and Spans | ||
|
||
You can add data attributes to your transactions and spans. This data is visible in the trace explorer in Sentry. Data attributes can be of type `String`, `int`, `double` or `bool`, as well as (non-mixed) arrays of these types: | ||
|
||
### For Transactions | ||
|
||
```dart | ||
final transaction = Sentry.startTransaction('my-transaction', 'http.server'); | ||
transaction.setData('data_attribute_1', 'value1'); | ||
transaction.setData('data_attribute_2', 42); | ||
transaction.setData('data_attribute_3', true); | ||
transaction.setData('data_attribute_4', ['value1', 'value2']); | ||
transaction.setData('data_attribute_5', [42, 43]); | ||
transaction.setData('data_attribute_6', [true, false]); | ||
``` | ||
|
||
### For Spans | ||
|
||
```dart | ||
final span = parent.startChild('http.client'); | ||
span.setData('data_attribute_1', 'value1'); | ||
span.setData('data_attribute_2', 42); | ||
span.setData('data_attribute_3', true); | ||
span.setData('data_attribute_4', ['value1', 'value2']); | ||
span.setData('data_attribute_5', [42, 43]); | ||
span.setData('data_attribute_6', [true, false]); | ||
``` |