Skip to content

Commit d4a3b10

Browse files
committed
feat: expose DD RUM sessionSampleRate and sessionReplaySampleRate
Signed-off-by: secustor <[email protected]>
1 parent 28571a6 commit d4a3b10

File tree

5 files changed

+47
-26
lines changed

5 files changed

+47
-26
lines changed

Diff for: app-config.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ app:
99
# applicationId: qwerty
1010
# site: # datadoghq.eu default = datadoghq.com
1111
# env: # optional
12+
# sessionSampleRate: 100
13+
# sessionReplaySampleRate: 0
14+
1215
support:
1316
url: https://github.com/backstage/backstage/issues # Used by common ErrorPage
1417
items: # Used by common SupportButton component

Diff for: docs/integrations/datadog-rum/installation.md

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ app:
2222
applicationId: qwerty
2323
# site: datadoghq.eu
2424
# env: 'staging'
25+
# sessionSampleRate: 100
26+
# sessionReplaySampleRate: 0
2527
```
2628

2729
If your [`app-config.yaml`](https://github.com/backstage/backstage/blob/e0506af8fc54074a160fb91c83d6cae8172d3bb3/app-config.yaml#L5) file does not have this configuration, you may have to adjust your [`packages/app/public/index.html`](https://github.com/backstage/backstage/blob/e0506af8fc54074a160fb91c83d6cae8172d3bb3/packages/app/public/index.html#L69) to include the Datadog RUM `init()` section manually.

Diff for: packages/app-next/public/index.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@
7272
site: '<%= config.getOptionalString("app.datadogRum.site") || "datadoghq.com" %>',
7373
service: 'backstage',
7474
env: '<%= config.getString("app.datadogRum.env") %>',
75-
sampleRate: 100,
75+
sampleRate:
76+
'<%= config.getOptionalNumber("app.datadogRum.sessionSampleRate") || 100 %>',
77+
sessionReplaySampleRate:
78+
'<%= config.getOptionalNumber("app.datadogRum.sessionReplaySampleRate") || 0 %>',
7679
trackInteractions: true,
7780
});
7881
});

Diff for: packages/app/public/index.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@
7272
site: '<%= config.getOptionalString("app.datadogRum.site") || "datadoghq.com" %>',
7373
service: 'backstage',
7474
env: '<%= config.getString("app.datadogRum.env") %>',
75-
sampleRate: 100,
75+
sampleRate:
76+
'<%= config.getOptionalNumber("app.datadogRum.sessionSampleRate") || 100 %>',
77+
sessionReplaySampleRate:
78+
'<%= config.getOptionalNumber("app.datadogRum.sessionReplaySampleRate") || 0 %>',
7679
trackInteractions: true,
7780
});
7881
});

Diff for: packages/cli/package.json

+34-24
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,45 @@
11
{
22
"name": "@backstage/cli",
3-
"description": "CLI for developing Backstage plugins and apps",
43
"version": "0.26.5-next.0",
5-
"publishConfig": {
6-
"access": "public"
7-
},
4+
"description": "CLI for developing Backstage plugins and apps",
85
"backstage": {
96
"role": "cli"
107
},
8+
"publishConfig": {
9+
"access": "public"
10+
},
11+
"keywords": [
12+
"backstage"
13+
],
1114
"homepage": "https://backstage.io",
1215
"repository": {
1316
"type": "git",
1417
"url": "https://github.com/backstage/backstage",
1518
"directory": "packages/cli"
1619
},
17-
"keywords": [
18-
"backstage"
19-
],
2020
"license": "Apache-2.0",
2121
"main": "dist/index.cjs.js",
22+
"bin": {
23+
"backstage-cli": "bin/backstage-cli"
24+
},
25+
"files": [
26+
"asset-types",
27+
"templates",
28+
"config",
29+
"bin",
30+
"dist/**/*.js"
31+
],
2232
"scripts": {
2333
"build": "backstage-cli package build",
24-
"lint": "backstage-cli package lint",
25-
"test": "backstage-cli package test",
2634
"clean": "backstage-cli package clean",
27-
"start": "nodemon --"
35+
"lint": "backstage-cli package lint",
36+
"start": "nodemon --",
37+
"test": "backstage-cli package test"
2838
},
29-
"bin": {
30-
"backstage-cli": "bin/backstage-cli"
39+
"nodemonConfig": {
40+
"exec": "bin/backstage-cli",
41+
"ext": "ts",
42+
"watch": "./src"
3143
},
3244
"dependencies": {
3345
"@backstage/catalog-model": "workspace:^",
@@ -197,18 +209,6 @@
197209
"optional": true
198210
}
199211
},
200-
"files": [
201-
"asset-types",
202-
"templates",
203-
"config",
204-
"bin",
205-
"dist/**/*.js"
206-
],
207-
"nodemonConfig": {
208-
"watch": "./src",
209-
"exec": "bin/backstage-cli",
210-
"ext": "ts"
211-
},
212212
"configSchema": {
213213
"$schema": "https://backstage.io/schema/config-v1",
214214
"title": "@backstage/cli",
@@ -248,6 +248,16 @@
248248
"type": "string",
249249
"visibility": "frontend",
250250
"description": "site for Datadog RUM events"
251+
},
252+
"sessionSampleRate": {
253+
"type": "number",
254+
"visibility": "frontend",
255+
"description": "sample rate of Datadog RUM events"
256+
},
257+
"sessionReplaySampleRate": {
258+
"type": "number",
259+
"visibility": "frontend",
260+
"description": "sample rate of session replays based upon already sampled Datadog RUM events"
251261
}
252262
},
253263
"required": [

0 commit comments

Comments
 (0)