Skip to content

Commit ef19dc3

Browse files
authored
Merge branch 'main' into decoded-body-size
2 parents eb2c20a + 2355717 commit ef19dc3

File tree

6 files changed

+19
-16
lines changed

6 files changed

+19
-16
lines changed

packages/opentelemetry-exporter-collector-proto/src/CollectorMetricExporter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { ServiceClientType } from './types';
2424
import { CollectorExporterNodeBase } from './CollectorExporterNodeBase';
2525
import { getEnv, baggageUtils } from '@opentelemetry/core';
2626

27-
const DEFAULT_COLLECTOR_URL = 'http://localhost:4317/v1/metrics';
27+
const DEFAULT_COLLECTOR_URL = 'http://localhost:55681/v1/metrics';
2828

2929
/**
3030
* Collector Metric Exporter for Node with protobuf

packages/opentelemetry-exporter-collector-proto/src/CollectorTraceExporter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
import { ServiceClientType } from './types';
2525
import { getEnv, baggageUtils } from '@opentelemetry/core';
2626

27-
const DEFAULT_COLLECTOR_URL = 'http://localhost:4317/v1/traces';
27+
const DEFAULT_COLLECTOR_URL = 'http://localhost:55681/v1/traces';
2828

2929
/**
3030
* Collector Trace Exporter for Node with protobuf

packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import * as types from '../../types';
1818
import * as path from 'path';
1919
import * as RequireInTheMiddle from 'require-in-the-middle';
20-
import * as semver from 'semver';
20+
import { satisfies } from 'semver';
2121
import { InstrumentationAbstract } from '../../instrumentation';
2222
import { InstrumentationModuleDefinition } from './types';
2323
import { diag } from '@opentelemetry/api';
@@ -50,7 +50,7 @@ export abstract class InstrumentationBase<T = any>
5050
if (this._modules.length === 0) {
5151
diag.warn(
5252
'No modules instrumentation has been defined,' +
53-
' nothing will be patched'
53+
' nothing will be patched'
5454
);
5555
}
5656

@@ -80,7 +80,7 @@ export abstract class InstrumentationBase<T = any>
8080
// main module
8181
if (
8282
typeof version === 'string' &&
83-
isSupported(module.supportedVersions, version)
83+
isSupported(module.supportedVersions, version, module.includePrerelease)
8484
) {
8585
if (typeof module.patch === 'function') {
8686
module.moduleExports = exports;
@@ -93,7 +93,7 @@ export abstract class InstrumentationBase<T = any>
9393
// internal file
9494
const files = module.files ?? [];
9595
const file = files.find(file => file.name === name);
96-
if (file && isSupported(file.supportedVersions, version)) {
96+
if (file && isSupported(file.supportedVersions, version, module.includePrerelease)) {
9797
file.moduleExports = exports;
9898
if (this._enabled) {
9999
return file.patch(exports, module.moduleVersion);
@@ -167,8 +167,8 @@ export abstract class InstrumentationBase<T = any>
167167
}
168168
}
169169

170-
function isSupported(supportedVersions: string[], version: string): boolean {
170+
function isSupported(supportedVersions: string[], version: string, includePrerelease?: boolean): boolean {
171171
return supportedVersions.some(supportedVersion => {
172-
return semver.satisfies(version, supportedVersion);
172+
return satisfies(version, supportedVersion, { includePrerelease });
173173
});
174174
}

packages/opentelemetry-instrumentation/src/platform/node/types.ts

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ export interface InstrumentationModuleDefinition<T> {
4747
/** Module internal files to be patched */
4848
files: InstrumentationModuleFile<any>[];
4949

50+
/** If set to true, the includePrerelease check will be included when calling semver.satisfies */
51+
includePrerelease?: boolean;
52+
5053
/** Method to patch the instrumentation */
5154
patch?: (moduleExports: T, moduleVersion?: string) => T;
5255

renovate.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"rangeStrategy": "bump"
1212
},
1313
{
14-
"matchPaths": ["backwards-compatibility/**"],
15-
"ignoreDeps": ["@types/node"],
14+
"matchPaths": ["backwards-compatibility"],
15+
"matchPackageNames": ["@types/node"],
1616
"enabled": false
1717
}
1818
],

website_docs/getting_started/browser.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Copy the following file into an empty directory and call it `index.html`.
1818
<html lang="en">
1919
<head>
2020
<meta charset="utf-8">
21-
<title>Document Load Plugin Example</title>
21+
<title>Document Load Instrumentation Example</title>
2222
<base href="/">
2323
<!--
2424
https://www.w3.org/TR/trace-context/
@@ -33,14 +33,14 @@ Copy the following file into an empty directory and call it `index.html`.
3333
<meta name="viewport" content="width=device-width, initial-scale=1">
3434
</head>
3535
<body>
36-
Example of using Web Tracer with document load plugin with console exporter and collector exporter
36+
Example of using Web Tracer with document load instrumentation with console exporter and collector exporter
3737
</body>
3838
</html>
3939
```
4040

4141
## Installation
4242

43-
To create traces in the browser, you will need `@opentelemetry/web`, and the plugin `@opentelemetry/plugin-document-load`:
43+
To create traces in the browser, you will need `@opentelemetry/web`, and the instrumentation `@opentelemetry/instrumentation-document-load`:
4444

4545
```shell
4646
npm init -y
@@ -59,7 +59,7 @@ We will add some code that will trace the document load timings and output those
5959

6060
## Creating a Tracer Provider
6161

62-
Add the following code to the `document-load.js` to create a tracer provider, which brings the plugin to trace document load:
62+
Add the following code to the `document-load.js` to create a tracer provider, which brings the instrumentaion to trace document load:
6363

6464
```javascript
6565
import { WebTracerProvider } from '@opentelemetry/web';
@@ -74,7 +74,7 @@ provider.register({
7474
contextManager: new ZoneContextManager(),
7575
});
7676

77-
// Registering instrumentations / plugins
77+
// Registering instrumentations
7878
registerInstrumentations({
7979
instrumentations: [
8080
new DocumentLoadInstrumentation(),
@@ -113,7 +113,7 @@ provider.register({
113113
contextManager: new ZoneContextManager(),
114114
});
115115

116-
// Registering instrumentations / plugins
116+
// Registering instrumentations
117117
registerInstrumentations({
118118
instrumentations: [
119119
new DocumentLoadInstrumentation(),

0 commit comments

Comments
 (0)