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

Ignore file-upload meteor-method by ostrio:files [2] #45

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Complete list of [Agent options](https://www.elastic.co/guide/en/apm/agent/nodej
## What it monitors

1. Meteor methods: method params, result, exceptions, stack trace
* Ignores methods starting with `_FilesCollectionWrite_`. (See: https://github.com/Meteor-Community-Packages/meteor-elastic-apm/issues/30)
2. Meteor pub/sub: tracks publications response time, params, exceptions, result
3. Meteor collection methods(find, insert, etc...): params, result, execution time
4. MongoDB cursor method(fetch, map, etc...): params, result, execution time
Expand Down
8 changes: 7 additions & 1 deletion instrumenting/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ function start(agent, Session) {
function wrapSession(sessionProto) {
shimmer.wrap(sessionProto, 'processMessage', function(original) {
return function(msg) {
if (msg.msg === 'method' || msg.msg === 'sub') {
if (
(msg.msg === 'method' &&
// _FilesCollectionWrite_ is a prefix for meteor-methods used by meteor/ostrio:files which is used to
// send files via DDP to the server. Monitoring these routes send the file - byte-serialized - to the monitoring system.
!msg.method.startsWith('_FilesCollectionWrite_')) ||
msg.msg === 'sub'
) {
const name = msg.msg === 'method' ? msg.method : msg.name;
const type = msg.msg;
const transaction = agent.startTransaction(name, type);
Expand Down