diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/src/index.ts b/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/src/index.ts index 7b73804ce47..9703dd04a88 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/src/index.ts +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/src/index.ts @@ -14,4 +14,5 @@ * limitations under the License. */ -export * from './OTLPMetricExporter'; +// Legacy exporter kept for compatibility, scheduled for removal in 2.0 +export { OTLPMetricExporter } from './legacy/OTLPMetricExporter'; diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/src/OTLPMetricExporter.ts b/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/src/legacy/OTLPMetricExporter.ts similarity index 98% rename from experimental/packages/opentelemetry-exporter-metrics-otlp-proto/src/OTLPMetricExporter.ts rename to experimental/packages/opentelemetry-exporter-metrics-otlp-proto/src/legacy/OTLPMetricExporter.ts index 52c9991e30a..e5b604a48fc 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/src/OTLPMetricExporter.ts +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/src/legacy/OTLPMetricExporter.ts @@ -31,7 +31,7 @@ import { createExportMetricsServiceRequest, IExportMetricsServiceRequest, } from '@opentelemetry/otlp-transformer'; -import { VERSION } from './version'; +import { VERSION } from '../version'; const DEFAULT_COLLECTOR_RESOURCE_PATH = 'v1/metrics'; const DEFAULT_COLLECTOR_URL = `http://localhost:4318/${DEFAULT_COLLECTOR_RESOURCE_PATH}`; diff --git a/experimental/packages/otlp-exporter-base/package.json b/experimental/packages/otlp-exporter-base/package.json index ce41ac2f0fc..0c07798ae28 100644 --- a/experimental/packages/otlp-exporter-base/package.json +++ b/experimental/packages/otlp-exporter-base/package.json @@ -8,10 +8,10 @@ "types": "build/src/index.d.ts", "repository": "open-telemetry/opentelemetry-js", "browser": { - "./src/platform/index.ts": "./src/platform/browser/index.ts", - "./build/esm/platform/index.js": "./build/esm/platform/browser/index.js", - "./build/esnext/platform/index.js": "./build/esnext/platform/browser/index.js", - "./build/src/platform/index.js": "./build/src/platform/browser/index.js" + "./src/legacy/platform/index.ts": "./src/legacy/platform/browser/index.ts", + "./build/esm/legacy/platform/index.js": "./build/esm/legacy/platform/browser/index.js", + "./build/esnext/legacy/platform/index.js": "./build/esnext/legacy/platform/browser/index.js", + "./build/src/legacy/platform/index.js": "./build/src/legacy/platform/browser/index.js" }, "scripts": { "prepublishOnly": "npm run compile", diff --git a/experimental/packages/otlp-exporter-base/src/index.ts b/experimental/packages/otlp-exporter-base/src/index.ts index 9ded1037826..4d4497ad664 100644 --- a/experimental/packages/otlp-exporter-base/src/index.ts +++ b/experimental/packages/otlp-exporter-base/src/index.ts @@ -13,17 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export * from './platform'; -export { OTLPExporterBase } from './OTLPExporterBase'; -export { - OTLPExporterError, - OTLPExporterConfigBase, - ExportServiceError, -} from './types'; -export { - parseHeaders, - appendResourcePathToUrl, - appendRootPathToUrlIfNeeded, - configureExporterTimeout, - invalidTimeout, -} from './util'; + +// Legacy exports scheduled for removal. +export * from './legacy'; diff --git a/experimental/packages/otlp-exporter-base/src/OTLPExporterBase.ts b/experimental/packages/otlp-exporter-base/src/legacy/OTLPExporterBase.ts similarity index 100% rename from experimental/packages/otlp-exporter-base/src/OTLPExporterBase.ts rename to experimental/packages/otlp-exporter-base/src/legacy/OTLPExporterBase.ts diff --git a/experimental/packages/otlp-exporter-base/src/legacy/index.ts b/experimental/packages/otlp-exporter-base/src/legacy/index.ts new file mode 100644 index 00000000000..ca115094a0f --- /dev/null +++ b/experimental/packages/otlp-exporter-base/src/legacy/index.ts @@ -0,0 +1,31 @@ +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Legacy +export * from './platform'; +export { OTLPExporterBase } from './OTLPExporterBase'; +export { + OTLPExporterError, + OTLPExporterConfigBase, + ExportServiceError, +} from './types'; +export { + parseHeaders, + appendResourcePathToUrl, + appendRootPathToUrlIfNeeded, + configureExporterTimeout, + invalidTimeout, +} from './util'; diff --git a/experimental/packages/otlp-exporter-base/src/platform/browser/OTLPExporterBrowserBase.ts b/experimental/packages/otlp-exporter-base/src/legacy/platform/browser/OTLPExporterBrowserBase.ts similarity index 100% rename from experimental/packages/otlp-exporter-base/src/platform/browser/OTLPExporterBrowserBase.ts rename to experimental/packages/otlp-exporter-base/src/legacy/platform/browser/OTLPExporterBrowserBase.ts diff --git a/experimental/packages/otlp-exporter-base/src/platform/browser/index.ts b/experimental/packages/otlp-exporter-base/src/legacy/platform/browser/index.ts similarity index 100% rename from experimental/packages/otlp-exporter-base/src/platform/browser/index.ts rename to experimental/packages/otlp-exporter-base/src/legacy/platform/browser/index.ts diff --git a/experimental/packages/otlp-exporter-base/src/platform/browser/util.ts b/experimental/packages/otlp-exporter-base/src/legacy/platform/browser/util.ts similarity index 100% rename from experimental/packages/otlp-exporter-base/src/platform/browser/util.ts rename to experimental/packages/otlp-exporter-base/src/legacy/platform/browser/util.ts diff --git a/experimental/packages/otlp-exporter-base/src/platform/index.ts b/experimental/packages/otlp-exporter-base/src/legacy/platform/index.ts similarity index 100% rename from experimental/packages/otlp-exporter-base/src/platform/index.ts rename to experimental/packages/otlp-exporter-base/src/legacy/platform/index.ts diff --git a/experimental/packages/otlp-exporter-base/src/platform/node/OTLPExporterNodeBase.ts b/experimental/packages/otlp-exporter-base/src/legacy/platform/node/OTLPExporterNodeBase.ts similarity index 100% rename from experimental/packages/otlp-exporter-base/src/platform/node/OTLPExporterNodeBase.ts rename to experimental/packages/otlp-exporter-base/src/legacy/platform/node/OTLPExporterNodeBase.ts diff --git a/experimental/packages/otlp-exporter-base/src/platform/node/index.ts b/experimental/packages/otlp-exporter-base/src/legacy/platform/node/index.ts similarity index 100% rename from experimental/packages/otlp-exporter-base/src/platform/node/index.ts rename to experimental/packages/otlp-exporter-base/src/legacy/platform/node/index.ts diff --git a/experimental/packages/otlp-exporter-base/src/platform/node/types.ts b/experimental/packages/otlp-exporter-base/src/legacy/platform/node/types.ts similarity index 100% rename from experimental/packages/otlp-exporter-base/src/platform/node/types.ts rename to experimental/packages/otlp-exporter-base/src/legacy/platform/node/types.ts diff --git a/experimental/packages/otlp-exporter-base/src/platform/node/util.ts b/experimental/packages/otlp-exporter-base/src/legacy/platform/node/util.ts similarity index 100% rename from experimental/packages/otlp-exporter-base/src/platform/node/util.ts rename to experimental/packages/otlp-exporter-base/src/legacy/platform/node/util.ts diff --git a/experimental/packages/otlp-exporter-base/src/types.ts b/experimental/packages/otlp-exporter-base/src/legacy/types.ts similarity index 100% rename from experimental/packages/otlp-exporter-base/src/types.ts rename to experimental/packages/otlp-exporter-base/src/legacy/types.ts diff --git a/experimental/packages/otlp-exporter-base/src/util.ts b/experimental/packages/otlp-exporter-base/src/legacy/util.ts similarity index 100% rename from experimental/packages/otlp-exporter-base/src/util.ts rename to experimental/packages/otlp-exporter-base/src/legacy/util.ts diff --git a/experimental/packages/otlp-exporter-base/test/browser/util.test.ts b/experimental/packages/otlp-exporter-base/test/browser/util.test.ts index 1dd3b77d588..4283d98eb4c 100644 --- a/experimental/packages/otlp-exporter-base/test/browser/util.test.ts +++ b/experimental/packages/otlp-exporter-base/test/browser/util.test.ts @@ -15,9 +15,9 @@ */ import * as sinon from 'sinon'; -import { sendWithXhr } from '../../src/platform/browser/util'; +import { sendWithXhr } from '../../src'; import { nextTick } from 'process'; -import { ensureHeadersContain } from '../testHelper'; +import { ensureHeadersContain } from '../common/legacy/testHelper'; describe('util - browser', () => { let server: any; diff --git a/experimental/packages/otlp-exporter-base/test/common/CollectorExporter.test.ts b/experimental/packages/otlp-exporter-base/test/common/legacy/CollectorExporter.test.ts similarity index 96% rename from experimental/packages/otlp-exporter-base/test/common/CollectorExporter.test.ts rename to experimental/packages/otlp-exporter-base/test/common/legacy/CollectorExporter.test.ts index e3b36e704d4..92eb694695c 100644 --- a/experimental/packages/otlp-exporter-base/test/common/CollectorExporter.test.ts +++ b/experimental/packages/otlp-exporter-base/test/common/legacy/CollectorExporter.test.ts @@ -17,10 +17,10 @@ import { ExportResultCode } from '@opentelemetry/core'; import * as assert from 'assert'; import * as sinon from 'sinon'; -import { OTLPExporterBase } from '../../src/OTLPExporterBase'; -import { OTLPExporterConfigBase } from '../../src/types'; -import { ComplexTestObject, mockedComplexTestObject } from '../testHelper'; -import * as otlpTypes from '../../src/types'; +import { OTLPExporterBase } from '../../../src'; +import { OTLPExporterConfigBase } from '../../../src'; +import { ComplexTestObject, mockedComplexTestObject } from './testHelper'; +import * as otlpTypes from '../../../src/legacy/types'; interface ExportRequest { resourceSpans: object[]; diff --git a/experimental/packages/otlp-exporter-base/test/testHelper.ts b/experimental/packages/otlp-exporter-base/test/common/legacy/testHelper.ts similarity index 100% rename from experimental/packages/otlp-exporter-base/test/testHelper.ts rename to experimental/packages/otlp-exporter-base/test/common/legacy/testHelper.ts diff --git a/experimental/packages/otlp-exporter-base/test/common/util.test.ts b/experimental/packages/otlp-exporter-base/test/common/legacy/util.test.ts similarity index 99% rename from experimental/packages/otlp-exporter-base/test/common/util.test.ts rename to experimental/packages/otlp-exporter-base/test/common/legacy/util.test.ts index b00d1f36a5c..ffb741d400b 100644 --- a/experimental/packages/otlp-exporter-base/test/common/util.test.ts +++ b/experimental/packages/otlp-exporter-base/test/common/legacy/util.test.ts @@ -22,7 +22,7 @@ import { appendResourcePathToUrl, appendRootPathToUrlIfNeeded, parseRetryAfterToMills, -} from '../../src/util'; +} from '../../../src/legacy/util'; describe('utils', () => { afterEach(() => { diff --git a/experimental/packages/otlp-exporter-base/test/node/util.test.ts b/experimental/packages/otlp-exporter-base/test/node/legacy/util.test.ts similarity index 95% rename from experimental/packages/otlp-exporter-base/test/node/util.test.ts rename to experimental/packages/otlp-exporter-base/test/node/legacy/util.test.ts index b279e57b9a1..5a9dc6ade4a 100644 --- a/experimental/packages/otlp-exporter-base/test/node/util.test.ts +++ b/experimental/packages/otlp-exporter-base/test/node/legacy/util.test.ts @@ -15,16 +15,19 @@ */ import * as assert from 'assert'; -import { configureExporterTimeout, invalidTimeout } from '../../src/util'; -import { sendWithHttp } from '../../src/platform/node/util'; -import { CompressionAlgorithm } from '../../src/platform/node/types'; -import { configureCompression } from '../../src/platform/node/util'; +import { + configureExporterTimeout, + invalidTimeout, + sendWithHttp, + CompressionAlgorithm, + configureCompression, + OTLPExporterNodeBase, + OTLPExporterNodeConfigBase, + OTLPExporterError, +} from '../../../src'; import { diag } from '@opentelemetry/api'; import * as sinon from 'sinon'; -import { OTLPExporterNodeBase } from '../../src/platform/node/OTLPExporterNodeBase'; -import { OTLPExporterNodeConfigBase } from '../../src/platform/node/types'; -import { OTLPExporterError } from '../../src/types'; import { PassThrough } from 'stream'; import * as http from 'http'; import * as zlib from 'zlib'; diff --git a/experimental/packages/otlp-proto-exporter-base/package.json b/experimental/packages/otlp-proto-exporter-base/package.json index e62916bdef8..c5940a77f8d 100644 --- a/experimental/packages/otlp-proto-exporter-base/package.json +++ b/experimental/packages/otlp-proto-exporter-base/package.json @@ -8,10 +8,10 @@ "types": "build/src/index.d.ts", "repository": "open-telemetry/opentelemetry-js", "browser": { - "./src/platform/index.ts": "./src/platform/browser/index.ts", - "./build/esm/platform/index.js": "./build/esm/platform/browser/index.js", - "./build/esnext/platform/index.js": "./build/esnext/platform/browser/index.js", - "./build/src/platform/index.js": "./build/src/platform/browser/index.js" + "./src/legacy/platform/index.ts": "./src/legacy/platform/browser/index.ts", + "./build/esm/legacy/platform/index.js": "./build/esm/legacy/platform/browser/index.js", + "./build/esnext/legacy/platform/index.js": "./build/esnext/legacy/platform/browser/index.js", + "./build/src/legacy/platform/index.js": "./build/src/legacy/platform/browser/index.js" }, "scripts": { "prepublishOnly": "npm run compile", diff --git a/experimental/packages/otlp-proto-exporter-base/src/index.ts b/experimental/packages/otlp-proto-exporter-base/src/index.ts index e76b3a35937..067652e33f7 100644 --- a/experimental/packages/otlp-proto-exporter-base/src/index.ts +++ b/experimental/packages/otlp-proto-exporter-base/src/index.ts @@ -13,4 +13,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export * from './platform'; +export * from './legacy/platform'; diff --git a/experimental/packages/otlp-proto-exporter-base/src/platform/browser/OTLPProtoExporterBrowserBase.ts b/experimental/packages/otlp-proto-exporter-base/src/legacy/platform/browser/OTLPProtoExporterBrowserBase.ts similarity index 100% rename from experimental/packages/otlp-proto-exporter-base/src/platform/browser/OTLPProtoExporterBrowserBase.ts rename to experimental/packages/otlp-proto-exporter-base/src/legacy/platform/browser/OTLPProtoExporterBrowserBase.ts diff --git a/experimental/packages/otlp-proto-exporter-base/src/platform/browser/index.ts b/experimental/packages/otlp-proto-exporter-base/src/legacy/platform/browser/index.ts similarity index 100% rename from experimental/packages/otlp-proto-exporter-base/src/platform/browser/index.ts rename to experimental/packages/otlp-proto-exporter-base/src/legacy/platform/browser/index.ts diff --git a/experimental/packages/otlp-proto-exporter-base/src/platform/index.ts b/experimental/packages/otlp-proto-exporter-base/src/legacy/platform/index.ts similarity index 100% rename from experimental/packages/otlp-proto-exporter-base/src/platform/index.ts rename to experimental/packages/otlp-proto-exporter-base/src/legacy/platform/index.ts diff --git a/experimental/packages/otlp-proto-exporter-base/src/platform/node/OTLPProtoExporterNodeBase.ts b/experimental/packages/otlp-proto-exporter-base/src/legacy/platform/node/OTLPProtoExporterNodeBase.ts similarity index 100% rename from experimental/packages/otlp-proto-exporter-base/src/platform/node/OTLPProtoExporterNodeBase.ts rename to experimental/packages/otlp-proto-exporter-base/src/legacy/platform/node/OTLPProtoExporterNodeBase.ts diff --git a/experimental/packages/otlp-proto-exporter-base/src/platform/node/index.ts b/experimental/packages/otlp-proto-exporter-base/src/legacy/platform/node/index.ts similarity index 100% rename from experimental/packages/otlp-proto-exporter-base/src/platform/node/index.ts rename to experimental/packages/otlp-proto-exporter-base/src/legacy/platform/node/index.ts diff --git a/experimental/packages/otlp-proto-exporter-base/src/platform/node/util.ts b/experimental/packages/otlp-proto-exporter-base/src/legacy/platform/node/util.ts similarity index 100% rename from experimental/packages/otlp-proto-exporter-base/src/platform/node/util.ts rename to experimental/packages/otlp-proto-exporter-base/src/legacy/platform/node/util.ts diff --git a/experimental/packages/otlp-proto-exporter-base/src/platform/types.ts b/experimental/packages/otlp-proto-exporter-base/src/legacy/platform/types.ts similarity index 100% rename from experimental/packages/otlp-proto-exporter-base/src/platform/types.ts rename to experimental/packages/otlp-proto-exporter-base/src/legacy/platform/types.ts diff --git a/experimental/packages/otlp-proto-exporter-base/src/platform/util.ts b/experimental/packages/otlp-proto-exporter-base/src/legacy/platform/util.ts similarity index 97% rename from experimental/packages/otlp-proto-exporter-base/src/platform/util.ts rename to experimental/packages/otlp-proto-exporter-base/src/legacy/platform/util.ts index 2fe428b4322..fe3ac0501d9 100644 --- a/experimental/packages/otlp-proto-exporter-base/src/platform/util.ts +++ b/experimental/packages/otlp-proto-exporter-base/src/legacy/platform/util.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import * as root from '../generated/root'; +import * as root from '../../generated/root'; import { ServiceClientType } from './types'; import type * as protobuf from 'protobufjs';