Skip to content

Commit

Permalink
rename function
Browse files Browse the repository at this point in the history
Signed-off-by: odubajDT <[email protected]>
  • Loading branch information
odubajDT committed Dec 3, 2024
1 parent ff33962 commit 748d28a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions receiver/cloudfoundryreceiver/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func convertEnvelopeToMetrics(envelope *loggregator_v2.Envelope, metricSlice pme
dataPoint.SetTimestamp(pcommon.Timestamp(envelope.GetTimestamp()))
dataPoint.SetStartTimestamp(pcommon.NewTimestampFromTime(startTime))
if allowResourceAttributes.IsEnabled() {
attrs := getEnvelopeDatapointAttributes(envelope)
attrs := getEnvelopeDataAttributes(envelope)
attrs.CopyTo(dataPoint.Attributes())
} else {
copyEnvelopeAttributes(dataPoint.Attributes(), envelope)
Expand All @@ -70,7 +70,7 @@ func convertEnvelopeToMetrics(envelope *loggregator_v2.Envelope, metricSlice pme
dataPoint.SetTimestamp(pcommon.Timestamp(envelope.GetTimestamp()))
dataPoint.SetStartTimestamp(pcommon.NewTimestampFromTime(startTime))
if allowResourceAttributes.IsEnabled() {
attrs := getEnvelopeDatapointAttributes(envelope)
attrs := getEnvelopeDataAttributes(envelope)
attrs.CopyTo(dataPoint.Attributes())
} else {
copyEnvelopeAttributes(dataPoint.Attributes(), envelope)
Expand All @@ -97,7 +97,7 @@ func convertEnvelopeToLogs(envelope *loggregator_v2.Envelope, logSlice plog.LogR
return fmt.Errorf("unsupported envelope log type: %s", envelope.GetLog().GetType())
}
if allowResourceAttributes.IsEnabled() {
attrs := getEnvelopeDatapointAttributes(envelope)
attrs := getEnvelopeDataAttributes(envelope)
attrs.CopyTo(log.Attributes())
} else {
copyEnvelopeAttributes(log.Attributes(), envelope)
Expand All @@ -117,7 +117,7 @@ func copyEnvelopeAttributes(attributes pcommon.Map, envelope *loggregator_v2.Env
}
}

func getEnvelopeDatapointAttributes(envelope *loggregator_v2.Envelope) pcommon.Map {
func getEnvelopeDataAttributes(envelope *loggregator_v2.Envelope) pcommon.Map {
attrs := pcommon.NewMap()
for key, value := range envelope.Tags {
if !slices.Contains(ResourceAttributesKeys, key) {
Expand Down

0 comments on commit 748d28a

Please sign in to comment.