Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mongoose query profiles not decoding properly with @sentry/nestjs #12872

Closed
3 tasks done
unix-system opened this issue Jul 11, 2024 · 1 comment
Closed
3 tasks done

Mongoose query profiles not decoding properly with @sentry/nestjs #12872

unix-system opened this issue Jul 11, 2024 · 1 comment

Comments

@unix-system
Copy link

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which SDK are you using?

@sentry/nestjs

SDK Version

8.16.0

Framework Version

Nest.js 10.3.10

Link to Sentry event

No response

SDK Setup/Reproduction Example

// (in instrument.ts, required first in main.ts)
import * as Sentry from '@sentry/nestjs';
import { nodeProfilingIntegration } from '@sentry/profiling-node';

// Ensure to call this before importing any other modules!
Sentry.init({
	dsn: process.env.SENTRY_DSN,
	release: process.env.SHA,
	environment: process.env.API_STAGE === 'dev' ? 'dev' : 'production',
	debug: false,

	integrations: [
		// Add our Profiling integration
		nodeProfilingIntegration(),
		Sentry.mongooseIntegration(),
	],

	// Add Tracing by setting tracesSampleRate
	// We recommend adjusting this value in production
	tracesSampleRate: 1.0,

	// Set sampling rate for profiling
	// This is relative to tracesSampleRate
	profilesSampleRate: 1.0,
});

Steps to Reproduce

  1. Use Mongoose profiler (with or without explicitly declaring it) with Nest.js and new @sentry/nestjs SDK. (Mongoose version 8.5.0)
  2. Look for any auto.db.otel.mongo profile spans

Expected Result

Should show rich database information, i.e. what query was performed

Actual Result

Query result in the db.statement field looks like this: {"find":"?","filter":{"userId":"?"},"limit":"?","singleBatch":"?","batchSize":"?"} or this:

{"find":"?","filter":{"_id":{"$in":[{"buffer":{"0":"?","1":"?","2":"?","3":"?","4":"?","5":"?","6":"?","7":"?","8":"?","9":"?","10":"?","11":"?"}},{"buffer":{"0":"?","1":"?","2":"?","3":"?","4":"?","5":"?","6":"?","7":"?","8":"?","9":"?","10":"?","11":"?"}},{"buffer":{"0":"?","1":"?","2":"?","3":"?","4":"?","5":"?","6":"?","7":"?","8":"?","9":"?","10":"?","11":"?"}},{"buffer":{"0":"?","1":"?","2":"?","3":"?","4":"?","5":"?","6":"?","7":"?","8":"?","9":"?","10":"?","11":"?"}},{"buffer":{"0":"?","1":"?","2":"?","3":"?","4":"?","5":"?","6":"?","7":"?","8":"?","9":"?","10":"?","11":"?"}},{"buffer":{"0":"?","1":"?","2":"?","3":"?","4":"?","5":"?","6":"?","7":"?","8":"?","9":"?","10":"?","11":"?"}}]}}}
@mydea
Copy link
Member

mydea commented Jul 11, 2024

Hey,

this is a duplicate of #11499 - sadly, we do not support mongoose v7 & v8 as of now. You can follow the progress on this in the linked issue!

@mydea mydea closed this as not planned Won't fix, can't repro, duplicate, stale Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants