update for latest micro and requestid changes

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2024-04-11 01:55:55 +03:00
parent df45b9e0bb
commit 87785d978a
4 changed files with 30 additions and 18 deletions

View File

@@ -148,7 +148,7 @@ func (w *wrapperStmt) ExecContext(ctx context.Context, args []driver.NamedValue)
if len(args) > 0 {
span.AddLabels("db.args", fmt.Sprintf("%v", namedValueToLabels(args)))
}
if id, ok := ctx.Value(requestid.XRequestIDKey).(string); ok {
if id, ok := ctx.Value(requestid.XRequestIDKey{}).(string); ok {
span.AddLabels("x-request-id", id)
}
labels := []string{labelMethod, "ExecContext", labelQuery, name}
@@ -221,7 +221,7 @@ func (w *wrapperStmt) QueryContext(ctx context.Context, args []driver.NamedValue
if len(args) > 0 {
span.AddLabels("db.args", fmt.Sprintf("%v", namedValueToLabels(args)))
}
if id, ok := ctx.Value(requestid.XRequestIDKey).(string); ok {
if id, ok := ctx.Value(requestid.XRequestIDKey{}).(string); ok {
span.AddLabels("x-request-id", id)
}
labels := []string{labelMethod, "QueryContext", labelQuery, name}