Prometheus: Update FrameType and make __name__ the field name (#62694)

These changes would make the response more in line with the dataplane contract, changes are under the feature toggle prometheusDataplane
This commit is contained in:
Kyle Brandt
2023-03-29 11:26:32 -04:00
committed by GitHub
parent 845951485f
commit 674144c8e8
8 changed files with 94 additions and 52 deletions

View File

@@ -43,6 +43,7 @@ type QueryData struct {
URL string
TimeInterval string
enableWideSeries bool
enableDataplane bool
exemplarSampler func() exemplar.Sampler
}
@@ -82,6 +83,7 @@ func New(
ID: settings.ID,
URL: settings.URL,
enableWideSeries: features.IsEnabled(featuremgmt.FlagPrometheusWideSeries),
enableDataplane: features.IsEnabled(featuremgmt.FlagPrometheusDataplane),
exemplarSampler: exemplarSampler,
}, nil
}

View File

@@ -28,6 +28,7 @@ func (s *QueryData) parseResponse(ctx context.Context, q *models.Query, res *htt
r := converter.ReadPrometheusStyleResult(iter, converter.Options{
MatrixWideSeries: s.enableWideSeries,
VectorWideSeries: s.enableWideSeries,
Dataplane: s.enableDataplane,
})
// Add frame to attach metadata