You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: GUIDELINES.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Instrumentations Implementation Guide
2
2
3
-
This document captures general guidelines for implementing instrumentations in NodeJS and browser.
3
+
This document captures general guidelines for implementing instrumentations in Node.js and browser.
4
4
5
5
## Types
6
6
@@ -14,11 +14,11 @@ These typescript `interface`s, `type`s, `enum`s and js `const`ants statements SH
14
14
15
15
#### Exporting
16
16
17
-
All types from `types.ts` file MUST be exported from instrumentation `index.ts` using export statement `export * from './types'`, which guarentee that they publicly available.
17
+
All types from `types.ts` file MUST be exported from instrumentation `index.ts` using export statement `export * from './types'`, which guarantee that they publicly available.
18
18
19
19
#### Breaking Changes
20
20
21
-
Since these types are publicly exported, a breaking change in this file can cause transpilation issues or require code changes for existing users. Special care and attention should be put when modifiying this file to guarantee backword compatibility or proper documentation of breaking changes.
21
+
Since these types are publicly exported, a breaking change in this file can cause transpilation issues or require code changes for existing users. Special care and attention should be put when modifying this file to guarantee backward compatibility or proper documentation of breaking changes.
22
22
23
23
### Internal Types
24
24
@@ -30,15 +30,15 @@ It is sometimes convenient to place these declarations in a dedicated file which
30
30
31
31
The file SHOULD be named `internal-types.ts`.
32
32
33
-
Using this file is optional - when a type is used only in a single file, it is ok to declare it and use it in this file **without exporting it**. When a type is expected to be shared between multiple files, it is encourged to be declared in `internal-types.ts` to prevent circular dependencies.
33
+
Using this file is optional - when a type is used only in a single file, it is ok to declare it and use it in this file **without exporting it**. When a type is expected to be shared between multiple files, it is encouraged to be declared in `internal-types.ts` to prevent circular dependencies.
34
34
35
35
#### Exporting
36
36
37
-
This file MUST NOT be exported publicly from instrumentation package, not directly (via `index.ts`) and not transitivly via export of other files.
37
+
This file MUST NOT be exported publicly from instrumentation package, not directly (via `index.ts`) and not transitively via export of other files.
38
38
39
39
#### Changes
40
40
41
-
Since the declarations in this file are not exported in the public instrumentation api, it is allowed to apply any refactors to this file, and they will not be breaking changes to users.
41
+
Since the declarations in this file are not exported in the public instrumentation API, it is allowed to apply any refactors to this file, and they will not be breaking changes to users.
42
42
43
43
## Dependencies
44
44
@@ -48,7 +48,7 @@ Since instrumentations will install all their dependencies into the end user `no
48
48
49
49
### OpenTelemetry API
50
50
51
-
Instrumentation SHOULD NOT add a dependency on `@opentelemetry/api`, as using multiple instrumentations might install multiple api versions into the user node_modules directory. It SHOULD add an entry in `"peerDependencies"` in `package.json` with the **minimum**api version it requires, as caret range (for example: `^1.0.0`).
51
+
Instrumentation SHOULD NOT add a dependency on `@opentelemetry/api`, as using multiple instrumentations might install multiple API versions into the user node_modules directory. It SHOULD add an entry in `"peerDependencies"` in `package.json` with the **minimum**API version it requires, as caret range (for example: `^1.0.0`).
52
52
53
53
Users and distributions need to install a version of `@opentelemetry/api` that is compatible with the instrumentation to use it.
54
54
@@ -64,14 +64,14 @@ Instrumentations SHOULD NOT add a `"dependency"` or `"peerDependencies"` on the
64
64
65
65
This means that the instrumentation code SHOULD NOT `import` anywhere from the instrumented package. e.g. `@opentelemetry/instrumentation-foo` cannot `import 'foo'` as it will fail for applications that installed the instrumentation but not the `foo` package itself, which is a valid and supported use case for OpenTelemetry distributions and end users.
66
66
67
-
It is allowed, however, to import `types` from the instrumented package with the [`import type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export) syntax, as long as this type is not used in the public api:
67
+
It is allowed, however, to import `types` from the instrumented package with the [`import type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export) syntax, as long as this type is not used in the public API:
68
68
69
69
```js
70
70
// instrumentation.ts
71
71
importtype { Bar } from'foo'; // OK
72
72
```
73
73
74
-
Since the instrumented package is installed as a dev dependency, types are available during compiling. Since they are not part of the public api, typescript removes these imports from the build artifacts during transpilation.
74
+
Since the instrumented package is installed as a dev dependency, types are available during compiling. Since they are not part of the public API, typescript removes these imports from the build artifacts during transpilation.
75
75
76
76
### Types Public API
77
77
@@ -89,7 +89,7 @@ Note that types that are used in non-public files (like `internal-types.ts` or `
89
89
90
90
### Adding Types in Public API
91
91
92
-
Sometimes, instrumented package types are needed in an instrumentation's public api. These are mostly found in `types.ts` file on instrumentation config hooks that include data from the package and want to type it for consumers.
92
+
Sometimes, instrumented package types are needed in an instrumentation's public API. These are mostly found in `types.ts` file on instrumentation config hooks that include data from the package and want to type it for consumers.
93
93
94
94
To support this use case, you can choose one of the following options:
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@
36
36
37
37
---
38
38
39
-
# OpenTelemetry Javascript Contrib
39
+
# OpenTelemetry JavaScript Contrib
40
40
41
41
A repository for OpenTelemetry JavaScript contributions that are not part of the [core repository](https://github.com/open-telemetry/opentelemetry-js) and core distribution of the API and the SDK.
Copy file name to clipboardExpand all lines: examples/react-load/preact/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
The React Load plugin provides auto-instrumentation for react lifecycle methods.
4
4
This example uses the plugin and exports them to the console.
5
5
6
-
The example will show traces belong to the mounting, updating, and umounting flows as defined by React 16.4+. In this example we can show how this plugin can also be used in a Preact app.
6
+
The example will show traces belong to the mounting, updating, and unmounting flows as defined by React 16.4+. In this example we can show how this plugin can also be used in a Preact app.
0 commit comments