mirror of
https://github.com/hanzoai/traces.git
synced 2026-11-03 04:05:45 +00:00
* Update Prometheus to v0.307.2 * Update otel collector * Update OTel collector
27 lines
1.0 KiB
Go
27 lines
1.0 KiB
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package internal // import "go.opentelemetry.io/collector/pdata/internal"
|
|
|
|
import (
|
|
otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1development"
|
|
otlpprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development"
|
|
)
|
|
|
|
// ProfilesToProto internal helper to convert Profiles to protobuf representation.
|
|
func ProfilesToProto(l Profiles) otlpprofile.ProfilesData {
|
|
return otlpprofile.ProfilesData{
|
|
ResourceProfiles: l.orig.ResourceProfiles,
|
|
Dictionary: l.orig.Dictionary,
|
|
}
|
|
}
|
|
|
|
// ProfilesFromProto internal helper to convert protobuf representation to Profiles.
|
|
// This function set exclusive state assuming that it's called only once per Profiles.
|
|
func ProfilesFromProto(orig otlpprofile.ProfilesData) Profiles {
|
|
return NewProfiles(&otlpcollectorprofile.ExportProfilesServiceRequest{
|
|
ResourceProfiles: orig.ResourceProfiles,
|
|
Dictionary: orig.Dictionary,
|
|
}, NewState())
|
|
}
|