feat: add gorm tracing middleware
This commit is contained in:
@ -58,6 +58,7 @@ const (
|
||||
ServiceLayerKey = attribute.Key("service.layer")
|
||||
ServiceLayerNameKey = attribute.Key("service.layer_name")
|
||||
DBExecutionTimeMsKey = attribute.Key("db.execution_time_ms")
|
||||
DBRowsAffectedKey = attribute.Key("db.rows_affected")
|
||||
)
|
||||
|
||||
type ServiceArchitectureLayer string
|
||||
@ -266,3 +267,10 @@ func DBExecutionTimeMs(duration time.Duration) attribute.KeyValue {
|
||||
Value: attribute.Int64Value(duration.Milliseconds()),
|
||||
}
|
||||
}
|
||||
|
||||
func DBRowsAffected(rows int64) attribute.KeyValue {
|
||||
return attribute.KeyValue{
|
||||
Key: DBRowsAffectedKey,
|
||||
Value: attribute.Int64Value(rows),
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user