Skip to content

Commit

Permalink
fix: Debug info about histograms
Browse files Browse the repository at this point in the history
  • Loading branch information
powersj committed Mar 7, 2024
1 parent 8d8d1bf commit ab43e61
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions plugins/parsers/prometheusremotewrite/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,20 @@ func (p *Parser) Parse(buf []byte) ([]telegraf.Metric, error) {
}
delete(tags, model.MetricNameLabel)

for _, h := range ts.Histograms {
fmt.Printf("Found histogram: %s\n", metricName)
fmt.Printf("timestmap: %d\n", h.Timestamp)
fmt.Printf("sum: %f\n", h.GetSum())
fmt.Printf("count: %f\n", h.GetCountFloat())
fmt.Printf("+span: %v\n", h.PositiveSpans)
fmt.Printf("+delta: %v\n", h.PositiveDeltas)
fmt.Printf("+count: %v\n", h.PositiveCounts)
fmt.Printf("-span: %v\n", h.NegativeSpans)
fmt.Printf("-delta: %v\n", h.NegativeDeltas)
fmt.Printf("+count: %v\n", h.NegativeCounts)
fmt.Println()
}

for _, s := range ts.Samples {
fields := make(map[string]interface{})
if !math.IsNaN(s.Value) {
Expand Down

0 comments on commit ab43e61

Please sign in to comment.