Skip to content

Commit

Permalink
Merge branch 'main' into async-hooks-no-leak
Browse files Browse the repository at this point in the history
  • Loading branch information
Flarna authored Feb 22, 2021
2 parents c21a21a + 38d1ee2 commit 4db9cd7
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 17 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ To request automatic tracing support for a module not on this list, please [file

## Upgrade guidelines

### 0.17.0 to ???
### 0.16.0 to 0.17.0

[PR-1880](https://github.com/open-telemetry/opentelemetry-js/pull/1880) feat(diag-logger): introduce a new global level api.diag for internal diagnostic logging

Expand Down Expand Up @@ -291,8 +291,6 @@ diag.setLogger();

```

### 0.16.0 to 0.17.0

[PR-1855](https://github.com/open-telemetry/opentelemetry-js/pull/1855) Use instrumentation loader to load plugins and instrumentations

- Providers do no load the plugins anymore. Also PluginLoader has been removed from providers, use `registerInstrumentations` instead
Expand Down
5 changes: 4 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ module.exports = {
"leadingUnderscore": "require"
}
],
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["warn"],
"@typescript-eslint/no-unused-vars": ["error", {"argsIgnorePattern": "^_", "args": "after-used"}],
"@typescript-eslint/no-inferrable-types": ["error", { ignoreProperties: true }],
"arrow-parens": ["error", "as-needed"],
Expand All @@ -43,7 +45,8 @@ module.exports = {
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-var-requires": "off"
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-shadow": ["off"],
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ export class HttpBaggage implements TextMapPropagator {
pairs.forEach(entry => {
const keyPair = this._parsePairKeyValue(entry);
if (keyPair) {
const entry: BaggageEntry = { value: keyPair.value };
const baggageEntry: BaggageEntry = { value: keyPair.value };
if (keyPair.metadata) {
entry.metadata = keyPair.metadata;
baggageEntry.metadata = keyPair.metadata;
}
baggage[keyPair.key] = entry;
baggage[keyPair.key] = baggageEntry;
}
});
if (Object.entries(baggage).length === 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ export function sendWithHttp<ExportItem, ServiceRequest>(
const request = parsedUrl.protocol === 'http:' ? http.request : https.request;

const req = request(options, (res: http.IncomingMessage) => {
let data = '';
res.on('data', chunk => (data += chunk));
let responseData = '';
res.on('data', chunk => (responseData += chunk));
res.on('end', () => {
if (res.statusCode && res.statusCode < 299) {
diag.debug(`statusCode: ${res.statusCode}`, data);
diag.debug(`statusCode: ${res.statusCode}`, responseData);
onSuccess();
} else {
const error = new collectorTypes.CollectorExporterError(
res.statusMessage,
res.statusCode,
data
responseData
);
onError(error);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/opentelemetry-instrumentation-http/src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,11 @@ export class HttpInstrumentation extends InstrumentationBase<Http> {
request.on(
'response',
(response: http.IncomingMessage & { aborted?: boolean }) => {
const attributes = utils.getOutgoingRequestAttributesOnResponse(
const responseAttributes = utils.getOutgoingRequestAttributesOnResponse(
response,
{ hostname }
);
span.setAttributes(attributes);
span.setAttributes(responseAttributes);
if (this._getConfig().responseHook) {
this._callResponseHook(span, response);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/opentelemetry-metrics/src/Meter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,11 @@ export class Meter implements api.Meter {
await Promise.all(observations);

// after this all remaining metrics can be run
const metrics = Array.from(this._metrics.values()).map(metric => {
const metricsRecords = Array.from(this._metrics.values()).map(metric => {
return metric.getMetricRecord();
});

await Promise.all(metrics).then(records => {
await Promise.all(metricsRecords).then(records => {
records.forEach(metrics => {
metrics.forEach(metric => this._processor.process(metric));
});
Expand Down
4 changes: 2 additions & 2 deletions packages/opentelemetry-plugin-http/src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,11 @@ export class HttpPlugin extends BasePlugin<Http> {
request.on(
'response',
(response: IncomingMessage & { aborted?: boolean }) => {
const attributes = utils.getOutgoingRequestAttributesOnResponse(
const responseAttributes = utils.getOutgoingRequestAttributesOnResponse(
response,
{ hostname }
);
span.setAttributes(attributes);
span.setAttributes(responseAttributes);
if (this._config.responseHook) {
this._callResponseHook(span, response);
}
Expand Down

0 comments on commit 4db9cd7

Please sign in to comment.