Skip to content

Commit

Permalink
docs(instrumentation): better docs for supportedVersions option (#4693)
Browse files Browse the repository at this point in the history
* docs(instrumentation): better docs for supportedVersions option

* docs: add recomundation to bound major version

* revert: Instrumentation class changes

* docs: add recommendation in both places

* docs: lint fix

* chore: CHANGLOG

* Update experimental/packages/opentelemetry-instrumentation/src/types.ts

* Update experimental/packages/opentelemetry-instrumentation/src/types.ts

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
  • Loading branch information
blumamir and pichlermarc authored May 13, 2024
1 parent 1c6e8b2 commit 50bd460
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
1 change: 1 addition & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ All notable changes to experimental packages in this project will be documented

### :books: (Refine Doc)

* docs(instrumentation): better docs for supportedVersions option [#4693](https://github.com/open-telemetry/opentelemetry-js/pull/4693) @blumamir
* docs: align all supported versions to a common format [#4696](https://github.com/open-telemetry/opentelemetry-js/pull/4696) @blumamir

### :house: (Internal)
Expand Down
28 changes: 26 additions & 2 deletions experimental/packages/opentelemetry-instrumentation/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,19 @@ export interface InstrumentationModuleFile {

moduleExports?: unknown;

/** Supported version this file */
/** Supported versions for the file.
*
* A module version is supported if one of the supportedVersions in the array satisfies the module version.
* The syntax of the version is checked with the `satisfies` function of "The semantic versioner for npm", see
* [`semver` package](https://www.npmjs.com/package/semver)
* If the version is not supported, we won't apply instrumentation patch.
* If omitted, all versions of the module will be patched.
*
* It is recommended to always specify a range that is bound to a major version, to avoid breaking changes.
* New major versions should be reviewed and tested before being added to the supportedVersions array.
*
* Example: ['>=1.2.3 <3']
*/
supportedVersions: string[];

/** Method to patch the instrumentation */
Expand All @@ -108,7 +120,19 @@ export interface InstrumentationModuleDefinition {
/** Instrumented module version */
moduleVersion?: string;

/** Supported version of module */
/** Supported version of module.
*
* A module version is supported if one of the supportedVersions in the array satisfies the module version.
* The syntax of the version is checked with the `satisfies` function of "The semantic versioner for npm", see
* [`semver` package](https://www.npmjs.com/package/semver)
* If the version is not supported, we won't apply instrumentation patch (see `enable` method).
* If omitted, all versions of the module will be patched.
*
* It is recommended to always specify a range that is bound to a major version, to avoid breaking changes.
* New major versions should be reviewed and tested before being added to the supportedVersions array.
*
* Example: ['>=1.2.3 <3']
*/
supportedVersions: string[];

/** Module internal files to be patched */
Expand Down

0 comments on commit 50bd460

Please sign in to comment.