[backend plugin] Metric request error

// create data frame response
	frame := data.NewFrame("count",
		data.NewField("time", nil, []time.Time{}),
		data.NewField("temp", nil, []int64{}))
	// add the time dimension
	// add values

	frame.AppendRow(query.TimeRange.To.Add(-1*time.Second), 5)
	frame.AppendRow(query.TimeRange.To.Add(-2*time.Second), 4)
	frame.AppendRow(query.TimeRange.To.Add(-3*time.Second), 7)
	frame.AppendRow(query.TimeRange.To.Add(-4*time.Second), 2)
	frame.AppendRow(query.TimeRange.To.Add(-5*time.Second), 1)
	
    response.Frames = append(response.Frames, frame)
	return response

the above code snippet is giving me error as Metric request error. Any help on this is appreciated

Also,
If my frame has two fields say time and temp, is it required that values field should be sorted? Because in case of random order of data, Grafana frontend is unable to visualize in Graph

I’m getting this too. I think I’ve isolated the problem to my use of data.NewField(). Let me know if you figure it out!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.