Skip to content

Commit

Permalink
Fix deprecated methods based on instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanahuckova committed Sep 4, 2024
1 parent f9752bb commit 53030e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pkg/datasource/resource_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

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

"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/backend/log"
"github.com/grafana/grafana-plugin-sdk-go/backend/resource/httpadapter"
)

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

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

ctx := req.Context()
pluginCxt := httpadapter.PluginConfigFromContext(ctx)
pluginCxt := backend.PluginConfigFromContext(ctx)
dsInstance, err := ds.getDSInstance(ctx, pluginCxt)
if err != nil {
ds.logger.Error("Error loading datasource", "error", err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func main() {

pluginLogger.Debug("Starting Zabbix datasource")

err := backend.Serve(backend.ServeOpts{
err := backend.Manage(ZABBIX_PLUGIN_ID, backend.ServeOpts{
CallResourceHandler: httpResourceHandler,
QueryDataHandler: ds,
CheckHealthHandler: ds,
Expand Down

0 comments on commit 53030e2

Please sign in to comment.