Skip to content

Commit f4e1b06

Browse files
🔊 Send source-code-context telemetry usage (#4675)
1 parent 9b6698b commit f4e1b06

4 files changed

Lines changed: 28 additions & 4 deletions

File tree

‎packages/core/src/domain/telemetry/telemetryEvent.types.ts‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,10 @@ export type TelemetryConfigurationEvent = CommonTelemetryProperties & {
388388
* The version of Unity used in a Unity application
389389
*/
390390
unity_version?: string
391+
/**
392+
* The version of MAUI used in a .NET MAUI application
393+
*/
394+
maui_version?: string
391395
/**
392396
* The threshold used for iOS App Hangs monitoring (in milliseconds)
393397
*/
@@ -447,7 +451,7 @@ export type TelemetryConfigurationEvent = CommonTelemetryProperties & {
447451
*/
448452
sdk_version?: string
449453
/**
450-
* The source of the SDK, e.g., 'browser', 'ios', 'android', 'flutter', 'react-native', 'unity', 'kotlin-multiplatform'.
454+
* The source of the SDK, e.g., 'browser', 'ios', 'android', 'flutter', 'react-native', 'unity', 'kotlin-multiplatform', 'maui'.
451455
*/
452456
source?: string
453457
/**
@@ -545,6 +549,7 @@ export type TelemetryBrowserFeaturesUsage =
545549
| StopAction
546550
| StartResource
547551
| StopResource
552+
| SourceCodeContext
548553
/**
549554
* Schema of mobile specific features usage
550555
*/
@@ -589,6 +594,7 @@ export interface CommonTelemetryProperties {
589594
| 'kotlin-multiplatform'
590595
| 'electron'
591596
| 'rum-cpp'
597+
| 'maui'
592598
/**
593599
* The version of the SDK generating the telemetry event
594600
*/
@@ -970,6 +976,13 @@ export interface StopResource {
970976
feature: 'stop-resource'
971977
[k: string]: unknown
972978
}
979+
export interface SourceCodeContext {
980+
/**
981+
* DD_SOURCE_CODE_CONTEXT global for microfrontends
982+
*/
983+
feature: 'source-code-context'
984+
[k: string]: unknown
985+
}
973986
export interface TrackWebView {
974987
/**
975988
* trackWebView API

‎packages/rum-core/src/domain/contexts/sourceCodeContext.ts‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import { SKIPPED, computeStackTrace, objectEntries, addTelemetryError, HookNames } from '@datadog/browser-core'
1+
import {
2+
SKIPPED,
3+
computeStackTrace,
4+
objectEntries,
5+
addTelemetryError,
6+
HookNames,
7+
addTelemetryUsage,
8+
} from '@datadog/browser-core'
29
import type { Hooks, DefaultRumEventAttributes, AssembleHookParams } from '../hooks'
310

411
interface SourceCodeContext {
@@ -19,6 +26,7 @@ export function startSourceCodeContext(hooks: Hooks) {
1926
if (!browserWindow.DD_SOURCE_CODE_CONTEXT) {
2027
return
2128
}
29+
addTelemetryUsage({ feature: 'source-code-context' })
2230

2331
objectEntries(browserWindow.DD_SOURCE_CODE_CONTEXT).forEach(([stack, context]) => {
2432
const stackTrace = computeStackTrace({ stack })

‎packages/rum-core/src/rumEvent.types.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export type RumActionEvent = CommonProperties &
154154
*/
155155
readonly height?: number
156156
/**
157-
* Mobile-only: a globally unique and stable identifier for this UI element, computed as the hash of the element's path (32 lowercase hex characters). Used to correlate actions with mobile session replay wireframes.
157+
* Mobile-only: a globally unique and stable identifier for this UI element, computed as the hash of the element's path. Used to correlate actions with mobile session replay wireframes.
158158
*/
159159
readonly permanent_id?: string
160160
[k: string]: unknown
@@ -321,6 +321,7 @@ export type RumErrorEvent = CommonProperties &
321321
| 'windows'
322322
| 'macos'
323323
| 'linux'
324+
| 'maui'
324325
/**
325326
* Resource properties of the error
326327
*/
@@ -1172,6 +1173,7 @@ export interface CommonProperties {
11721173
| 'kotlin-multiplatform'
11731174
| 'electron'
11741175
| 'rum-cpp'
1176+
| 'maui'
11751177
/**
11761178
* View properties
11771179
*/
@@ -1525,6 +1527,7 @@ export interface ViewContainerSchema {
15251527
| 'kotlin-multiplatform'
15261528
| 'electron'
15271529
| 'rum-cpp'
1530+
| 'maui'
15281531
[k: string]: unknown
15291532
}
15301533
[k: string]: unknown

0 commit comments

Comments
 (0)