mongoose-xray
Advanced tools
Comparing version 3.0.3 to 3.1.0
@@ -45,7 +45,7 @@ const AWSXRay = require('aws-xray-sdk-core'); | ||
if (parent) { | ||
const subsegment = parent.addNewSubsegment( | ||
`${aggregate.model().modelName}-${operation}` | ||
); | ||
const subsegment = parent.addNewSubsegment('mongodb.aggregate'); | ||
subsegment.addAnnotation(`${aggregate.model().modelName}-${operation}`, 'aggregate'); | ||
subsegment.addAnnotation('model', aggregate.model().modelName); | ||
subsegment.addMetadata('operation', operation); | ||
subsegment.namespace = 'remote'; | ||
if (options && options.verbose) { | ||
@@ -52,0 +52,0 @@ subsegment.addMetadata('options', aggregate.options); |
@@ -50,6 +50,7 @@ const AWSXRay = require('aws-xray-sdk-core'); | ||
`${document.constructor.name}-${document.constructor.path}`; | ||
const subsegment = parent.addNewSubsegment(`${modelName}-${operation}`); | ||
const subsegment = parent.addNewSubsegment('mongodb.document'); | ||
subsegment.addAnnotation(`${modelName}-${operation}`, 'document'); | ||
subsegment.addAnnotation('model', modelName); | ||
subsegment.addMetadata('operation', operation); | ||
subsegment.namespace = 'remote'; | ||
if (options && options.verbose) { | ||
@@ -56,0 +57,0 @@ subsegment.addMetadata('document', JSON.stringify(document)); |
@@ -50,6 +50,8 @@ const AWSXRay = require('aws-xray-sdk-core'); | ||
const subsegment = parent.addNewSubsegment( | ||
`${model.modelName}-${operation}` | ||
'mongodb.model' | ||
); | ||
subsegment.addAnnotation(`${model.modelName}-${operation}`, 'model'); | ||
subsegment.addAnnotation('model', model.modelName); | ||
subsegment.addMetadata('operation', operation); | ||
subsegment.namespace = 'remote'; | ||
logDebugSafe( | ||
@@ -56,0 +58,0 @@ `Mongoose-XRay: Opened Subsegment: ${subsegment.id} Parent Segment: ${parent.id}` |
@@ -60,7 +60,7 @@ const AWSXRay = require('aws-xray-sdk-core'); | ||
if (parent) { | ||
const subsegment = parent.addNewSubsegment( | ||
`${query.model.modelName}-${operation}` | ||
); | ||
const subsegment = parent.addNewSubsegment('mongodb.query'); | ||
subsegment.addAnnotation(`${query.model.modelName}-${operation}`, 'query'); | ||
subsegment.addAnnotation('model', query.model.modelName); | ||
subsegment.addMetadata('operation', operation); | ||
subsegment.namespace = 'remote'; | ||
if (options && options.verbose) { | ||
@@ -67,0 +67,0 @@ subsegment.addMetadata( |
{ | ||
"name": "mongoose-xray", | ||
"version": "3.0.3", | ||
"version": "3.1.0", | ||
"description": "AWS-Xray plugin for Mongoose", | ||
@@ -24,22 +24,22 @@ "main": "lib/index.js", | ||
"@types/dirty-chai": "^2.0.2", | ||
"@types/node": "^10.17.24", | ||
"@types/node": "^10.17.26", | ||
"@types/mocha": "^7.0.2", | ||
"@types/mongoose": "^5.7.21", | ||
"@types/sinon": "^9.0.3", | ||
"@types/mongoose": "^5.7.29", | ||
"@types/sinon": "^9.0.4", | ||
"@types/sinon-chai": "^3.2.4", | ||
"aws-sdk": "^2.687.0", | ||
"aws-xray-sdk-core": "^3.0.1", | ||
"aws-xray-sdk-core": "^3.1.0", | ||
"chai": "^4.2.0", | ||
"dirty-chai": "^2.0.1", | ||
"eslint": "^7.2.0", | ||
"eslint": "^7.3.1", | ||
"eslint-config-prettier": "^6.11.0", | ||
"eslint-config-standard": "^14.1.1", | ||
"eslint-plugin-import": "^2.21.2", | ||
"eslint-plugin-import": "^2.22.0", | ||
"eslint-plugin-mocha": "^7.0.1", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-prettier": "^3.1.3", | ||
"eslint-plugin-prettier": "^3.1.4", | ||
"eslint-plugin-promise": "^4.2.1", | ||
"eslint-plugin-standard": "^4.0.1", | ||
"mocha": "^8.0.1", | ||
"mongoose": "^5.9.18", | ||
"mongoose": "^5.9.21", | ||
"prettier": "^2.0.5", | ||
@@ -46,0 +46,0 @@ "sinon": "^9.0.2", |
@@ -46,3 +46,3 @@ # mongoose-xray | ||
For all operations, XRay will record: | ||
- Model name + operation as the segment name | ||
- Model name + operation as an annotation | ||
- Model name as an annotation | ||
@@ -49,0 +49,0 @@ - Operation as metadata |
14824
324