Skip to content

Commit

Permalink
Merge branch 'main' into benchmark-test-ts
Browse files Browse the repository at this point in the history
  • Loading branch information
pichlermarc authored Sep 19, 2023
2 parents eb4d3e2 + cbc5c52 commit 9ef6acc
Show file tree
Hide file tree
Showing 52 changed files with 992 additions and 67 deletions.
34 changes: 21 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,27 @@ There may also be API packages for experimental signals in the experimental dire
All stable packages are released with the same version, and all experimental packages are released with the same version.
The below table describes which versions of each set of packages are expected to work together.

| API | Stable Packages | Experimental Packages |
| ----- | --------------- | --------------------- |
| 1.3.x | 1.9.x | 0.35.x |
| 1.3.x | 1.8.x | 0.34.x |
| 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 |
| 1.1.x | 1.3.x | 0.29.x |
| 1.1.x | 1.2.x | 0.29.x |
| 1.1.x | 1.1.x | 0.28.x |
| 1.0.x | 1.0.x | 0.27.x |
| 1.0.x | 1.0.x | 0.26.x |
| Stable Packages | Experimental Packages |
|-----------------------------------------------------------------|-----------------------|
| 1.17.x | 0.43.x |
| 1.16.x | 0.42.x |
| 1.15.x | 0.41.x |
| 1.14.x | 0.40.x |
| 1.13.x | 0.39.x |
| 1.12.x | 0.38.x |
| 1.11.x | 0.37.x |
| 1.10.x | 0.36.x |
| 1.9.x | 0.35.x |
| 1.8.x (this and later versions require API >=1.3.0 for metrics) | 0.34.x |
| 1.7.x | 0.33.x |
| 1.6.x | 0.32.x |
| 1.5.x | 0.31.x |
| 1.4.x | 0.30.x |
| 1.3.x | 0.29.x |
| 1.2.x | 0.29.x |
| 1.1.x | 0.28.x |
| 1.0.x | 0.27.x |
| 1.0.x (this and later versions require API >=1.0.0 for traces) | 0.26.x |

## Versioning

Expand Down
7 changes: 6 additions & 1 deletion experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@ All notable changes to experimental packages in this project will be documented
### :boom: Breaking Change

* fix(exporter-logs-otlp-proto): change OTLPLogExporter to OTLPLogExporter [#4140](https://github.com/open-telemetry/opentelemetry-js/pull/4140) @Vunovati
* fix(sdk-node): remove explicit dependency on @opentelemetry/exporter-jaeger
* '@opentelemetry/exporter-jaeger' is no longer be a dependency of this package. To continue using '@opentelemetry/exporter-jaeger', please install it manually.
* NOTE: `@opentelemetry/exporter-jaeger` is deprecated, consider switching to one of the alternatives described [here](https://www.npmjs.com/package/@opentelemetry/exporter-jaeger)

### :rocket: (Enhancement)

* feat(exporter-metrics-otlp-proto): add esm build [#4099](https://github.com/open-telemetry/opentelemetry-js/pull/4099) @pichlermarc
* feat(opencensus-shim): implement OpenCensus metric producer [#4066](https://github.com/open-telemetry/opentelemetry-js/pull/4066) @aabmass

### :bug: (Bug Fix)

### :books: (Refine Doc)
Expand Down Expand Up @@ -48,7 +54,6 @@ All notable changes to experimental packages in this project will be documented
### :bug: (Bug Fix)

* fix(exporter-logs-otlp-http): add @opentelemetry/api-logs as dependency
* fix(sdk-node): remove explicit dependency on @opentelemetry/exporter-jaeger.

## 0.41.2

Expand Down
10 changes: 10 additions & 0 deletions experimental/examples/opencensus-shim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ The example has:
- Root Spans (on client), instrumented with OpenCensus's HTTP instrumentation
- Child Span from a remote parent (on server), instrumented with OpenCensus's HTTP instrumentation
- Another Child Span created in the server representing some work being done, instrumented manually with OpenTelemetry.
- Server metrics coming from OpenCensus's HTTP instrumentation, available through the
OpenTelemetry's Prometheus exporter.

## Installation

Expand Down Expand Up @@ -64,6 +66,14 @@ Go to Jaeger with your browser <http://localhost:16686/> and click on the "Servi

<p align="center"><img src="./images/jaeger-trace.png"/></p>

## Check the Prometheus metrics

Load the Prometheus metrics endpoint of the server at <http://localhost:9464/metrics> in your
browser. You should see the `opencensus_io_http_server_*` related metrics in
the output.

<p align="center"><img src="./images/prom-metrics.png"/></p>

## Useful links

- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions experimental/examples/opencensus-shim/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@
},
"dependencies": {
"@opencensus/core": "0.1.0",
"@opencensus/instrumentation-http": "0.1.0",
"@opencensus/nodejs-base": "0.1.0",
"@opentelemetry/api": "1.6.0",
"@opentelemetry/exporter-prometheus": "0.43.0",
"@opentelemetry/exporter-trace-otlp-grpc": "0.43.0",
"@opentelemetry/resources": "1.17.0",
"@opentelemetry/sdk-metrics": "1.17.0",
"@opentelemetry/sdk-trace-node": "1.17.0",
"@opentelemetry/semantic-conventions": "1.17.0",
"@opentelemetry/shim-opencensus": "0.43.0"
Expand Down
2 changes: 2 additions & 0 deletions experimental/examples/opencensus-shim/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const setup = require('./setup');
const utils = require('./utils');
const { trace } = require('@opentelemetry/api');

const oc = require('@opencensus/core');

setup('opencensus-shim-example-server');
const http = require('http');

Expand Down
49 changes: 38 additions & 11 deletions experimental/examples/opencensus-shim/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,64 @@
*/
'use strict';

const { DiagConsoleLogger, diag, DiagLogLevel } = require('@opentelemetry/api');
const { diag, metrics } = require('@opentelemetry/api');
const {
NodeTracerProvider,
BatchSpanProcessor,
} = require('@opentelemetry/sdk-trace-node');
const { MeterProvider } = require('@opentelemetry/sdk-metrics');
const {
OTLPTraceExporter,
} = require('@opentelemetry/exporter-trace-otlp-grpc');
const { PrometheusExporter } = require('@opentelemetry/exporter-prometheus');
const { Resource } = require('@opentelemetry/resources');
const {
SemanticResourceAttributes,
} = require('@opentelemetry/semantic-conventions');
const { OpenCensusMetricProducer } = require('@opentelemetry/shim-opencensus');
const instrumentationHttp = require('@opencensus/instrumentation-http');
const { TracingBase } = require('@opencensus/nodejs-base');
const oc = require('@opencensus/core');

module.exports = function setup(serviceName) {
const tracing = require('@opencensus/nodejs-base');
/**
* You can alternatively just use the @opentelemetry/nodejs package directly:
*
* ```js
* const tracing = require('@opencensus/nodejs');
* ```
*/
const tracing = new TracingBase(['http']);
tracing.tracer = new oc.CoreTracer();

diag.setLogger(new DiagConsoleLogger(), { logLevel: DiagLogLevel.ALL });
const provider = new NodeTracerProvider({
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: serviceName,
}),
const resource = new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: serviceName,
});
provider.addSpanProcessor(
const tracerProvider = new NodeTracerProvider({ resource });
tracerProvider.addSpanProcessor(
new BatchSpanProcessor(new OTLPTraceExporter(), {
scheduledDelayMillis: 5000,
})
);
provider.register();
tracerProvider.register();

const meterProvider = new MeterProvider({ resource });
meterProvider.addMetricReader(
new PrometheusExporter({
metricProducers: [
new OpenCensusMetricProducer({
openCensusMetricProducerManager:
oc.Metrics.getMetricProducerManager(),
}),
],
})
);
metrics.setGlobalMeterProvider(meterProvider);

// Start OpenCensus tracing
tracing.start({ samplingRate: 1, logger: diag });
tracing.start({ samplingRate: 1, logger: diag, stats: oc.globalStats });
// Register OpenCensus HTTP stats views
instrumentationHttp.registerAllViews(oc.globalStats);

return provider;
return tracerProvider;
};
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 @@ -48,7 +48,7 @@
"access": "public"
},
"devDependencies": {
"@babel/core": "7.22.17",
"@babel/core": "7.22.20",
"@grpc/proto-loader": "^0.7.3",
"@opentelemetry/api": "1.6.0",
"@opentelemetry/api-logs": "0.43.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 @@ -71,7 +71,7 @@
],
"sideEffects": false,
"devDependencies": {
"@babel/core": "7.22.17",
"@babel/core": "7.22.20",
"@opentelemetry/api": "1.6.0",
"@opentelemetry/resources": "1.17.0",
"@types/mocha": "10.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"access": "public"
},
"devDependencies": {
"@babel/core": "7.22.17",
"@babel/core": "7.22.20",
"@opentelemetry/api": "1.6.0",
"@types/mocha": "10.0.1",
"@types/node": "18.6.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"access": "public"
},
"devDependencies": {
"@babel/core": "7.22.17",
"@babel/core": "7.22.20",
"@grpc/proto-loader": "^0.7.3",
"@opentelemetry/api": "1.6.0",
"@opentelemetry/otlp-exporter-base": "0.43.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"access": "public"
},
"devDependencies": {
"@babel/core": "7.22.17",
"@babel/core": "7.22.20",
"@opentelemetry/api": "1.6.0",
"@types/mocha": "10.0.1",
"@types/node": "18.6.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"access": "public"
},
"devDependencies": {
"@babel/core": "7.22.17",
"@babel/core": "7.22.20",
"@opentelemetry/api": "1.6.0",
"@types/mocha": "10.0.1",
"@types/node": "18.6.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"access": "public"
},
"devDependencies": {
"@babel/core": "7.22.17",
"@babel/core": "7.22.20",
"@opentelemetry/api": "1.6.0",
"@types/mocha": "10.0.1",
"@types/node": "18.6.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"access": "public"
},
"devDependencies": {
"@babel/core": "7.22.17",
"@babel/core": "7.22.20",
"@grpc/proto-loader": "^0.7.3",
"@opentelemetry/api": "1.6.0",
"@types/mocha": "10.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"access": "public"
},
"devDependencies": {
"@babel/core": "7.22.17",
"@babel/core": "7.22.20",
"@opentelemetry/api": "1.6.0",
"@types/mocha": "10.0.1",
"@types/node": "18.6.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
"version": "0.43.0",
"description": "OpenTelemetry Collector Metrics Exporter allows user to send collected metrics to the OpenTelemetry Collector using protobuf over HTTP",
"main": "build/src/index.js",
"module": "build/esm/index.js",
"esnext": "build/esnext/index.js",
"types": "build/src/index.d.ts",
"repository": "open-telemetry/opentelemetry-js",
"scripts": {
"prepublishOnly": "npm run compile",
"compile": "tsc --build",
"clean": "tsc --build --clean",
"compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"tdd": "npm run test -- --watch-extensions ts --watch",
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts' --exclude 'test/browser/**/*.ts'",
"version": "node ../../../scripts/version-update.js",
"watch": "tsc -w",
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
"precompile": "cross-var lerna run version --scope $npm_package_name --include-dependencies",
"prewatch": "npm run precompile",
"peer-api-check": "node ../../../scripts/peer-api-check.js",
Expand All @@ -35,6 +37,12 @@
"node": ">=14"
},
"files": [
"build/esm/**/*.js",
"build/esm/**/*.js.map",
"build/esm/**/*.d.ts",
"build/esnext/**/*.js",
"build/esnext/**/*.js.map",
"build/esnext/**/*.d.ts",
"build/src/**/*.js",
"build/src/**/*.js.map",
"build/src/**/*.d.ts",
Expand All @@ -47,7 +55,7 @@
"access": "public"
},
"devDependencies": {
"@babel/core": "7.22.17",
"@babel/core": "7.22.20",
"@opentelemetry/api": "1.6.0",
"@types/mocha": "10.0.1",
"@types/node": "18.6.5",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"extends": "../../../tsconfig.base.esm.json",
"compilerOptions": {
"outDir": "build/esm",
"rootDir": "src",
"tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo"
},
"include": [
"src/**/*.ts"
],
"references": [
{
"path": "../../../api"
},
{
"path": "../../../packages/opentelemetry-core"
},
{
"path": "../../../packages/opentelemetry-resources"
},
{
"path": "../../../packages/sdk-metrics"
},
{
"path": "../opentelemetry-exporter-metrics-otlp-http"
},
{
"path": "../otlp-exporter-base"
},
{
"path": "../otlp-proto-exporter-base"
},
{
"path": "../otlp-transformer"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"extends": "../../../tsconfig.base.esnext.json",
"compilerOptions": {
"outDir": "build/esnext",
"rootDir": "src",
"tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo"
},
"include": [
"src/**/*.ts"
],
"references": [
{
"path": "../../../api"
},
{
"path": "../../../packages/opentelemetry-core"
},
{
"path": "../../../packages/opentelemetry-resources"
},
{
"path": "../../../packages/sdk-metrics"
},
{
"path": "../opentelemetry-exporter-metrics-otlp-http"
},
{
"path": "../otlp-exporter-base"
},
{
"path": "../otlp-proto-exporter-base"
},
{
"path": "../otlp-transformer"
}
]
}
Loading

0 comments on commit 9ef6acc

Please sign in to comment.