Files
MarioandGitHub e0354d1bed Update Prometheus to v0.307.2, OTel collector contrib to v0.138.0, OTel to v1.44.0 (#5810)
* Update Prometheus to v0.307.2

* Update otel collector

* Update OTel collector
2025-10-28 11:30:17 +01:00

41 lines
1.3 KiB
Go

// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package plogotlp // import "go.opentelemetry.io/collector/pdata/plog/plogotlp"
import (
"slices"
"go.opentelemetry.io/collector/pdata/internal"
"go.opentelemetry.io/collector/pdata/internal/json"
)
// MarshalProto marshals ExportResponse into proto bytes.
func (ms ExportResponse) MarshalProto() ([]byte, error) {
size := internal.SizeProtoOrigExportLogsServiceResponse(ms.orig)
buf := make([]byte, size)
_ = internal.MarshalProtoOrigExportLogsServiceResponse(ms.orig, buf)
return buf, nil
}
// UnmarshalProto unmarshalls ExportResponse from proto bytes.
func (ms ExportResponse) UnmarshalProto(data []byte) error {
return internal.UnmarshalProtoOrigExportLogsServiceResponse(ms.orig, data)
}
// MarshalJSON marshals ExportResponse into JSON bytes.
func (ms ExportResponse) MarshalJSON() ([]byte, error) {
dest := json.BorrowStream(nil)
defer json.ReturnStream(dest)
internal.MarshalJSONOrigExportLogsServiceResponse(ms.orig, dest)
return slices.Clone(dest.Buffer()), dest.Error()
}
// UnmarshalJSON unmarshalls ExportResponse from JSON bytes.
func (ms ExportResponse) UnmarshalJSON(data []byte) error {
iter := json.BorrowIterator(data)
defer json.ReturnIterator(iter)
internal.UnmarshalJSONOrigExportLogsServiceResponse(ms.orig, iter)
return iter.Error()
}