Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(otlp-transformer): split otlp-transformer into multiple packages #2968

1 change: 1 addition & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ All notable changes to experimental packages in this project will be documented
* feat(exporters): update proto version and use otlp-transformer #2929 @pichlermarc
* fix(sdk-metrics-base): misbehaving aggregation temporality selector tolerance #2958 @legendecas
* feat(sdk-metrics-base): async instruments callback timeout #2742 @legendecas
* feat(otlp-transformer): split otlp-transformer into multiple packages #2968 @pichlermarc

### :bug: (Bug Fix)

Expand Down
5 changes: 3 additions & 2 deletions experimental/packages/exporter-trace-otlp-grpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
"sinon": "12.0.1",
"ts-loader": "8.3.0",
"ts-mocha": "9.0.2",
"typescript": "4.4.4"
"typescript": "4.4.4",
"@opentelemetry/otlp-transformer-base": "0.28.0"
},
"peerDependencies": {
"@opentelemetry/api": "^1.0.0"
Expand All @@ -70,7 +71,7 @@
"@opentelemetry/core": "1.2.0",
"@grpc/grpc-js": "^1.5.9",
"@grpc/proto-loader": "^0.6.9",
"@opentelemetry/otlp-transformer": "0.28.0",
"@opentelemetry/otlp-transformer-trace": "0.28.0",
"@opentelemetry/otlp-grpc-exporter-base": "0.28.0",
"@opentelemetry/resources": "1.2.0",
"@opentelemetry/sdk-trace-base": "1.2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ import {
ServiceClientType,
validateAndNormalizeUrl
} from '@opentelemetry/otlp-grpc-exporter-base';
import { createExportTraceServiceRequest, IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';
import {
createExportTraceServiceRequest,
IExportTraceServiceRequest
} from '@opentelemetry/otlp-transformer-trace';

const DEFAULT_COLLECTOR_URL = 'localhost:4317';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import {
import * as core from '@opentelemetry/core';
import { CompressionAlgorithm } from '@opentelemetry/otlp-exporter-base';
import { GrpcCompressionAlgorithm } from '@opentelemetry/otlp-grpc-exporter-base';
import { IExportTraceServiceRequest, IResourceSpans } from '@opentelemetry/otlp-transformer';
import { IExportTraceServiceRequest, IResourceSpans } from '@opentelemetry/otlp-transformer-trace';

const traceServiceProtoPath =
'opentelemetry/proto/collector/trace/v1/trace_service.proto';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
import * as assert from 'assert';
import * as grpc from '@grpc/grpc-js';
import { VERSION } from '@opentelemetry/core';
import { IEvent, IKeyValue, ILink, IResource, ISpan } from '@opentelemetry/otlp-transformer';
import { IKeyValue, IResource } from '@opentelemetry/otlp-transformer-base';
import { IEvent, ILink, ISpan } from '@opentelemetry/otlp-transformer-trace';


const traceIdArr = [
31,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
"path": "../otlp-grpc-exporter-base"
},
{
"path": "../otlp-transformer"
"path": "../otlp-transformer-base"
},
{
"path": "../otlp-transformer-trace"
}
]
}
5 changes: 3 additions & 2 deletions experimental/packages/exporter-trace-otlp-http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
"typescript": "4.4.4",
"webpack": "4.46.0",
"webpack-cli": "4.9.1",
"webpack-merge": "5.8.0"
"webpack-merge": "5.8.0",
"@opentelemetry/otlp-transformer-base": "0.28.0"
},
"peerDependencies": {
"@opentelemetry/api": "^1.0.0"
Expand All @@ -98,6 +99,6 @@
"@opentelemetry/resources": "1.2.0",
"@opentelemetry/sdk-trace-base": "1.2.0",
"@opentelemetry/otlp-exporter-base": "0.28.0",
"@opentelemetry/otlp-transformer": "0.28.0"
"@opentelemetry/otlp-transformer-trace": "0.28.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ import { appendResourcePathToUrlIfNotPresent, OTLPExporterBrowserBase } from '@o
import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
import { getEnv, baggageUtils } from '@opentelemetry/core';
import { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';
import { createExportTraceServiceRequest, IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';
import {
createExportTraceServiceRequest,
IExportTraceServiceRequest
} from '@opentelemetry/otlp-transformer-trace';

const DEFAULT_COLLECTOR_RESOURCE_PATH = '/v1/traces';
const DEFAULT_COLLECTOR_URL=`http://localhost:4318${DEFAULT_COLLECTOR_RESOURCE_PATH}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ import {
OTLPExporterNodeConfigBase,
appendResourcePathToUrlIfNotPresent
} from '@opentelemetry/otlp-exporter-base';
import { createExportTraceServiceRequest, IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';
import {
createExportTraceServiceRequest,
IExportTraceServiceRequest
} from '@opentelemetry/otlp-transformer-trace';

const DEFAULT_COLLECTOR_RESOURCE_PATH = '/v1/traces';
const DEFAULT_COLLECTOR_URL = `http://localhost:4318${DEFAULT_COLLECTOR_RESOURCE_PATH}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
mockedReadableSpan,
} from '../traceHelper';
import { OTLPExporterConfigBase, OTLPExporterError } from '@opentelemetry/otlp-exporter-base';
import { IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';
import { IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer-trace';

describe('OTLPTraceExporter - web', () => {
let collectorTraceExporter: OTLPTraceExporter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import {
} from '../traceHelper';
import { nextTick } from 'process';
import { MockedResponse } from './nodeHelpers';
import { IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';
import { IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer-trace';

let fakeRequest: PassThrough;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,10 @@ import { Resource } from '@opentelemetry/resources';
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
import * as assert from 'assert';
import {
ESpanKind,
IEvent,
IExportTraceServiceRequest,
IKeyValue,
ILink,
IResource,
ISpan
} from '@opentelemetry/otlp-transformer';
IResource
} from '@opentelemetry/otlp-transformer-base';
import { ESpanKind, IEvent, IExportTraceServiceRequest, ILink, ISpan } from '@opentelemetry/otlp-transformer-trace';

if (typeof Buffer === 'undefined') {
(window as any).Buffer = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
"path": "../otlp-exporter-base"
},
{
"path": "../otlp-transformer"
"path": "../otlp-transformer-base"
},
{
"path": "../otlp-transformer-trace"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
"sinon": "12.0.1",
"ts-loader": "8.3.0",
"ts-mocha": "9.0.2",
"typescript": "4.4.4"
"typescript": "4.4.4",
"@opentelemetry/otlp-transformer-base": "0.28.0"
},
"peerDependencies": {
"@opentelemetry/api": "^1.0.0"
Expand All @@ -73,6 +74,6 @@
"@opentelemetry/otlp-exporter-base": "0.28.0",
"@opentelemetry/otlp-proto-exporter-base": "0.28.0",
"protobufjs": "^6.9.0",
"@opentelemetry/otlp-transformer": "0.28.0"
"@opentelemetry/otlp-transformer-trace": "0.28.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
import { getEnv, baggageUtils } from '@opentelemetry/core';
import { appendResourcePathToUrlIfNotPresent, OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';
import { OTLPProtoExporterNodeBase, ServiceClientType } from '@opentelemetry/otlp-proto-exporter-base';
import { createExportTraceServiceRequest, IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';
import {
createExportTraceServiceRequest,
IExportTraceServiceRequest
} from '@opentelemetry/otlp-transformer-trace';

const DEFAULT_COLLECTOR_RESOURCE_PATH = '/v1/traces';
const DEFAULT_COLLECTOR_URL=`http://localhost:4318${DEFAULT_COLLECTOR_RESOURCE_PATH}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
} from './traceHelper';
import { CompressionAlgorithm, OTLPExporterNodeConfigBase, OTLPExporterError } from '@opentelemetry/otlp-exporter-base';
import { getExportRequestProto } from '@opentelemetry/otlp-proto-exporter-base';
import { IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';
import { IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer-trace';

let fakeRequest: PassThrough;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ import { Resource } from '@opentelemetry/resources';
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
import * as assert from 'assert';
import { Stream } from 'stream';
import { IEvent, IExportTraceServiceRequest, IKeyValue, ILink, ISpan } from '@opentelemetry/otlp-transformer';
import { IKeyValue } from '@opentelemetry/otlp-transformer-base';
import {
IEvent,
IExportTraceServiceRequest,
ILink,
ISpan
} from '@opentelemetry/otlp-transformer-trace';

const traceIdHex = '1f1008dc8e270e85c40a0d7c3939b278';
const spanIdHex = '5e107261f64fa53e';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
"path": "../otlp-proto-exporter-base"
},
{
"path": "../otlp-transformer"
"path": "../otlp-transformer-base"
},
{
"path": "../otlp-transformer-trace"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
"sinon": "12.0.1",
"ts-loader": "8.3.0",
"ts-mocha": "9.0.2",
"typescript": "4.4.4"
"typescript": "4.4.4",
"@opentelemetry/otlp-transformer-base": "0.28.0"
},
"peerDependencies": {
"@opentelemetry/api": "^1.0.0"
Expand All @@ -72,7 +73,7 @@
"@opentelemetry/core": "1.2.0",
"@opentelemetry/exporter-metrics-otlp-http": "0.28.0",
"@opentelemetry/otlp-grpc-exporter-base": "0.28.0",
"@opentelemetry/otlp-transformer": "0.28.0",
"@opentelemetry/otlp-transformer-metrics": "0.28.0",
"@opentelemetry/resources": "1.2.0",
"@opentelemetry/sdk-metrics-base": "0.28.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
} from '@opentelemetry/otlp-grpc-exporter-base';
import { baggageUtils, getEnv } from '@opentelemetry/core';
import { Metadata } from '@grpc/grpc-js';
import { createExportMetricsServiceRequest, IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer';
import { createExportMetricsServiceRequest, IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer-metrics';

const DEFAULT_COLLECTOR_URL = 'localhost:4317';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
mockObservableGauge, setUp, shutdown,
} from './metricsHelper';
import { AggregationTemporality, ResourceMetrics } from '@opentelemetry/sdk-metrics-base';
import { IExportMetricsServiceRequest, IResourceMetrics } from '@opentelemetry/otlp-transformer';
import { IExportMetricsServiceRequest, IResourceMetrics } from '@opentelemetry/otlp-transformer-metrics';

const metricsServiceProtoPath =
'opentelemetry/proto/collector/metrics/v1/metrics_service.proto';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ import {
MeterProvider,
MetricReader,
} from '@opentelemetry/sdk-metrics-base';
import { IKeyValue, IMetric, IResource } from '@opentelemetry/otlp-transformer';
import { IKeyValue, IResource } from '@opentelemetry/otlp-transformer-base';
import { IMetric } from '@opentelemetry/otlp-transformer-metrics';

class TestMetricReader extends MetricReader {
selectAggregationTemporality() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
"path": "../otlp-grpc-exporter-base"
},
{
"path": "../otlp-transformer"
"path": "../otlp-transformer-base"
},
{
"path": "../otlp-transformer-metrics"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,16 @@
"typescript": "4.4.4",
"webpack": "4.46.0",
"webpack-cli": "4.9.1",
"webpack-merge": "5.8.0"
"webpack-merge": "5.8.0",
"@opentelemetry/otlp-transformer-base": "0.28.0"
},
"peerDependencies": {
"@opentelemetry/api": "^1.0.0"
},
"dependencies": {
"@opentelemetry/api-metrics": "0.28.0",
"@opentelemetry/core": "1.2.0",
"@opentelemetry/otlp-transformer": "0.28.0",
"@opentelemetry/otlp-transformer-metrics": "0.28.0",
"@opentelemetry/otlp-exporter-base": "0.28.0",
"@opentelemetry/resources": "1.2.0",
"@opentelemetry/sdk-metrics-base": "0.28.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
} from '@opentelemetry/sdk-metrics-base';
import { defaultOptions, OTLPMetricExporterOptions } from './OTLPMetricExporterOptions';
import { OTLPExporterBase } from '@opentelemetry/otlp-exporter-base';
import { IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer';
import { IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer-metrics';

export const CumulativeTemporalitySelector: AggregationTemporalitySelector = () => AggregationTemporality.CUMULATIVE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ import {
OTLPExporterBrowserBase,
OTLPExporterConfigBase
} from '@opentelemetry/otlp-exporter-base';
import { createExportMetricsServiceRequest, IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer';
import {
createExportMetricsServiceRequest,
IExportMetricsServiceRequest
} from '@opentelemetry/otlp-transformer-metrics';

const DEFAULT_COLLECTOR_RESOURCE_PATH = '/v1/metrics';
const DEFAULT_COLLECTOR_URL = `http://localhost:4318${DEFAULT_COLLECTOR_RESOURCE_PATH}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@
*/

import { ResourceMetrics } from '@opentelemetry/sdk-metrics-base';
import { getEnv, baggageUtils} from '@opentelemetry/core';
import { getEnv, baggageUtils } from '@opentelemetry/core';
import { defaultOptions, OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';
import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
import {
appendResourcePathToUrlIfNotPresent,
OTLPExporterNodeBase,
OTLPExporterNodeConfigBase
} from '@opentelemetry/otlp-exporter-base';
import { createExportMetricsServiceRequest, IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer';
import {
createExportMetricsServiceRequest,
IExportMetricsServiceRequest
} from '@opentelemetry/otlp-transformer-metrics';

const DEFAULT_COLLECTOR_RESOURCE_PATH = '/v1/metrics';
const DEFAULT_COLLECTOR_URL = `http://localhost:4318${DEFAULT_COLLECTOR_RESOURCE_PATH}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
} from '../metricsHelper';
import { OTLPMetricExporterOptions } from '../../src';
import { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';
import { IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer';
import { IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer-metrics';

describe('OTLPMetricExporter - web', () => {
let collectorExporter: OTLPMetricExporter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import * as assert from 'assert';
import * as sinon from 'sinon';
import { collect, mockCounter, mockObservableGauge, setUp, shutdown } from '../metricsHelper';
import { OTLPExporterBase, OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';
import { IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer';
import { IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer-metrics';

type CollectorExporterConfig = OTLPExporterConfigBase;
class OTLPMetricExporter extends OTLPExporterBase<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ import {
MetricReader
} from '@opentelemetry/sdk-metrics-base';
import {
IExportMetricsServiceRequest,
IKeyValue,
IMetric,
IResource
} from '@opentelemetry/otlp-transformer';
} from '@opentelemetry/otlp-transformer-base';
import { IExportMetricsServiceRequest, IMetric } from '@opentelemetry/otlp-transformer-metrics';

if (typeof Buffer === 'undefined') {
(window as any).Buffer = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { MockedResponse } from './nodeHelpers';
import { AggregationTemporality, ResourceMetrics } from '@opentelemetry/sdk-metrics-base';
import { Stream, PassThrough } from 'stream';
import { OTLPExporterError, OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';
import { IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer';
import { IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer-metrics';

let fakeRequest: PassThrough;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
"path": "../otlp-exporter-base"
},
{
"path": "../otlp-transformer"
"path": "../otlp-transformer-base"
},
{
"path": "../otlp-transformer-metrics"
}
]
}
Loading