Skip to content

Commit d240d37

Browse files
authored
feat(core)!: drop unused constants (#5504)
1 parent 455a352 commit d240d37

File tree

5 files changed

+15
-35
lines changed

5 files changed

+15
-35
lines changed

Diff for: CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@ For semantic convention package changes, see the [semconv CHANGELOG](packages/se
117117
* feat(core)!: drop `getEnv()`, `getEnvWithoutDefaults()` [#5481](https://github.com/open-telemetry/opentelemetry-js/pull/5481) @pichlermarc
118118
* (user-facing): `getEnv()` has been replaced by `getStringFromEnv()`, `getNumberFromEnv()`, `getBooleanFromEnv()`, `getStringListFromEnv()`
119119
* these new functions do not include defaults, please inline any defaults if necessary (example: `getStringFromEnv("OTEL_FOO") ?? "my-default"`)
120+
* to find the previously used defaults, please see [here](https://github.com/open-telemetry/opentelemetry-js/blob/e9d3c71918635d490b6a9ac9f8259265b38394d0/packages/opentelemetry-core/src/utils/environment.ts#L154-L239)
120121
* (user-facing): `getEnvWithoutDefaults()` has been replaced by `getStringFromEnv()`, `getNumberFromEnv()`, `getBooleanFromEnv()`, `getStringListFromEnv()`
121122
* (user-facing): `DEFAULT_ENVIRONMENT` has been removed, please inline any defaults from now on
123+
* to find the previously used defaults, please see [here](https://github.com/open-telemetry/opentelemetry-js/blob/e9d3c71918635d490b6a9ac9f8259265b38394d0/packages/opentelemetry-core/src/utils/environment.ts#L154-L239)
122124
* (user-facing): `ENVIRONMENT` has been removed without replacement
123125
* (user-facing): `RAW_ENVIRONMENT` has been removed without replacement
124126
* (user-facing): `parseEnvironment` has been removed without replacement
@@ -128,6 +130,11 @@ For semantic convention package changes, see the [semconv CHANGELOG](packages/se
128130
* to register a global context manager, please use `context.setGlobalContextManager()` from `@opentelemetry/api`
129131
* feat!: set compilation target to ES2022 for all packages except `@opentelemetry/api`, `@opentelemetry/api-logs`, `@opentelemetry/api-events`, and `@opentelemetry/semantic-conventions` [#5456](https://github.com/open-telemetry/opentelemetry-js/pull/5456) @david-luna
130132
* (user-facing): drops browser runtimes which do not support ES2022 features
133+
* feat(core)! drop unused constants [#5504](https://github.com/open-telemetry/opentelemetry-js/pull/5504) @pichlermarc
134+
* (user-facing): `DEFAULT_ATTRIBUTE_VALUE_LENTGHT_LIMIT` has been removed, please use `Infinity` instead
135+
* (user-facing): `DEFAULT_ATTRIBUTE_VALUE_COUNT_LIMIT` has been removed, please use `128` instead
136+
* (user-facing): `DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT` has been removed, please use `128` instead
137+
* (user-facing): `DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT` has been removed, please use `128` instead
131138

132139
### :rocket: (Enhancement)
133140

Diff for: packages/opentelemetry-core/src/index.ts

-6
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@ export {
7272
unsuppressTracing,
7373
} from './trace/suppress-tracing';
7474
export { TraceState } from './trace/TraceState';
75-
export {
76-
DEFAULT_ATTRIBUTE_COUNT_LIMIT,
77-
DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,
78-
DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,
79-
DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT,
80-
} from './utils/environment';
8175
export { merge } from './utils/merge';
8276
export { TimeoutError, callWithTimeout } from './utils/timeout';
8377
export { isUrlIgnored, urlMatches } from './utils/url';

Diff for: packages/opentelemetry-core/src/utils/environment.ts

-22
This file was deleted.

Diff for: packages/opentelemetry-sdk-trace-base/src/utility.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@
1717
import { buildSamplerFromEnv, loadDefaultConfig } from './config';
1818
import { Sampler } from './Sampler';
1919
import { SpanLimits, TracerConfig, GeneralLimits } from './types';
20-
import {
21-
DEFAULT_ATTRIBUTE_COUNT_LIMIT,
22-
DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,
23-
getNumberFromEnv,
24-
} from '@opentelemetry/core';
20+
import { getNumberFromEnv } from '@opentelemetry/core';
21+
22+
export const DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128;
23+
export const DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity;
2524

2625
/**
2726
* Function to merge Default configuration (as specified in './config') with

Diff for: packages/opentelemetry-sdk-trace-base/test/common/Span.test.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ import {
2727
AttributeValue,
2828
} from '@opentelemetry/api';
2929
import {
30-
DEFAULT_ATTRIBUTE_COUNT_LIMIT,
31-
DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,
3230
hrTimeDuration,
3331
hrTimeToMilliseconds,
3432
hrTimeToNanoseconds,
@@ -45,6 +43,10 @@ import { BasicTracerProvider, Span, SpanProcessor } from '../../src';
4543
import { SpanImpl } from '../../src/Span';
4644
import { invalidAttributes, validAttributes } from './util';
4745
import { Tracer } from '../../src/Tracer';
46+
import {
47+
DEFAULT_ATTRIBUTE_COUNT_LIMIT,
48+
DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,
49+
} from '../../src/utility';
4850

4951
const performanceTimeOrigin: HrTime = [1, 1];
5052

0 commit comments

Comments
 (0)