1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-12-06 22:40:58 +03:00

Use OTEL semantic conventions constants for most attributes

This commit is contained in:
Quentin Gliech
2024-03-19 16:38:06 +01:00
parent 7e30daf83e
commit dde907758e
11 changed files with 72 additions and 57 deletions

View File

@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use opentelemetry_semantic_conventions::trace::DB_STATEMENT;
use tracing::Span;
/// An extension trait for [`sqlx::Execute`] that records the SQL statement as
@@ -34,7 +35,7 @@ where
DB: sqlx::Database,
{
fn record(self, span: &Span) -> Self {
span.record("db.statement", self.sql());
span.record(DB_STATEMENT, self.sql());
self
}
}