From 3ac1ee16f377d31a0fb80c8dae28b6239ac4229e Mon Sep 17 00:00:00 2001 From: Terin Stock Date: Sun, 9 Mar 2025 17:47:56 +0100 Subject: [chore] remove vendor --- .../auto/sdk/internal/telemetry/resource.go | 66 ---------------------- 1 file changed, 66 deletions(-) delete mode 100644 vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/resource.go (limited to 'vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/resource.go') diff --git a/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/resource.go b/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/resource.go deleted file mode 100644 index cecad8bae..000000000 --- a/vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/resource.go +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package telemetry - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "io" -) - -// Resource information. -type Resource struct { - // Attrs are the set of attributes that describe the resource. Attribute - // keys MUST be unique (it is not allowed to have more than one attribute - // with the same key). - Attrs []Attr `json:"attributes,omitempty"` - // DroppedAttrs is the number of dropped attributes. If the value - // is 0, then no attributes were dropped. - DroppedAttrs uint32 `json:"droppedAttributesCount,omitempty"` -} - -// UnmarshalJSON decodes the OTLP formatted JSON contained in data into r. -func (r *Resource) UnmarshalJSON(data []byte) error { - decoder := json.NewDecoder(bytes.NewReader(data)) - - t, err := decoder.Token() - if err != nil { - return err - } - if t != json.Delim('{') { - return errors.New("invalid Resource type") - } - - for decoder.More() { - keyIface, err := decoder.Token() - if err != nil { - if errors.Is(err, io.EOF) { - // Empty. - return nil - } - return err - } - - key, ok := keyIface.(string) - if !ok { - return fmt.Errorf("invalid Resource field: %#v", keyIface) - } - - switch key { - case "attributes": - err = decoder.Decode(&r.Attrs) - case "droppedAttributesCount", "dropped_attributes_count": - err = decoder.Decode(&r.DroppedAttrs) - default: - // Skip unknown. - } - - if err != nil { - return err - } - } - return nil -} -- cgit v1.2.3