Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,18 @@ For semantic convention package changes, see the [semconv CHANGELOG](packages/se
* 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
* feat(core)!: remove TracesSamplerValues from exports [#5406](https://github.com/open-telemetry/opentelemetry-js/pull/5406) @pichlermarc
* (user-facing): TracesSamplerValues was only consumed internally and has been removed from exports without replacement
* feat(core)!: remove unused and obsolete functions and types [#5444](https://github.com/open-telemetry/opentelemetry-js/pull/5444) @pichlermarc
* (user-facing): `VERSION` was an internal constant that was unintentionally exported. It has been removed without replacement.
* (user-facing): `isWrapped` has been removed in favor of `isWrapped` from `@opentelemetry/instrumentation`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I mentioned in a comment, this is used in one contrib package (plugin-react-load). So perhaps this falls under:

if an export is used in exactly one package - move its code to that package (do not export it from the package it was moved to)

It is used in tests in another package (opentelemetry-instrumentation-user-interaction), but that pkg also has a dep on @opentelemetry/instrumentation, so can use the isWrapped from there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thanks for double checking - I had missed that one. I've opened a PR to make all necessary changes in contrib: open-telemetry/opentelemetry-js-contrib#2704

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since both implementations are identical I've opted to just use the one from @opentelemetry/instrumentation instead. :)

* (user-facing): `ShimWrapped` has been removed in favor of `ShimWrapped` from `@opentelemetry/instrumentation`
* (user-facing): `hexToBase64` was a utility function that is not used by the SDK anymore. It has been removed without replacement.
* (user-facing): `hexToBinary` was a utility function that now internal to `@opentelemetry/otlp-tranformer`. It has been removed without replacement.
* (user-facing): `baggageUtils.getKeyParis` was an internal utility function that was unintentionally exported. It has been removed without replacement.
* (user-facing): `baggageUtils.serializeKeyPairs` was an internal utility function that was unintentionally exported. It has been removed without replacement.
* (user-facing): `baggageUtils.parseKeyPairsIntoRecord,` has been removed in favor of `parseKeyPairsIntoRecord`
* (user-facing): `baggageUtils.parsePairKeyValue` was an internal utility function that was unintentionally exported. It has been removed without replacement.
* (user-facing): `TimeOriginLegacy` has been removed without replacement.
* (user-facing): `isAttributeKey` was an internal utility function that was unintentionally exported. It has been removed without replacement.

### :rocket: (Enhancement)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
* limitations under the License.
*/
import * as api from '@opentelemetry/api';
import { otperformance as performance, isWrapped } from '@opentelemetry/core';
import { registerInstrumentations } from '@opentelemetry/instrumentation';
import { otperformance as performance } from '@opentelemetry/core';
import {
registerInstrumentations,
isWrapped,
} from '@opentelemetry/instrumentation';
import {
B3Propagator,
B3InjectEncoding,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { baggageUtils } from '@opentelemetry/core';
import { parseKeyPairsIntoRecord } from '@opentelemetry/core';
import { diag } from '@opentelemetry/api';
import { getSharedConfigurationFromEnvironment } from './shared-env-configuration';
import { OtlpHttpConfiguration } from './otlp-http-configuration';
Expand All @@ -27,10 +27,10 @@ function getStaticHeadersFromEnv(
const nonSignalSpecificRawHeaders =
process.env['OTEL_EXPORTER_OTLP_HEADERS']?.trim();

const signalSpecificHeaders = baggageUtils.parseKeyPairsIntoRecord(
const signalSpecificHeaders = parseKeyPairsIntoRecord(
signalSpecificRawHeaders
);
const nonSignalSpecificHeaders = baggageUtils.parseKeyPairsIntoRecord(
const nonSignalSpecificHeaders = parseKeyPairsIntoRecord(
nonSignalSpecificRawHeaders
);

Expand All @@ -45,8 +45,8 @@ function getStaticHeadersFromEnv(
// the non-specific ones.
return Object.assign(
{},
baggageUtils.parseKeyPairsIntoRecord(nonSignalSpecificRawHeaders),
baggageUtils.parseKeyPairsIntoRecord(signalSpecificRawHeaders)
parseKeyPairsIntoRecord(nonSignalSpecificRawHeaders),
parseKeyPairsIntoRecord(signalSpecificRawHeaders)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
import { UnresolvedOtlpGrpcConfiguration } from './otlp-grpc-configuration';
import type { ChannelCredentials, Metadata } from '@grpc/grpc-js';
import { baggageUtils } from '@opentelemetry/core';
import { parseKeyPairsIntoRecord } from '@opentelemetry/core';
import {
createEmptyMetadata,
createInsecureCredentials,
Expand Down Expand Up @@ -47,10 +47,10 @@ function getMetadataFromEnv(signalIdentifier: string): Metadata | undefined {
const nonSignalSpecificRawHeaders =
process.env['OTEL_EXPORTER_OTLP_HEADERS']?.trim();

const signalSpecificHeaders = baggageUtils.parseKeyPairsIntoRecord(
const signalSpecificHeaders = parseKeyPairsIntoRecord(
signalSpecificRawHeaders
);
const nonSignalSpecificHeaders = baggageUtils.parseKeyPairsIntoRecord(
const nonSignalSpecificHeaders = parseKeyPairsIntoRecord(
nonSignalSpecificRawHeaders
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

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

export function hrTimeToNanos(hrTime: HrTime): bigint {
const NANOSECONDS = BigInt(1_000_000_000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

import { hexToBinary } from '@opentelemetry/core';
import { toAnyValue } from '../src/common/internal';
import * as assert from 'assert';
import { getOtlpEncoder } from '../src/common/utils';
import { hexToBinary } from '../src/common/hex-to-binary';

const traceId = 'abcdef01234567890000000000000000';
const spanId = '12341234abcdabcd';
Expand Down
3 changes: 2 additions & 1 deletion experimental/packages/otlp-transformer/test/logs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
import { HrTime, TraceFlags } from '@opentelemetry/api';
import { InstrumentationScope, hexToBinary } from '@opentelemetry/core';
import { InstrumentationScope } from '@opentelemetry/core';
import { Resource } from '@opentelemetry/resources';
import * as assert from 'assert';
import { ReadableLogRecord } from '@opentelemetry/sdk-logs';
Expand All @@ -29,6 +29,7 @@ import {
import { createExportLogsServiceRequest } from '../src/logs/internal';
import { ProtobufLogsSerializer } from '../src/logs/protobuf';
import { JsonLogsSerializer } from '../src/logs/json';
import { hexToBinary } from '../src/common/hex-to-binary';

function createExpectedLogJson(
options: OtlpEncodingOptions
Expand Down
3 changes: 2 additions & 1 deletion experimental/packages/otlp-transformer/test/trace.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
import * as root from '../src/generated/root';
import { SpanKind, SpanStatusCode, TraceFlags } from '@opentelemetry/api';
import { TraceState, hexToBinary } from '@opentelemetry/core';
import { TraceState } from '@opentelemetry/core';
import { Resource } from '@opentelemetry/resources';
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
import * as assert from 'assert';
Expand All @@ -25,6 +25,7 @@ import { ESpanKind, EStatusCode } from '../src/trace/internal-types';
import { createExportTraceServiceRequest } from '../src/trace/internal';
import { ProtobufTraceSerializer } from '../src/trace/protobuf';
import { JsonTraceSerializer } from '../src/trace/json';
import { hexToBinary } from '../src/common/hex-to-binary';

function createExpectedSpanJson(options: OtlpEncodingOptions) {
const useHex = options.useHex ?? false;
Expand Down
2 changes: 1 addition & 1 deletion experimental/packages/otlp-transformer/test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

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

/**
* utility function to convert a string representing a hex value to a base64 string
Expand Down
34 changes: 0 additions & 34 deletions integration-tests/api/test/core-entries.test.js

This file was deleted.

30 changes: 3 additions & 27 deletions packages/opentelemetry-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@

export { W3CBaggagePropagator } from './baggage/propagation/W3CBaggagePropagator';
export { AnchoredClock, Clock } from './common/anchored-clock';
export {
isAttributeKey,
isAttributeValue,
sanitizeAttributes,
} from './common/attributes';
export { isAttributeValue, sanitizeAttributes } from './common/attributes';
export {
globalErrorHandler,
setGlobalErrorHandler,
Expand All @@ -40,32 +36,14 @@ export {
millisToHrTime,
timeInputToHrTime,
} from './common/time';
export {
ErrorHandler,
InstrumentationScope,
ShimWrapped,
TimeOriginLegacy,
} from './common/types';
export { hexToBinary } from './common/hex-to-binary';
export { ErrorHandler, InstrumentationScope } from './common/types';
export { ExportResult, ExportResultCode } from './ExportResult';
import {
getKeyPairs,
serializeKeyPairs,
parseKeyPairsIntoRecord,
parsePairKeyValue,
} from './baggage/utils';
export const baggageUtils = {
getKeyPairs,
serializeKeyPairs,
parseKeyPairsIntoRecord,
parsePairKeyValue,
};
export { parseKeyPairsIntoRecord } from './baggage/utils';
export {
SDK_INFO,
_globalThis,
getEnv,
getEnvWithoutDefaults,
hexToBase64,
otperformance,
unrefTimer,
} from './platform';
Expand Down Expand Up @@ -105,9 +83,7 @@ export {
export { merge } from './utils/merge';
export { TimeoutError, callWithTimeout } from './utils/timeout';
export { isUrlIgnored, urlMatches } from './utils/url';
export { isWrapped } from './utils/wrap';
export { BindOnceFuture } from './utils/callback';
export { VERSION } from './version';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no way to read the VERSION now.

import { _export } from './internal/exporter';
export const internal = {
_export,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

export { getEnvWithoutDefaults, getEnv } from './environment';
export { _globalThis } from './globalThis';
export { hexToBase64 } from './hex-to-base64';
export { otperformance } from './performance';
export { SDK_INFO } from './sdk-info';
export { unrefTimer } from './timer-util';
1 change: 0 additions & 1 deletion packages/opentelemetry-core/src/platform/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export {
_globalThis,
getEnv,
getEnvWithoutDefaults,
hexToBase64,
otperformance,
unrefTimer,
} from './node';
20 changes: 0 additions & 20 deletions packages/opentelemetry-core/src/platform/node/hex-to-base64.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/opentelemetry-core/src/platform/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

export { getEnvWithoutDefaults, getEnv } from './environment';
export { _globalThis } from './globalThis';
export { hexToBase64 } from './hex-to-base64';
export { otperformance } from './performance';
export { SDK_INFO } from './sdk-info';
export { unrefTimer } from './timer-util';
30 changes: 0 additions & 30 deletions packages/opentelemetry-core/src/utils/wrap.ts

This file was deleted.

34 changes: 0 additions & 34 deletions packages/opentelemetry-core/test/platform/hex-to-base64.test.ts

This file was deleted.

Loading