@opentelemetry/hapi-instrumentation
Advanced tools
Comparing version 0.13.1 to 0.14.0
@@ -35,7 +35,7 @@ "use strict"; | ||
patch() { | ||
this._logger.debug('Patching Hapi'); | ||
api_1.diag.debug('Patching Hapi'); | ||
if (this._moduleExports == null) { | ||
return this._moduleExports; | ||
} | ||
this._logger.debug('Patching Hapi.server'); | ||
api_1.diag.debug('Patching Hapi.server'); | ||
shimmer.wrap(this._moduleExports, 'server', this._getServerPatch.bind(this)); | ||
@@ -47,3 +47,3 @@ // Casting as any is necessary here due to an issue with the @types/hapi__hapi | ||
// Function is defined at: https://github.com/hapijs/hapi/blob/main/lib/index.js#L9 | ||
this._logger.debug('Patching Hapi.Server'); | ||
api_1.diag.debug('Patching Hapi.Server'); | ||
shimmer.wrap( | ||
@@ -58,3 +58,3 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
unpatch() { | ||
this._logger.debug('Unpatching Hapi'); | ||
api_1.diag.debug('Unpatching Hapi'); | ||
shimmer.massUnwrap([this._moduleExports], ['server', 'Server']); | ||
@@ -101,3 +101,3 @@ } | ||
const instrumentation = this; | ||
this._logger.debug('Patching Hapi.Server register function'); | ||
api_1.diag.debug('Patching Hapi.Server register function'); | ||
return function register(pluginInput, options) { | ||
@@ -128,3 +128,3 @@ var _a, _b, _c, _d; | ||
const instrumentation = this; | ||
instrumentation._logger.debug('Patching Hapi.Server ext function'); | ||
api_1.diag.debug('Patching Hapi.Server ext function'); | ||
return function ext(...args) { | ||
@@ -170,3 +170,3 @@ if (Array.isArray(args[0])) { | ||
const instrumentation = this; | ||
instrumentation._logger.debug('Patching Hapi.Server route function'); | ||
api_1.diag.debug('Patching Hapi.Server route function'); | ||
return function route(route) { | ||
@@ -173,0 +173,0 @@ if (Array.isArray(route)) { |
@@ -1,2 +0,2 @@ | ||
import { Attributes } from '@opentelemetry/api'; | ||
import { SpanAttributes } from '@opentelemetry/api'; | ||
import type * as Hapi from '@hapi/hapi'; | ||
@@ -10,9 +10,9 @@ import { PatchableExtMethod, ServerExtDirectInput } from './types'; | ||
export declare const getRouteMetadata: (route: Hapi.ServerRoute, pluginName?: string | undefined) => { | ||
attributes: Attributes; | ||
attributes: SpanAttributes; | ||
name: string; | ||
}; | ||
export declare const getExtMetadata: (extPoint: Hapi.ServerRequestExtType, pluginName?: string | undefined) => { | ||
attributes: Attributes; | ||
attributes: SpanAttributes; | ||
name: string; | ||
}; | ||
//# sourceMappingURL=utils.d.ts.map |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.13.1"; | ||
export declare const VERSION = "0.14.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.VERSION = '0.13.1'; | ||
exports.VERSION = '0.14.0'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@opentelemetry/hapi-instrumentation", | ||
"version": "0.13.1", | ||
"version": "0.14.0", | ||
"description": "OpenTelemetry Hapi automatic instrumentation package.", | ||
@@ -45,5 +45,5 @@ "main": "build/src/index.js", | ||
"@hapi/hapi": "20.0.1", | ||
"@opentelemetry/context-async-hooks": "0.15.0", | ||
"@opentelemetry/node": "0.15.0", | ||
"@opentelemetry/tracing": "0.15.0", | ||
"@opentelemetry/context-async-hooks": "0.18.0", | ||
"@opentelemetry/node": "0.18.0", | ||
"@opentelemetry/tracing": "0.18.0", | ||
"@types/hapi__hapi": "20.0.1", | ||
@@ -66,8 +66,8 @@ "@types/mocha": "7.0.2", | ||
"dependencies": { | ||
"@opentelemetry/api": "^0.15.0", | ||
"@opentelemetry/core": "^0.15.0", | ||
"@opentelemetry/semantic-conventions": "^0.15.0", | ||
"@opentelemetry/api": "^0.18.0", | ||
"@opentelemetry/core": "^0.18.0", | ||
"@opentelemetry/semantic-conventions": "^0.18.0", | ||
"shimmer": "^1.2.1" | ||
}, | ||
"gitHead": "fa0700bae22c5e3d6f007b4353ed18f1f53a6c69" | ||
"gitHead": "7a87f4105ff432380132d81f56a33e3f5c4e8fb1" | ||
} |
@@ -24,14 +24,24 @@ # OpenTelemetry Hapi Instrumentation for Node.js | ||
To load a specific instrumentation (Hapi in this case), specify it in the Node Tracer's configuration. | ||
To load a specific instrumentation (Hapi in this case), specify it in the registerInstrumentations' configuration. | ||
```js | ||
const { NodeTracerProvider } = require('@opentelemetry/node'); | ||
const { registerInstrumentations } = require('@opentelemetry/instrumentation'); | ||
const provider = new NodeTracerProvider({ | ||
plugins: { | ||
'@hapi/hapi': { | ||
enabled: true, | ||
// You may use a package name or absolute path to the file. | ||
path: '@opentelemetry/hapi-instrumentation', | ||
} | ||
} | ||
const provider = new NodeTracerProvider(); | ||
provider.register(); | ||
registerInstrumentations({ | ||
instrumentations: [ | ||
{ | ||
plugins: { | ||
'@hapi/hapi': { | ||
enabled: true, | ||
// You may use a package name or absolute path to the file. | ||
path: '@opentelemetry/hapi-instrumentation', | ||
} | ||
}, | ||
}, | ||
], | ||
tracerProvider: provider, | ||
}); | ||
@@ -43,4 +53,10 @@ ``` | ||
const { NodeTracerProvider } = require('@opentelemetry/node'); | ||
const { registerInstrumentations } = require('@opentelemetry/instrumentation'); | ||
const provider = new NodeTracerProvider(); | ||
provider.register(); | ||
registerInstrumentations({ | ||
tracerProvider: provider, | ||
}); | ||
``` | ||
@@ -47,0 +63,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45551
84
+ Added@opentelemetry/api@0.18.1(transitive)
+ Added@opentelemetry/core@0.18.2(transitive)
+ Added@opentelemetry/semantic-conventions@0.18.2(transitive)
- Removed@opentelemetry/api@0.15.0(transitive)
- Removed@opentelemetry/context-base@0.15.0(transitive)
- Removed@opentelemetry/core@0.15.0(transitive)
- Removed@opentelemetry/semantic-conventions@0.15.0(transitive)
Updated@opentelemetry/api@^0.18.0
Updated@opentelemetry/core@^0.18.0