|
@@ -6,7 +6,7 @@ import (
|
|
|
"sync"
|
|
"sync"
|
|
|
|
|
|
|
|
"github.com/grafana/grafana/pkg/infra/log"
|
|
"github.com/grafana/grafana/pkg/infra/log"
|
|
|
- "github.com/pkg/errors"
|
|
|
|
|
|
|
+ "github.com/grafana/grafana/pkg/util/errutil"
|
|
|
|
|
|
|
|
"github.com/grafana/grafana/pkg/registry"
|
|
"github.com/grafana/grafana/pkg/registry"
|
|
|
"github.com/grafana/grafana/pkg/services/provisioning/dashboards"
|
|
"github.com/grafana/grafana/pkg/services/provisioning/dashboards"
|
|
@@ -103,20 +103,20 @@ func (ps *provisioningServiceImpl) Run(ctx context.Context) error {
|
|
|
func (ps *provisioningServiceImpl) ProvisionDatasources() error {
|
|
func (ps *provisioningServiceImpl) ProvisionDatasources() error {
|
|
|
datasourcePath := path.Join(ps.Cfg.ProvisioningPath, "datasources")
|
|
datasourcePath := path.Join(ps.Cfg.ProvisioningPath, "datasources")
|
|
|
err := ps.provisionDatasources(datasourcePath)
|
|
err := ps.provisionDatasources(datasourcePath)
|
|
|
- return errors.Wrap(err, "Datasource provisioning error")
|
|
|
|
|
|
|
+ return errutil.Wrap("Datasource provisioning error", err)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (ps *provisioningServiceImpl) ProvisionNotifications() error {
|
|
func (ps *provisioningServiceImpl) ProvisionNotifications() error {
|
|
|
alertNotificationsPath := path.Join(ps.Cfg.ProvisioningPath, "notifiers")
|
|
alertNotificationsPath := path.Join(ps.Cfg.ProvisioningPath, "notifiers")
|
|
|
err := ps.provisionNotifiers(alertNotificationsPath)
|
|
err := ps.provisionNotifiers(alertNotificationsPath)
|
|
|
- return errors.Wrap(err, "Alert notification provisioning error")
|
|
|
|
|
|
|
+ return errutil.Wrap("Alert notification provisioning error", err)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (ps *provisioningServiceImpl) ProvisionDashboards() error {
|
|
func (ps *provisioningServiceImpl) ProvisionDashboards() error {
|
|
|
dashboardPath := path.Join(ps.Cfg.ProvisioningPath, "dashboards")
|
|
dashboardPath := path.Join(ps.Cfg.ProvisioningPath, "dashboards")
|
|
|
dashProvisioner, err := ps.newDashboardProvisioner(dashboardPath)
|
|
dashProvisioner, err := ps.newDashboardProvisioner(dashboardPath)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
- return errors.Wrap(err, "Failed to create provisioner")
|
|
|
|
|
|
|
+ return errutil.Wrap("Failed to create provisioner", err)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ps.mutex.Lock()
|
|
ps.mutex.Lock()
|
|
@@ -127,7 +127,7 @@ func (ps *provisioningServiceImpl) ProvisionDashboards() error {
|
|
|
if err := dashProvisioner.Provision(); err != nil {
|
|
if err := dashProvisioner.Provision(); err != nil {
|
|
|
// If we fail to provision with the new provisioner, mutex will unlock and the polling we restart with the
|
|
// If we fail to provision with the new provisioner, mutex will unlock and the polling we restart with the
|
|
|
// old provisioner as we did not switch them yet.
|
|
// old provisioner as we did not switch them yet.
|
|
|
- return errors.Wrap(err, "Failed to provision dashboards")
|
|
|
|
|
|
|
+ return errutil.Wrap("Failed to provision dashboards", err)
|
|
|
}
|
|
}
|
|
|
ps.dashboardProvisioner = dashProvisioner
|
|
ps.dashboardProvisioner = dashProvisioner
|
|
|
return nil
|
|
return nil
|