mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
Limit OpenTelemetry span name length. (#23281)
Minor tweak to OpenTelemetry SQL config. - [x] Manual testing
This commit is contained in:
parent
3a278c67a3
commit
59a26db1f8
1 changed files with 7 additions and 2 deletions
|
|
@ -34,7 +34,7 @@ import (
|
|||
"github.com/hashicorp/go-multierror"
|
||||
"github.com/jmoiron/sqlx"
|
||||
"github.com/ngrok/sqlmw"
|
||||
semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
|
||||
semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -418,7 +418,12 @@ func init() {
|
|||
return string(method)
|
||||
}
|
||||
// Append query with extra whitespaces removed
|
||||
return string(method) + ": " + strings.Join(strings.Fields(query), " ")
|
||||
query = strings.Join(strings.Fields(query), " ")
|
||||
const maxQueryLen = 100
|
||||
if len(query) > maxQueryLen {
|
||||
query = query[:maxQueryLen] + "..."
|
||||
}
|
||||
return string(method) + ": " + query
|
||||
}),
|
||||
)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue