Skip to content

Commit 25d6c78

Browse files
deepakglobantdeepakglobant
andauthored
feat: allow user to add custom tags (MN-274) (#493)
Co-authored-by: deepakglobant <[email protected]>
1 parent 9416ac3 commit 25d6c78

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

packages/corejs/src/monitoring/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ export function MonitoringProvider({ children, config }: PropsWithChildren<Monit
4646
new BrowserTracing({ tracePropagationTargets: config.tracingOrigins }),
4747
],
4848
});
49+
50+
if (config.customTags) {
51+
Sentry.setTags(config.customTags);
52+
}
4953
}, []);
5054

5155
/**

packages/corejs/src/monitoring/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ export interface MonitoringConfig {
3232
* Array of all the origin to browser trace.
3333
*/
3434
tracingOrigins: string[];
35+
/**
36+
* Custom tags to add in all transaction.
37+
*/
38+
customTags?: { [tag: string]: string };
3539
}
3640

3741
/**

website/docs/monitoring.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ The configuration options are listed below :
2424

2525
### Monitoring Config
2626

27-
| **Config option** | **Required** | **Type** | **Description** |
28-
| ------------------ | ------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
29-
| `dsn` || string | DSN (Data Source Name) key for sentry.io application. A DSN tells a Sentry SDK where to send events so the events are associated with the correct project. |
30-
| `environment` || string | The current environment of your application , such as _development_, _testing_, _staging_, or _production_. Environments help you better filter issues and transactions among other uses. |
31-
| `debug` || boolean | Enable debug functionality in the SDK itself. If debug is enabled SDK will attempt to print out useful debugging information in browser's console if something goes wrong with sending the event. |
32-
| `tracesSampleRate` || number | Sample rate to determine trace sampling. The default is 1.0 which means that 100% of error events are sent. |
33-
| `tracingOrigins` || string[] | Array of all the origin to browser trace |
27+
| **Config option** | **Required** | **Type** | **Description** |
28+
| ------------------ | ------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
29+
| `dsn` || string | DSN (Data Source Name) key for sentry.io application. A DSN tells a Sentry SDK where to send events so the events are associated with the correct project. |
30+
| `environment` || string | The current environment of your application , such as _development_, _testing_, _staging_, or _production_. Environments help you better filter issues and transactions among other uses. |
31+
| `debug` || boolean | Enable debug functionality in the SDK itself. If debug is enabled SDK will attempt to print out useful debugging information in browser's console if something goes wrong with sending the event. |
32+
| `tracesSampleRate` || number | Sample rate to determine trace sampling. The default is 1.0 which means that 100% of error events are sent. |
33+
| `tracingOrigins` || string[] | Array of all the origin to browser trace |
34+
| `customTags` | | { [tag: string]: string } | Add custom tags in all transactions for better tracking |
3435

3536
### Note
3637

0 commit comments

Comments
 (0)