Chore: Promlib allows extendOptions to be nil (#84463)

* use logger from service

* allow extendOptions to be nil

* Update logger
This commit is contained in:
ismail simsek
2024-03-15 13:37:29 +01:00
committed by GitHub
parent 94a9aeaccc
commit eae9bfe4bc
6 changed files with 79 additions and 39 deletions
+4 -2
View File
@@ -8,6 +8,7 @@ import (
"net/http"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/backend/log"
)
const (
@@ -85,10 +86,11 @@ func (s *Service) GetHeuristics(ctx context.Context, req HeuristicsRequest) (*He
if err != nil {
return nil, err
}
return getHeuristics(ctx, ds)
logger := s.logger.FromContext(ctx)
return getHeuristics(ctx, ds, logger)
}
func getHeuristics(ctx context.Context, i *instance) (*Heuristics, error) {
func getHeuristics(ctx context.Context, i *instance, logger log.Logger) (*Heuristics, error) {
heuristics := Heuristics{
Application: "unknown",
Features: Features{