@crimson-education/browser-logger 5.0.1-beta.3 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +127 -73
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +47 -19
- package/lib/index.js.map +1 -1
- package/lib/logger/consoleTransport.d.ts +1 -1
- package/lib/logger/consoleTransport.d.ts.map +1 -1
- package/lib/logger/consoleTransport.js +22 -16
- package/lib/logger/consoleTransport.js.map +1 -1
- package/lib/logger/datadogTransport.d.ts +1 -1
- package/lib/logger/datadogTransport.d.ts.map +1 -1
- package/lib/logger/datadogTransport.js +8 -4
- package/lib/logger/datadogTransport.js.map +1 -1
- package/lib/logger/index.js +49 -29
- package/lib/logger/index.js.map +1 -1
- package/lib/logger/index.test.js +18 -16
- package/lib/logger/index.test.js.map +1 -1
- package/lib/logger/utils.js +9 -4
- package/lib/logger/utils.js.map +1 -1
- package/lib/reporters/amplifyReporter.d.ts +86 -0
- package/lib/reporters/amplifyReporter.d.ts.map +1 -0
- package/lib/reporters/amplifyReporter.js +225 -0
- package/lib/reporters/amplifyReporter.js.map +1 -0
- package/lib/reporters/amplifyReporter.test.d.ts +2 -0
- package/lib/reporters/amplifyReporter.test.d.ts.map +1 -0
- package/lib/reporters/amplifyReporter.test.js +51 -0
- package/lib/reporters/amplifyReporter.test.js.map +1 -0
- package/lib/reporters/datadogReporter.d.ts +1 -13
- package/lib/reporters/datadogReporter.d.ts.map +1 -1
- package/lib/reporters/datadogReporter.js +49 -122
- package/lib/reporters/datadogReporter.js.map +1 -1
- package/lib/reporters/gtmReporter.d.ts +1 -1
- package/lib/reporters/gtmReporter.d.ts.map +1 -1
- package/lib/reporters/gtmReporter.js +5 -1
- package/lib/reporters/gtmReporter.js.map +1 -1
- package/lib/reporters/index.js +71 -46
- package/lib/reporters/index.js.map +1 -1
- package/lib/reporters/logReporter.js +34 -24
- package/lib/reporters/logReporter.js.map +1 -1
- package/lib/reporters/posthogReporter.d.ts +51 -0
- package/lib/reporters/posthogReporter.d.ts.map +1 -0
- package/lib/reporters/posthogReporter.js +254 -0
- package/lib/reporters/posthogReporter.js.map +1 -0
- package/lib/reporters/posthogReporter.test.d.ts +2 -0
- package/lib/reporters/posthogReporter.test.d.ts.map +1 -0
- package/lib/reporters/posthogReporter.test.js +197 -0
- package/lib/reporters/posthogReporter.test.js.map +1 -0
- package/lib/types/index.js +18 -2
- package/lib/types/index.js.map +1 -1
- package/lib/types/logger.d.ts +3 -3
- package/lib/types/logger.d.ts.map +1 -1
- package/lib/types/logger.js +5 -2
- package/lib/types/logger.js.map +1 -1
- package/lib/types/reporter.d.ts +20 -6
- package/lib/types/reporter.d.ts.map +1 -1
- package/lib/types/reporter.js +2 -1
- package/lib/utils.js +5 -1
- package/lib/utils.js.map +1 -1
- package/lib/utils.test.js +4 -2
- package/lib/utils.test.js.map +1 -1
- package/package.json +17 -11
- package/src/index.ts +11 -0
- package/src/reporters/amplifyReporter.test.ts +61 -0
- package/src/reporters/amplifyReporter.ts +344 -0
- package/src/reporters/datadogReporter.ts +22 -133
- package/src/reporters/posthogReporter.test.ts +244 -0
- package/src/reporters/posthogReporter.ts +374 -0
- package/src/types/reporter.ts +16 -0
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import posthog, { BeforeSendFn, CaptureResult, PostHogConfig, Properties } from 'posthog-js';
|
|
2
|
+
import {
|
|
3
|
+
IReporter,
|
|
4
|
+
Metadata,
|
|
5
|
+
ReportError,
|
|
6
|
+
ReporterBreadcrumb,
|
|
7
|
+
ReporterConfigBase,
|
|
8
|
+
ReporterEvent,
|
|
9
|
+
ReporterFlag,
|
|
10
|
+
ReportUser,
|
|
11
|
+
ServiceInfo,
|
|
12
|
+
} from '../types';
|
|
13
|
+
|
|
14
|
+
type PostHogValue = Properties[string];
|
|
15
|
+
|
|
16
|
+
type PostHogReporterSdkConfig = Partial<
|
|
17
|
+
Omit<
|
|
18
|
+
PostHogConfig,
|
|
19
|
+
| 'api_host'
|
|
20
|
+
| 'autocapture'
|
|
21
|
+
| 'before_send'
|
|
22
|
+
| 'bootstrap'
|
|
23
|
+
| 'capture_pageleave'
|
|
24
|
+
| 'capture_pageview'
|
|
25
|
+
| 'cross_subdomain_cookie'
|
|
26
|
+
| 'debug'
|
|
27
|
+
| 'defaults'
|
|
28
|
+
| 'disable_session_recording'
|
|
29
|
+
| 'loaded'
|
|
30
|
+
| 'person_profiles'
|
|
31
|
+
| 'persistence'
|
|
32
|
+
| 'persistence_name'
|
|
33
|
+
>
|
|
34
|
+
>;
|
|
35
|
+
|
|
36
|
+
export interface PostHogReporterConfig extends ReporterConfigBase {
|
|
37
|
+
/** The PostHog project API key. */
|
|
38
|
+
apiKey: string;
|
|
39
|
+
/** The PostHog ingest host, e.g. https://eu.i.posthog.com */
|
|
40
|
+
apiHost: string;
|
|
41
|
+
/** Optional PostHog bootstrap config. */
|
|
42
|
+
bootstrap?: PostHogConfig['bootstrap'];
|
|
43
|
+
/** Optional PostHog SDK defaults mode. */
|
|
44
|
+
defaults?: PostHogConfig['defaults'];
|
|
45
|
+
/** Optional PostHog before-send hook. */
|
|
46
|
+
beforeSend?: PostHogConfig['before_send'];
|
|
47
|
+
/** Controls PostHog autocapture. Defaults to true. */
|
|
48
|
+
autocapture?: PostHogConfig['autocapture'];
|
|
49
|
+
/** Controls automatic pageview capture. Defaults to history_change for SPAs. */
|
|
50
|
+
capturePageview?: PostHogConfig['capture_pageview'];
|
|
51
|
+
/** Controls automatic pageleave capture. Defaults to if_capture_pageview. */
|
|
52
|
+
capturePageleave?: PostHogConfig['capture_pageleave'];
|
|
53
|
+
/** Share cookies across subdomains. Defaults to true. */
|
|
54
|
+
crossSubdomainCookie?: PostHogConfig['cross_subdomain_cookie'];
|
|
55
|
+
/** PostHog persistence mode. */
|
|
56
|
+
persistence?: PostHogConfig['persistence'];
|
|
57
|
+
/** Optional persistence name. */
|
|
58
|
+
persistenceName?: PostHogConfig['persistence_name'];
|
|
59
|
+
/** Enable PostHog debug mode. */
|
|
60
|
+
debug?: PostHogConfig['debug'];
|
|
61
|
+
/** Controls when person processing happens. Defaults to identified_only. */
|
|
62
|
+
personProfiles?: PostHogConfig['person_profiles'];
|
|
63
|
+
/** Disable session recording at startup. */
|
|
64
|
+
disableSessionRecording?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Compatibility alias for Datadog-style replay gating.
|
|
67
|
+
* Values <= 0 disable recording at startup; values > 0 leave it enabled.
|
|
68
|
+
*/
|
|
69
|
+
replaySampleRate?: number;
|
|
70
|
+
/**
|
|
71
|
+
* When true, automatic pageview capture is disabled and `Logger.setPageName()`
|
|
72
|
+
* will emit manual `$pageview` events instead.
|
|
73
|
+
*/
|
|
74
|
+
trackViewsManually?: boolean;
|
|
75
|
+
/** Optional PostHog loaded callback. */
|
|
76
|
+
loaded?: PostHogConfig['loaded'];
|
|
77
|
+
/** Optional raw PostHog SDK overrides for advanced use cases. */
|
|
78
|
+
sdkConfig?: PostHogReporterSdkConfig;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
type CompatibilityUser = ReportUser & {
|
|
82
|
+
role?: unknown;
|
|
83
|
+
roles?: unknown;
|
|
84
|
+
userRole?: unknown;
|
|
85
|
+
userRoles?: unknown;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
function hasActiveUser(user: ReportUser | null): user is ReportUser {
|
|
89
|
+
if (!user) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return !!String(user.id ?? '').trim();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function getCurrentUrl(captureResult: CaptureResult): string | undefined {
|
|
97
|
+
const currentUrl = captureResult.properties?.$current_url;
|
|
98
|
+
if (typeof currentUrl === 'string' && currentUrl) {
|
|
99
|
+
return currentUrl;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (typeof window !== 'undefined') {
|
|
103
|
+
return window.location.href;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function getUserRoleValue(user: CompatibilityUser | null, metadata: Metadata): PostHogValue | undefined {
|
|
110
|
+
const candidate =
|
|
111
|
+
user?.userRole ?? user?.role ?? user?.userRoles ?? user?.roles ?? metadata.userRole ?? metadata.userRoles;
|
|
112
|
+
|
|
113
|
+
return normalizeValue(candidate);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function buildCompatibilityProperties(
|
|
117
|
+
info: ServiceInfo,
|
|
118
|
+
metadata: Metadata,
|
|
119
|
+
user: CompatibilityUser | null,
|
|
120
|
+
captureResult: CaptureResult,
|
|
121
|
+
): Properties {
|
|
122
|
+
const url = getCurrentUrl(captureResult);
|
|
123
|
+
const baseOrigin = typeof window !== 'undefined' ? window.location.origin : 'https://example.invalid';
|
|
124
|
+
const urlObject = url ? new URL(url, baseOrigin) : null;
|
|
125
|
+
const urlPath = urlObject?.pathname;
|
|
126
|
+
const pageName = typeof metadata.pageName === 'string' ? metadata.pageName : undefined;
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
app_name: String(metadata.application ?? info.application ?? info.service),
|
|
130
|
+
domain: String(
|
|
131
|
+
metadata.domain ?? urlObject?.hostname ?? (typeof window !== 'undefined' ? window.location.hostname : ''),
|
|
132
|
+
),
|
|
133
|
+
event_type: captureResult.event,
|
|
134
|
+
session_id: posthog.get_session_id(),
|
|
135
|
+
rum_session_id: posthog.get_session_id(),
|
|
136
|
+
user_id: user?.id,
|
|
137
|
+
user_email: user?.email,
|
|
138
|
+
user_name: user?.name ?? user?.username,
|
|
139
|
+
user_role: getUserRoleValue(user, metadata),
|
|
140
|
+
url,
|
|
141
|
+
url_path: urlPath,
|
|
142
|
+
view_id: posthog.getPageViewId(),
|
|
143
|
+
view_name: pageName,
|
|
144
|
+
browser: captureResult.properties?.$browser,
|
|
145
|
+
device: captureResult.properties?.$device_type,
|
|
146
|
+
geo: captureResult.properties?.$geoip_country_name ?? captureResult.properties?.$geoip_country_code,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function composeBeforeSend(
|
|
151
|
+
info: ServiceInfo,
|
|
152
|
+
currentMetadata: Metadata,
|
|
153
|
+
getCurrentUser: () => CompatibilityUser | null,
|
|
154
|
+
beforeSend?: PostHogReporterConfig['beforeSend'],
|
|
155
|
+
): BeforeSendFn {
|
|
156
|
+
const beforeSendFns = Array.isArray(beforeSend) ? beforeSend : beforeSend ? [beforeSend] : [];
|
|
157
|
+
|
|
158
|
+
return (captureResult) => {
|
|
159
|
+
if (!captureResult) {
|
|
160
|
+
return captureResult;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
captureResult.properties = {
|
|
164
|
+
...captureResult.properties,
|
|
165
|
+
...buildCompatibilityProperties(info, currentMetadata, getCurrentUser(), captureResult),
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
let nextResult: CaptureResult | null = captureResult;
|
|
169
|
+
for (const beforeSendFn of beforeSendFns) {
|
|
170
|
+
nextResult = beforeSendFn(nextResult);
|
|
171
|
+
if (!nextResult) {
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return nextResult;
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function normalizeError(error: unknown): Record<string, string | undefined> {
|
|
181
|
+
if (error instanceof Error) {
|
|
182
|
+
return {
|
|
183
|
+
name: error.name,
|
|
184
|
+
message: error.message,
|
|
185
|
+
stack: error.stack,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
return {
|
|
190
|
+
message: typeof error === 'string' ? error : JSON.stringify(error),
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function normalizeValue(value: unknown): PostHogValue | undefined {
|
|
195
|
+
if (value === undefined) {
|
|
196
|
+
return undefined;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (value === null || typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
200
|
+
return value;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (value instanceof Date) {
|
|
204
|
+
return value.toISOString();
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
if (value instanceof Error) {
|
|
208
|
+
return normalizeError(value);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
if (Array.isArray(value)) {
|
|
212
|
+
const result = value
|
|
213
|
+
.map((item) => normalizeValue(item))
|
|
214
|
+
.filter((item): item is NonNullable<PostHogValue> => item !== undefined);
|
|
215
|
+
return result;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (typeof value === 'object') {
|
|
219
|
+
const result: Properties = {};
|
|
220
|
+
for (const [key, child] of Object.entries(value as Record<string, unknown>)) {
|
|
221
|
+
const normalized = normalizeValue(child);
|
|
222
|
+
if (normalized !== undefined) {
|
|
223
|
+
result[key] = normalized;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return result;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
return String(value);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export function normalizeProperties(metadata?: Metadata): Properties | undefined {
|
|
233
|
+
if (!metadata) {
|
|
234
|
+
return undefined;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const result: Properties = {};
|
|
238
|
+
for (const [key, value] of Object.entries(metadata)) {
|
|
239
|
+
const normalized = normalizeValue(value);
|
|
240
|
+
if (normalized !== undefined && normalized !== null) {
|
|
241
|
+
result[key] = normalized;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return Object.keys(result).length > 0 ? result : undefined;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function shouldDisableSessionRecording(config: PostHogReporterConfig): boolean {
|
|
249
|
+
if (config.disableSessionRecording !== undefined) {
|
|
250
|
+
return config.disableSessionRecording;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
if (config.replaySampleRate !== undefined) {
|
|
254
|
+
return config.replaySampleRate <= 0;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
return false;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export function posthogReporter(info: ServiceInfo, config: PostHogReporterConfig): IReporter {
|
|
261
|
+
const manualPageviews = config.trackViewsManually ?? false;
|
|
262
|
+
const currentMetadata: Metadata = {};
|
|
263
|
+
let currentUser: CompatibilityUser | null = null;
|
|
264
|
+
|
|
265
|
+
posthog.init(config.apiKey, {
|
|
266
|
+
api_host: config.apiHost,
|
|
267
|
+
autocapture: config.autocapture ?? true,
|
|
268
|
+
before_send: composeBeforeSend(info, currentMetadata, () => currentUser, config.beforeSend),
|
|
269
|
+
bootstrap: config.bootstrap,
|
|
270
|
+
capture_pageleave: manualPageviews ? false : config.capturePageleave ?? 'if_capture_pageview',
|
|
271
|
+
capture_pageview: manualPageviews ? false : config.capturePageview ?? 'history_change',
|
|
272
|
+
cross_subdomain_cookie: config.crossSubdomainCookie ?? true,
|
|
273
|
+
debug: config.debug ?? false,
|
|
274
|
+
defaults: config.defaults ?? '2025-05-24',
|
|
275
|
+
disable_session_recording: shouldDisableSessionRecording(config),
|
|
276
|
+
loaded: config.loaded ?? (() => {}),
|
|
277
|
+
persistence: config.persistence,
|
|
278
|
+
persistence_name: config.persistenceName,
|
|
279
|
+
person_profiles: config.personProfiles ?? 'identified_only',
|
|
280
|
+
...config.sdkConfig,
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
const reporter: IReporter = {
|
|
284
|
+
...config,
|
|
285
|
+
trackEvent: function (event: ReporterEvent): void {
|
|
286
|
+
posthog.capture(event.message, {
|
|
287
|
+
message: event.message,
|
|
288
|
+
level: event.level,
|
|
289
|
+
...normalizeProperties(event.metadata),
|
|
290
|
+
...normalizeProperties(event.tags),
|
|
291
|
+
...normalizeProperties(event.metrics),
|
|
292
|
+
});
|
|
293
|
+
},
|
|
294
|
+
addBreadcrumb: function (breadcrumb: ReporterBreadcrumb): void {
|
|
295
|
+
posthog.capture(breadcrumb.message, {
|
|
296
|
+
message: breadcrumb.message,
|
|
297
|
+
category: breadcrumb.category,
|
|
298
|
+
breadcrumb: true,
|
|
299
|
+
...normalizeProperties(breadcrumb.metadata),
|
|
300
|
+
});
|
|
301
|
+
},
|
|
302
|
+
addMetadata: function (metadata: Metadata): void {
|
|
303
|
+
const nextProperties = normalizeProperties(metadata);
|
|
304
|
+
for (const [key, value] of Object.entries(metadata)) {
|
|
305
|
+
if (value === null) {
|
|
306
|
+
delete currentMetadata[key];
|
|
307
|
+
posthog.unregister(key);
|
|
308
|
+
} else {
|
|
309
|
+
currentMetadata[key] = value;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
if (!nextProperties) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
posthog.register(nextProperties);
|
|
318
|
+
},
|
|
319
|
+
setUser: function (user: ReportUser | null): void {
|
|
320
|
+
currentUser = user as CompatibilityUser | null;
|
|
321
|
+
|
|
322
|
+
if (!hasActiveUser(user)) {
|
|
323
|
+
posthog.reset();
|
|
324
|
+
const restoredMetadata = normalizeProperties(currentMetadata);
|
|
325
|
+
if (restoredMetadata) {
|
|
326
|
+
posthog.register(restoredMetadata);
|
|
327
|
+
}
|
|
328
|
+
currentUser = null;
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
const { id, ...rest } = user;
|
|
333
|
+
posthog.identify(String(id), normalizeProperties(rest));
|
|
334
|
+
posthog.register({
|
|
335
|
+
user_id: String(id),
|
|
336
|
+
user_email: user.email,
|
|
337
|
+
user_name: user.name ?? user.username,
|
|
338
|
+
user_role: getUserRoleValue(user as CompatibilityUser, currentMetadata),
|
|
339
|
+
});
|
|
340
|
+
},
|
|
341
|
+
setRouteName: function (routeName: string): void {
|
|
342
|
+
reporter.addMetadata({ routeName });
|
|
343
|
+
},
|
|
344
|
+
setPageName: function (pageName: string): void {
|
|
345
|
+
if (manualPageviews) {
|
|
346
|
+
posthog.capture('$pageview', {
|
|
347
|
+
pageName,
|
|
348
|
+
});
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
reporter.addMetadata({ pageName });
|
|
353
|
+
},
|
|
354
|
+
reportError: function (error: ReportError, metadata?: Metadata): void {
|
|
355
|
+
posthog.captureException(error, {
|
|
356
|
+
...normalizeProperties(metadata),
|
|
357
|
+
...normalizeError(error),
|
|
358
|
+
});
|
|
359
|
+
},
|
|
360
|
+
reportFeatureFlag: function (flag: ReporterFlag): void {
|
|
361
|
+
reporter.addMetadata({
|
|
362
|
+
[`featureFlag.${flag.name}`]: flag.value,
|
|
363
|
+
});
|
|
364
|
+
},
|
|
365
|
+
recordSession: function (): void {
|
|
366
|
+
posthog.startSessionRecording(true);
|
|
367
|
+
},
|
|
368
|
+
recordSessionStop: function (): void {
|
|
369
|
+
posthog.stopSessionRecording();
|
|
370
|
+
},
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
return reporter;
|
|
374
|
+
}
|
package/src/types/reporter.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { AmplifyReporterConfig } from '../reporters/amplifyReporter';
|
|
1
2
|
import { DatadogReporterConfig } from '../reporters/datadogReporter';
|
|
2
3
|
import { GTMReporterConfig } from '../reporters/gtmReporter';
|
|
3
4
|
import { LogReporterConfig } from '../reporters/logReporter';
|
|
5
|
+
import { PostHogReporterConfig } from '../reporters/posthogReporter';
|
|
4
6
|
import { LogLevel, Metadata } from './logger';
|
|
5
7
|
|
|
6
8
|
export type ReporterConfigurations = {
|
|
@@ -16,6 +18,18 @@ export type ReporterConfigurations = {
|
|
|
16
18
|
*/
|
|
17
19
|
datadog?: DatadogReporterConfig;
|
|
18
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Amplify/Pinpoint reporter configuration.
|
|
23
|
+
* If not set, the amplify reporter will not be used.
|
|
24
|
+
*/
|
|
25
|
+
amplify?: AmplifyReporterConfig;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* PostHog reporter configuration.
|
|
29
|
+
* If not set, the PostHog reporter will not be used.
|
|
30
|
+
*/
|
|
31
|
+
posthog?: PostHogReporterConfig;
|
|
32
|
+
|
|
19
33
|
/**
|
|
20
34
|
* Google Tag Manager reporter configuration.
|
|
21
35
|
* If not set, the gtm reporter will not be used.
|
|
@@ -30,6 +44,8 @@ export type Metrics = Record<string, number>;
|
|
|
30
44
|
export type ServiceInfo = {
|
|
31
45
|
/** The Application's name. */
|
|
32
46
|
service: string;
|
|
47
|
+
/** Optional product/application identifier shared across services. */
|
|
48
|
+
application?: string;
|
|
33
49
|
/** The Application's Environment */
|
|
34
50
|
environment: string;
|
|
35
51
|
/** The Application's Version. */
|