File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 11import { Attributes } from '@opentelemetry/api'
22import { Types } from '@vtex/diagnostics-nodejs'
33import { getMetricClient } from '../service/metrics/client'
4- import { METRIC_CLIENT_INIT_TIMEOUT_MS } from '../constants'
4+ import { METRIC_CLIENT_INIT_TIMEOUT_MS , LINKED } from '../constants'
55
66/**
77 * Maximum number of attributes allowed per metric to control cardinality.
@@ -33,10 +33,12 @@ function limitAttributes(attributes?: Attributes): Attributes | undefined {
3333 return attributes
3434 }
3535
36- console . warn (
37- `Attribute limit exceeded: ${ entries . length } attributes provided, using only the first ${ MAX_ATTRIBUTES } . ` +
38- `Consider reducing the number of attributes to avoid high cardinality.`
39- )
36+ if ( LINKED ) {
37+ console . warn (
38+ `Attribute limit exceeded: ${ entries . length } attributes provided, using only the first ${ MAX_ATTRIBUTES } . ` +
39+ `Consider reducing the number of attributes to avoid high cardinality.`
40+ )
41+ }
4042
4143 return Object . fromEntries ( entries . slice ( 0 , MAX_ATTRIBUTES ) )
4244}
You can’t perform that action at this time.
0 commit comments