Skip to content

Commit

Permalink
Log proxied URL
Browse files Browse the repository at this point in the history
  • Loading branch information
sd2k committed Jun 6, 2023
1 parent b99c820 commit f546e56
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/plugin/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"net/url"
"strings"

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

Expand All @@ -19,6 +20,7 @@ func newOpenAIProxy() http.Handler {
r.SetURL(u)
r.Out.Header.Set("Authorization", "Bearer "+apiKey)
r.Out.URL.Path = strings.TrimPrefix(r.In.URL.Path, "/openai")
log.DefaultLogger.Info("proxying to url", "url", r.Out.URL.String())
},
}
}
Expand Down

0 comments on commit f546e56

Please sign in to comment.