Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RUMF-620]: Dual-ship "service" as tag and attribute #543

Merged
merged 1 commit into from
Sep 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/core/src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ export type Configuration = typeof DEFAULT_CONFIGURATION & {
internalMonitoringEndpoint?: string
proxyHost?: string

service?: string

isEnabled: (feature: string) => boolean

// only on staging build mode
Expand Down Expand Up @@ -134,6 +136,7 @@ export function buildConfiguration(userConfiguration: UserConfiguration, buildEn
logsEndpoint: getEndpoint('browser', transportConfiguration),
proxyHost: userConfiguration.proxyHost,
rumEndpoint: getEndpoint('rum', transportConfiguration),
service: userConfiguration.service,
traceEndpoint: getEndpoint('public-trace', transportConfiguration),
...DEFAULT_CONFIGURATION,
}
Expand Down
1 change: 1 addition & 0 deletions packages/logs/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ function startLoggerBatch(configuration: Configuration, session: LoggerSession,
return deepMerge(
{
date: new Date().getTime(),
service: configuration.service,
session_id: session.getId(),
view: {
referrer: document.referrer,
Expand Down
2 changes: 2 additions & 0 deletions packages/logs/test/logger.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ describe('logger module', () => {
...DEFAULT_CONFIGURATION,
logsEndpoint: 'https://localhost/v1/input/log',
maxBatchSize: 1,
service: 'Service',
}
let LOGS: LogsApi
let server: sinon.SinonFakeServer
Expand All @@ -57,6 +58,7 @@ describe('logger module', () => {
date: FAKE_DATE,
foo: 'bar',
message: 'message',
service: 'Service',
status: StatusType.warn,
view: {
referrer: document.referrer,
Expand Down
1 change: 1 addition & 0 deletions packages/rum/src/rum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ export function startRum(
() => ({
applicationId,
date: new Date().getTime(),
service: configuration.service,
session: {
// must be computed on each event because synthetics instrumentation can be done after sdk execution
// cf https://github.com/puppeteer/puppeteer/issues/3667
Expand Down