Skip to content

Commit 94059f7

Browse files
authored
feat(core)!: remove unused/obsolete functions and types (open-telemetry#5444)
1 parent 99091be commit 94059f7

File tree

21 files changed

+37
-267
lines changed

21 files changed

+37
-267
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,18 @@ For semantic convention package changes, see the [semconv CHANGELOG](packages/se
8080
* chore!: Raise the minimum supported Node.js version to `^18.19.0 || >=20.6.0`. Support for Node.js 14, 16, and early minor versions of 18 and 20 have been dropped. This applies to all packages except the 'api' and 'semantic-conventions' packages. [#5395](https://github.com/open-telemetry/opentelemetry-js/issues/5395) @trentm
8181
* feat(core)!: remove TracesSamplerValues from exports [#5406](https://github.com/open-telemetry/opentelemetry-js/pull/5406) @pichlermarc
8282
* (user-facing): TracesSamplerValues was only consumed internally and has been removed from exports without replacement
83+
* feat(core)!: remove unused and obsolete functions and types [#5444](https://github.com/open-telemetry/opentelemetry-js/pull/5444) @pichlermarc
84+
* (user-facing): `VERSION` was an internal constant that was unintentionally exported. It has been removed without replacement.
85+
* (user-facing): `isWrapped` has been removed in favor of `isWrapped` from `@opentelemetry/instrumentation`
86+
* (user-facing): `ShimWrapped` has been removed in favor of `ShimWrapped` from `@opentelemetry/instrumentation`
87+
* (user-facing): `hexToBase64` was a utility function that is not used by the SDK anymore. It has been removed without replacement.
88+
* (user-facing): `hexToBinary` was a utility function that now internal to `@opentelemetry/otlp-tranformer`. It has been removed without replacement.
89+
* (user-facing): `baggageUtils.getKeyParis` was an internal utility function that was unintentionally exported. It has been removed without replacement.
90+
* (user-facing): `baggageUtils.serializeKeyPairs` was an internal utility function that was unintentionally exported. It has been removed without replacement.
91+
* (user-facing): `baggageUtils.parseKeyPairsIntoRecord,` has been removed in favor of `parseKeyPairsIntoRecord`
92+
* (user-facing): `baggageUtils.parsePairKeyValue` was an internal utility function that was unintentionally exported. It has been removed without replacement.
93+
* (user-facing): `TimeOriginLegacy` has been removed without replacement.
94+
* (user-facing): `isAttributeKey` was an internal utility function that was unintentionally exported. It has been removed without replacement.
8395

8496
### :rocket: (Enhancement)
8597

experimental/packages/opentelemetry-instrumentation-xml-http-request/test/xhr.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@
1414
* limitations under the License.
1515
*/
1616
import * as api from '@opentelemetry/api';
17-
import { otperformance as performance, isWrapped } from '@opentelemetry/core';
18-
import { registerInstrumentations } from '@opentelemetry/instrumentation';
17+
import { otperformance as performance } from '@opentelemetry/core';
18+
import {
19+
registerInstrumentations,
20+
isWrapped,
21+
} from '@opentelemetry/instrumentation';
1922
import {
2023
B3Propagator,
2124
B3InjectEncoding,

experimental/packages/otlp-exporter-base/src/configuration/otlp-http-env-configuration.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import { baggageUtils } from '@opentelemetry/core';
16+
import { parseKeyPairsIntoRecord } from '@opentelemetry/core';
1717
import { diag } from '@opentelemetry/api';
1818
import { getSharedConfigurationFromEnvironment } from './shared-env-configuration';
1919
import { OtlpHttpConfiguration } from './otlp-http-configuration';
@@ -27,10 +27,10 @@ function getStaticHeadersFromEnv(
2727
const nonSignalSpecificRawHeaders =
2828
process.env['OTEL_EXPORTER_OTLP_HEADERS']?.trim();
2929

30-
const signalSpecificHeaders = baggageUtils.parseKeyPairsIntoRecord(
30+
const signalSpecificHeaders = parseKeyPairsIntoRecord(
3131
signalSpecificRawHeaders
3232
);
33-
const nonSignalSpecificHeaders = baggageUtils.parseKeyPairsIntoRecord(
33+
const nonSignalSpecificHeaders = parseKeyPairsIntoRecord(
3434
nonSignalSpecificRawHeaders
3535
);
3636

@@ -45,8 +45,8 @@ function getStaticHeadersFromEnv(
4545
// the non-specific ones.
4646
return Object.assign(
4747
{},
48-
baggageUtils.parseKeyPairsIntoRecord(nonSignalSpecificRawHeaders),
49-
baggageUtils.parseKeyPairsIntoRecord(signalSpecificRawHeaders)
48+
parseKeyPairsIntoRecord(nonSignalSpecificRawHeaders),
49+
parseKeyPairsIntoRecord(signalSpecificRawHeaders)
5050
);
5151
}
5252

experimental/packages/otlp-grpc-exporter-base/src/configuration/otlp-grpc-env-configuration.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
import { UnresolvedOtlpGrpcConfiguration } from './otlp-grpc-configuration';
1717
import type { ChannelCredentials, Metadata } from '@grpc/grpc-js';
18-
import { baggageUtils } from '@opentelemetry/core';
18+
import { parseKeyPairsIntoRecord } from '@opentelemetry/core';
1919
import {
2020
createEmptyMetadata,
2121
createInsecureCredentials,
@@ -47,10 +47,10 @@ function getMetadataFromEnv(signalIdentifier: string): Metadata | undefined {
4747
const nonSignalSpecificRawHeaders =
4848
process.env['OTEL_EXPORTER_OTLP_HEADERS']?.trim();
4949

50-
const signalSpecificHeaders = baggageUtils.parseKeyPairsIntoRecord(
50+
const signalSpecificHeaders = parseKeyPairsIntoRecord(
5151
signalSpecificRawHeaders
5252
);
53-
const nonSignalSpecificHeaders = baggageUtils.parseKeyPairsIntoRecord(
53+
const nonSignalSpecificHeaders = parseKeyPairsIntoRecord(
5454
nonSignalSpecificRawHeaders
5555
);
5656

experimental/packages/otlp-transformer/src/common/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616

1717
import type { OtlpEncodingOptions, Fixed64, LongBits } from './internal-types';
1818
import { HrTime } from '@opentelemetry/api';
19-
import { hexToBinary, hrTimeToNanoseconds } from '@opentelemetry/core';
19+
import { hrTimeToNanoseconds } from '@opentelemetry/core';
20+
import { hexToBinary } from './hex-to-binary';
2021

2122
export function hrTimeToNanos(hrTime: HrTime): bigint {
2223
const NANOSECONDS = BigInt(1_000_000_000);

experimental/packages/otlp-transformer/test/common.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { hexToBinary } from '@opentelemetry/core';
1817
import { toAnyValue } from '../src/common/internal';
1918
import * as assert from 'assert';
2019
import { getOtlpEncoder } from '../src/common/utils';
20+
import { hexToBinary } from '../src/common/hex-to-binary';
2121

2222
const traceId = 'abcdef01234567890000000000000000';
2323
const spanId = '12341234abcdabcd';

experimental/packages/otlp-transformer/test/logs.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616
import { HrTime, TraceFlags } from '@opentelemetry/api';
17-
import { InstrumentationScope, hexToBinary } from '@opentelemetry/core';
17+
import { InstrumentationScope } from '@opentelemetry/core';
1818
import { Resource } from '@opentelemetry/resources';
1919
import * as assert from 'assert';
2020
import { ReadableLogRecord } from '@opentelemetry/sdk-logs';
@@ -29,6 +29,7 @@ import {
2929
import { createExportLogsServiceRequest } from '../src/logs/internal';
3030
import { ProtobufLogsSerializer } from '../src/logs/protobuf';
3131
import { JsonLogsSerializer } from '../src/logs/json';
32+
import { hexToBinary } from '../src/common/hex-to-binary';
3233

3334
function createExpectedLogJson(
3435
options: OtlpEncodingOptions

experimental/packages/otlp-transformer/test/trace.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
import * as root from '../src/generated/root';
1717
import { SpanKind, SpanStatusCode, TraceFlags } from '@opentelemetry/api';
18-
import { TraceState, hexToBinary } from '@opentelemetry/core';
18+
import { TraceState } from '@opentelemetry/core';
1919
import { Resource } from '@opentelemetry/resources';
2020
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
2121
import * as assert from 'assert';
@@ -25,6 +25,7 @@ import { ESpanKind, EStatusCode } from '../src/trace/internal-types';
2525
import { createExportTraceServiceRequest } from '../src/trace/internal';
2626
import { ProtobufTraceSerializer } from '../src/trace/protobuf';
2727
import { JsonTraceSerializer } from '../src/trace/json';
28+
import { hexToBinary } from '../src/common/hex-to-binary';
2829

2930
function createExpectedSpanJson(options: OtlpEncodingOptions) {
3031
const useHex = options.useHex ?? false;

experimental/packages/otlp-transformer/test/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { hexToBinary } from '@opentelemetry/core';
17+
import { hexToBinary } from '../src/common/hex-to-binary';
1818

1919
/**
2020
* utility function to convert a string representing a hex value to a base64 string

0 commit comments

Comments
 (0)