diff --git a/.gitmodules b/.gitmodules index 2a5d6c4ac7..4a85c71995 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,8 +1,8 @@ [submodule "packages/exporter-trace-otlp-proto/protos"] - path = packages/exporter-trace-otlp-proto/protos + path = experimental/packages/exporter-trace-otlp-proto/protos url = https://github.com/open-telemetry/opentelemetry-proto.git [submodule "packages/exporter-trace-otlp-grpc/protos"] - path = packages/exporter-trace-otlp-grpc/protos + path = experimental/packages/exporter-trace-otlp-grpc/protos url = https://github.com/open-telemetry/opentelemetry-proto.git [submodule "experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/protos"] path = experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/protos diff --git a/packages/exporter-trace-otlp-grpc/.eslintignore b/experimental/packages/exporter-trace-otlp-grpc/.eslintignore similarity index 100% rename from packages/exporter-trace-otlp-grpc/.eslintignore rename to experimental/packages/exporter-trace-otlp-grpc/.eslintignore diff --git a/packages/exporter-trace-otlp-grpc/.eslintrc.js b/experimental/packages/exporter-trace-otlp-grpc/.eslintrc.js similarity index 71% rename from packages/exporter-trace-otlp-grpc/.eslintrc.js rename to experimental/packages/exporter-trace-otlp-grpc/.eslintrc.js index fc4d038120..3ed0fbeba3 100644 --- a/packages/exporter-trace-otlp-grpc/.eslintrc.js +++ b/experimental/packages/exporter-trace-otlp-grpc/.eslintrc.js @@ -4,5 +4,5 @@ module.exports = { "commonjs": true, "node": true, }, - ...require('../../eslint.config.js') + ...require('../../../eslint.config.js') } diff --git a/packages/exporter-trace-otlp-grpc/.npmignore b/experimental/packages/exporter-trace-otlp-grpc/.npmignore similarity index 100% rename from packages/exporter-trace-otlp-grpc/.npmignore rename to experimental/packages/exporter-trace-otlp-grpc/.npmignore diff --git a/packages/exporter-trace-otlp-grpc/LICENSE b/experimental/packages/exporter-trace-otlp-grpc/LICENSE similarity index 100% rename from packages/exporter-trace-otlp-grpc/LICENSE rename to experimental/packages/exporter-trace-otlp-grpc/LICENSE diff --git a/packages/exporter-trace-otlp-grpc/README.md b/experimental/packages/exporter-trace-otlp-grpc/README.md similarity index 100% rename from packages/exporter-trace-otlp-grpc/README.md rename to experimental/packages/exporter-trace-otlp-grpc/README.md diff --git a/packages/exporter-trace-otlp-grpc/package.json b/experimental/packages/exporter-trace-otlp-grpc/package.json similarity index 88% rename from packages/exporter-trace-otlp-grpc/package.json rename to experimental/packages/exporter-trace-otlp-grpc/package.json index cefe99a44f..40587c7513 100644 --- a/packages/exporter-trace-otlp-grpc/package.json +++ b/experimental/packages/exporter-trace-otlp-grpc/package.json @@ -1,7 +1,6 @@ { "name": "@opentelemetry/exporter-trace-otlp-grpc", - "version": "1.1.1", - "private": "true", + "version": "0.27.0", "description": "OpenTelemetry Collector Exporter allows user to send collected traces to the OpenTelemetry Collector", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -17,7 +16,7 @@ "submodule": "git submodule sync --recursive && git submodule update --init --recursive", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", - "version": "node ../../scripts/version-update.js", + "version": "node ../../../scripts/version-update.js", "watch": "npm run protos:copy && tsc -w", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "npm run precompile" @@ -50,7 +49,7 @@ }, "devDependencies": { "@babel/core": "7.16.0", - "@opentelemetry/api": "^1.1.0", + "@opentelemetry/api": "^1.0.3", "@types/mocha": "8.2.3", "@types/node": "14.17.33", "@types/sinon": "10.0.6", @@ -68,10 +67,10 @@ "@opentelemetry/api": "^1.0.3" }, "dependencies": { - "@grpc/grpc-js": "^1.3.7", - "@grpc/proto-loader": "^0.6.4", "@opentelemetry/core": "1.1.1", - "@opentelemetry/exporter-trace-otlp-http": "1.1.1", + "@grpc/grpc-js": "^1.5.9", + "@grpc/proto-loader": "^0.6.9", + "@opentelemetry/exporter-trace-otlp-http": "0.27.0", "@opentelemetry/resources": "1.1.1", "@opentelemetry/sdk-trace-base": "1.1.1" } diff --git a/packages/exporter-trace-otlp-grpc/protos b/experimental/packages/exporter-trace-otlp-grpc/protos similarity index 100% rename from packages/exporter-trace-otlp-grpc/protos rename to experimental/packages/exporter-trace-otlp-grpc/protos diff --git a/packages/exporter-trace-otlp-grpc/src/OTLPExporterNodeBase.ts b/experimental/packages/exporter-trace-otlp-grpc/src/OTLPExporterNodeBase.ts similarity index 100% rename from packages/exporter-trace-otlp-grpc/src/OTLPExporterNodeBase.ts rename to experimental/packages/exporter-trace-otlp-grpc/src/OTLPExporterNodeBase.ts diff --git a/packages/exporter-trace-otlp-grpc/src/OTLPTraceExporter.ts b/experimental/packages/exporter-trace-otlp-grpc/src/OTLPTraceExporter.ts similarity index 100% rename from packages/exporter-trace-otlp-grpc/src/OTLPTraceExporter.ts rename to experimental/packages/exporter-trace-otlp-grpc/src/OTLPTraceExporter.ts diff --git a/packages/exporter-trace-otlp-grpc/src/index.ts b/experimental/packages/exporter-trace-otlp-grpc/src/index.ts similarity index 100% rename from packages/exporter-trace-otlp-grpc/src/index.ts rename to experimental/packages/exporter-trace-otlp-grpc/src/index.ts diff --git a/packages/exporter-trace-otlp-grpc/src/types.ts b/experimental/packages/exporter-trace-otlp-grpc/src/types.ts similarity index 100% rename from packages/exporter-trace-otlp-grpc/src/types.ts rename to experimental/packages/exporter-trace-otlp-grpc/src/types.ts diff --git a/packages/exporter-trace-otlp-grpc/src/util.ts b/experimental/packages/exporter-trace-otlp-grpc/src/util.ts similarity index 100% rename from packages/exporter-trace-otlp-grpc/src/util.ts rename to experimental/packages/exporter-trace-otlp-grpc/src/util.ts diff --git a/packages/exporter-trace-otlp-grpc/submodule.md b/experimental/packages/exporter-trace-otlp-grpc/submodule.md similarity index 100% rename from packages/exporter-trace-otlp-grpc/submodule.md rename to experimental/packages/exporter-trace-otlp-grpc/submodule.md diff --git a/packages/exporter-trace-otlp-grpc/test/OTLPExporterNodeBase.test.ts b/experimental/packages/exporter-trace-otlp-grpc/test/OTLPExporterNodeBase.test.ts similarity index 100% rename from packages/exporter-trace-otlp-grpc/test/OTLPExporterNodeBase.test.ts rename to experimental/packages/exporter-trace-otlp-grpc/test/OTLPExporterNodeBase.test.ts diff --git a/packages/exporter-trace-otlp-grpc/test/OTLPTraceExporter.test.ts b/experimental/packages/exporter-trace-otlp-grpc/test/OTLPTraceExporter.test.ts similarity index 100% rename from packages/exporter-trace-otlp-grpc/test/OTLPTraceExporter.test.ts rename to experimental/packages/exporter-trace-otlp-grpc/test/OTLPTraceExporter.test.ts diff --git a/packages/exporter-trace-otlp-grpc/test/certs/ca.crt b/experimental/packages/exporter-trace-otlp-grpc/test/certs/ca.crt similarity index 100% rename from packages/exporter-trace-otlp-grpc/test/certs/ca.crt rename to experimental/packages/exporter-trace-otlp-grpc/test/certs/ca.crt diff --git a/packages/exporter-trace-otlp-grpc/test/certs/ca.key b/experimental/packages/exporter-trace-otlp-grpc/test/certs/ca.key similarity index 100% rename from packages/exporter-trace-otlp-grpc/test/certs/ca.key rename to experimental/packages/exporter-trace-otlp-grpc/test/certs/ca.key diff --git a/packages/exporter-trace-otlp-grpc/test/certs/client.crt b/experimental/packages/exporter-trace-otlp-grpc/test/certs/client.crt similarity index 100% rename from packages/exporter-trace-otlp-grpc/test/certs/client.crt rename to experimental/packages/exporter-trace-otlp-grpc/test/certs/client.crt diff --git a/packages/exporter-trace-otlp-grpc/test/certs/client.csr b/experimental/packages/exporter-trace-otlp-grpc/test/certs/client.csr similarity index 100% rename from packages/exporter-trace-otlp-grpc/test/certs/client.csr rename to experimental/packages/exporter-trace-otlp-grpc/test/certs/client.csr diff --git a/packages/exporter-trace-otlp-grpc/test/certs/client.key b/experimental/packages/exporter-trace-otlp-grpc/test/certs/client.key similarity index 100% rename from packages/exporter-trace-otlp-grpc/test/certs/client.key rename to experimental/packages/exporter-trace-otlp-grpc/test/certs/client.key diff --git a/packages/exporter-trace-otlp-grpc/test/certs/regenerate.sh b/experimental/packages/exporter-trace-otlp-grpc/test/certs/regenerate.sh similarity index 100% rename from packages/exporter-trace-otlp-grpc/test/certs/regenerate.sh rename to experimental/packages/exporter-trace-otlp-grpc/test/certs/regenerate.sh diff --git a/packages/exporter-trace-otlp-grpc/test/certs/server.crt b/experimental/packages/exporter-trace-otlp-grpc/test/certs/server.crt similarity index 100% rename from packages/exporter-trace-otlp-grpc/test/certs/server.crt rename to experimental/packages/exporter-trace-otlp-grpc/test/certs/server.crt diff --git a/packages/exporter-trace-otlp-grpc/test/certs/server.csr b/experimental/packages/exporter-trace-otlp-grpc/test/certs/server.csr similarity index 100% rename from packages/exporter-trace-otlp-grpc/test/certs/server.csr rename to experimental/packages/exporter-trace-otlp-grpc/test/certs/server.csr diff --git a/packages/exporter-trace-otlp-grpc/test/certs/server.key b/experimental/packages/exporter-trace-otlp-grpc/test/certs/server.key similarity index 100% rename from packages/exporter-trace-otlp-grpc/test/certs/server.key rename to experimental/packages/exporter-trace-otlp-grpc/test/certs/server.key diff --git a/packages/exporter-trace-otlp-grpc/test/traceHelper.ts b/experimental/packages/exporter-trace-otlp-grpc/test/traceHelper.ts similarity index 100% rename from packages/exporter-trace-otlp-grpc/test/traceHelper.ts rename to experimental/packages/exporter-trace-otlp-grpc/test/traceHelper.ts diff --git a/packages/exporter-trace-otlp-grpc/test/util.test.ts b/experimental/packages/exporter-trace-otlp-grpc/test/util.test.ts similarity index 100% rename from packages/exporter-trace-otlp-grpc/test/util.test.ts rename to experimental/packages/exporter-trace-otlp-grpc/test/util.test.ts diff --git a/packages/exporter-trace-otlp-proto/tsconfig.json b/experimental/packages/exporter-trace-otlp-grpc/tsconfig.json similarity index 50% rename from packages/exporter-trace-otlp-proto/tsconfig.json rename to experimental/packages/exporter-trace-otlp-grpc/tsconfig.json index 573e18d61f..8597d3eb6b 100644 --- a/packages/exporter-trace-otlp-proto/tsconfig.json +++ b/experimental/packages/exporter-trace-otlp-grpc/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "rootDir": ".", "outDir": "build" @@ -11,15 +11,6 @@ "references": [ { "path": "../exporter-trace-otlp-http" - }, - { - "path": "../opentelemetry-core" - }, - { - "path": "../opentelemetry-resources" - }, - { - "path": "../opentelemetry-sdk-trace-base" } ] } diff --git a/packages/exporter-trace-otlp-http/.eslintignore b/experimental/packages/exporter-trace-otlp-http/.eslintignore similarity index 100% rename from packages/exporter-trace-otlp-http/.eslintignore rename to experimental/packages/exporter-trace-otlp-http/.eslintignore diff --git a/packages/exporter-trace-otlp-http/.eslintrc.js b/experimental/packages/exporter-trace-otlp-http/.eslintrc.js similarity index 75% rename from packages/exporter-trace-otlp-http/.eslintrc.js rename to experimental/packages/exporter-trace-otlp-http/.eslintrc.js index 9dfe62f9b8..e41d9a9299 100644 --- a/packages/exporter-trace-otlp-http/.eslintrc.js +++ b/experimental/packages/exporter-trace-otlp-http/.eslintrc.js @@ -5,5 +5,5 @@ module.exports = { "node": true, "browser": true }, - ...require('../../eslint.config.js') + ...require('../../../eslint.config.js') } diff --git a/packages/exporter-trace-otlp-http/.npmignore b/experimental/packages/exporter-trace-otlp-http/.npmignore similarity index 100% rename from packages/exporter-trace-otlp-http/.npmignore rename to experimental/packages/exporter-trace-otlp-http/.npmignore diff --git a/packages/exporter-trace-otlp-http/LICENSE b/experimental/packages/exporter-trace-otlp-http/LICENSE similarity index 100% rename from packages/exporter-trace-otlp-http/LICENSE rename to experimental/packages/exporter-trace-otlp-http/LICENSE diff --git a/packages/exporter-trace-otlp-http/README.md b/experimental/packages/exporter-trace-otlp-http/README.md similarity index 100% rename from packages/exporter-trace-otlp-http/README.md rename to experimental/packages/exporter-trace-otlp-http/README.md diff --git a/packages/exporter-trace-otlp-http/karma.conf.js b/experimental/packages/exporter-trace-otlp-http/karma.conf.js similarity index 87% rename from packages/exporter-trace-otlp-http/karma.conf.js rename to experimental/packages/exporter-trace-otlp-http/karma.conf.js index 455b1437c8..4c60b54edb 100644 --- a/packages/exporter-trace-otlp-http/karma.conf.js +++ b/experimental/packages/exporter-trace-otlp-http/karma.conf.js @@ -14,8 +14,8 @@ * limitations under the License. */ -const karmaWebpackConfig = require('../../karma.webpack'); -const karmaBaseConfig = require('../../karma.base'); +const karmaWebpackConfig = require('../../../karma.webpack'); +const karmaBaseConfig = require('../../../karma.base'); module.exports = (config) => { config.set(Object.assign({}, karmaBaseConfig, { diff --git a/packages/exporter-trace-otlp-http/package.json b/experimental/packages/exporter-trace-otlp-http/package.json similarity index 95% rename from packages/exporter-trace-otlp-http/package.json rename to experimental/packages/exporter-trace-otlp-http/package.json index 244d786a7b..f2e4cf8a06 100644 --- a/packages/exporter-trace-otlp-http/package.json +++ b/experimental/packages/exporter-trace-otlp-http/package.json @@ -1,7 +1,6 @@ { "name": "@opentelemetry/exporter-trace-otlp-http", - "version": "1.1.1", - "private": "true", + "version": "0.27.0", "description": "OpenTelemetry Collector Trace Exporter allows user to send collected traces to the OpenTelemetry Collector", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -25,7 +24,7 @@ "tdd:browser": "karma start", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts' --exclude 'test/browser/**/*.ts'", "test:browser": "nyc karma start --single-run", - "version": "node ../../scripts/version-update.js", + "version": "node ../../../scripts/version-update.js", "watch": "tsc --build --watch tsconfig.all.json", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "npm run precompile" @@ -63,7 +62,7 @@ }, "devDependencies": { "@babel/core": "7.16.0", - "@opentelemetry/api": "^1.1.0", + "@opentelemetry/api": "^1.0.3", "@types/mocha": "8.2.3", "@types/node": "14.17.33", "@types/sinon": "10.0.6", diff --git a/packages/exporter-trace-otlp-http/src/OTLPExporterBase.ts b/experimental/packages/exporter-trace-otlp-http/src/OTLPExporterBase.ts similarity index 100% rename from packages/exporter-trace-otlp-http/src/OTLPExporterBase.ts rename to experimental/packages/exporter-trace-otlp-http/src/OTLPExporterBase.ts diff --git a/packages/exporter-trace-otlp-http/src/index.ts b/experimental/packages/exporter-trace-otlp-http/src/index.ts similarity index 100% rename from packages/exporter-trace-otlp-http/src/index.ts rename to experimental/packages/exporter-trace-otlp-http/src/index.ts diff --git a/packages/exporter-trace-otlp-http/src/platform/browser/OTLPExporterBrowserBase.ts b/experimental/packages/exporter-trace-otlp-http/src/platform/browser/OTLPExporterBrowserBase.ts similarity index 100% rename from packages/exporter-trace-otlp-http/src/platform/browser/OTLPExporterBrowserBase.ts rename to experimental/packages/exporter-trace-otlp-http/src/platform/browser/OTLPExporterBrowserBase.ts diff --git a/packages/exporter-trace-otlp-http/src/platform/browser/OTLPTraceExporter.ts b/experimental/packages/exporter-trace-otlp-http/src/platform/browser/OTLPTraceExporter.ts similarity index 100% rename from packages/exporter-trace-otlp-http/src/platform/browser/OTLPTraceExporter.ts rename to experimental/packages/exporter-trace-otlp-http/src/platform/browser/OTLPTraceExporter.ts diff --git a/packages/exporter-trace-otlp-http/src/platform/browser/index.ts b/experimental/packages/exporter-trace-otlp-http/src/platform/browser/index.ts similarity index 100% rename from packages/exporter-trace-otlp-http/src/platform/browser/index.ts rename to experimental/packages/exporter-trace-otlp-http/src/platform/browser/index.ts diff --git a/packages/exporter-trace-otlp-http/src/platform/browser/util.ts b/experimental/packages/exporter-trace-otlp-http/src/platform/browser/util.ts similarity index 100% rename from packages/exporter-trace-otlp-http/src/platform/browser/util.ts rename to experimental/packages/exporter-trace-otlp-http/src/platform/browser/util.ts diff --git a/packages/exporter-trace-otlp-http/src/platform/index.ts b/experimental/packages/exporter-trace-otlp-http/src/platform/index.ts similarity index 100% rename from packages/exporter-trace-otlp-http/src/platform/index.ts rename to experimental/packages/exporter-trace-otlp-http/src/platform/index.ts diff --git a/packages/exporter-trace-otlp-http/src/platform/node/OTLPExporterNodeBase.ts b/experimental/packages/exporter-trace-otlp-http/src/platform/node/OTLPExporterNodeBase.ts similarity index 100% rename from packages/exporter-trace-otlp-http/src/platform/node/OTLPExporterNodeBase.ts rename to experimental/packages/exporter-trace-otlp-http/src/platform/node/OTLPExporterNodeBase.ts diff --git a/packages/exporter-trace-otlp-http/src/platform/node/OTLPTraceExporter.ts b/experimental/packages/exporter-trace-otlp-http/src/platform/node/OTLPTraceExporter.ts similarity index 100% rename from packages/exporter-trace-otlp-http/src/platform/node/OTLPTraceExporter.ts rename to experimental/packages/exporter-trace-otlp-http/src/platform/node/OTLPTraceExporter.ts diff --git a/packages/exporter-trace-otlp-http/src/platform/node/index.ts b/experimental/packages/exporter-trace-otlp-http/src/platform/node/index.ts similarity index 100% rename from packages/exporter-trace-otlp-http/src/platform/node/index.ts rename to experimental/packages/exporter-trace-otlp-http/src/platform/node/index.ts diff --git a/packages/exporter-trace-otlp-http/src/platform/node/types.ts b/experimental/packages/exporter-trace-otlp-http/src/platform/node/types.ts similarity index 100% rename from packages/exporter-trace-otlp-http/src/platform/node/types.ts rename to experimental/packages/exporter-trace-otlp-http/src/platform/node/types.ts diff --git a/packages/exporter-trace-otlp-http/src/platform/node/util.ts b/experimental/packages/exporter-trace-otlp-http/src/platform/node/util.ts similarity index 100% rename from packages/exporter-trace-otlp-http/src/platform/node/util.ts rename to experimental/packages/exporter-trace-otlp-http/src/platform/node/util.ts diff --git a/packages/exporter-trace-otlp-http/src/transform.ts b/experimental/packages/exporter-trace-otlp-http/src/transform.ts similarity index 100% rename from packages/exporter-trace-otlp-http/src/transform.ts rename to experimental/packages/exporter-trace-otlp-http/src/transform.ts diff --git a/packages/exporter-trace-otlp-http/src/types.ts b/experimental/packages/exporter-trace-otlp-http/src/types.ts similarity index 100% rename from packages/exporter-trace-otlp-http/src/types.ts rename to experimental/packages/exporter-trace-otlp-http/src/types.ts diff --git a/packages/exporter-trace-otlp-http/src/util.ts b/experimental/packages/exporter-trace-otlp-http/src/util.ts similarity index 100% rename from packages/exporter-trace-otlp-http/src/util.ts rename to experimental/packages/exporter-trace-otlp-http/src/util.ts diff --git a/packages/exporter-trace-otlp-http/test/browser/CollectorTraceExporter.test.ts b/experimental/packages/exporter-trace-otlp-http/test/browser/CollectorTraceExporter.test.ts similarity index 100% rename from packages/exporter-trace-otlp-http/test/browser/CollectorTraceExporter.test.ts rename to experimental/packages/exporter-trace-otlp-http/test/browser/CollectorTraceExporter.test.ts diff --git a/packages/exporter-trace-otlp-http/test/browser/index-webpack.ts b/experimental/packages/exporter-trace-otlp-http/test/browser/index-webpack.ts similarity index 100% rename from packages/exporter-trace-otlp-http/test/browser/index-webpack.ts rename to experimental/packages/exporter-trace-otlp-http/test/browser/index-webpack.ts diff --git a/packages/exporter-trace-otlp-http/test/browser/util.test.ts b/experimental/packages/exporter-trace-otlp-http/test/browser/util.test.ts similarity index 100% rename from packages/exporter-trace-otlp-http/test/browser/util.test.ts rename to experimental/packages/exporter-trace-otlp-http/test/browser/util.test.ts diff --git a/packages/exporter-trace-otlp-http/test/certs/ca.crt b/experimental/packages/exporter-trace-otlp-http/test/certs/ca.crt similarity index 100% rename from packages/exporter-trace-otlp-http/test/certs/ca.crt rename to experimental/packages/exporter-trace-otlp-http/test/certs/ca.crt diff --git a/packages/exporter-trace-otlp-http/test/certs/ca.key b/experimental/packages/exporter-trace-otlp-http/test/certs/ca.key similarity index 100% rename from packages/exporter-trace-otlp-http/test/certs/ca.key rename to experimental/packages/exporter-trace-otlp-http/test/certs/ca.key diff --git a/packages/exporter-trace-otlp-http/test/certs/client.crt b/experimental/packages/exporter-trace-otlp-http/test/certs/client.crt similarity index 100% rename from packages/exporter-trace-otlp-http/test/certs/client.crt rename to experimental/packages/exporter-trace-otlp-http/test/certs/client.crt diff --git a/packages/exporter-trace-otlp-http/test/certs/client.csr b/experimental/packages/exporter-trace-otlp-http/test/certs/client.csr similarity index 100% rename from packages/exporter-trace-otlp-http/test/certs/client.csr rename to experimental/packages/exporter-trace-otlp-http/test/certs/client.csr diff --git a/packages/exporter-trace-otlp-http/test/certs/client.key b/experimental/packages/exporter-trace-otlp-http/test/certs/client.key similarity index 100% rename from packages/exporter-trace-otlp-http/test/certs/client.key rename to experimental/packages/exporter-trace-otlp-http/test/certs/client.key diff --git a/packages/exporter-trace-otlp-http/test/certs/regenerate.sh b/experimental/packages/exporter-trace-otlp-http/test/certs/regenerate.sh similarity index 100% rename from packages/exporter-trace-otlp-http/test/certs/regenerate.sh rename to experimental/packages/exporter-trace-otlp-http/test/certs/regenerate.sh diff --git a/packages/exporter-trace-otlp-http/test/certs/server.crt b/experimental/packages/exporter-trace-otlp-http/test/certs/server.crt similarity index 100% rename from packages/exporter-trace-otlp-http/test/certs/server.crt rename to experimental/packages/exporter-trace-otlp-http/test/certs/server.crt diff --git a/packages/exporter-trace-otlp-http/test/certs/server.csr b/experimental/packages/exporter-trace-otlp-http/test/certs/server.csr similarity index 100% rename from packages/exporter-trace-otlp-http/test/certs/server.csr rename to experimental/packages/exporter-trace-otlp-http/test/certs/server.csr diff --git a/packages/exporter-trace-otlp-http/test/certs/server.key b/experimental/packages/exporter-trace-otlp-http/test/certs/server.key similarity index 100% rename from packages/exporter-trace-otlp-http/test/certs/server.key rename to experimental/packages/exporter-trace-otlp-http/test/certs/server.key diff --git a/packages/exporter-trace-otlp-http/test/common/CollectorTraceExporter.test.ts b/experimental/packages/exporter-trace-otlp-http/test/common/CollectorTraceExporter.test.ts similarity index 100% rename from packages/exporter-trace-otlp-http/test/common/CollectorTraceExporter.test.ts rename to experimental/packages/exporter-trace-otlp-http/test/common/CollectorTraceExporter.test.ts diff --git a/packages/exporter-trace-otlp-http/test/common/transform.test.ts b/experimental/packages/exporter-trace-otlp-http/test/common/transform.test.ts similarity index 100% rename from packages/exporter-trace-otlp-http/test/common/transform.test.ts rename to experimental/packages/exporter-trace-otlp-http/test/common/transform.test.ts diff --git a/packages/exporter-trace-otlp-http/test/common/utils.test.ts b/experimental/packages/exporter-trace-otlp-http/test/common/utils.test.ts similarity index 100% rename from packages/exporter-trace-otlp-http/test/common/utils.test.ts rename to experimental/packages/exporter-trace-otlp-http/test/common/utils.test.ts diff --git a/packages/exporter-trace-otlp-http/test/node/CollectorTraceExporter.test.ts b/experimental/packages/exporter-trace-otlp-http/test/node/CollectorTraceExporter.test.ts similarity index 100% rename from packages/exporter-trace-otlp-http/test/node/CollectorTraceExporter.test.ts rename to experimental/packages/exporter-trace-otlp-http/test/node/CollectorTraceExporter.test.ts diff --git a/packages/exporter-trace-otlp-http/test/node/nodeHelpers.ts b/experimental/packages/exporter-trace-otlp-http/test/node/nodeHelpers.ts similarity index 100% rename from packages/exporter-trace-otlp-http/test/node/nodeHelpers.ts rename to experimental/packages/exporter-trace-otlp-http/test/node/nodeHelpers.ts diff --git a/packages/exporter-trace-otlp-http/test/node/utils.test.ts b/experimental/packages/exporter-trace-otlp-http/test/node/utils.test.ts similarity index 100% rename from packages/exporter-trace-otlp-http/test/node/utils.test.ts rename to experimental/packages/exporter-trace-otlp-http/test/node/utils.test.ts diff --git a/packages/exporter-trace-otlp-http/test/traceHelper.ts b/experimental/packages/exporter-trace-otlp-http/test/traceHelper.ts similarity index 100% rename from packages/exporter-trace-otlp-http/test/traceHelper.ts rename to experimental/packages/exporter-trace-otlp-http/test/traceHelper.ts diff --git a/packages/exporter-trace-otlp-http/tsconfig.all.json b/experimental/packages/exporter-trace-otlp-http/tsconfig.all.json similarity index 78% rename from packages/exporter-trace-otlp-http/tsconfig.all.json rename to experimental/packages/exporter-trace-otlp-http/tsconfig.all.json index 4d28a993d3..06c5491334 100644 --- a/packages/exporter-trace-otlp-http/tsconfig.all.json +++ b/experimental/packages/exporter-trace-otlp-http/tsconfig.all.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../../tsconfig.base.json", "files": [], "references": [ { "path": "./tsconfig.json" }, diff --git a/packages/exporter-trace-otlp-http/tsconfig.esm.json b/experimental/packages/exporter-trace-otlp-http/tsconfig.esm.json similarity index 78% rename from packages/exporter-trace-otlp-http/tsconfig.esm.json rename to experimental/packages/exporter-trace-otlp-http/tsconfig.esm.json index a94adff6aa..379f547a46 100644 --- a/packages/exporter-trace-otlp-http/tsconfig.esm.json +++ b/experimental/packages/exporter-trace-otlp-http/tsconfig.esm.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.base.esm.json", + "extends": "../../../tsconfig.base.esm.json", "compilerOptions": { "rootDir": "src", "outDir": "build/esm", diff --git a/packages/exporter-trace-otlp-http/tsconfig.esnext.json b/experimental/packages/exporter-trace-otlp-http/tsconfig.esnext.json similarity index 78% rename from packages/exporter-trace-otlp-http/tsconfig.esnext.json rename to experimental/packages/exporter-trace-otlp-http/tsconfig.esnext.json index 65a918cf6b..cb78dd6ff3 100644 --- a/packages/exporter-trace-otlp-http/tsconfig.esnext.json +++ b/experimental/packages/exporter-trace-otlp-http/tsconfig.esnext.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.base.esnext.json", + "extends": "../../../tsconfig.base.esnext.json", "compilerOptions": { "rootDir": "src", "outDir": "build/esnext", diff --git a/experimental/packages/exporter-trace-otlp-http/tsconfig.json b/experimental/packages/exporter-trace-otlp-http/tsconfig.json new file mode 100644 index 0000000000..ed9d0830bd --- /dev/null +++ b/experimental/packages/exporter-trace-otlp-http/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build" + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts" + ] +} diff --git a/packages/exporter-trace-otlp-proto/.eslintignore b/experimental/packages/exporter-trace-otlp-proto/.eslintignore similarity index 100% rename from packages/exporter-trace-otlp-proto/.eslintignore rename to experimental/packages/exporter-trace-otlp-proto/.eslintignore diff --git a/packages/exporter-trace-otlp-proto/.eslintrc.js b/experimental/packages/exporter-trace-otlp-proto/.eslintrc.js similarity index 71% rename from packages/exporter-trace-otlp-proto/.eslintrc.js rename to experimental/packages/exporter-trace-otlp-proto/.eslintrc.js index fc4d038120..3ed0fbeba3 100644 --- a/packages/exporter-trace-otlp-proto/.eslintrc.js +++ b/experimental/packages/exporter-trace-otlp-proto/.eslintrc.js @@ -4,5 +4,5 @@ module.exports = { "commonjs": true, "node": true, }, - ...require('../../eslint.config.js') + ...require('../../../eslint.config.js') } diff --git a/packages/exporter-trace-otlp-proto/.npmignore b/experimental/packages/exporter-trace-otlp-proto/.npmignore similarity index 100% rename from packages/exporter-trace-otlp-proto/.npmignore rename to experimental/packages/exporter-trace-otlp-proto/.npmignore diff --git a/packages/exporter-trace-otlp-proto/LICENSE b/experimental/packages/exporter-trace-otlp-proto/LICENSE similarity index 100% rename from packages/exporter-trace-otlp-proto/LICENSE rename to experimental/packages/exporter-trace-otlp-proto/LICENSE diff --git a/packages/exporter-trace-otlp-proto/README.md b/experimental/packages/exporter-trace-otlp-proto/README.md similarity index 100% rename from packages/exporter-trace-otlp-proto/README.md rename to experimental/packages/exporter-trace-otlp-proto/README.md diff --git a/packages/exporter-trace-otlp-proto/package.json b/experimental/packages/exporter-trace-otlp-proto/package.json similarity index 90% rename from packages/exporter-trace-otlp-proto/package.json rename to experimental/packages/exporter-trace-otlp-proto/package.json index c38e65723d..2d069e3139 100644 --- a/packages/exporter-trace-otlp-proto/package.json +++ b/experimental/packages/exporter-trace-otlp-proto/package.json @@ -1,7 +1,6 @@ { "name": "@opentelemetry/exporter-trace-otlp-proto", - "version": "1.1.1", - "private": "true", + "version": "0.27.0", "description": "OpenTelemetry Collector Exporter allows user to send collected traces to the OpenTelemetry Collector using protobuf over HTTP", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -17,7 +16,7 @@ "submodule": "git submodule sync --recursive && git submodule update --init --recursive", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", - "version": "node ../../scripts/version-update.js", + "version": "node ../../../scripts/version-update.js", "watch": "npm run protos:copy && tsc -w", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "npm run precompile" @@ -50,7 +49,7 @@ }, "devDependencies": { "@babel/core": "7.16.0", - "@opentelemetry/api": "^1.1.0", + "@opentelemetry/api": "^1.0.3", "@types/mocha": "8.2.3", "@types/node": "14.17.33", "@types/sinon": "10.0.6", @@ -68,9 +67,9 @@ "@opentelemetry/api": "^1.0.3" }, "dependencies": { - "@grpc/proto-loader": "^0.6.4", "@opentelemetry/core": "1.1.1", - "@opentelemetry/exporter-trace-otlp-http": "1.1.1", + "@grpc/proto-loader": "^0.6.9", + "@opentelemetry/exporter-trace-otlp-http": "0.27.0", "@opentelemetry/resources": "1.1.1", "@opentelemetry/sdk-trace-base": "1.1.1", "protobufjs": "^6.9.0" diff --git a/packages/exporter-trace-otlp-proto/protos b/experimental/packages/exporter-trace-otlp-proto/protos similarity index 100% rename from packages/exporter-trace-otlp-proto/protos rename to experimental/packages/exporter-trace-otlp-proto/protos diff --git a/packages/exporter-trace-otlp-proto/src/OTLPExporterNodeBase.ts b/experimental/packages/exporter-trace-otlp-proto/src/OTLPExporterNodeBase.ts similarity index 100% rename from packages/exporter-trace-otlp-proto/src/OTLPExporterNodeBase.ts rename to experimental/packages/exporter-trace-otlp-proto/src/OTLPExporterNodeBase.ts diff --git a/packages/exporter-trace-otlp-proto/src/OTLPTraceExporter.ts b/experimental/packages/exporter-trace-otlp-proto/src/OTLPTraceExporter.ts similarity index 100% rename from packages/exporter-trace-otlp-proto/src/OTLPTraceExporter.ts rename to experimental/packages/exporter-trace-otlp-proto/src/OTLPTraceExporter.ts diff --git a/packages/exporter-trace-otlp-proto/src/index.ts b/experimental/packages/exporter-trace-otlp-proto/src/index.ts similarity index 100% rename from packages/exporter-trace-otlp-proto/src/index.ts rename to experimental/packages/exporter-trace-otlp-proto/src/index.ts diff --git a/packages/exporter-trace-otlp-proto/src/types.ts b/experimental/packages/exporter-trace-otlp-proto/src/types.ts similarity index 100% rename from packages/exporter-trace-otlp-proto/src/types.ts rename to experimental/packages/exporter-trace-otlp-proto/src/types.ts diff --git a/packages/exporter-trace-otlp-proto/src/util.ts b/experimental/packages/exporter-trace-otlp-proto/src/util.ts similarity index 100% rename from packages/exporter-trace-otlp-proto/src/util.ts rename to experimental/packages/exporter-trace-otlp-proto/src/util.ts diff --git a/packages/exporter-trace-otlp-proto/submodule.md b/experimental/packages/exporter-trace-otlp-proto/submodule.md similarity index 100% rename from packages/exporter-trace-otlp-proto/submodule.md rename to experimental/packages/exporter-trace-otlp-proto/submodule.md diff --git a/packages/exporter-trace-otlp-proto/test/OTLPTraceExporter.test.ts b/experimental/packages/exporter-trace-otlp-proto/test/OTLPTraceExporter.test.ts similarity index 100% rename from packages/exporter-trace-otlp-proto/test/OTLPTraceExporter.test.ts rename to experimental/packages/exporter-trace-otlp-proto/test/OTLPTraceExporter.test.ts diff --git a/packages/exporter-trace-otlp-proto/test/certs/ca.crt b/experimental/packages/exporter-trace-otlp-proto/test/certs/ca.crt similarity index 100% rename from packages/exporter-trace-otlp-proto/test/certs/ca.crt rename to experimental/packages/exporter-trace-otlp-proto/test/certs/ca.crt diff --git a/packages/exporter-trace-otlp-proto/test/certs/ca.key b/experimental/packages/exporter-trace-otlp-proto/test/certs/ca.key similarity index 100% rename from packages/exporter-trace-otlp-proto/test/certs/ca.key rename to experimental/packages/exporter-trace-otlp-proto/test/certs/ca.key diff --git a/packages/exporter-trace-otlp-proto/test/certs/client.crt b/experimental/packages/exporter-trace-otlp-proto/test/certs/client.crt similarity index 100% rename from packages/exporter-trace-otlp-proto/test/certs/client.crt rename to experimental/packages/exporter-trace-otlp-proto/test/certs/client.crt diff --git a/packages/exporter-trace-otlp-proto/test/certs/client.csr b/experimental/packages/exporter-trace-otlp-proto/test/certs/client.csr similarity index 100% rename from packages/exporter-trace-otlp-proto/test/certs/client.csr rename to experimental/packages/exporter-trace-otlp-proto/test/certs/client.csr diff --git a/packages/exporter-trace-otlp-proto/test/certs/client.key b/experimental/packages/exporter-trace-otlp-proto/test/certs/client.key similarity index 100% rename from packages/exporter-trace-otlp-proto/test/certs/client.key rename to experimental/packages/exporter-trace-otlp-proto/test/certs/client.key diff --git a/packages/exporter-trace-otlp-proto/test/certs/regenerate.sh b/experimental/packages/exporter-trace-otlp-proto/test/certs/regenerate.sh similarity index 100% rename from packages/exporter-trace-otlp-proto/test/certs/regenerate.sh rename to experimental/packages/exporter-trace-otlp-proto/test/certs/regenerate.sh diff --git a/packages/exporter-trace-otlp-proto/test/certs/server.crt b/experimental/packages/exporter-trace-otlp-proto/test/certs/server.crt similarity index 100% rename from packages/exporter-trace-otlp-proto/test/certs/server.crt rename to experimental/packages/exporter-trace-otlp-proto/test/certs/server.crt diff --git a/packages/exporter-trace-otlp-proto/test/certs/server.csr b/experimental/packages/exporter-trace-otlp-proto/test/certs/server.csr similarity index 100% rename from packages/exporter-trace-otlp-proto/test/certs/server.csr rename to experimental/packages/exporter-trace-otlp-proto/test/certs/server.csr diff --git a/packages/exporter-trace-otlp-proto/test/certs/server.key b/experimental/packages/exporter-trace-otlp-proto/test/certs/server.key similarity index 100% rename from packages/exporter-trace-otlp-proto/test/certs/server.key rename to experimental/packages/exporter-trace-otlp-proto/test/certs/server.key diff --git a/packages/exporter-trace-otlp-proto/test/traceHelper.ts b/experimental/packages/exporter-trace-otlp-proto/test/traceHelper.ts similarity index 100% rename from packages/exporter-trace-otlp-proto/test/traceHelper.ts rename to experimental/packages/exporter-trace-otlp-proto/test/traceHelper.ts diff --git a/packages/exporter-trace-otlp-grpc/tsconfig.json b/experimental/packages/exporter-trace-otlp-proto/tsconfig.json similarity index 50% rename from packages/exporter-trace-otlp-grpc/tsconfig.json rename to experimental/packages/exporter-trace-otlp-proto/tsconfig.json index 573e18d61f..8597d3eb6b 100644 --- a/packages/exporter-trace-otlp-grpc/tsconfig.json +++ b/experimental/packages/exporter-trace-otlp-proto/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "rootDir": ".", "outDir": "build" @@ -11,15 +11,6 @@ "references": [ { "path": "../exporter-trace-otlp-http" - }, - { - "path": "../opentelemetry-core" - }, - { - "path": "../opentelemetry-resources" - }, - { - "path": "../opentelemetry-sdk-trace-base" } ] } diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/package.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/package.json index 416bba2ff9..28c2096142 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/package.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/package.json @@ -49,7 +49,7 @@ }, "devDependencies": { "@babel/core": "7.16.0", - "@opentelemetry/api": "^1.0.3", + "@opentelemetry/api": "^1.1.0", "@opentelemetry/api-metrics": "0.27.0", "@types/mocha": "8.2.3", "@types/node": "14.17.33", @@ -68,8 +68,8 @@ "@opentelemetry/api": "^1.0.3" }, "dependencies": { - "@grpc/grpc-js": "1.4.4", - "@grpc/proto-loader": "^0.6.4", + "@grpc/grpc-js": "^1.5.9", + "@grpc/proto-loader": "^0.6.9", "@opentelemetry/core": "1.0.1", "@opentelemetry/exporter-metrics-otlp-http": "0.27.0", "@opentelemetry/exporter-trace-otlp-grpc": "0.27.0", diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/test/OTLPMetricExporter.test.ts b/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/test/OTLPMetricExporter.test.ts index 569bd2e500..45f1b9fd31 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/test/OTLPMetricExporter.test.ts +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/test/OTLPMetricExporter.test.ts @@ -20,7 +20,7 @@ import { ObservableGauge, Histogram, } from '@opentelemetry/api-metrics'; -import { diag } from '@opentelemetry/api'; +import { diag, DiagLogger } from '@opentelemetry/api'; import { otlpTypes } from '@opentelemetry/exporter-trace-otlp-http'; import * as metrics from '@opentelemetry/sdk-metrics-base'; import * as assert from 'assert'; @@ -164,24 +164,41 @@ const testOTLPMetricExporter = (params: TestParams) => }); describe('instance', () => { + let warnStub: sinon.SinonStub; + + beforeEach(() => { + // Need to stub/spy on the underlying logger as the "diag" instance is global + warnStub = sinon.stub(); + const nop = () => {}; + const diagLogger: DiagLogger = { + debug: nop, + error: nop, + info: nop, + verbose: nop, + warn: warnStub + }; + diag.setLogger(diagLogger); + }); + + afterEach(() => { + diag.disable(); + }); + it('should warn about headers', () => { - // Need to stub/spy on the underlying logger as the 'diag' instance is global - const spyLoggerWarn = sinon.stub(diag, 'warn'); collectorExporter = new OTLPMetricExporter({ url: `http://${address}`, headers: { foo: 'bar', }, }); - const args = spyLoggerWarn.args[0]; + const args = warnStub.args[0]; assert.strictEqual(args[0], 'Headers cannot be set when using grpc'); }); it('should warn about path in url', () => { - const spyLoggerWarn = sinon.stub(diag, 'warn'); collectorExporter = new OTLPMetricExporter({ url: `http://${address}/v1/metrics` }); - const args = spyLoggerWarn.args[0]; + const args = warnStub.args[0]; assert.strictEqual( args[0], 'URL path should not be set when using grpc, the path part of the URL will be ignored.' diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/tsconfig.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/tsconfig.json index 72219a62cd..caca784fe2 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/tsconfig.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/tsconfig.json @@ -9,6 +9,12 @@ "test/**/*.ts" ], "references": [ + { + "path": "../exporter-trace-otlp-grpc" + }, + { + "path": "../exporter-trace-otlp-http" + }, { "path": "../opentelemetry-exporter-metrics-otlp-http" } diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json index dc4add04e3..c09f3250b0 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json @@ -62,7 +62,7 @@ }, "devDependencies": { "@babel/core": "7.16.0", - "@opentelemetry/api": "^1.0.3", + "@opentelemetry/api": "^1.1.0", "@types/mocha": "8.2.3", "@types/node": "14.17.33", "@types/sinon": "10.0.6", diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/test/browser/CollectorMetricExporter.test.ts b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/test/browser/CollectorMetricExporter.test.ts index ed31149691..5eab43664b 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/test/browser/CollectorMetricExporter.test.ts +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/test/browser/CollectorMetricExporter.test.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { diag } from '@opentelemetry/api'; +import { diag, DiagLogger, DiagLogLevel } from '@opentelemetry/api'; import { Counter, ObservableGauge, @@ -49,6 +49,8 @@ describe('OTLPMetricExporter - web', () => { let stubOpen: sinon.SinonStub; let stubBeacon: sinon.SinonStub; let metrics: MetricRecord[]; + let debugStub: sinon.SinonStub; + let errorStub: sinon.SinonStub; beforeEach(async () => { stubOpen = sinon.stub(XMLHttpRequest.prototype, 'open'); @@ -72,10 +74,24 @@ describe('OTLPMetricExporter - web', () => { metrics.push((await counter.getMetricRecord())[0]); metrics.push((await observableGauge.getMetricRecord())[0]); metrics.push((await histogram.getMetricRecord())[0]); + + // Need to stub/spy on the underlying logger as the "diag" instance is global + debugStub = sinon.stub(); + errorStub = sinon.stub(); + const nop = () => {}; + const diagLogger: DiagLogger = { + debug: debugStub, + error: errorStub, + info: nop, + verbose: nop, + warn: nop + }; + diag.setLogger(diagLogger, DiagLogLevel.DEBUG); }); afterEach(() => { sinon.restore(); + diag.disable(); }); describe('export', () => { @@ -159,17 +175,14 @@ describe('OTLPMetricExporter - web', () => { }); it('should log the successful message', done => { - // Need to stub/spy on the underlying logger as the "diag" instance is global - const spyLoggerDebug = sinon.stub(diag, 'debug'); - const spyLoggerError = sinon.stub(diag, 'error'); stubBeacon.returns(true); collectorExporter.export(metrics, () => {}); setTimeout(() => { - const response: any = spyLoggerDebug.args[1][0]; + const response: any = debugStub.args[2][0]; assert.strictEqual(response, 'sendBeacon - can send'); - assert.strictEqual(spyLoggerError.args.length, 0); + assert.strictEqual(errorStub.args.length, 0); done(); }); @@ -268,19 +281,15 @@ describe('OTLPMetricExporter - web', () => { }); it('should log the successful message', done => { - // Need to stub/spy on the underlying logger as the "diag" instance is global - const spyLoggerDebug = sinon.stub(diag, 'debug'); - const spyLoggerError = sinon.stub(diag, 'error'); - collectorExporter.export(metrics, () => {}); setTimeout(() => { const request = server.requests[0]; request.respond(200); - const response: any = spyLoggerDebug.args[1][0]; + const response: any = debugStub.args[2][0]; assert.strictEqual(response, 'xhr success'); - assert.strictEqual(spyLoggerError.args.length, 0); + assert.strictEqual(errorStub.args.length, 0); assert.strictEqual(stubBeacon.callCount, 0); done(); diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/test/node/CollectorMetricExporter.test.ts b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/test/node/CollectorMetricExporter.test.ts index 8bae6eab8c..2e04d70d39 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/test/node/CollectorMetricExporter.test.ts +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/test/node/CollectorMetricExporter.test.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { diag } from '@opentelemetry/api'; +import { diag, DiagLogger } from '@opentelemetry/api'; import { Counter, ObservableGauge, @@ -66,15 +66,33 @@ describe('OTLPMetricExporter - node with json over http', () => { }); describe('instance', () => { + let warnStub: sinon.SinonStub; + + beforeEach(() => { + // Need to stub/spy on the underlying logger as the "diag" instance is global + warnStub = sinon.stub(); + const nop = () => {}; + const diagLogger: DiagLogger = { + debug: nop, + error: nop, + info: nop, + verbose: nop, + warn: warnStub + }; + diag.setLogger(diagLogger); + }); + + afterEach(() => { + diag.disable(); + }); + it('should warn about metadata when using json', () => { const metadata = 'foo'; - // Need to stub/spy on the underlying logger as the "diag" instance is global - const spyLoggerWarn = sinon.stub(diag, 'warn'); collectorExporter = new OTLPMetricExporter({ url: address, metadata, } as any); - const args = spyLoggerWarn.args[0]; + const args = warnStub.args[0]; assert.strictEqual(args[0], 'Metadata cannot be set when using http'); }); }); diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.json index ed9d0830bd..8597d3eb6b 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.json @@ -7,5 +7,10 @@ "include": [ "src/**/*.ts", "test/**/*.ts" + ], + "references": [ + { + "path": "../exporter-trace-otlp-http" + } ] } diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/package.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/package.json index 1d93664d5a..efb09de1c5 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/package.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/package.json @@ -68,7 +68,7 @@ "@opentelemetry/api": "^1.0.3" }, "dependencies": { - "@grpc/proto-loader": "^0.6.4", + "@grpc/proto-loader": "0.6.9", "@opentelemetry/core": "1.0.1", "@opentelemetry/exporter-metrics-otlp-http": "0.27.0", "@opentelemetry/exporter-trace-otlp-http": "0.27.0", diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/tsconfig.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/tsconfig.json index 72219a62cd..86457b9d6a 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/tsconfig.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/tsconfig.json @@ -9,6 +9,12 @@ "test/**/*.ts" ], "references": [ + { + "path": "../exporter-trace-otlp-http" + }, + { + "path": "../exporter-trace-otlp-proto" + }, { "path": "../opentelemetry-exporter-metrics-otlp-http" } diff --git a/experimental/packages/opentelemetry-instrumentation-grpc/package.json b/experimental/packages/opentelemetry-instrumentation-grpc/package.json index 1f61a65d92..63161a8258 100644 --- a/experimental/packages/opentelemetry-instrumentation-grpc/package.json +++ b/experimental/packages/opentelemetry-instrumentation-grpc/package.json @@ -44,8 +44,8 @@ "access": "public" }, "devDependencies": { - "@grpc/grpc-js": "1.4.4", - "@grpc/proto-loader": "0.6.6", + "@grpc/grpc-js": "1.5.9", + "@grpc/proto-loader": "0.6.9", "@opentelemetry/api": "^1.0.3", "@opentelemetry/context-async-hooks": "1.0.1", "@opentelemetry/core": "1.0.1", diff --git a/experimental/tsconfig.json b/experimental/tsconfig.json index 54a089b0bb..a049b5a42b 100644 --- a/experimental/tsconfig.json +++ b/experimental/tsconfig.json @@ -2,6 +2,15 @@ "extends": "../tsconfig.base.json", "files": [], "references": [ + { + "path": "packages/exporter-trace-otlp-grpc" + }, + { + "path": "packages/exporter-trace-otlp-http" + }, + { + "path": "packages/exporter-trace-otlp-proto" + }, { "path": "packages/opentelemetry-api-metrics" }, diff --git a/packages/exporter-trace-otlp-http/tsconfig.json b/packages/exporter-trace-otlp-http/tsconfig.json deleted file mode 100644 index 1d7ba827ac..0000000000 --- a/packages/exporter-trace-otlp-http/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build" - }, - "include": [ - "src/**/*.ts", - "test/**/*.ts" - ], - "references": [ - { - "path": "../opentelemetry-core" - }, - { - "path": "../opentelemetry-resources" - }, - { - "path": "../opentelemetry-sdk-trace-base" - } - ] -} diff --git a/tsconfig.json b/tsconfig.json index e6b6a20a30..86c1ef2732 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -43,15 +43,6 @@ "excludePrivate": true }, "references": [ - { - "path": "packages/exporter-trace-otlp-grpc" - }, - { - "path": "packages/exporter-trace-otlp-http" - }, - { - "path": "packages/exporter-trace-otlp-proto" - }, { "path": "packages/opentelemetry-context-async-hooks" },