Skip to content

Commit

Permalink
Fix errors nit in otlp_transform
Browse files Browse the repository at this point in the history
  • Loading branch information
Achooo committed Aug 2, 2023
1 parent bc356c3 commit d3ff4fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions agent/hcp/telemetry/otlp_transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func metricTypeToPB(m metricdata.Metrics) (*mpb.Metric, error) {
}
case metricdata.Sum[float64]:
if a.Temporality != metricdata.CumulativeTemporality {
return out, fmt.Errorf("error: %w: %T", errTemporality, a)
return out, fmt.Errorf("failed to convert metric to otel format: %w: %T", errTemporality, a)
}
out.Data = &mpb.Metric_Sum{
Sum: &mpb.Sum{
Expand All @@ -107,7 +107,7 @@ func metricTypeToPB(m metricdata.Metrics) (*mpb.Metric, error) {
}
case metricdata.Histogram[float64]:
if a.Temporality != metricdata.CumulativeTemporality {
return out, fmt.Errorf("error: %w: %T", errTemporality, a)
return out, fmt.Errorf("failed to convert metric to otel format:: %w: %T", errTemporality, a)
}
out.Data = &mpb.Metric_Histogram{
Histogram: &mpb.Histogram{
Expand All @@ -116,7 +116,7 @@ func metricTypeToPB(m metricdata.Metrics) (*mpb.Metric, error) {
},
}
default:
return out, fmt.Errorf("error: %w: %T", errAggregaton, a)
return out, fmt.Errorf("failed to convert metric to otel format:: %w: %T", errAggregaton, a)
}
return out, nil
}
Expand Down

0 comments on commit d3ff4fd

Please sign in to comment.