uptrace / opentelemetry-go-extra

OpenTelemetry instrumentations for Go
https://uptrace.dev/get/instrument/
BSD 2-Clause "Simplified" License
314 stars 72 forks source link

[Feature Request] otelsql: allow named parameters #119

Open monwolf opened 8 months ago

monwolf commented 8 months ago

We are starting to instrument a service with otel and otelsql. It worked fine until we tested queries with named parameters, and we received the following error:

{   "error": "otelsql: driver does not support named parameters" }

the code generating the error is:

    namedParams = append(namedParams, sql.Named("numper", userID))
    namedParams = append(namedParams, sql.Named("fechaIni", filtros.FecIni.NullTime))
    namedParams = append(namedParams, sql.Named("fechaFin", filtros.FecFin.NullTime))
    rows, err := repo.db.Query(dbQuery, namedParams...)

We would appreciate having this functionality.

Thanks.