Skip to content

Commit

Permalink
👷 [RUM] add application id as query parameter (#405)
Browse files Browse the repository at this point in the history
debug for #incident-4632
back is going to hide it in order to not be displayed in the UI
  • Loading branch information
bcaudan authored May 28, 2020
1 parent 0e4ab00 commit 8ba333d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/core/src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const DEFAULT_CONFIGURATION = {
export interface UserConfiguration {
publicApiKey?: string // deprecated
clientToken: string
applicationId?: string
internalMonitoringApiKey?: string
isCollectingError?: boolean
sampleRate?: number
Expand Down Expand Up @@ -70,6 +71,7 @@ interface TransportConfiguration {
sdkEnv: Environment
buildMode: BuildMode
sdkVersion: string
applicationId?: string
proxyHost?: string

service?: string
Expand All @@ -79,6 +81,7 @@ interface TransportConfiguration {

export function buildConfiguration(userConfiguration: UserConfiguration, buildEnv: BuildEnv): Configuration {
const transportConfiguration: TransportConfiguration = {
applicationId: userConfiguration.applicationId,
buildMode: buildEnv.buildMode,
clientToken: userConfiguration.clientToken,
datacenter: userConfiguration.datacenter || buildEnv.datacenter,
Expand Down Expand Up @@ -149,6 +152,8 @@ function getEndpoint(type: string, conf: TransportConfiguration, source?: string
const datadogHost = `${type}-http-intake.logs.${domain}`
const host = conf.proxyHost ? conf.proxyHost : datadogHost
const proxyParameter = conf.proxyHost ? `ddhost=${datadogHost}&` : ''
const applicationIdParameter = conf.applicationId ? `_dd.application_id=${conf.applicationId}&` : ''
const parameters = `${applicationIdParameter}${proxyParameter}ddsource=${source || 'browser'}&ddtags=${tags}`

return `https://${host}/v1/input/${conf.clientToken}?${proxyParameter}ddsource=${source || 'browser'}&ddtags=${tags}`
return `https://${host}/v1/input/${conf.clientToken}?${parameters}`
}

0 comments on commit 8ba333d

Please sign in to comment.