@opentelemetry/instrumentation-grpc
Advanced tools
Comparing version 0.35.1 to 0.36.0
@@ -108,2 +108,7 @@ "use strict"; | ||
}); | ||
instrumentation._metadataCapture.server.captureRequestMetadata(span, call.metadata); | ||
instrumentation._wrap(call, 'sendMetadata', originalSendMetadata => (responseMetadata) => { | ||
instrumentation._metadataCapture.server.captureResponseMetadata(span, responseMetadata); | ||
originalSendMetadata.call(call, responseMetadata); | ||
}); | ||
api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { | ||
@@ -199,3 +204,3 @@ serverUtils_1.handleServerFunction.call(self, span, type, originalFunc, call, callback); | ||
_createMetadataCapture() { | ||
var _a, _b, _c, _d, _e, _f; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; | ||
const config = this.getConfig(); | ||
@@ -207,2 +212,6 @@ return { | ||
}, | ||
server: { | ||
captureRequestMetadata: (0, utils_1.metadataCapture)('request', (_j = (_h = (_g = config.metadataToSpanAttributes) === null || _g === void 0 ? void 0 : _g.server) === null || _h === void 0 ? void 0 : _h.requestMetadata) !== null && _j !== void 0 ? _j : []), | ||
captureResponseMetadata: (0, utils_1.metadataCapture)('response', (_m = (_l = (_k = config.metadataToSpanAttributes) === null || _k === void 0 ? void 0 : _k.server) === null || _l === void 0 ? void 0 : _l.responseMetadata) !== null && _m !== void 0 ? _m : []), | ||
}, | ||
}; | ||
@@ -209,0 +218,0 @@ } |
@@ -125,2 +125,7 @@ "use strict"; | ||
}); | ||
instrumentation._metadataCapture.server.captureRequestMetadata(span, call.metadata); | ||
instrumentation._wrap(call, 'sendMetadata', originalSendMetadata => (responseMetadata) => { | ||
instrumentation._metadataCapture.server.captureResponseMetadata(span, responseMetadata); | ||
originalSendMetadata.call(call, responseMetadata); | ||
}); | ||
api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { | ||
@@ -207,3 +212,3 @@ switch (type) { | ||
_createMetadataCapture() { | ||
var _a, _b, _c, _d, _e, _f; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; | ||
const config = this.getConfig(); | ||
@@ -215,2 +220,6 @@ return { | ||
}, | ||
server: { | ||
captureRequestMetadata: (0, utils_1.metadataCapture)('request', (_j = (_h = (_g = config.metadataToSpanAttributes) === null || _g === void 0 ? void 0 : _g.server) === null || _h === void 0 ? void 0 : _h.requestMetadata) !== null && _j !== void 0 ? _j : []), | ||
captureResponseMetadata: (0, utils_1.metadataCapture)('response', (_m = (_l = (_k = config.metadataToSpanAttributes) === null || _k === void 0 ? void 0 : _k.server) === null || _l === void 0 ? void 0 : _l.responseMetadata) !== null && _m !== void 0 ? _m : []), | ||
}, | ||
}; | ||
@@ -217,0 +226,0 @@ } |
@@ -9,3 +9,7 @@ import { Span } from '@opentelemetry/api'; | ||
}; | ||
server: { | ||
captureRequestMetadata: (span: Span, metadata: grpcJsTypes.Metadata | grpcTypes.Metadata) => void; | ||
captureResponseMetadata: (span: Span, metadata: grpcJsTypes.Metadata | grpcTypes.Metadata) => void; | ||
}; | ||
}; | ||
//# sourceMappingURL=internal-types.d.ts.map |
@@ -11,4 +11,8 @@ import { InstrumentationConfig } from '@opentelemetry/instrumentation'; | ||
}; | ||
server?: { | ||
responseMetadata?: string[]; | ||
requestMetadata?: string[]; | ||
}; | ||
}; | ||
} | ||
//# sourceMappingURL=types.d.ts.map |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.35.1"; | ||
export declare const VERSION = "0.36.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.VERSION = '0.35.1'; | ||
exports.VERSION = '0.36.0'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@opentelemetry/instrumentation-grpc", | ||
"version": "0.35.1", | ||
"version": "0.36.0", | ||
"description": "OpenTelemetry grpc automatic instrumentation package.", | ||
@@ -50,7 +50,7 @@ "main": "build/src/index.js", | ||
"@grpc/proto-loader": "^0.7.3", | ||
"@opentelemetry/api": "^1.3.0", | ||
"@opentelemetry/context-async-hooks": "1.9.1", | ||
"@opentelemetry/core": "1.9.1", | ||
"@opentelemetry/sdk-trace-base": "1.9.1", | ||
"@opentelemetry/sdk-trace-node": "1.9.1", | ||
"@opentelemetry/api": "1.4.1", | ||
"@opentelemetry/context-async-hooks": "1.10.0", | ||
"@opentelemetry/core": "1.10.0", | ||
"@opentelemetry/sdk-trace-base": "1.10.0", | ||
"@opentelemetry/sdk-trace-node": "1.10.0", | ||
"@types/mocha": "10.0.0", | ||
@@ -75,8 +75,8 @@ "@types/node": "18.6.5", | ||
"dependencies": { | ||
"@opentelemetry/instrumentation": "0.35.1", | ||
"@opentelemetry/semantic-conventions": "1.9.1" | ||
"@opentelemetry/instrumentation": "0.36.0", | ||
"@opentelemetry/semantic-conventions": "1.10.0" | ||
}, | ||
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-grpc", | ||
"sideEffects": false, | ||
"gitHead": "279458e7ddf16f7ddca5fe60c78672e05fafce66" | ||
"gitHead": "56e6b1bb890f844b8963a146780d0b9cfa8abd0d" | ||
} |
@@ -50,3 +50,3 @@ # OpenTelemetry gRPC Instrumentation for Node.js | ||
| [`ignoreGrpcMethods`](https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/packages/opentelemetry-instrumentation-grpc/src/types.ts#L25) | `IgnoreMatcher[]` | gRPC instrumentation will not trace any methods that match anything in this list. You may pass a string (case-insensitive match), a `RegExp` object, or a filter function. | | ||
| [`metadataToSpanAttributes`](https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/packages/opentelemetry-instrumentation-grpc/src/types.ts#L27) | `object` | List of case insensitive metadata to convert to span attributes. Client (outgoing requests, incoming responses) metadata attributes will be converted to span attributes in the form of `rpc.{request\response}.metadata.metadata_key`, e.g. `rpc.response.metadata.date` | | ||
| [`metadataToSpanAttributes`](https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/packages/opentelemetry-instrumentation-grpc/src/types.ts#L27) | `object` | List of case insensitive metadata to convert to span attributes. Client and server (outgoing requests, incoming responses) metadata attributes will be converted to span attributes in the form of `rpc.{request\response}.metadata.metadata_key`, e.g. `rpc.response.metadata.date` | | ||
@@ -53,0 +53,0 @@ ## Useful links |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
203243
1681
+ Added@opentelemetry/instrumentation@0.36.0(transitive)
+ Added@opentelemetry/semantic-conventions@1.10.0(transitive)
+ Addedrequire-in-the-middle@6.0.0(transitive)
- Removed@opentelemetry/instrumentation@0.35.1(transitive)
- Removed@opentelemetry/semantic-conventions@1.9.1(transitive)
- Removedrequire-in-the-middle@5.2.0(transitive)