Skip to content

Commit

Permalink
chore: move trace exporters back to experimental (#2835)
Browse files Browse the repository at this point in the history
Co-authored-by: Gerhard Stöbich <[email protected]>
Co-authored-by: Gerhard Stöbich <[email protected]>
  • Loading branch information
3 people authored Mar 25, 2022
1 parent 549bd5b commit 16eaeb6
Show file tree
Hide file tree
Showing 111 changed files with 136 additions and 107 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ module.exports = {
"commonjs": true,
"node": true,
},
...require('../../eslint.config.js')
...require('../../../eslint.config.js')
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
Expand Down Expand Up @@ -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",
Expand All @@ -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"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "build"
Expand All @@ -11,15 +11,6 @@
"references": [
{
"path": "../exporter-trace-otlp-http"
},
{
"path": "../opentelemetry-core"
},
{
"path": "../opentelemetry-resources"
},
{
"path": "../opentelemetry-sdk-trace-base"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ module.exports = {
"node": true,
"browser": true
},
...require('../../eslint.config.js')
...require('../../../eslint.config.js')
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../../tsconfig.base.json",
"files": [],
"references": [
{ "path": "./tsconfig.json" },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.esm.json",
"extends": "../../../tsconfig.base.esm.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build/esm",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.esnext.json",
"extends": "../../../tsconfig.base.esnext.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build/esnext",
Expand Down
11 changes: 11 additions & 0 deletions experimental/packages/exporter-trace-otlp-http/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "build"
},
"include": [
"src/**/*.ts",
"test/**/*.ts"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ module.exports = {
"commonjs": true,
"node": true,
},
...require('../../eslint.config.js')
...require('../../../eslint.config.js')
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
Expand Down Expand Up @@ -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",
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "build"
Expand All @@ -11,15 +11,6 @@
"references": [
{
"path": "../exporter-trace-otlp-http"
},
{
"path": "../opentelemetry-core"
},
{
"path": "../opentelemetry-resources"
},
{
"path": "../opentelemetry-sdk-trace-base"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
"test/**/*.ts"
],
"references": [
{
"path": "../exporter-trace-otlp-grpc"
},
{
"path": "../exporter-trace-otlp-http"
},
{
"path": "../opentelemetry-exporter-metrics-otlp-http"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading

0 comments on commit 16eaeb6

Please sign in to comment.