Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into service-worker-support
Browse files Browse the repository at this point in the history
  • Loading branch information
sugi committed Jun 4, 2023
2 parents 7dd9675 + 1fc4ac6 commit 8187bd0
Show file tree
Hide file tree
Showing 183 changed files with 4,644 additions and 457 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/label-releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
on:
pull_request_target:
branches:
- main

jobs:
label-release:
if: ${{ startsWith(github.event.pull_request.title, 'release:') }}
runs-on: ubuntu-latest
steps:
- run: echo this is a release PR
- run: gh pr edit ${{ github.event.pull_request.number }} --add-label release
2 changes: 1 addition & 1 deletion .github/workflows/peer-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
peer-api-check:
runs-on: ubuntu-latest
container:
image: node:18
image: node:20
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
16 changes: 12 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,25 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/

### :rocket: (Enhancement)

* feat(core): add environment variables for OTLP log exporters. [#3712](https://github.com/open-telemetry/opentelemetry-js/pull/3712/) @llc1123
* feat(SpanExpoter): Add optional forceFlush to SpanExporter interface [#3753](https://github.com/open-telemetry/opentelemetry-js/pull/3753/) @sgracias1 @JacksonWeber

### :bug: (Bug Fix)

* fix(http-instrumentation): stop listening to `request`'s `close` event once it has emitted `response` [#3625](https://github.com/open-telemetry/opentelemetry-js/pull/3625) @SimenB
* fix(sdk-node): fix initialization in bundled environments by not loading @opentelemetry/exporter-jaeger [#3739](https://github.com/open-telemetry/opentelemetry-js/pull/3739) @pichlermarc

### :books: (Refine Doc)

### :house: (Internal)

## 1.13.0

### :rocket: (Enhancement)

* feat(core): add environment variables for OTLP log exporters. [#3712](https://github.com/open-telemetry/opentelemetry-js/pull/3712/) @llc1123

### :bug: (Bug Fix)

* fix(http-instrumentation): stop listening to `request`'s `close` event once it has emitted `response` [#3625](https://github.com/open-telemetry/opentelemetry-js/pull/3625) @SimenB
* fix(sdk-node): fix initialization in bundled environments by not loading @opentelemetry/exporter-jaeger [#3739](https://github.com/open-telemetry/opentelemetry-js/pull/3739) @pichlermarc

## 1.12.0

### :rocket: (Enhancement)
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,16 @@ We have a weekly SIG meeting! See the [community page](https://github.com/open-t

- [Gerhard Stöbich](https://github.com/Flarna), Dynatrace
- [Haddas Bronfman](https://github.com/haddasbronfman), Cisco
- [Hector Hernandez](https://github.com/hectorhdzg), Microsoft
- [Jamie Danielson](https://github.com/JamieDanielson), Honeycomb
- [John Bley](https://github.com/johnbley), Splunk
- [Mark Wolff](https://github.com/markwolff), Microsoft
- [Martin Kuba](https://github.com/martinkuba), Lightstep
- [Matthew Wear](https://github.com/mwear), LightStep
- [Naseem K. Ullah](https://github.com/naseemkullah), Transit
- [Neville Wylie](https://github.com/MSNev), Microsoft
- [Olivier Albertini](https://github.com/OlivierAlbertini), Ville de Montréal
- [Purvi Kanal](https://github.com/pkanal), Honeycomb
- [Svetlana Brennan](https://github.com/svetlanabrennan), New Relic

*Find more about the approver role in [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#approver).*
Expand Down
1 change: 1 addition & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use the latest and greatest features, and best practices.
| [grpc](grpc/) | gRPC Instrumentation to automatically collect trace data and export them to the backend of choice | Intermediate |
| [otlp-exporter-node](otlp-exporter-node/) | This example shows how to use `@opentelemetry/exporter-otlp-http` to instrument a simple Node.js application | Intermediate |
| [opentracing-shim](opentracing-shim/) | This is a simple example that demonstrates how existing OpenTracing instrumentation can be integrated with OpenTelemetry | Intermediate |
| [esm-http-ts](esm-http-ts/) | This is a simple example that demonstrates tracing HTTP request, with an app written in TypeScript and transpiled to ES Modules. | Intermediate |

Examples of experimental packages can be found at [experimental/examples](../experimental/examples).

Expand Down
25 changes: 25 additions & 0 deletions examples/esm-http-ts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Overview

This is a simple example that demonstrates tracing HTTP request, with an app written in TypeScript and transpiled to ES Modules.

## Installation

```sh
# from this directory
npm install
npm run build
npm start
```

In a separate terminal, `curl localhost:3000`.

See two spans in the console (one manual, one for http instrumentation)

## Useful links

- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
- For more information on OpenTelemetry for Node.js, visit: <https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node>

## LICENSE

Apache License 2.0
43 changes: 43 additions & 0 deletions examples/esm-http-ts/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { registerInstrumentations } from '@opentelemetry/instrumentation';
import { trace, DiagConsoleLogger, DiagLogLevel, diag } from '@opentelemetry/api';
import { HttpInstrumentation } from '@opentelemetry/instrumentation-http';
import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node';
import {
ConsoleSpanExporter,
SimpleSpanProcessor,
} from '@opentelemetry/sdk-trace-base';
import { Resource } from '@opentelemetry/resources';
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
import http from 'http';

diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG);
const tracerProvider = new NodeTracerProvider({
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: 'esm-http-ts-example',
}),
});
const exporter = new ConsoleSpanExporter();
const processor = new SimpleSpanProcessor(exporter);
tracerProvider.addSpanProcessor(processor);
tracerProvider.register();

registerInstrumentations({
instrumentations: [new HttpInstrumentation()],
});

const hostname = '0.0.0.0';
const port = 3000;

const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
const tracer = trace.getTracer('esm-tracer');
tracer.startActiveSpan('manual', span => {
span.end();
});
res.end('Hello, World!\n');
});

server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
42 changes: 42 additions & 0 deletions examples/esm-http-ts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "esm-http-ts",
"private": true,
"version": "0.38.0",
"description": "Example of HTTP integration with OpenTelemetry using ESM and TypeScript",
"main": "build/index.js",
"type": "module",
"scripts": {
"build": "tsc --build",
"start": "node --experimental-loader=@opentelemetry/instrumentation/hook.mjs ./build/index.js"
},
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/open-telemetry/opentelemetry-js.git"
},
"keywords": [
"opentelemetry",
"http",
"tracing",
"esm",
"typescript"
],
"engines": {
"node": ">=14"
},
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/open-telemetry/opentelemetry-js/issues"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/",
"dependencies": {
"@opentelemetry/api": "1.4.0",
"@opentelemetry/exporter-trace-otlp-proto": "0.38.0",
"@opentelemetry/instrumentation": "0.38.0",
"@opentelemetry/instrumentation-http": "0.38.0",
"@opentelemetry/resources": "1.9.1",
"@opentelemetry/sdk-trace-base": "1.9.1",
"@opentelemetry/sdk-trace-node": "1.9.1",
"@opentelemetry/semantic-conventions": "1.9.1"
}
}
25 changes: 25 additions & 0 deletions examples/esm-http-ts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"compilerOptions": {
/* Language and Environment */
"target": "ES2020" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,

/* Modules */
"module": "ESNext" /* Specify what module code is generated. */,
"rootDir": "." /* Specify the root folder within your source files. */,
"moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
"resolveJsonModule": true /* Enable importing .json files. */,

/* Emit */
"outDir": "build" /* Specify an output folder for all emitted files. */,

/* Interop Constraints */
"allowSyntheticDefaultImports": true /* Allow 'import x from y' when a module doesn't have a default export. */,
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,

/* Completeness */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
},
"include": ["**/*.ts", "**/*.js", "*.config.js"],
"exclude": ["node_modules"]
}
18 changes: 9 additions & 9 deletions examples/http/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "http-example",
"private": true,
"version": "0.37.0",
"version": "0.39.1",
"description": "Example of HTTP integration with OpenTelemetry",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -29,14 +29,14 @@
},
"dependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/exporter-jaeger": "1.9.1",
"@opentelemetry/exporter-zipkin": "1.9.1",
"@opentelemetry/instrumentation": "0.35.1",
"@opentelemetry/instrumentation-http": "0.35.1",
"@opentelemetry/resources": "1.9.1",
"@opentelemetry/sdk-trace-base": "1.9.1",
"@opentelemetry/sdk-trace-node": "1.9.1",
"@opentelemetry/semantic-conventions": "1.9.1"
"@opentelemetry/exporter-jaeger": "1.13.0",
"@opentelemetry/exporter-zipkin": "1.13.0",
"@opentelemetry/instrumentation": "0.39.1",
"@opentelemetry/instrumentation-http": "0.39.1",
"@opentelemetry/resources": "1.13.0",
"@opentelemetry/sdk-trace-base": "1.13.0",
"@opentelemetry/sdk-trace-node": "1.13.0",
"@opentelemetry/semantic-conventions": "1.13.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/http",
"devDependencies": {
Expand Down
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.38.0",
"version": "0.39.1",
"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.12.0",
"@opentelemetry/exporter-zipkin": "1.12.0",
"@opentelemetry/instrumentation": "0.38.0",
"@opentelemetry/instrumentation-http": "0.38.0",
"@opentelemetry/resources": "1.12.0",
"@opentelemetry/sdk-trace-base": "1.12.0",
"@opentelemetry/sdk-trace-node": "1.12.0",
"@opentelemetry/semantic-conventions": "1.12.0"
"@opentelemetry/exporter-jaeger": "1.13.0",
"@opentelemetry/exporter-zipkin": "1.13.0",
"@opentelemetry/instrumentation": "0.39.1",
"@opentelemetry/instrumentation-http": "0.39.1",
"@opentelemetry/resources": "1.13.0",
"@opentelemetry/sdk-trace-base": "1.13.0",
"@opentelemetry/sdk-trace-node": "1.13.0",
"@opentelemetry/semantic-conventions": "1.13.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.38.0",
"version": "0.39.1",
"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.3.0",
"@opentelemetry/context-zone": "1.12.0",
"@opentelemetry/core": "1.12.0",
"@opentelemetry/exporter-metrics-otlp-http": "0.38.0",
"@opentelemetry/exporter-trace-otlp-http": "0.38.0",
"@opentelemetry/exporter-trace-otlp-proto": "0.38.0",
"@opentelemetry/exporter-zipkin": "1.12.0",
"@opentelemetry/instrumentation": "0.38.0",
"@opentelemetry/instrumentation-fetch": "0.38.0",
"@opentelemetry/instrumentation-xml-http-request": "0.38.0",
"@opentelemetry/propagator-b3": "1.12.0",
"@opentelemetry/sdk-metrics": "1.12.0",
"@opentelemetry/sdk-trace-base": "1.12.0",
"@opentelemetry/sdk-trace-web": "1.12.0",
"@opentelemetry/semantic-conventions": "1.12.0"
"@opentelemetry/context-zone": "1.13.0",
"@opentelemetry/core": "1.13.0",
"@opentelemetry/exporter-metrics-otlp-http": "0.39.1",
"@opentelemetry/exporter-trace-otlp-http": "0.39.1",
"@opentelemetry/exporter-trace-otlp-proto": "0.39.1",
"@opentelemetry/exporter-zipkin": "1.13.0",
"@opentelemetry/instrumentation": "0.39.1",
"@opentelemetry/instrumentation-fetch": "0.39.1",
"@opentelemetry/instrumentation-xml-http-request": "0.39.1",
"@opentelemetry/propagator-b3": "1.13.0",
"@opentelemetry/sdk-metrics": "1.13.0",
"@opentelemetry/sdk-trace-base": "1.13.0",
"@opentelemetry/sdk-trace-web": "1.13.0",
"@opentelemetry/semantic-conventions": "1.13.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/tracer-web"
}
24 changes: 12 additions & 12 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.38.0",
"version": "0.39.1",
"description": "Example of using @opentelemetry/collector-exporter in Node.js",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -29,17 +29,17 @@
},
"dependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/core": "1.12.0",
"@opentelemetry/exporter-metrics-otlp-grpc": "0.38.0",
"@opentelemetry/exporter-metrics-otlp-http": "0.38.0",
"@opentelemetry/exporter-metrics-otlp-proto": "0.38.0",
"@opentelemetry/exporter-trace-otlp-grpc": "0.38.0",
"@opentelemetry/exporter-trace-otlp-http": "0.38.0",
"@opentelemetry/exporter-trace-otlp-proto": "0.38.0",
"@opentelemetry/resources": "1.12.0",
"@opentelemetry/sdk-metrics": "1.12.0",
"@opentelemetry/sdk-trace-base": "1.12.0",
"@opentelemetry/semantic-conventions": "1.12.0"
"@opentelemetry/core": "1.13.0",
"@opentelemetry/exporter-metrics-otlp-grpc": "0.39.1",
"@opentelemetry/exporter-metrics-otlp-http": "0.39.1",
"@opentelemetry/exporter-metrics-otlp-proto": "0.39.1",
"@opentelemetry/exporter-trace-otlp-grpc": "0.39.1",
"@opentelemetry/exporter-trace-otlp-http": "0.39.1",
"@opentelemetry/exporter-trace-otlp-proto": "0.39.1",
"@opentelemetry/resources": "1.13.0",
"@opentelemetry/sdk-metrics": "1.13.0",
"@opentelemetry/sdk-trace-base": "1.13.0",
"@opentelemetry/semantic-conventions": "1.13.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/otlp-exporter-node"
}
Loading

0 comments on commit 8187bd0

Please sign in to comment.