Phlare: Update client code to use v0.1.2 API. (#60941)

* Depends on Phlare API instead of copying the code

* Rollback the breaking change from the API version
This commit is contained in:
Cyril Tovena
2023-01-10 14:16:45 +00:00
committed by GitHub
parent 0c8ad80575
commit ad1813da27
11 changed files with 63 additions and 5854 deletions
+5 -5
View File
@@ -12,9 +12,9 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend/instancemgmt"
"github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/infra/httpclient"
commonv1 "github.com/grafana/grafana/pkg/tsdb/phlare/gen/common/v1"
querierv1 "github.com/grafana/grafana/pkg/tsdb/phlare/gen/querier/v1"
"github.com/grafana/grafana/pkg/tsdb/phlare/gen/querier/v1/querierv1connect"
querierv1 "github.com/grafana/phlare/api/gen/proto/go/querier/v1"
"github.com/grafana/phlare/api/gen/proto/go/querier/v1/querierv1connect"
typesv1 "github.com/grafana/phlare/api/gen/proto/go/types/v1"
)
var (
@@ -234,8 +234,8 @@ func (d *PhlareDatasource) PublishStream(_ context.Context, _ *backend.PublishSt
}, nil
}
func withoutPrivateLabels(labels []*commonv1.LabelPair) []*commonv1.LabelPair {
res := make([]*commonv1.LabelPair, 0, len(labels))
func withoutPrivateLabels(labels []*typesv1.LabelPair) []*typesv1.LabelPair {
res := make([]*typesv1.LabelPair, 0, len(labels))
for _, l := range labels {
if !strings.HasPrefix(l.Name, "__") {
res = append(res, l)