mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-07 11:11:30 +00:00
collab: Attach user_id
to LLM spans (#16311)
This PR updates the LLM service to attach the user ID to the spans. Release Notes: - N/A
This commit is contained in:
parent
ff83e5b55a
commit
5e05821d18
2 changed files with 4 additions and 1 deletions
|
@ -138,7 +138,9 @@ async fn validate_api_token<B>(mut req: Request<B>, next: Next<B>) -> impl IntoR
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
tracing::Span::current().record("authn.jti", &claims.jti);
|
tracing::Span::current()
|
||||||
|
.record("user_id", claims.user_id)
|
||||||
|
.record("authn.jti", &claims.jti);
|
||||||
|
|
||||||
req.extensions_mut().insert(claims);
|
req.extensions_mut().insert(claims);
|
||||||
Ok::<_, Error>(next.run(req).await.into_response())
|
Ok::<_, Error>(next.run(req).await.into_response())
|
||||||
|
|
|
@ -150,6 +150,7 @@ async fn main() -> Result<()> {
|
||||||
"http_request",
|
"http_request",
|
||||||
method = ?request.method(),
|
method = ?request.method(),
|
||||||
matched_path,
|
matched_path,
|
||||||
|
user_id = tracing::field::Empty,
|
||||||
authn.jti = tracing::field::Empty
|
authn.jti = tracing::field::Empty
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue