diff --git a/app/vmselect/graphite/render_response.qtpl b/app/vmselect/graphite/render_response.qtpl index 308a378ad..2ea588e64 100644 --- a/app/vmselect/graphite/render_response.qtpl +++ b/app/vmselect/graphite/render_response.qtpl @@ -47,7 +47,7 @@ See https://graphite.readthedocs.io/en/stable/render_api.html#json {% code timestamps := s.Timestamps %} {% for i, v := range s.Values %} [ - {% if math.IsNaN(v) %}null{% else %}{%f= v %}{% endif %}, + {% if math.IsNaN(v) || math.IsInf(v, 0) %}null{% else %}{%f= v %}{% endif %}, {%dl= timestamps[i]/1e3 %} ] {% if i+1 < len(timestamps) %},{% endif %} diff --git a/app/vmselect/graphite/render_response.qtpl.go b/app/vmselect/graphite/render_response.qtpl.go index 213403fb1..77a87998e 100644 --- a/app/vmselect/graphite/render_response.qtpl.go +++ b/app/vmselect/graphite/render_response.qtpl.go @@ -148,7 +148,7 @@ func streamrenderSeriesJSON(qw422016 *qt422016.Writer, s *series) { //line app/vmselect/graphite/render_response.qtpl:48 qw422016.N().S(`[`) //line app/vmselect/graphite/render_response.qtpl:50 - if math.IsNaN(v) { + if math.IsNaN(v) || math.IsInf(v, 0) { //line app/vmselect/graphite/render_response.qtpl:50 qw422016.N().S(`null`) //line app/vmselect/graphite/render_response.qtpl:50