-
Notifications
You must be signed in to change notification settings - Fork 0
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 query metrics and spans #74
Conversation
@@ -155,39 +156,7 @@ impl connector::Connector for SQLServer { | |||
state: &Self::State, | |||
query_request: models::QueryRequest, | |||
) -> Result<JsonResponse<models::QueryResponse>, connector::QueryError> { | |||
tracing::info!("{}", serde_json::to_string(&query_request).unwrap()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to src/query.rs
@@ -1,58 +0,0 @@ | |||
//! Metrics setup and update for our connector. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Superceded by metrics.rs
in query-engine
/// | ||
/// This function implements the [query endpoint](https://hasura.github.io/ndc-spec/specification/queries/index.html) | ||
/// from the NDC specification. | ||
pub async fn query( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split this up into plan_query
and execute_query
so it's easier to time / instrument both.
Ok(response) | ||
} | ||
|
||
async fn execute_query( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make execute_query
it's own function so it's easier to instrument / time.
@@ -21,35 +24,57 @@ pub async fn mssql_execute( | |||
&plan.variables, | |||
); | |||
|
|||
let acquisition_timer = metrics.time_connection_acquisition_wait(); | |||
let connection_result = mssql_pool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acquire one connection and use it throughout rather than passing the pool around.
5866d79
to
07614ce
Compare
@@ -0,0 +1,12 @@ | |||
apiVersion: 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything in /metrics
is taken from ndc-postgres
and postgres
-> sqlserver
.
965a7c5
to
c12eef1
Compare
What
In order to run the benchmarks we rely on a bunch of metrics existing, such as connection acquisition time and query time. This adds these, as well as instrumenting OTel spans in this area too.
How
Match
ndc-postgres
as much as possible.