Skip to content

Commit

Permalink
Remove warning string redundancies
Browse files Browse the repository at this point in the history
  • Loading branch information
amortemousque committed Jul 22, 2024
1 parent 25e4789 commit 6c184ba
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/domain/configuration/tags.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DOCS_ORIGIN, display } from '../../tools/display'
import { DOCS_ORIGIN, MORE_DETAILS, display } from '../../tools/display'
import type { InitConfiguration } from './configuration'

export const TAG_SIZE_LIMIT = 200
Expand Down Expand Up @@ -33,7 +33,7 @@ export function buildTag(key: string, rawValue: string) {

if (rawValue.length > valueSizeLimit || FORBIDDEN_CHARACTERS.test(rawValue)) {
display.warn(
`${key} value doesn't meet tag requirements and will be sanitized. More details: ${DOCS_ORIGIN}/getting_started/tagging/#defining-tags`
`${key} value doesn't meet tag requirements and will be sanitized. ${MORE_DETAILS} ${DOCS_ORIGIN}/getting_started/tagging/#defining-tags`
)
}

Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/domain/context/customerDataTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ONE_KIBI_BYTE, computeBytesCount } from '../../tools/utils/byteUtils'
import { throttle } from '../../tools/utils/functionUtils'
import type { Context } from '../../tools/serialisation/context'
import { jsonStringify } from '../../tools/serialisation/jsonStringify'
import { DOCS_ORIGIN, display } from '../../tools/display'
import { DOCS_TROUBLESHOOTING, MORE_DETAILS, display } from '../../tools/display'
import { isEmptyObject } from '../../tools/utils/objectUtils'
import type { CustomerDataType } from './contextConstants'

Expand Down Expand Up @@ -129,6 +129,6 @@ function displayCustomerDataLimitReachedWarning(bytesCountLimit: number) {
display.warn(
`Customer data exceeds the recommended ${
bytesCountLimit / ONE_KIBI_BYTE
}KiB threshold. More details: ${DOCS_ORIGIN}/real_user_monitoring/browser/troubleshooting/#customer-data-exceeds-the-recommended-threshold-warning`
}KiB threshold. ${MORE_DETAILS} ${DOCS_TROUBLESHOOTING}/#customer-data-exceeds-the-recommended-threshold-warning`
)
}
2 changes: 2 additions & 0 deletions packages/core/src/tools/display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,5 @@ export const display: Display = {
}

export const DOCS_ORIGIN = 'https://docs.datadoghq.com'
export const DOCS_TROUBLESHOOTING = `${DOCS_ORIGIN}/real_user_monitoring/browser/troubleshooting`
export const MORE_DETAILS = 'More details:'
4 changes: 2 additions & 2 deletions packages/core/src/transport/batch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DOCS_ORIGIN, display } from '../tools/display'
import { DOCS_TROUBLESHOOTING, MORE_DETAILS, display } from '../tools/display'
import type { Context } from '../tools/serialisation/context'
import { objectValues } from '../tools/utils/polyfills'
import { isPageExitReason } from '../browser/pageExitObservable'
Expand Down Expand Up @@ -81,7 +81,7 @@ export class Batch {

if (estimatedMessageBytesCount >= this.messageBytesLimit) {
display.warn(
`Discarded a message whose size was bigger than the maximum allowed size ${this.messageBytesLimit}KB. More details: ${DOCS_ORIGIN}/real_user_monitoring/browser/troubleshooting/#technical-limitations`
`Discarded a message whose size was bigger than the maximum allowed size ${this.messageBytesLimit}KB. ${MORE_DETAILS} ${DOCS_TROUBLESHOOTING}/#technical-limitations`
)
return
}
Expand Down

0 comments on commit 6c184ba

Please sign in to comment.