Skip to content

Conversation

@mamcx
Copy link
Contributor

@mamcx mamcx commented Sep 29, 2023

Description of Changes

This helps to visualize tracy events better.

API and ABI

  • This is a breaking change to the module ABI
  • This is a breaking change to the module API
  • This is a breaking change to the ClientAPI
  • This is a breaking change to the SDK API

If the API is breaking, please state below what will break

///
/// Matching is defined by `Ord for AlgebraicValue`.
#[tracing::instrument(skip(self, tx))]
#[tracing::instrument(skip(self, tx, value))]
Copy link
Collaborator

Choose a reason for hiding this comment

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

The actual table and column names would be useful to capture here, but because we only have the IDs, it's probably ok to just skip_all.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the table id might be useful tbh

}

#[tracing::instrument(skip(self, tx))]
#[tracing::instrument(skip(self, tx, row))]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similarly here.

}

#[tracing::instrument(skip_all)]
#[tracing::instrument(skip_all, fields(reducer=reducer))]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice!

}

#[tracing::instrument(skip(args))]
#[tracing::instrument(skip(self, args), fields(db_id=self.instance.instance_env().dbic.database_id))]
Copy link
Collaborator

Choose a reason for hiding this comment

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

By calling self.instance.instance_env().dbic.database_id won't this add overhead to the init_database call that won't be reflective of its true characteristics?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually instance_env() shouldn't add any meaningful overhead, but we probably want to avoid calling arbitrary methods as part of trace logging since in general we don't know exactly how much overhead that will add to the span.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks minimal:

    fn instance_env(&self) -> &InstanceEnv {
        &self.env.as_ref(&self.store).instance_env
    }

Also this is only in the init of the db. The rest of the calls should take more time...

}

#[tracing::instrument(skip(db, tx, auth))]
#[tracing::instrument(skip_all)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should create a ticket to capture the actual sql string here that we compiled earlier.

@cloutiertyler cloutiertyler enabled auto-merge (squash) September 30, 2023 06:07
@cloutiertyler cloutiertyler merged commit 3d1d98c into master Sep 30, 2023
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.

4 participants