(protos []T)
| 115 | } |
| 116 | |
| 117 | func MarshalProtoJSONs[T proto.Message](protos []T) ([]byte, error) { |
| 118 | msgs := make([]json.RawMessage, len(protos)) |
| 119 | for i, msg := range protos { |
| 120 | pl, err := protojson.Marshal(msg) |
| 121 | if err != nil { |
| 122 | return nil, fmt.Errorf("failed to protojson marshal: %w", err) |
| 123 | } |
| 124 | msgs[i] = json.RawMessage(pl) |
| 125 | } |
| 126 | return json.Marshal(msgs) |
| 127 | } |
| 128 | |
| 129 | // Attributes returns the attributes of the span |
| 130 | func (ros *readOnlySpan) Attributes() []attribute.KeyValue { |