Zipkin: Run health check through backend (#96031)

* Zipkin: Run health check through backend

* Mark some errors as downstream

* Update pkg/tsdb/zipkin/zipkin.go

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>

* Use errors.New where error formatting is not needed

* Remove executable in plugin.json

* Fix joining the path

* Keep logger as global and then create from context

* Close the res body

---------

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
This commit is contained in:
Ivana Huckova
2024-11-07 16:48:00 +01:00
committed by GitHub
parent 21ba507bcb
commit 4d0a7637b2
13 changed files with 178 additions and 12 deletions

View File

@ -34,6 +34,7 @@ import (
"github.com/grafana/grafana/pkg/tsdb/parca"
"github.com/grafana/grafana/pkg/tsdb/prometheus"
"github.com/grafana/grafana/pkg/tsdb/tempo"
"github.com/grafana/grafana/pkg/tsdb/zipkin"
)
const (
@ -55,6 +56,7 @@ const (
Grafana = "grafana"
Pyroscope = "grafana-pyroscope-datasource"
Parca = "parca"
Zipkin = "zipkin"
)
func init() {
@ -93,7 +95,7 @@ func NewRegistry(store map[string]backendplugin.PluginFactoryFunc) *Registry {
func ProvideCoreRegistry(tracer tracing.Tracer, am *azuremonitor.Service, cw *cloudwatch.CloudWatchService, cm *cloudmonitoring.Service,
es *elasticsearch.Service, grap *graphite.Service, idb *influxdb.Service, lk *loki.Service, otsdb *opentsdb.Service,
pr *prometheus.Service, t *tempo.Service, td *testdatasource.Service, pg *postgres.Service, my *mysql.Service,
ms *mssql.Service, graf *grafanads.Service, pyroscope *pyroscope.Service, parca *parca.Service) *Registry {
ms *mssql.Service, graf *grafanads.Service, pyroscope *pyroscope.Service, parca *parca.Service, zipkin *zipkin.Service) *Registry {
// Non-optimal global solution to replace plugin SDK default tracer for core plugins.
sdktracing.InitDefaultTracer(tracer)
@ -115,6 +117,7 @@ func ProvideCoreRegistry(tracer tracing.Tracer, am *azuremonitor.Service, cw *cl
Grafana: asBackendPlugin(graf),
Pyroscope: asBackendPlugin(pyroscope),
Parca: asBackendPlugin(parca),
Zipkin: asBackendPlugin(zipkin),
})
}
@ -239,6 +242,8 @@ func NewPlugin(pluginID string, cfg *setting.Cfg, httpClientProvider *httpclient
svc = pyroscope.ProvideService(httpClientProvider)
case Parca:
svc = parca.ProvideService(httpClientProvider)
case Zipkin:
svc = zipkin.ProvideService(httpClientProvider)
default:
return nil, ErrCorePluginNotFound
}

View File

@ -35,6 +35,7 @@ func TestNewPlugin(t *testing.T) {
{ID: Tempo},
{ID: TestData, ExpectedAlias: TestDataAlias},
{ID: TestDataAlias, ExpectedID: TestData, ExpectedAlias: TestDataAlias},
{ID: Zipkin},
}
for _, tc := range tcs {