Skip to content

Commit

Permalink
Func name change
Browse files Browse the repository at this point in the history
  • Loading branch information
aishyandapalli committed Oct 6, 2022
1 parent a53b930 commit cde77f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions receiver/prometheusreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ receivers:
collector_id: collector-1
```
## Exemplars
This receiver accepts exemplars coming in Prometheus format and converts it to Otlp format.
This receiver accepts exemplars coming in Prometheus format and converts it to OTLP format.
1. Value is expected to be received in `float64` format
2. Timestamp is expected to be received in `ms`
3. Labels with key `span_id` in prometheus exemplars are set as Otlp `span id` and labels with key `trace_id` are set as `trace id`
4. Rest of the labels are copied as it is to Otlp format
4. Rest of the labels are copied as it is to OTLP format

[sc]: https://github.com/prometheus/prometheus/blob/v2.28.1/docs/configuration/configuration.md#scrape_config

Expand Down
4 changes: 2 additions & 2 deletions receiver/prometheusreceiver/internal/metricfamily.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,10 @@ func (mf *metricFamily) addExemplar(l labels.Labels, e exemplar.Exemplar) {
return
}
es := mg.exemplars
convertToOtlpExemplar(e, es.AppendEmpty())
convertExemplar(e, es.AppendEmpty())
}

func convertToOtlpExemplar(pe exemplar.Exemplar, e pmetric.Exemplar) {
func convertExemplar(pe exemplar.Exemplar, e pmetric.Exemplar) {
e.SetTimestamp(timestampFromMs(pe.Ts))
e.SetDoubleValue(pe.Value)
e.FilteredAttributes().EnsureCapacity(len(pe.Labels))
Expand Down

0 comments on commit cde77f6

Please sign in to comment.