Skip to content

Commit

Permalink
Merge branch 'main' into feat/response-handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
pichlermarc authored Nov 21, 2024
2 parents 33887a1 + ef80821 commit 67b794c
Show file tree
Hide file tree
Showing 94 changed files with 2,784 additions and 769 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ For semantic convention package changes, see the [semconv CHANGELOG](packages/se

### :boom: Breaking Change

* feat(sdk-metrics): Add support for aggregation cardinality limit with a default limit of 2000. This limit can be customized via views [#5182](https://github.com/open-telemetry/opentelemetry-js/pull/5128)

### :rocket: (Enhancement)

### :bug: (Bug Fix)
Expand Down
2 changes: 1 addition & 1 deletion api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"access": "public"
},
"devDependencies": {
"@types/mocha": "10.0.9",
"@types/mocha": "10.0.10",
"@types/node": "18.6.5",
"@types/sinon": "17.0.3",
"@types/webpack": "5.28.5",
Expand Down
2 changes: 1 addition & 1 deletion examples/esm-http-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
"@opentelemetry/resources": "1.28.0",
"@opentelemetry/sdk-trace-base": "1.28.0",
"@opentelemetry/sdk-trace-node": "1.28.0",
"@opentelemetry/semantic-conventions": "1.27.0"
"@opentelemetry/semantic-conventions": "1.28.0"
}
}
2 changes: 1 addition & 1 deletion examples/http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@opentelemetry/resources": "1.28.0",
"@opentelemetry/sdk-trace-base": "1.28.0",
"@opentelemetry/sdk-trace-node": "1.28.0",
"@opentelemetry/semantic-conventions": "1.27.0"
"@opentelemetry/semantic-conventions": "1.28.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/http",
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/https/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@opentelemetry/resources": "1.28.0",
"@opentelemetry/sdk-trace-base": "1.28.0",
"@opentelemetry/sdk-trace-node": "1.28.0",
"@opentelemetry/semantic-conventions": "1.27.0"
"@opentelemetry/semantic-conventions": "1.28.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/https",
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/opentelemetry-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@opentelemetry/sdk-metrics": "1.28.0",
"@opentelemetry/sdk-trace-base": "1.28.0",
"@opentelemetry/sdk-trace-web": "1.28.0",
"@opentelemetry/semantic-conventions": "1.27.0"
"@opentelemetry/semantic-conventions": "1.28.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/tracer-web"
}
2 changes: 1 addition & 1 deletion examples/otlp-exporter-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@opentelemetry/resources": "1.28.0",
"@opentelemetry/sdk-metrics": "1.28.0",
"@opentelemetry/sdk-trace-base": "1.28.0",
"@opentelemetry/semantic-conventions": "1.27.0"
"@opentelemetry/semantic-conventions": "1.28.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/otlp-exporter-node"
}
25 changes: 15 additions & 10 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,23 @@ All notable changes to experimental packages in this project will be documented

### :boom: Breaking Change

* feat(otlp-exporter-base)!: collapse base classes into one [#5031](https://github.com/open-telemetry/opentelemetry-js/pull/5031) @pichlermarc
* `OTLPExporterNodeBase` has been removed in favor of a platform-agnostic implementation (`OTLPExporterBase`)
* `OTLPExporterBrowserBase` has been removed in favor of a platform-agnostic implementation (`OTLPExporterBase`)
* `ExportServiceError` was intended for internal use and has been dropped from exports
* `validateAndNormalizeHeaders` was intended for internal use and has been dropped from exports
* `OTLPExporterBase` all properties are now private, the constructor now takes an `IOTLPExportDelegate`, the type parameter for config type has been dropped.
* This type is scheduled for removal in a future version of this package, please treat all exporters as `SpanExporter`, `PushMetricExporter` or `LogRecordExporter`, based on their respective type.
* feat(otlp-grpc-exporter-base)!: collapse base classes into one [#5031](https://github.com/open-telemetry/opentelemetry-js/pull/5031) @pichlermarc
* `OTLPGRPCExporterNodeBase` has been removed in favor of a platform-agnostic implementation (`OTLPExporterBase` from `@opentelemetry/otlp-exporter-base`)
* feat(otlp-transformer)!: accept `ResourceMetrics` in serializers instead of `ResourceMetrics[]`
* (user-facing): `ProtobufMetricsSerializer` now only accepts `ResourceMetrics` instead of `ResourceMetrics[]` to align with `PushMetricExporter` requirements
* (user-facing): `JsonMetricsSerializer` now only accepts `ResourceMetrics` instead of `ResourceMetrics[]` to align with `PushMetricExporter` requirements

### :rocket: (Enhancement)

feat(otlp-exporter-base): handle OTLP partial success [#5183](https://github.com/open-telemetry/opentelemetry-js/pull/5183) @pichlermarc
* feat(otlp-exporter-base): handle OTLP partial success [#5183](https://github.com/open-telemetry/opentelemetry-js/pull/5183) @pichlermarc
* feat(otlp-exporter-base): internally accept a http header provider function only [#5179](https://github.com/open-telemetry/opentelemetry-js/pull/5179) @pichlermarc

### :bug: (Bug Fix)

Expand Down Expand Up @@ -55,15 +69,6 @@ feat(otlp-exporter-base): handle OTLP partial success [#5183](https://github.com
* GetFunction
* Func
* Err
* feat(otlp-exporter-base)!: collapse base classes into one [#5031](https://github.com/open-telemetry/opentelemetry-js/pull/5031)
* `OTLPExporterNodeBase` has been removed in favor of a platform-agnostic implementation (`OTLPExporterBase`)
* `OTLPExporterBrowserBase` has been removed in favor of a platform-agnostic implementation (`OTLPExporterBase`)
* `ExportServiceError` was intended for internal use and has been dropped from exports
* `validateAndNormalizeHeaders` was intended for internal use and has been dropped from exports
* `OTLPExporterBase` all properties are now private, the constructor now takes an `IOTLPExportDelegate`, the type parameter for config type has been dropped.
* This type is scheduled for removal in a future version of this package, please treat all exporters as `SpanExporter`, `PushMetricExporter` or `LogRecordExporter`, based on their respective type.
* feat(otlp-grpc-exporter-base)!: collapse base classes into one [#5031](https://github.com/open-telemetry/opentelemetry-js/pull/5031)
* `OTLPGRPCExporterNodeBase` has been removed in favor of a platform-agnostic implementation (`OTLPExporterBase` from `@opentelemetry/otlp-exporter-base`)

### :rocket: (Enhancement)

Expand Down
2 changes: 1 addition & 1 deletion experimental/examples/opencensus-shim/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@opentelemetry/resources": "1.28.0",
"@opentelemetry/sdk-metrics": "1.28.0",
"@opentelemetry/sdk-trace-node": "1.28.0",
"@opentelemetry/semantic-conventions": "1.27.0",
"@opentelemetry/semantic-conventions": "1.28.0",
"@opentelemetry/shim-opencensus": "0.55.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/examples/opencensus-shim"
Expand Down
2 changes: 1 addition & 1 deletion experimental/packages/api-events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"@opentelemetry/api-logs": "0.55.0"
},
"devDependencies": {
"@types/mocha": "10.0.9",
"@types/mocha": "10.0.10",
"@types/node": "18.6.5",
"@types/webpack-env": "1.16.3",
"babel-plugin-istanbul": "7.0.0",
Expand Down
2 changes: 1 addition & 1 deletion experimental/packages/api-logs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@opentelemetry/api": "^1.3.0"
},
"devDependencies": {
"@types/mocha": "10.0.9",
"@types/mocha": "10.0.10",
"@types/node": "18.6.5",
"@types/webpack-env": "1.16.3",
"babel-plugin-istanbul": "7.0.0",
Expand Down
2 changes: 1 addition & 1 deletion experimental/packages/exporter-logs-otlp-grpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@opentelemetry/api-logs": "0.55.0",
"@opentelemetry/otlp-exporter-base": "0.55.0",
"@opentelemetry/resources": "1.28.0",
"@types/mocha": "10.0.9",
"@types/mocha": "10.0.10",
"@types/node": "18.6.5",
"@types/sinon": "17.0.3",
"cross-var": "1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion experimental/packages/exporter-logs-otlp-http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"@babel/preset-env": "7.26.0",
"@opentelemetry/api": "1.9.0",
"@opentelemetry/resources": "1.28.0",
"@types/mocha": "10.0.9",
"@types/mocha": "10.0.10",
"@types/node": "18.6.5",
"@types/sinon": "17.0.3",
"@types/webpack-env": "1.16.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@babel/core": "7.26.0",
"@babel/preset-env": "7.26.0",
"@opentelemetry/api": "1.9.0",
"@types/mocha": "10.0.9",
"@types/mocha": "10.0.10",
"@types/node": "18.6.5",
"@types/sinon": "17.0.3",
"babel-plugin-istanbul": "7.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@grpc/proto-loader": "^0.7.10",
"@opentelemetry/api": "1.9.0",
"@opentelemetry/otlp-exporter-base": "0.55.0",
"@types/mocha": "10.0.9",
"@types/mocha": "10.0.10",
"@types/node": "18.6.5",
"@types/sinon": "17.0.3",
"cross-var": "1.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@babel/core": "7.26.0",
"@babel/preset-env": "7.26.0",
"@opentelemetry/api": "1.9.0",
"@types/mocha": "10.0.9",
"@types/mocha": "10.0.10",
"@types/node": "18.6.5",
"@types/sinon": "17.0.3",
"@types/webpack-env": "1.16.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@babel/core": "7.26.0",
"@babel/preset-env": "7.26.0",
"@opentelemetry/api": "1.9.0",
"@types/mocha": "10.0.9",
"@types/mocha": "10.0.10",
"@types/node": "18.6.5",
"@types/sinon": "17.0.3",
"babel-plugin-istanbul": "7.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"@babel/core": "7.26.0",
"@babel/preset-env": "7.26.0",
"@opentelemetry/api": "1.9.0",
"@types/mocha": "10.0.9",
"@types/mocha": "10.0.10",
"@types/node": "18.6.5",
"@types/sinon": "17.0.3",
"babel-plugin-istanbul": "7.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"devDependencies": {
"@grpc/proto-loader": "^0.7.10",
"@opentelemetry/api": "1.9.0",
"@types/mocha": "10.0.9",
"@types/mocha": "10.0.10",
"@types/node": "18.6.5",
"@types/sinon": "17.0.3",
"cross-var": "1.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@babel/core": "7.26.0",
"@babel/preset-env": "7.26.0",
"@opentelemetry/api": "1.9.0",
"@types/mocha": "10.0.9",
"@types/mocha": "10.0.10",
"@types/node": "18.6.5",
"@types/sinon": "17.0.3",
"@types/webpack-env": "1.16.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { ExportResult, getEnv } from '@opentelemetry/core';
import { getEnv } from '@opentelemetry/core';
import {
AggregationTemporality,
AggregationTemporalitySelector,
Expand All @@ -28,7 +28,10 @@ import {
AggregationTemporalityPreference,
OTLPMetricExporterOptions,
} from './OTLPMetricExporterOptions';
import { IOtlpExportDelegate } from '@opentelemetry/otlp-exporter-base';
import {
IOtlpExportDelegate,
OTLPExporterBase,
} from '@opentelemetry/otlp-exporter-base';
import { diag } from '@opentelemetry/api';

export const CumulativeTemporalitySelector: AggregationTemporalitySelector =
Expand Down Expand Up @@ -117,37 +120,24 @@ function chooseAggregationSelector(
}
}

export class OTLPMetricExporterBase implements PushMetricExporter {
public _delegate: IOtlpExportDelegate<ResourceMetrics[]>;
private _aggregationTemporalitySelector: AggregationTemporalitySelector;
private _aggregationSelector: AggregationSelector;
export class OTLPMetricExporterBase
extends OTLPExporterBase<ResourceMetrics>
implements PushMetricExporter
{
private readonly _aggregationTemporalitySelector: AggregationTemporalitySelector;
private readonly _aggregationSelector: AggregationSelector;

constructor(
delegate: IOtlpExportDelegate<ResourceMetrics[]>,
delegate: IOtlpExportDelegate<ResourceMetrics>,
config?: OTLPMetricExporterOptions
) {
this._delegate = delegate;
super(delegate);
this._aggregationSelector = chooseAggregationSelector(config);
this._aggregationTemporalitySelector = chooseTemporalitySelector(
config?.temporalityPreference
);
}

export(
metrics: ResourceMetrics,
resultCallback: (result: ExportResult) => void
): void {
this._delegate.export([metrics], resultCallback);
}

async shutdown(): Promise<void> {
await this._delegate.shutdown();
}

forceFlush(): Promise<void> {
return this._delegate.forceFlush();
}

selectAggregation(instrumentType: InstrumentType): Aggregation {
return this._aggregationSelector(instrumentType);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,5 @@
const testsContext = require.context('../browser', true, /test$/);
testsContext.keys().forEach(testsContext);

const testsContextCommon = require.context('../common', true, /test$/);
testsContextCommon.keys().forEach(testsContextCommon);

const srcContext = require.context('.', true, /src$/);
srcContext.keys().forEach(srcContext);

This file was deleted.

Loading

0 comments on commit 67b794c

Please sign in to comment.