Skip to content

Commit

Permalink
Merge branch 'main' into override-idGenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
haddasbronfman authored Mar 2, 2023
2 parents ef5c72a + 31dd7b7 commit a95639b
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 5 deletions.
1 change: 1 addition & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"produceSourceMap": false,
"extension": [
".ts"
],
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/
### :bug: (Bug Fix)

* fix(core): added falsy check to make otel core work with browser where webpack config had process as false or null [#3613](https://github.com/open-telemetry/opentelemetry-js/issues/3613) @ravindra-dyte
* fix(instrumentation-http): include query params in http.target [#3646](https://github.com/open-telemetry/opentelemetry-js/pull/3646) @kobi-co

### :books: (Refine Doc)

### :house: (Internal)

* fix(sdk-metrics): ix flaky LastValueAggregator test by using fake timer [#3587](https://github.com/open-telemetry/opentelemetry-js/pull/3587) @pichlermarc
* fix(sdk-metrics): fix flaky LastValueAggregator test by using fake timer [#3587](https://github.com/open-telemetry/opentelemetry-js/pull/3587) @pichlermarc
* fix(test): fix failing tests by preventing source-map generation [#3642](https://github.com/open-telemetry/opentelemetry-js/pull/3642) @pichlermarc

## 1.9.1

Expand Down
1 change: 1 addition & 0 deletions api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
### :bug: (Bug Fix)

* fix(metrics): export `MetricsAPI` type [#3535](https://github.com/open-telemetry/opentelemetry-js/pull/3535)
* fix(api): rename `LoggerOptions` to `DiagLoggerOptions` [#3641](https://github.com/open-telemetry/opentelemetry-js/pull/3641)

## 1.4.0

Expand Down
6 changes: 3 additions & 3 deletions api/src/diag/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export interface ComponentLoggerOptions {
namespace: string;
}

export interface LoggerOptions {
export interface DiagLoggerOptions {
/**
* The {@link DiagLogLevel} used to filter logs sent to the logger.
*
Expand All @@ -117,10 +117,10 @@ export interface DiagLoggerApi {
* If a global diag logger is already set, this will override it.
*
* @param logger - The {@link DiagLogger} instance to set as the default logger.
* @param options - A {@link LoggerOptions} object. If not provided, default values will be set.
* @param options - A {@link DiagLoggerOptions} object. If not provided, default values will be set.
* @returns `true` if the logger was successfully registered, else `false`
*/
setLogger(logger: DiagLogger, options?: LoggerOptions): boolean;
setLogger(logger: DiagLogger, options?: DiagLoggerOptions): boolean;

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ export const getIncomingRequestAttributes = (
}

if (requestUrl) {
attributes[SemanticAttributes.HTTP_TARGET] = requestUrl.pathname || '/';
attributes[SemanticAttributes.HTTP_TARGET] = requestUrl.path || '/';
}

if (userAgent !== undefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,23 @@ describe('Utility', () => {
});
assert.strictEqual(attributes[SemanticAttributes.HTTP_ROUTE], undefined);
});

it('should set http.target as path in http span attributes', () => {
const request = {
url: 'http://hostname/user/?q=val',
method: 'GET',
} as IncomingMessage;
request.headers = {
'user-agent': 'chrome',
};
const attributes = utils.getIncomingRequestAttributes(request, {
component: 'http',
});
assert.strictEqual(
attributes[SemanticAttributes.HTTP_TARGET],
'/user/?q=val'
);
});
});

describe('headers to span attributes capture', () => {
Expand Down

0 comments on commit a95639b

Please sign in to comment.