Skip to content

Commit 53030e2

Browse files
committed
Fix deprecated methods based on instructions
1 parent f9752bb commit 53030e2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/datasource/resource_handler.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88

99
"github.com/alexanderzobnin/grafana-zabbix/pkg/zabbix"
1010

11+
"github.com/grafana/grafana-plugin-sdk-go/backend"
1112
"github.com/grafana/grafana-plugin-sdk-go/backend/log"
12-
"github.com/grafana/grafana-plugin-sdk-go/backend/resource/httpadapter"
1313
)
1414

1515
// Resource handler describes handlers for the resources populated by plugin in plugin.go, like:
@@ -48,7 +48,7 @@ func (ds *ZabbixDatasource) ZabbixAPIHandler(rw http.ResponseWriter, req *http.R
4848
}
4949

5050
ctx := req.Context()
51-
pluginCxt := httpadapter.PluginConfigFromContext(ctx)
51+
pluginCxt := backend.PluginConfigFromContext(ctx)
5252
dsInstance, err := ds.getDSInstance(ctx, pluginCxt)
5353
if err != nil {
5454
ds.logger.Error("Error loading datasource", "error", err)
@@ -89,7 +89,7 @@ func (ds *ZabbixDatasource) DBConnectionPostProcessingHandler(rw http.ResponseWr
8989
}
9090

9191
ctx := req.Context()
92-
pluginCxt := httpadapter.PluginConfigFromContext(ctx)
92+
pluginCxt := backend.PluginConfigFromContext(ctx)
9393
dsInstance, err := ds.getDSInstance(ctx, pluginCxt)
9494
if err != nil {
9595
ds.logger.Error("Error loading datasource", "error", err)

pkg/plugin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func main() {
2222

2323
pluginLogger.Debug("Starting Zabbix datasource")
2424

25-
err := backend.Serve(backend.ServeOpts{
25+
err := backend.Manage(ZABBIX_PLUGIN_ID, backend.ServeOpts{
2626
CallResourceHandler: httpResourceHandler,
2727
QueryDataHandler: ds,
2828
CheckHealthHandler: ds,

0 commit comments

Comments
 (0)