From 2610521b1638265dd5f12bcdd72e5a36d19157c7 Mon Sep 17 00:00:00 2001 From: Marc Pichler Date: Wed, 18 Dec 2024 17:32:28 +0100 Subject: [PATCH] docs: merge changelog and readme --- CHANGELOG.md | 19 +++ CHANGELOG_NEXT.md | 32 ---- README.md | 379 +++++++++++++++++++++++++++++++++++++++++++++- README_NEXT.md | 366 -------------------------------------------- 4 files changed, 395 insertions(+), 401 deletions(-) delete mode 100644 CHANGELOG_NEXT.md delete mode 100644 README_NEXT.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 92d6a217c9f..305495ddd31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,20 @@ For semantic convention package changes, see the [semconv CHANGELOG](packages/se ### :boom: Breaking Change +* feat(sdk-metrics)!: bump minimum version of `@opentelemetry/api` peer dependency to 1.9.0 [#5254](https://github.com/open-telemetry/opentelemetry-js/pull/5254) @chancancode +* chore(shim-opentracing): replace deprecated SpanAttributes [#4430](https://github.com/open-telemetry/opentelemetry-js/pull/4430) @JamieDanielson +* chore(otel-core): replace deprecated SpanAttributes [#4408](https://github.com/open-telemetry/opentelemetry-js/pull/4408) @JamieDanielson +* feat(sdk-metrics)!: remove MeterProvider.addMetricReader() in favor of constructor option [#4419](https://github.com/open-telemetry/opentelemetry-js/pull/4419) @pichlermarc +* chore(otel-resources): replace deprecated SpanAttributes [#4428](https://github.com/open-telemetry/opentelemetry-js/pull/4428) @JamieDanielson +* feat(sdk-metrics)!: remove MeterProvider.addMetricReader() in favor of constructor option [#4419](https://github.com/open-telemetry/opentelemetry-js/pull/4419) @pichlermarc +* feat(sdk-metrics)!: replace attributeKeys with custom processors option [#4532](https://github.com/open-telemetry/opentelemetry-js/pull/4532) @pichlermarc +* refactor(sdk-trace-base)!: replace `SpanAttributes` with `Attributes` [#5009](https://github.com/open-telemetry/opentelemetry-js/pull/5009) @david-luna +* refactor(resources)!: replace `ResourceAttributes` with `Attributes` [#5016](https://github.com/open-telemetry/opentelemetry-js/pull/5016) @david-luna +* feat(sdk-metrics)!: drop `View` and `Aggregation` in favor of `ViewOptions` and `AggregationOption` [#4931](https://github.com/open-telemetry/opentelemetry-js/pull/4931) @pichlermarc +* refactor(sdk-trace-base)!: remove `new Span` constructor in favor of `Tracer.startSpan` API [#5048](https://github.com/open-telemetry/opentelemetry-js/pull/5048) @david-luna +* refactor(sdk-trace-base)!: remove `BasicTracerProvider.addSpanProcessor` API in favor of constructor options. [#5134](https://github.com/open-telemetry/opentelemetry-js/pull/5134) @david-luna +* refactor(sdk-trace-base)!: make `resource` property private in `BasicTracerProvider` and remove `getActiveSpanProcessor` API. [#5192](https://github.com/open-telemetry/opentelemetry-js/pull/5192) @david-luna + ### :rocket: (Enhancement) ### :bug: (Bug Fix) @@ -19,6 +33,11 @@ For semantic convention package changes, see the [semconv CHANGELOG](packages/se ### :house: (Internal) +* refactor(sdk-metrics): remove `Gauge` and `MetricAdvice` workaround types in favor of the upstream `@opentelemetry/api` types [#5254](https://github.com/open-telemetry/opentelemetry-js/pull/5254) @chancancode +* chore: remove checks for unsupported node versions [#4341](https://github.com/open-telemetry/opentelemetry-js/pull/4341) @dyladan +* refactor(sdk-trace-base): remove `BasicTracerProvider._registeredSpanProcessors` private property. [#5134](https://github.com/open-telemetry/opentelemetry-js/pull/5134) @david-luna +* refactor(sdk-trace-base): rename `BasicTracerProvider.activeSpanProcessor` private property. [#5211](https://github.com/open-telemetry/opentelemetry-js/pull/5211) @david-luna + ## 1.30.0 ### :rocket: (Enhancement) diff --git a/CHANGELOG_NEXT.md b/CHANGELOG_NEXT.md deleted file mode 100644 index 60a15df6c29..00000000000 --- a/CHANGELOG_NEXT.md +++ /dev/null @@ -1,32 +0,0 @@ - - -## 2.0 - -### :boom: Breaking Change - -* feat(sdk-metrics)!: bump minimum version of `@opentelemetry/api` peer dependency to 1.9.0 [#5254](https://github.com/open-telemetry/opentelemetry-js/pull/5254) @chancancode -* chore(shim-opentracing): replace deprecated SpanAttributes [#4430](https://github.com/open-telemetry/opentelemetry-js/pull/4430) @JamieDanielson -* chore(otel-core): replace deprecated SpanAttributes [#4408](https://github.com/open-telemetry/opentelemetry-js/pull/4408) @JamieDanielson -* feat(sdk-metrics)!: remove MeterProvider.addMetricReader() in favor of constructor option [#4419](https://github.com/open-telemetry/opentelemetry-js/pull/4419) @pichlermarc -* chore(otel-resources): replace deprecated SpanAttributes [#4428](https://github.com/open-telemetry/opentelemetry-js/pull/4428) @JamieDanielson -* feat(sdk-metrics)!: remove MeterProvider.addMetricReader() in favor of constructor option [#4419](https://github.com/open-telemetry/opentelemetry-js/pull/4419) @pichlermarc -* feat(sdk-metrics)!: replace attributeKeys with custom processors option [#4532](https://github.com/open-telemetry/opentelemetry-js/pull/4532) @pichlermarc -* refactor(sdk-trace-base)!: replace `SpanAttributes` with `Attributes` [#5009](https://github.com/open-telemetry/opentelemetry-js/pull/5009) @david-luna -* refactor(resources)!: replace `ResourceAttributes` with `Attributes` [#5016](https://github.com/open-telemetry/opentelemetry-js/pull/5016) @david-luna -* feat(sdk-metrics)!: drop `View` and `Aggregation` in favor of `ViewOptions` and `AggregationOption` [#4931](https://github.com/open-telemetry/opentelemetry-js/pull/4931) @pichlermarc -* refactor(sdk-trace-base)!: remove `new Span` constructor in favor of `Tracer.startSpan` API [#5048](https://github.com/open-telemetry/opentelemetry-js/pull/5048) @david-luna -* refactor(sdk-trace-base)!: remove `BasicTracerProvider.addSpanProcessor` API in favor of constructor options. [#5134](https://github.com/open-telemetry/opentelemetry-js/pull/5134) @david-luna -* refactor(sdk-trace-base)!: make `resource` property private in `BasicTracerProvider` and remove `getActiveSpanProcessor` API. [#5192](https://github.com/open-telemetry/opentelemetry-js/pull/5192) @david-luna - -### :rocket: (Enhancement) - -### :books: (Refine Doc) - -### :house: (Internal) - -* refactor(sdk-metrics): remove `Gauge` and `MetricAdvice` workaround types in favor of the upstream `@opentelemetry/api` types [#5254](https://github.com/open-telemetry/opentelemetry-js/pull/5254) @chancancode -* chore: remove checks for unsupported node versions [#4341](https://github.com/open-telemetry/opentelemetry-js/pull/4341) @dyladan -* refactor(sdk-trace-base): remove `BasicTracerProvider._registeredSpanProcessors` private property. [#5134](https://github.com/open-telemetry/opentelemetry-js/pull/5134) @david-luna -* refactor(sdk-trace-base): rename `BasicTracerProvider.activeSpanProcessor` private property. [#5211](https://github.com/open-telemetry/opentelemetry-js/pull/5211) @david-luna - -### :bug: (Bug Fix) diff --git a/README.md b/README.md index 24942a07aa4..0f92c9ad599 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,378 @@ -# OpenTelemetry JavaScript SDK 2.0 + +--- +

+ + Getting Started +   •   + API and SDK Reference + +

+ +

+ + GitHub release (latest by date including pre-releases) + + + Codecov Status + + + license + +
+ + Build Status + + Beta +

+ +

+ + Contributing +   •   + Examples + +

+ +--- > [!WARNING] -> You have found the working branch for the work in progress 2.0 SDK. -> If you are a user, you are probably looking for the 1.x SDK on the main branch. +> This is the working branch for the work in progress 2.0 SDK, see [this tracking issue](https://github.com/open-telemetry/opentelemetry-js/issues/5148) for details. +> If you are a user looking for the current released state, you are probably looking for the [1.x SDK](https://github.com/open-telemetry/opentelemetry-js/tree/v1.x) on the v1.x branch. + +## About this project + +This is the JavaScript version of [OpenTelemetry](https://opentelemetry.io/), a framework for collecting traces, metrics, and logs from applications. + +## Quick Start + +**Much of OpenTelemetry JS documentation is written assuming the compiled application is run as CommonJS.** +For more details on ECMAScript Modules vs CommonJS, refer to [esm-support](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/esm-support.md). + +The following describes how to set up tracing for a basic web application. +For more detailed documentation, see the website at . + +### Installation + +Dependencies with the `latest` tag on NPM should be compatible with each other. +See the [version compatibility matrix](#package-version-compatibility) below for more information. + +```shell +npm install --save @opentelemetry/api +npm install --save @opentelemetry/sdk-node +npm install --save @opentelemetry/auto-instrumentations-node +``` + +**Note:** `auto-instrumentations-node` is a meta package from [opentelemetry-js-contrib](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/metapackages/auto-instrumentations-node) that provides a simple way to initialize multiple Node.js instrumentations. + +### Set up Tracing + +```js +// tracing.js + +'use strict' + +const process = require('process'); +const opentelemetry = require('@opentelemetry/sdk-node'); +const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node'); +const { ConsoleSpanExporter } = require('@opentelemetry/sdk-trace-base'); +const { Resource } = require('@opentelemetry/resources'); +const { SEMRESATTRS_SERVICE_NAME } = require('@opentelemetry/semantic-conventions'); + +// configure the SDK to export telemetry data to the console +// enable all auto-instrumentations from the meta package +const traceExporter = new ConsoleSpanExporter(); +const sdk = new opentelemetry.NodeSDK({ + resource: new Resource({ + [SEMRESATTRS_SERVICE_NAME]: 'my-service', + }), + traceExporter, + instrumentations: [getNodeAutoInstrumentations()] +}); + +// initialize the SDK and register with the OpenTelemetry API +// this enables the API to record telemetry +sdk.start(); + +// gracefully shut down the SDK on process exit +process.on('SIGTERM', () => { + sdk.shutdown() + .then(() => console.log('Tracing terminated')) + .catch((error) => console.log('Error terminating tracing', error)) + .finally(() => process.exit(0)); +}); +``` + +### Run Your Application + +```shell +node -r ./tracing.js app.js +``` + +The above example will emit auto-instrumented telemetry about your Node.js application to the console. For a more in-depth example, see the [Getting Started Guide](https://opentelemetry.io/docs/languages/js/getting-started/). For more information about automatic instrumentation see [@opentelemetry/sdk-trace-node][otel-node], which provides auto-instrumentation for Node.js applications. If the automatic instrumentation does not suit your needs, or you would like to create manual traces, see [@opentelemetry/sdk-trace-base][otel-tracing] + +## Library Author + +If you are a library author looking to build OpenTelemetry into your library, please see [the documentation][docs]. As a library author, it is important that you only depend on properties and methods published on the public API. If you use any properties or methods from the SDK that are not officially a part of the public API, your library may break if an application owner uses a different SDK implementation. + +## Supported Runtimes + +| Platform Version | Supported | +| ------------------- | --------------------------------------------- | +| Node.JS `v22` | :heavy_check_mark: | +| Node.JS `v20` | :heavy_check_mark: | +| Node.JS `v18` | :heavy_check_mark: | +| Node.JS `v16` | :heavy_check_mark: | +| Node.JS `v14` | :heavy_check_mark: | +| Older Node Versions | See [Node Support](#node-support) | +| Web Browsers | See [Browser Support](#browser-support) below | + +### Node Support + +Only Node.js Active or Maintenance LTS versions are supported. +Previous versions of node *may* work, but they are not tested by OpenTelemetry and they are not guaranteed to work. +Note that versions of Node.JS v8 prior to `v8.12.0` will NOT work, because OpenTelemetry Node depends on the +`perf_hooks` module introduced in `v8.5.0` and `performance.timeOrigin` that is set correctly starting in `v8.12.0`. + +### Browser Support + +> [!IMPORTANT] +> Client instrumentation for the browser is **experimental** and mostly **unspecified**. If you are interested in +> helping out, get in touch with the [Client Instrumentation SIG][client-instrumentation-sig]. + +Rather than define versions of specific browsers / runtimes, OpenTelemetry sets the minimum supported version based on the +underlying language features used. + +The current minumum language feature support is set as [ECMAScript 2020](https://262.ecma-international.org/11.0/) that are available +in all modern browsers / runtimes. + +This means that if you are targeting or your end-users are using a browser / runtime that does not support ES2020, you will need +to transpile the code and provide any necessary polyfills for the missing features to ensure compatibility with your target +environments. Any support issues that arise from using a browser or runtime that does not support ES2020 will be closed as "won't fix". + +This minimum support level is subject to change as the project evolves and as the underlying language features evolve. + +## Package Version Compatibility + +OpenTelemetry is released as a set of distinct packages in 3 categories: API, stable SDK, and experimental. +The API is located at [/api](/api/), the stable SDK packages are in the [/packages](/packages/) directory, and the experimental packages are listed in the [/experimental/packages](/experimental/packages/) directory. +There may also be API packages for experimental signals in the experimental directory. +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. + +| Stable Packages | Experimental Packages | +|-----------------|-----------------------| +| 1.29.x | 0.56.x | +| 1.28.x | 0.55.x | +| 1.27.x | 0.54.x | +| 1.25.x | 0.52.x | +| 1.24.x | 0.51.x | + +
+Older version compatibility matrix + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Stable Packages Experimental Packages
1.23.x 0.50.x
1.22.x 0.49.x
1.21.x 0.48.x
1.20.x 0.47.x
1.19.x 0.46.x
1.18.x 0.45.x
1.17.x 0.43.x, 0.44.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 + +The current version for each package can be found in the respective `package.json` file for that module. For additional details see the [versioning and stability][spec-versioning] document in the specification. + +## Feature Status + +| Signal | API Status | SDK Status | +| ------- | ----------- | ----------- | +| Tracing | Stable | Stable | +| Metrics | Stable | Stable | +| Logs | Development | Development | + +For a more detailed breakdown of feature support see the [specification compliance matrix][compliance-matrix]. + +## Contributing + +We'd love your help!. Use tags [up-for-grabs][up-for-grabs-issues] and +[good first issue][good-first-issues] to get started with the project. For +instructions to build and make changes to this project, see the +[CONTRIBUTING][CONTRIBUTING] guide. + +We have a weekly SIG meeting! See the [community page](https://github.com/open-telemetry/community#javascript-sdk) for meeting details and notes. + +### Community members + +#### Maintainers ([@open-telemetry/javascript-maintainers](https://github.com/orgs/open-telemetry/teams/javascript-maintainers)) + +- [Amir Blum](https://github.com/blumamir), Odigos +- [Chengzhong Wu](https://github.com/legendecas), Bloomberg +- [Daniel Dyla](https://github.com/dyladan), Dynatrace +- [Jamie Danielson](https://github.com/JamieDanielson), Honeycomb +- [Marc Pichler](https://github.com/pichlermarc), Dynatrace +- [Trent Mick](https://github.com/trentm), Elastic + +*Find more about the maintainer role in the [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#maintainer).* + +#### Approvers ([@open-telemetry/javascript-approvers](https://github.com/orgs/open-telemetry/teams/javascript-approvers)) + +- [David Luna](https://github.com/david-luna), Elastic +- [Hector Hernandez](https://github.com/hectorhdzg), 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 +- [Purvi Kanal](https://github.com/pkanal), Honeycomb +- [Svetlana Brennan](https://github.com/svetlanabrennan), New Relic +- [Marylia Gutierrez](https://github.com/maryliag), Grafana Labs + +*Find more about the approver role in the [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#approver).* + +#### Triager ([@open-telemetry/javascript-triagers](https://github.com/orgs/open-telemetry/teams/javascript-triagers)) + +- N/A + +*Find more about the triager role in the [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#triager).* + +#### Emeriti + +- [Bartlomiej Obecny](https://github.com/obecny), LightStep, Maintainer +- [Daniel Khan](https://github.com/dkhan), Dynatrace, Maintainer +- [Mayur Kale](https://github.com/mayurkale22), Google, Maintainer +- [Rauno Viskus](https://github.com/rauno56), Maintainer +- [Valentin Marchaud](https://github.com/vmarchaud), Maintainer +- [Brandon Gonzalez](https://github.com/bg451), LightStep, Approver +- [Roch Devost](https://github.com/rochdev), DataDog, Approver +- [John Bley](https://github.com/johnbley), Splunk, Approver +- [Mark Wolff](https://github.com/markwolff), Microsoft, Approver +- [Olivier Albertini](https://github.com/OlivierAlbertini), Ville de Montréal, Approver +- [Gerhard Stöbich](https://github.com/Flarna), Dynatrace, Approver +- [Haddas Bronfman](https://github.com/haddasbronfman), Cisco, Approver + +*Find more about the emeritus role in [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#emeritus-maintainerapprovertriager).* + +#### Thanks to all the people who already contributed + + + Repo contributors + + +## Packages + +### API + +| Package | Description | +| -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [@opentelemetry/api][otel-api] | This package provides TypeScript interfaces, enums and no-op implementations for the OpenTelemetry core trace and metrics model. It is intended for use both on the server and in the browser. | +| [@opentelemetry/core][otel-core] | This package provides default and no-op implementations of the OpenTelemetry api for trace and metrics. It's intended for use both on the server and in the browser. | + +### Implementation / SDKs + +| Package | Description | +| --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [@opentelemetry/sdk-trace-base][otel-tracing] | This module provides a full control over instrumentation and span creation. It doesn't load [`async_hooks`](https://nodejs.org/api/async_hooks.html) or any instrumentation by default. It is intended for use both on the server and in the browser. | +| [@opentelemetry/sdk-metrics][otel-metrics] | This module provides instruments and meters for reporting of time series data. | +| [@opentelemetry/sdk-trace-node][otel-node] | This module provides automatic tracing for Node.js applications. It is intended for use on the server only. | +| [@opentelemetry/sdk-trace-web][otel-web] | This module provides automated instrumentation and tracing for Web applications. It is intended for use in the browser only. | + +### Compatible Exporters + +OpenTelemetry is vendor-agnostic and can upload data to any backend with various exporter implementations. Even though, OpenTelemetry provides support for many backends, vendors/users can also implement their own exporters for proprietary and unofficially supported backends. + +See the [OpenTelemetry registry](https://opentelemetry.io/registry/?language=js&component=exporter#) for a list of exporters available. + +### Instrumentations + +OpenTelemetry can collect tracing data automatically using instrumentations. + +To request automatic tracing support for a module not on this list, please [file an issue](https://github.com/open-telemetry/opentelemetry-js/issues). Alternatively, Vendor/Users can [write an instrumentation yourself](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/instrumentation-guide.md). + +Currently, OpenTelemetry supports automatic tracing for: + +#### Node Instrumentations + +##### Core + +- [@opentelemetry/instrumentation-grpc][otel-instrumentation-grpc] +- [@opentelemetry/instrumentation-http][otel-instrumentation-http] + +##### Contrib + +These instrumentations are hosted at + +#### Web Instrumentations + +##### Core + +- [@opentelemetry/instrumentation-xml-http-request][otel-instrumentation-xml-http-request] +- [@opentelemetry/instrumentation-fetch][otel-instrumentation-fetch] + +##### Contrib + +These instrumentations are hosted at + +### Shims + +| Package | Description | +| -------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| [@opentelemetry/shim-opentracing][otel-shim-opentracing] | OpenTracing shim allows existing OpenTracing instrumentation to report to OpenTelemetry | + +## Useful links + +- Upgrade guidelines: [Upgrade Guide](./doc/upgrade-guide.md) +- For more information on OpenTelemetry, visit: +- For help or feedback on this project, join us in [GitHub Discussions][discussions-url] + +## License + +Apache 2.0 - See [LICENSE][license-url] for more information. + +[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions +[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/LICENSE +[up-for-grabs-issues]: https://github.com/open-telemetry/OpenTelemetry-js/issues?q=is%3Aissue+is%3Aopen+label%3Aup-for-grabs +[good-first-issues]: https://github.com/open-telemetry/OpenTelemetry-js/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22 + +[client-instrumentation-sig]: https://docs.google.com/document/d/16Vsdh-DM72AfMg_FIt9yT9ExEWF4A_vRbQ3jRNBe09w/edit + +[docs]: https://open-telemetry.github.io/opentelemetry-js +[compliance-matrix]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/spec-compliance-matrix.md +[CONTRIBUTING]: https://github.com/open-telemetry/opentelemetry-js/blob/main/CONTRIBUTING.md + +[otel-metrics]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics +[otel-node]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node + +[otel-instrumentation-fetch]: https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-fetch +[otel-instrumentation-grpc]: https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-grpc +[otel-instrumentation-http]: https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-http +[otel-instrumentation-xml-http-request]: https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-xml-http-request + +[otel-shim-opentracing]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-shim-opentracing +[otel-tracing]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-base +[otel-web]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-web +[otel-api]: https://github.com/open-telemetry/opentelemetry-js/tree/main/api +[otel-core]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-core + +[spec-versioning]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md diff --git a/README_NEXT.md b/README_NEXT.md deleted file mode 100644 index 40c667951b6..00000000000 --- a/README_NEXT.md +++ /dev/null @@ -1,366 +0,0 @@ - ---- -

- - Getting Started -   •   - API and SDK Reference - -

- -

- - GitHub release (latest by date including pre-releases) - - - Codecov Status - - - license - -
- - Build Status - - Beta -

- -

- - Contributing -   •   - Examples - -

- ---- - -## About this project - -This is the JavaScript version of [OpenTelemetry](https://opentelemetry.io/), a framework for collecting traces, metrics, and logs from applications. - -## Quick Start - -**Much of OpenTelemetry JS documentation is written assuming the compiled application is run as CommonJS.** -For more details on ECMAScript Modules vs CommonJS, refer to [esm-support](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/esm-support.md). - -The following describes how to set up tracing for a basic web application. -For more detailed documentation, see the website at . - -### Installation - -Dependencies with the `latest` tag on NPM should be compatible with each other. -See the [version compatibility matrix](#package-version-compatibility) below for more information. - -```shell -npm install --save @opentelemetry/api -npm install --save @opentelemetry/sdk-node -npm install --save @opentelemetry/auto-instrumentations-node -``` - -**Note:** `auto-instrumentations-node` is a meta package from [opentelemetry-js-contrib](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/metapackages/auto-instrumentations-node) that provides a simple way to initialize multiple Node.js instrumentations. - -### Set up Tracing - -```js -// tracing.js - -'use strict' - -const process = require('process'); -const opentelemetry = require('@opentelemetry/sdk-node'); -const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node'); -const { ConsoleSpanExporter } = require('@opentelemetry/sdk-trace-base'); -const { Resource } = require('@opentelemetry/resources'); -const { SEMRESATTRS_SERVICE_NAME } = require('@opentelemetry/semantic-conventions'); - -// configure the SDK to export telemetry data to the console -// enable all auto-instrumentations from the meta package -const traceExporter = new ConsoleSpanExporter(); -const sdk = new opentelemetry.NodeSDK({ - resource: new Resource({ - [SEMRESATTRS_SERVICE_NAME]: 'my-service', - }), - traceExporter, - instrumentations: [getNodeAutoInstrumentations()] -}); - -// initialize the SDK and register with the OpenTelemetry API -// this enables the API to record telemetry -sdk.start(); - -// gracefully shut down the SDK on process exit -process.on('SIGTERM', () => { - sdk.shutdown() - .then(() => console.log('Tracing terminated')) - .catch((error) => console.log('Error terminating tracing', error)) - .finally(() => process.exit(0)); -}); -``` - -### Run Your Application - -```shell -node -r ./tracing.js app.js -``` - -The above example will emit auto-instrumented telemetry about your Node.js application to the console. For a more in-depth example, see the [Getting Started Guide](https://opentelemetry.io/docs/languages/js/getting-started/). For more information about automatic instrumentation see [@opentelemetry/sdk-trace-node][otel-node], which provides auto-instrumentation for Node.js applications. If the automatic instrumentation does not suit your needs, or you would like to create manual traces, see [@opentelemetry/sdk-trace-base][otel-tracing] - -## Library Author - -If you are a library author looking to build OpenTelemetry into your library, please see [the documentation][docs]. As a library author, it is important that you only depend on properties and methods published on the public API. If you use any properties or methods from the SDK that are not officially a part of the public API, your library may break if an application owner uses a different SDK implementation. - -## Supported Runtimes - -| Platform Version | Supported | -| ------------------- | --------------------------------------------- | -| Node.JS `v22` | :heavy_check_mark: | -| Node.JS `v20` | :heavy_check_mark: | -| Node.JS `v18` | :heavy_check_mark: | -| Node.JS `v16` | :heavy_check_mark: | -| Node.JS `v14` | :heavy_check_mark: | -| Older Node Versions | See [Node Support](#node-support) | -| Web Browsers | See [Browser Support](#browser-support) below | - -### Node Support - -Only Node.js Active or Maintenance LTS versions are supported. -Previous versions of node *may* work, but they are not tested by OpenTelemetry and they are not guaranteed to work. -Note that versions of Node.JS v8 prior to `v8.12.0` will NOT work, because OpenTelemetry Node depends on the -`perf_hooks` module introduced in `v8.5.0` and `performance.timeOrigin` that is set correctly starting in `v8.12.0`. - -### Browser Support - -> [!IMPORTANT] -> Client instrumentation for the browser is **experimental** and mostly **unspecified**. If you are interested in -> helping out, get in touch with the [Client Instrumentation SIG][client-instrumentation-sig]. - -Rather than define versions of specific browsers / runtimes, OpenTelemetry sets the minimum supported version based on the -underlying Language features used. - -The current minumum language feature support is set as [ECMAScript 2020](https://262.ecma-international.org/11.0/) that are available -in all modern browsers / runtimes. - -This means that if you are targeting or your end-users are using a browser / runtime that does not support ES2020, you will need -to transpile the code and provide any necessary polyfills for the missing features to ensure compatibility with your target -environments. Any support issues that arise from using a browser or runtime that does not support ES2020 will be closed as "won't fix". - -This minimum support level is subject to change as the project evolves and as the underlying language features evolve. - -## Package Version Compatibility - -OpenTelemetry is released as a set of distinct packages in 3 categories: API, stable SDK, and experimental. -The API is located at [/api](/api/), the stable SDK packages are in the [/packages](/packages/) directory, and the experimental packages are listed in the [/experimental/packages](/experimental/packages/) directory. -There may also be API packages for experimental signals in the experimental directory. -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. - -| Stable Packages | Experimental Packages | -| --------------- | --------------------- | -| 1.21.x | 0.48.x | -| 1.20.x | 0.47.x | -| 1.19.x | 0.46.x | -| 1.18.x | 0.45.x | -| 1.17.x | 0.44.x | - -
-Older version compatibility matrix - - - - - - - - - - - - - - - - - - - - - -
Stable Packages Experimental Packages
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 - -The current version for each package can be found in the respective `package.json` file for that module. For additional details see the [versioning and stability][spec-versioning] document in the specification. - -## Feature Status - -| Signal | API Status | SDK Status | -| ------- | ----------- | ----------- | -| Tracing | Stable | Stable | -| Metrics | Stable | Stable | -| Logs | Development | Development | - -For a more detailed breakdown of feature support see the [specification compliance matrix][compliance-matrix]. - -## Contributing - -We'd love your help!. Use tags [up-for-grabs][up-for-grabs-issues] and -[good first issue][good-first-issues] to get started with the project. For -instructions to build and make changes to this project, see the -[CONTRIBUTING][CONTRIBUTING] guide. - -We have a weekly SIG meeting! See the [community page](https://github.com/open-telemetry/community#javascript-sdk) for meeting details and notes. - -### Community members - -#### Maintainers ([@open-telemetry/javascript-maintainers](https://github.com/orgs/open-telemetry/teams/javascript-maintainers)) - -- [Amir Blum](https://github.com/blumamir), Odigos -- [Chengzhong Wu](https://github.com/legendecas), Bloomberg -- [Daniel Dyla](https://github.com/dyladan), Dynatrace -- [Jamie Danielson](https://github.com/JamieDanielson), Honeycomb -- [Marc Pichler](https://github.com/pichlermarc), Dynatrace -- [Trent Mick](https://github.com/trentm), Elastic - -*Find more about the maintainer role in the [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#maintainer).* - -#### Approvers ([@open-telemetry/javascript-approvers](https://github.com/orgs/open-telemetry/teams/javascript-approvers)) - -- [David Luna](https://github.com/david-luna), Elastic -- [Hector Hernandez](https://github.com/hectorhdzg), 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 -- [Purvi Kanal](https://github.com/pkanal), Honeycomb -- [Svetlana Brennan](https://github.com/svetlanabrennan), New Relic - -*Find more about the approver role in the [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#approver).* - -#### Triager ([@open-telemetry/javascript-triagers](https://github.com/orgs/open-telemetry/teams/javascript-triagers)) - -- [Marylia Gutierrez](https://github.com/maryliag), Grafana Labs - -*Find more about the triager role in the [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#triager).* - -#### Emeriti - -- [Bartlomiej Obecny](https://github.com/obecny), LightStep, Maintainer -- [Daniel Khan](https://github.com/dkhan), Dynatrace, Maintainer -- [Mayur Kale](https://github.com/mayurkale22), Google, Maintainer -- [Rauno Viskus](https://github.com/rauno56), Maintainer -- [Valentin Marchaud](https://github.com/vmarchaud), Maintainer -- [Brandon Gonzalez](https://github.com/bg451), LightStep, Approver -- [Roch Devost](https://github.com/rochdev), DataDog, Approver -- [John Bley](https://github.com/johnbley), Splunk, Approver -- [Mark Wolff](https://github.com/markwolff), Microsoft, Approver -- [Olivier Albertini](https://github.com/OlivierAlbertini), Ville de Montréal, Approver -- [Gerhard Stöbich](https://github.com/Flarna), Dynatrace, Approver -- [Haddas Bronfman](https://github.com/haddasbronfman), Cisco, Approver - -*Find more about the emeritus role in [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#emeritus-maintainerapprovertriager).* - -#### Thanks to all the people who already contributed - - - Repo contributors - - -## Packages - -### API - -| Package | Description | -| -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [@opentelemetry/api][otel-api] | This package provides TypeScript interfaces, enums and no-op implementations for the OpenTelemetry core trace and metrics model. It is intended for use both on the server and in the browser. | -| [@opentelemetry/core][otel-core] | This package provides default and no-op implementations of the OpenTelemetry api for trace and metrics. It's intended for use both on the server and in the browser. | - -### Implementation / SDKs - -| Package | Description | -| --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [@opentelemetry/sdk-trace-base][otel-tracing] | This module provides a full control over instrumentation and span creation. It doesn't load [`async_hooks`](https://nodejs.org/api/async_hooks.html) or any instrumentation by default. It is intended for use both on the server and in the browser. | -| [@opentelemetry/sdk-metrics][otel-metrics] | This module provides instruments and meters for reporting of time series data. | -| [@opentelemetry/sdk-trace-node][otel-node] | This module provides automatic tracing for Node.js applications. It is intended for use on the server only. | -| [@opentelemetry/sdk-trace-web][otel-web] | This module provides automated instrumentation and tracing for Web applications. It is intended for use in the browser only. | - -### Compatible Exporters - -OpenTelemetry is vendor-agnostic and can upload data to any backend with various exporter implementations. Even though, OpenTelemetry provides support for many backends, vendors/users can also implement their own exporters for proprietary and unofficially supported backends. - -See the [OpenTelemetry registry](https://opentelemetry.io/registry/?language=js&component=exporter#) for a list of exporters available. - -### Instrumentations - -OpenTelemetry can collect tracing data automatically using instrumentations. - -To request automatic tracing support for a module not on this list, please [file an issue](https://github.com/open-telemetry/opentelemetry-js/issues). Alternatively, Vendors/Users can [write an instrumentation themselves](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/instrumentation-guide.md). - -Currently, OpenTelemetry supports automatic tracing for: - -#### Node Instrumentations - -##### Core - -- [@opentelemetry/instrumentation-grpc][otel-instrumentation-grpc] -- [@opentelemetry/instrumentation-http][otel-instrumentation-http] - -##### Contrib - -These instrumentations are hosted at - -#### Web Instrumentations - -##### Core - -- [@opentelemetry/instrumentation-xml-http-request][otel-instrumentation-xml-http-request] -- [@opentelemetry/instrumentation-fetch][otel-instrumentation-fetch] - -##### Contrib - -These instrumentations are hosted at - -### Shims - -| Package | Description | -| -------------------------------------------------------- | --------------------------------------------------------------------------------------- | -| [@opentelemetry/shim-opentracing][otel-shim-opentracing] | OpenTracing shim allows existing OpenTracing instrumentation to report to OpenTelemetry | - -## Useful links - -- Upgrade guidelines: [Upgrade Guide](./doc/upgrade-guide.md) -- For more information on OpenTelemetry, visit: -- For help or feedback on this project, join us in [GitHub Discussions][discussions-url] - -## License - -Apache 2.0 - See [LICENSE][license-url] for more information. - -[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions -[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/LICENSE -[up-for-grabs-issues]: https://github.com/open-telemetry/OpenTelemetry-js/issues?q=is%3Aissue+is%3Aopen+label%3Aup-for-grabs -[good-first-issues]: https://github.com/open-telemetry/OpenTelemetry-js/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22 - -[client-instrumentation-sig]: https://docs.google.com/document/d/16Vsdh-DM72AfMg_FIt9yT9ExEWF4A_vRbQ3jRNBe09w/edit - -[docs]: https://open-telemetry.github.io/opentelemetry-js -[compliance-matrix]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/spec-compliance-matrix.md -[CONTRIBUTING]: https://github.com/open-telemetry/opentelemetry-js/blob/main/CONTRIBUTING.md - -[otel-metrics]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics -[otel-node]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node - -[otel-instrumentation-fetch]: https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-fetch -[otel-instrumentation-grpc]: https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-grpc -[otel-instrumentation-http]: https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-http -[otel-instrumentation-xml-http-request]: https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-xml-http-request - -[otel-shim-opentracing]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-shim-opentracing -[otel-tracing]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-base -[otel-web]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-web -[otel-api]: https://github.com/open-telemetry/opentelemetry-js/tree/main/api -[otel-core]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-core - -[spec-versioning]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md