mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-09 19:17:29 -06:00
[chore] Update usage of OTEL libraries (#2725)
* otel to 1.24 * prometheus exporter to 0.46 * bunotel to 1.1.17 Also: * Use schemaless URL for metrics * Add software version to tracing schema
This commit is contained in:
parent
8e88ee8d9c
commit
5e871e81a8
126 changed files with 12940 additions and 2267 deletions
14
vendor/go.opentelemetry.io/otel/sdk/metric/metricdata/data.go
generated
vendored
14
vendor/go.opentelemetry.io/otel/sdk/metric/metricdata/data.go
generated
vendored
|
|
@ -15,6 +15,7 @@
|
|||
package metricdata // import "go.opentelemetry.io/otel/sdk/metric/metricdata"
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
|
|
@ -211,6 +212,19 @@ type Extrema[N int64 | float64] struct {
|
|||
valid bool
|
||||
}
|
||||
|
||||
// MarshalText converts the Extrema value to text.
|
||||
func (e Extrema[N]) MarshalText() ([]byte, error) {
|
||||
if !e.valid {
|
||||
return json.Marshal(nil)
|
||||
}
|
||||
return json.Marshal(e.value)
|
||||
}
|
||||
|
||||
// MarshalJSON converts the Extrema value to JSON number.
|
||||
func (e *Extrema[N]) MarshalJSON() ([]byte, error) {
|
||||
return e.MarshalText()
|
||||
}
|
||||
|
||||
// NewExtrema returns an Extrema set to v.
|
||||
func NewExtrema[N int64 | float64](v N) Extrema[N] {
|
||||
return Extrema[N]{value: v, valid: true}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue