Skip to content

Commit

Permalink
Merge branch 'main' into api-rm-files
Browse files Browse the repository at this point in the history
  • Loading branch information
dyladan authored Sep 19, 2022
2 parents 05336d7 + d8dabf1 commit 5708267
Show file tree
Hide file tree
Showing 50 changed files with 317 additions and 245 deletions.
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,20 @@ All notable changes to this project will be documented in this file.

### :bug: (Bug Fix)

### :books: (Refine Doc)

### :house: (Internal)

## 1.7.0

### :bug: (Bug Fix)

* fix(sdk-trace-base): make span start times resistant to hrtime clock drift
[#3129](https://github.com/open-telemetry/opentelemetry-js/issues/3129)

* fix(sdk-trace-base): validate maxExportBatchSize in BatchSpanProcessorBase
[#3232](https://github.com/open-telemetry/opentelemetry-js/issues/3232)

### :books: (Refine Doc)

* docs(metrics): add missing metrics packages to SDK reference documentation [#3239](https://github.com/open-telemetry/opentelemetry-js/pull/3239) @dyladan
Expand Down Expand Up @@ -40,8 +51,6 @@ All notable changes to this project will be documented in this file.
* chore: update trace-web example and rename it to opentelemetry-web [#3145](https://github.com/open-telemetry/opentelemetry-js/pull/3145) @pichlermarc
* chore: update https example [#3152](https://github.com/open-telemetry/opentelemetry-js/pull/3152) @pichlermarc

### :house: (Internal)

## 1.5.0

### :rocket: (Enhancement)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ This is the JavaScript version of [OpenTelemetry](https://opentelemetry.io/), a

| API Version | Core version | Experimental Packages |
| ----------- | ------------ | --------------------- |
| 1.2.x | 1.7.x | 0.33.x |
| 1.2.x | 1.6.x | 0.32.x |
| 1.1.x | 1.5.x | 0.31.x |
| 1.1.x | 1.4.x | 0.30.x |
Expand Down
File renamed without changes.
50 changes: 42 additions & 8 deletions doc/exporter-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ opentelemetry-exporter-myexporter
│ └── index.ts
│ └── transform.ts
│ └── types.ts
│ └── myexporter.ts
│ └── my-trace-exporter.ts
│ └── my-metric-exporter.ts
└── test
└── transform.test.ts
└── myexporter.test.ts
└── my-trace-exporter.test.ts
└── my-metric-exporter.test.ts
```

## Tracing
## Traces

The `SpanExporter` interface defines which methods the protocol-specific trace/span exporters must implement so that they can be plugged into OpenTelemetry SDK. Span exporters must follow these rules:

Expand All @@ -29,7 +31,7 @@ The `SpanExporter` interface defines which methods the protocol-specific trace/s
5. Do not modify received spans.
6. Do not implement queuing or batching logic because this is handled by Span Processors.

The current `SpanExporter` interface (`0.2.0`) contains 2 methods:
The current `SpanExporter` interface contains 2 methods:

- `export`: Exports a batch of spans. In this method, you’ll process and translate `ReadableSpan` Data into the data that your trace backend accepts, and send them to your tracing backend.

Expand All @@ -39,16 +41,48 @@ Please refer to the [Zipkin Exporter][zipkin-exporter] or [Jaeger Exporter][jaeg

## Metrics

The `MetricExporter` defines the interface that protocol-specific exporters must implement so that they can be plugged into OpenTelemetry SDK and support sending of metrics data.
Metrics can be exported with two distinct patterns:

The current `MetricExporter` interface (`0.2.0`) defines 2 methods:
- Push model exporting, like periodically push metrics to the backend.
- Pull model exporting, like Prometheus pulling metrics from the application.

- `export`: Exports a batch of telemetry data. In this method you’ll process and translate `MetricRecord` Data into the data that your metric backend accepts.
### Push model exporting

- `shutdown`: Shuts down the exporter. This is an opportunity for exporter to do any cleanup required. `Shutdown` should be called only once for each Exporter instance. After the call to `Shutdown` subsequent calls to Export are not allowed and should return `FailedNotRetryable` error.
The `PushMetricExporter` defines the interface that protocol-specific exporters must implement so that they can be plugged into OpenTelemetry SDK and support sending of metrics data with `PeriodicMetricReader`.

The current `PushMetricExporter` interface defines 3 required methods:

- `export`: Exports a batch of telemetry data. In this method you’ll process and translate `ResourceMetrics` into the data that your metric backend accepts.

- `shutdown`: Shuts down the exporter. This is an opportunity for exporter to do any cleanup required. `Shutdown` should be called only once for each Exporter instance.

- `forceFlush`: Ensure that the export of any metrics the exporter has received is completed before the returned promise is settled.

The `PushMetricExporter` interface can also implement following methods to provide a preference on metric configuration:

- `selectAggregationTemporality`: Select the preferred `AggregationTemporality` for the given `InstrumentType` for this exporter.

- `selectAggregation`: Select the preferred `Aggregation` for the given `InstrumentType` for this exporter.

Please refer to the [OTLP Exporter][otlp-exporter] for more comprehensive examples.

### Pull model exporting

The pulling model exporting requires the export pipeline proactively initiate metric collections. Such exporting pipeline must be modeled as a `MetricReader`.

The abstract class `MetricReader` defines the interface that protocol-specific readers must implement so that they can be plugged into OpenTelemetry SDK and support pulling of metrics data.

The current `MetricReader` interface defines 2 required methods:

- `onShutdown`: Shuts down the reader. This is an opportunity for reader to do any cleanup required. `Shutdown` should be called only once for each reader instance.

- `onForceFlush`: Ensure that the export of any metrics the reader has received is completed before the returned promise is settled.

A `MetricReader` can initiate a metric collection request with `MetricReader.collect()` method. The `MetricReader.collect()` returns a promise that settles with a `CollectionResult`, containing the `ResourceMetrics` record and a series of reasons for possibly failed asynchronous metric instrument collection. The `ResourceMetrics` record can be processed and translated into the data that your metric backend accepts.

Please refer to the [Prometheus Exporter][prometheus-exporter] for more comprehensive examples.

[zipkin-exporter]: https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-exporter-zipkin
[jaeger-exporter]: https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-exporter-jaeger
[otlp-exporter]: https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc
[prometheus-exporter]: https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/packages/opentelemetry-exporter-prometheus
18 changes: 9 additions & 9 deletions examples/https/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "https-example",
"private": true,
"version": "0.32.0",
"version": "0.33.0",
"description": "Example of HTTPs integration with OpenTelemetry",
"main": "build/src/index.js",
"types": "build/src/index.d.ts",
Expand Down Expand Up @@ -33,14 +33,14 @@
},
"dependencies": {
"@opentelemetry/api": "^1.0.0",
"@opentelemetry/exporter-jaeger": "1.6.0",
"@opentelemetry/exporter-zipkin": "1.6.0",
"@opentelemetry/instrumentation": "0.32.0",
"@opentelemetry/instrumentation-http": "0.32.0",
"@opentelemetry/resources": "1.6.0",
"@opentelemetry/sdk-trace-base": "1.6.0",
"@opentelemetry/sdk-trace-node": "1.6.0",
"@opentelemetry/semantic-conventions": "1.6.0"
"@opentelemetry/exporter-jaeger": "1.7.0",
"@opentelemetry/exporter-zipkin": "1.7.0",
"@opentelemetry/instrumentation": "0.33.0",
"@opentelemetry/instrumentation-http": "0.33.0",
"@opentelemetry/resources": "1.7.0",
"@opentelemetry/sdk-trace-base": "1.7.0",
"@opentelemetry/sdk-trace-node": "1.7.0",
"@opentelemetry/semantic-conventions": "1.7.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/https",
"devDependencies": {
Expand Down
30 changes: 15 additions & 15 deletions examples/opentelemetry-web/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "web-opentelemetry-example",
"private": true,
"version": "0.32.0",
"version": "0.33.0",
"description": "Example of using @opentelemetry/sdk-trace-web and @opentelemetry/sdk-metrics in browser",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -43,20 +43,20 @@
},
"dependencies": {
"@opentelemetry/api": "^1.0.2",
"@opentelemetry/api-metrics": "0.32.0",
"@opentelemetry/context-zone": "1.6.0",
"@opentelemetry/core": "1.6.0",
"@opentelemetry/exporter-metrics-otlp-http": "0.32.0",
"@opentelemetry/exporter-trace-otlp-http": "0.32.0",
"@opentelemetry/exporter-zipkin": "1.6.0",
"@opentelemetry/instrumentation": "0.32.0",
"@opentelemetry/instrumentation-fetch": "0.32.0",
"@opentelemetry/instrumentation-xml-http-request": "0.32.0",
"@opentelemetry/propagator-b3": "1.6.0",
"@opentelemetry/sdk-metrics": "0.32.0",
"@opentelemetry/sdk-trace-base": "1.6.0",
"@opentelemetry/sdk-trace-web": "1.6.0",
"@opentelemetry/semantic-conventions": "1.6.0"
"@opentelemetry/api-metrics": "0.33.0",
"@opentelemetry/context-zone": "1.7.0",
"@opentelemetry/core": "1.7.0",
"@opentelemetry/exporter-metrics-otlp-http": "0.33.0",
"@opentelemetry/exporter-trace-otlp-http": "0.33.0",
"@opentelemetry/exporter-zipkin": "1.7.0",
"@opentelemetry/instrumentation": "0.33.0",
"@opentelemetry/instrumentation-fetch": "0.33.0",
"@opentelemetry/instrumentation-xml-http-request": "0.33.0",
"@opentelemetry/propagator-b3": "1.7.0",
"@opentelemetry/sdk-metrics": "0.33.0",
"@opentelemetry/sdk-trace-base": "1.7.0",
"@opentelemetry/sdk-trace-web": "1.7.0",
"@opentelemetry/semantic-conventions": "1.7.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/tracer-web"
}
26 changes: 13 additions & 13 deletions examples/otlp-exporter-node/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "example-otlp-exporter-node",
"private": true,
"version": "0.32.0",
"version": "0.33.0",
"description": "Example of using @opentelemetry/collector-exporter in Node.js",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -29,18 +29,18 @@
},
"dependencies": {
"@opentelemetry/api": "^1.1.0",
"@opentelemetry/api-metrics": "0.32.0",
"@opentelemetry/core": "1.6.0",
"@opentelemetry/exporter-metrics-otlp-grpc": "0.32.0",
"@opentelemetry/exporter-metrics-otlp-http": "0.32.0",
"@opentelemetry/exporter-metrics-otlp-proto": "0.32.0",
"@opentelemetry/exporter-trace-otlp-grpc": "0.32.0",
"@opentelemetry/exporter-trace-otlp-http": "0.32.0",
"@opentelemetry/exporter-trace-otlp-proto": "0.32.0",
"@opentelemetry/resources": "1.6.0",
"@opentelemetry/sdk-metrics": "0.32.0",
"@opentelemetry/sdk-trace-base": "1.6.0",
"@opentelemetry/semantic-conventions": "1.6.0"
"@opentelemetry/api-metrics": "0.33.0",
"@opentelemetry/core": "1.7.0",
"@opentelemetry/exporter-metrics-otlp-grpc": "0.33.0",
"@opentelemetry/exporter-metrics-otlp-http": "0.33.0",
"@opentelemetry/exporter-metrics-otlp-proto": "0.33.0",
"@opentelemetry/exporter-trace-otlp-grpc": "0.33.0",
"@opentelemetry/exporter-trace-otlp-http": "0.33.0",
"@opentelemetry/exporter-trace-otlp-proto": "0.33.0",
"@opentelemetry/resources": "1.7.0",
"@opentelemetry/sdk-metrics": "0.33.0",
"@opentelemetry/sdk-trace-base": "1.7.0",
"@opentelemetry/semantic-conventions": "1.7.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/otlp-exporter-node"
}
14 changes: 12 additions & 2 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ All notable changes to experimental packages in this project will be documented

### :boom: Breaking Change

### :rocket: (Enhancement)

### :bug: (Bug Fix)

### :books: (Refine Doc)

### :house: (Internal)

## 0.33.0

### :boom: Breaking Change

* Add `resourceDetectors` option to `NodeSDK` [#3210](https://github.com/open-telemetry/opentelemetry-js/issues/3210)
* `NodeSDK.detectResources()` function is no longer able to receive config as a parameter.
Instead, the detectors are passed to the constructor.
Expand Down Expand Up @@ -46,8 +58,6 @@ All notable changes to experimental packages in this project will be documented
* Add `resourceDetectors` option to `NodeSDK` [#3210](https://github.com/open-telemetry/opentelemetry-js/issues/3210)
* feat: add Logs API @mkuba [#3117](https://github.com/open-telemetry/opentelemetry-js/pull/3117)

### :bug: (Bug Fix)

### :books: (Refine Doc)

* docs(sdk-metrics): fix typos and add missing parameter docs. [#3244](https://github.com/open-telemetry/opentelemetry-js/pull/3244) @pichlermarc
Expand Down
6 changes: 3 additions & 3 deletions experimental/backwards-compatability/node14/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backcompat-node14",
"version": "0.32.0",
"version": "0.33.0",
"private": true,
"description": "Backwards compatability app for node 14 types and the OpenTelemetry Node.js SDK",
"main": "index.js",
Expand All @@ -9,8 +9,8 @@
"peer-api-check": "node ../../../scripts/peer-api-check.js"
},
"dependencies": {
"@opentelemetry/sdk-node": "0.32.0",
"@opentelemetry/sdk-trace-base": "1.6.0"
"@opentelemetry/sdk-node": "0.33.0",
"@opentelemetry/sdk-trace-base": "1.7.0"
},
"devDependencies": {
"@types/node": "14.18.25",
Expand Down
6 changes: 3 additions & 3 deletions experimental/backwards-compatability/node16/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backcompat-node16",
"version": "0.32.0",
"version": "0.33.0",
"private": true,
"description": "Backwards compatability app for node 16 types and the OpenTelemetry Node.js SDK",
"main": "index.js",
Expand All @@ -9,8 +9,8 @@
"peer-api-check": "node ../../../scripts/peer-api-check.js"
},
"dependencies": {
"@opentelemetry/sdk-node": "0.32.0",
"@opentelemetry/sdk-trace-base": "1.6.0"
"@opentelemetry/sdk-node": "0.33.0",
"@opentelemetry/sdk-trace-base": "1.7.0"
},
"devDependencies": {
"@types/node": "16.11.52",
Expand Down
2 changes: 1 addition & 1 deletion experimental/packages/api-logs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentelemetry/api-logs",
"version": "0.32.0",
"version": "0.33.0",
"description": "Public logs API for OpenTelemetry",
"main": "build/src/index.js",
"module": "build/esm/index.js",
Expand Down
14 changes: 7 additions & 7 deletions experimental/packages/exporter-trace-otlp-grpc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentelemetry/exporter-trace-otlp-grpc",
"version": "0.32.0",
"version": "0.33.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 Down Expand Up @@ -49,7 +49,7 @@
"devDependencies": {
"@babel/core": "7.16.0",
"@opentelemetry/api": "^1.0.0",
"@opentelemetry/otlp-exporter-base": "0.32.0",
"@opentelemetry/otlp-exporter-base": "0.33.0",
"@types/mocha": "9.1.1",
"@types/node": "18.6.5",
"@types/sinon": "10.0.13",
Expand All @@ -69,11 +69,11 @@
"dependencies": {
"@grpc/grpc-js": "^1.5.9",
"@grpc/proto-loader": "^0.6.9",
"@opentelemetry/core": "1.6.0",
"@opentelemetry/otlp-grpc-exporter-base": "0.32.0",
"@opentelemetry/otlp-transformer": "0.32.0",
"@opentelemetry/resources": "1.6.0",
"@opentelemetry/sdk-trace-base": "1.6.0"
"@opentelemetry/core": "1.7.0",
"@opentelemetry/otlp-grpc-exporter-base": "0.33.0",
"@opentelemetry/otlp-transformer": "0.33.0",
"@opentelemetry/resources": "1.7.0",
"@opentelemetry/sdk-trace-base": "1.7.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/exporter-trace-otlp-grpc"
}
12 changes: 6 additions & 6 deletions experimental/packages/exporter-trace-otlp-http/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentelemetry/exporter-trace-otlp-http",
"version": "0.32.0",
"version": "0.33.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 Down Expand Up @@ -94,11 +94,11 @@
"@opentelemetry/api": "^1.0.0"
},
"dependencies": {
"@opentelemetry/core": "1.6.0",
"@opentelemetry/otlp-exporter-base": "0.32.0",
"@opentelemetry/otlp-transformer": "0.32.0",
"@opentelemetry/resources": "1.6.0",
"@opentelemetry/sdk-trace-base": "1.6.0"
"@opentelemetry/core": "1.7.0",
"@opentelemetry/otlp-exporter-base": "0.33.0",
"@opentelemetry/otlp-transformer": "0.33.0",
"@opentelemetry/resources": "1.7.0",
"@opentelemetry/sdk-trace-base": "1.7.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/exporter-trace-otlp-http"
}
14 changes: 7 additions & 7 deletions experimental/packages/exporter-trace-otlp-proto/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentelemetry/exporter-trace-otlp-proto",
"version": "0.32.0",
"version": "0.33.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 Down Expand Up @@ -67,12 +67,12 @@
},
"dependencies": {
"@grpc/proto-loader": "^0.6.9",
"@opentelemetry/core": "1.6.0",
"@opentelemetry/otlp-exporter-base": "0.32.0",
"@opentelemetry/otlp-proto-exporter-base": "0.32.0",
"@opentelemetry/otlp-transformer": "0.32.0",
"@opentelemetry/resources": "1.6.0",
"@opentelemetry/sdk-trace-base": "1.6.0"
"@opentelemetry/core": "1.7.0",
"@opentelemetry/otlp-exporter-base": "0.33.0",
"@opentelemetry/otlp-proto-exporter-base": "0.33.0",
"@opentelemetry/otlp-transformer": "0.33.0",
"@opentelemetry/resources": "1.7.0",
"@opentelemetry/sdk-trace-base": "1.7.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/exporter-trace-otlp-proto"
}
Loading

0 comments on commit 5708267

Please sign in to comment.