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

Support Meteor 3 #93

Open
wants to merge 339 commits into
base: master
Choose a base branch
from
Open

Support Meteor 3 #93

wants to merge 339 commits into from

Conversation

leonardoventurini
Copy link
Contributor

@leonardoventurini leonardoventurini commented Feb 3, 2023

Remove fibers from the agent and integrate with Async Hooks and Async Local Storage.

@leonardoventurini
Copy link
Contributor Author

Milestone

Tests pass on Meteor's future release 3.0 branch

image

@leonardoventurini
Copy link
Contributor Author

Right now there is no way to know if a promise has been awaited or resolved in the background. What we can do is assume that an event which does not have other events in parallel has been awaited.

lib/tracer/tracer.js Outdated Show resolved Hide resolved
lib/tracer/tracer.js Outdated Show resolved Hide resolved
lib/tracer/tracer.js Outdated Show resolved Hide resolved
lib/tracer/tracer.js Outdated Show resolved Hide resolved
lib/tracer/tracer.js Outdated Show resolved Hide resolved
lib/tracer/tracer.js Outdated Show resolved Hide resolved
lib/tracer/tracer.js Outdated Show resolved Hide resolved
lib/tracer/tracer.js Outdated Show resolved Hide resolved
lib/ntp.js Outdated Show resolved Hide resolved
@@ -81,12 +80,6 @@ SystemModel.prototype.buildPayload = function () {
metrics.mongoPoolCheckedOutConnections = driverMetrics.checkedOut;
metrics.mongoPoolCreatedConnections = driverMetrics.created;

const fiberMetrics = getFiberMetrics();
Copy link
Member

@zodern zodern Jun 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would there be any async hooks/ALS metrics that would be useful instead? Can we track how many hooks or ASL stores are being used in the app?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can, will research.

lib/common/utils.js Outdated Show resolved Hide resolved
lib/common/utils.js Show resolved Hide resolved
lib/als/async-hook.js Outdated Show resolved Hide resolved
lib/als/async-hook.js Outdated Show resolved Hide resolved
lib/als/async-hook.js Outdated Show resolved Hide resolved
lib/als/async-hook.js Outdated Show resolved Hide resolved
lib/als/async-hook.js Outdated Show resolved Hide resolved
lib/als/async-hook.js Outdated Show resolved Hide resolved
@StorytellerCZ
Copy link

StorytellerCZ commented Jul 31, 2024

Got the following error when trying beta 5:

I20240731-19:41:18.179(2)? error on boot.js TypeError: Cannot read properties of undefined (reading 'prototype')
I20240731-19:41:18.179(2)?     at hijackNextObject (packages/montiapm:agent/lib/hijack/db/hijack-next-object.js:6:42)
I20240731-19:41:18.180(2)?     at hijackDBOps (packages/montiapm:agent/lib/hijack/db/index.js:46:3)
I20240731-19:41:18.180(2)?     at packages/montiapm:agent/lib/hijack/instrument.js:58:5
I20240731-19:41:18.180(2)?     at initAsync (packages/montiapm:meteorx/src/server.js:40:11)
I20240731-19:41:18.180(2)?     at processTicksAndRejections (node:internal/process/task_queues:95:5)
I20240731-19:41:18.181(2)?     at /tools/static-assets/server/boot.js:453:5
I20240731-19:41:18.181(2)?     at /tools/static-assets/server/boot.js:504:7
I20240731-19:41:18.181(2)?     at startServerProcess (/tools/static-assets/server/boot.js:501:3)
I20240731-19:41:18.181(2)? TypeError: Cannot read properties of undefined (reading 'prototype')
I20240731-19:41:18.182(2)?     at hijackNextObject (packages/montiapm:agent/lib/hijack/db/hijack-next-object.js:6:42)
I20240731-19:41:18.182(2)?     at hijackDBOps (packages/montiapm:agent/lib/hijack/db/index.js:46:3)
I20240731-19:41:18.182(2)?     at packages/montiapm:agent/lib/hijack/instrument.js:58:5
I20240731-19:41:18.182(2)?     at initAsync (packages/montiapm:meteorx/src/server.js:40:11)
I20240731-19:41:18.182(2)?     at processTicksAndRejections (node:internal/process/task_queues:95:5)
I20240731-19:41:18.182(2)?     at /tools/static-assets/server/boot.js:453:5
I20240731-19:41:18.182(2)?     at /tools/static-assets/server/boot.js:504:7
I20240731-19:41:18.183(2)?     at startServerProcess (/tools/static-assets/server/boot.js:501:3)

Initially couldn't even install because of this: meteor/meteor#13268

My packages:

[email protected]                 # Packages every Meteor app needs to have
[email protected]           # Packages for a great mobile UX
[email protected]                       # The database Meteor supports right now
[email protected]                # Reactive variable for tracker
[email protected]                     # Meteor's client-side reactive programming library

[email protected]        # JS minifier run for production mode
[email protected]                    # ECMAScript 5 compatibility for older browsers.
[email protected]                  # Enable ECMAScript2015+ syntax in app code
[email protected]                # Server-side component of the `meteor shell` command

# testing

# development
percolate:migrations

# technical from Meteor
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
react-meteor-data
[email protected]
[email protected]
mdg:seo
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

# GraphQL
apollo
swydo:graphql

# collections
aldeed:simple-schema
aldeed:collection2
aldeed:schema-deny

natestrauser:publish-performant-counts
reywood:publish-composite
matb33:[email protected]

# jam
jam:pub-sub
jam:offline

# socialize
socialize:base-model
socialize:commentable
socialize:friendships
socialize:likeable
socialize:linkable-model
socialize:messaging
socialize:postable
socialize:requestable
socialize:server-presence
socialize:server-time
socialize:user-blocking
socialize:user-model
socialize:user-presence
socialize:user-profile
socialize:feed
socialize:voteable

# accounts
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
bozhao:link-accounts
storyteller:accounts-line
[email protected]
freedombase:legal-management
react-meteor-state
react-meteor-accounts
storyteller:accounts-discord
storyteller:accounts-betapass

# LU specific
storyteller:fictionaltime
freedombase:forums
lu-intl

# Financial packages
freedombase:payments-core
freedombase:payments-provider-stripe
freedombase:payments-subscriptions
freedombase:payments-platform
freedombase:payments-checkout

# other
alanning:roles@=4.0.0-rc.2
freedombase:flashnews
storyteller:ssl
zodern:types
storyteller:cdn
msavin:sjobs
ostrio:spiderable-middleware

montiapm:agent@=3.0.0-beta.5

@zodern
Copy link
Member

zodern commented Jul 31, 2024

Thanks @StorytellerCZ. I'll look into it this week.

@brianlukoff
Copy link

@zodern I'm seeing the same error as @StorytellerCZ when trying to use the 3.0 beta -- it seems to be a conflict with matb33:collection-hooks starting with version 2.0.0-rc.0 of that package -- if I revert matb33:collection-hooks back to 2.0.0-beta.2 then there is no problem.

@StorytellerCZ
Copy link

Collection hooks recently got a fix from MS core team on one thing, so it might be a good idea to test again.

@brianlukoff
Copy link

@StorytellerCZ I had tried with 2.0.0-rc.3 -- is that the latest? (I was just trying to figure out which version of collection-hooks introduced the incompatibility and it looks like it was rc.0.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants