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

Add easier and generic instrumentation on Sequelize models #2613

Open
kushal45 opened this issue Sep 25, 2024 · 2 comments
Open

Add easier and generic instrumentation on Sequelize models #2613

kushal45 opened this issue Sep 25, 2024 · 2 comments

Comments

@kushal45
Copy link

kushal45 commented Sep 25, 2024

Is your feature request related to a problem? Please describe.

I want to instrument db queries via the Sequelize model executed so that it can give an idea which queries are slow.
As of now I see a generic instrumentation implementation for a datastore and also a all in one example of sequelize which is equivalent to a web transaction metrics

Feature Description

It would be really helpful if theres a pluggable implementation to instrument sequelize models as per the query time being taken and it would be great if its pluggable on the model level instead of instrumenting on query execution level .

Describe Alternatives

As of now I dont have a real example to show . But just to demonstrate

`class Post extends Model {
static init(sequelize) {
super.init(
{
userId:DataTypes.INTEGER,
assetId:DataTypes.INTEGER
},
{
sequelize,
timestamps: true,
underscored: false,
createdAt: "createdAt",
updatedAt: "updatedAt",
tableName: "posts",
}
);
}

static associate(models) {
  this.belongsTo(models.Asset, {
    foreignKey: 'assetId', // 'assetId' is a column in 'Post' referencing 'id' in 'Asset'
    as: 'asset', // Optional: Specifies an alias for when you load the association
  });

  this.hasMany(models.Comment, {
    foreignKey: 'postId',
    as: 'comments',
   });
 }

}

Post.instrument(shim){
// add instrumentation
}`

Additional context

Add any other context here.

Priority

Please help us better understand this feature request by choosing a priority from the following options:
Really want to track during load testing

@workato-integration
Copy link

@workato-integration workato-integration bot changed the title Add easier and generic instrumentation on Sequelize models Add easier and generic instrumentation on Sequelize models Sep 25, 2024
@mrickard
Copy link
Member

@kushal45 Thank you for registering this feature request, so our product team can gauge interest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Triage Needed: Unprioritized Features
Development

No branches or pull requests

2 participants