Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Backend template logging improvements #140

Closed
marefr opened this issue Nov 11, 2022 · 2 comments · Fixed by #146
Closed

Enhancement: Backend template logging improvements #140

marefr opened this issue Nov 11, 2022 · 2 comments · Fixed by #146
Assignees
Labels
enhancement New feature or request onboarding released This issue/pull request has been released.

Comments

@marefr
Copy link
Contributor

marefr commented Nov 11, 2022

Package Name

create-plugin

What happened?

Logging being made with Info level.

log.DefaultLogger.Info("QueryData called", "request", req)

log.DefaultLogger.Info("CheckHealth called", "request", req)

What you expected to happen

Logging being made with Debug level since the frequency of QueryData calls can be high and could create a large amount of logged messages.

How to reproduce it (as minimally and precisely as possible)

N/A

Environment

N/A

Additional context

No response

@marefr marefr added bug enhancement New feature or request and removed bug labels Nov 11, 2022
@marefr marefr changed the title Bug: Backend template logging improvements Enhancement: Backend template logging improvements Nov 11, 2022
@marefr marefr moved this to 📬 Uncategorized in Plugins Platform / Grafana Community Nov 11, 2022
@marefr marefr moved this from 📬 Uncategorized to 📅 Planned in Plugins Platform / Grafana Community Nov 11, 2022
@marefr marefr moved this from 📅 Planned to 📬 Uncategorized in Plugins Platform / Grafana Community Nov 11, 2022
@tolzhabayev tolzhabayev moved this from 📬 Uncategorized to 📅 Planned in Plugins Platform / Grafana Community Nov 11, 2022
@xnyo xnyo self-assigned this Nov 11, 2022
@xnyo
Copy link
Member

xnyo commented Nov 11, 2022

FYI - I have just checked the examples and they use Debug already, so this issue only affects the template and not the existing examples

╰─❯ grep -rnw . -e "DefaultLogger"
./examples/datasource-basic/pkg/plugin/datasource.go:59:        log.DefaultLogger.Debug("QueryData called", "queries", req.Queries)
./examples/datasource-basic/pkg/plugin/datasource.go:81:        log.DefaultLogger.Debug("CheckHealth called")
./examples/datasource-basic/pkg/main.go:21:             log.DefaultLogger.Error(err.Error())
./examples/datasource-http-backend/pkg/plugin/datasource.go:97:                 log.DefaultLogger.Error("query: failed to close response body", "err", err.Error())
./examples/datasource-http-backend/pkg/plugin/datasource.go:146:                        log.DefaultLogger.Error("check health: failed to close response body", "err", err.Error())
./examples/datasource-http-backend/pkg/main.go:21:              log.DefaultLogger.Error(err.Error())

@xnyo xnyo moved this from 📅 Planned to 🧑‍💻 In development (Limit 6) in Plugins Platform / Grafana Community Nov 15, 2022
@xnyo xnyo closed this as completed in #146 Nov 15, 2022
Repository owner moved this from 🧑‍💻 In development (Limit 6) to 🚀 Shipped in Plugins Platform / Grafana Community Nov 15, 2022
@grafanabot
Copy link
Contributor

🚀 Issue was released in @grafana/create-plugin@0.5.2 🚀

@grafanabot grafanabot added the released This issue/pull request has been released. label Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request onboarding released This issue/pull request has been released.
Projects
Development

Successfully merging a pull request may close this issue.

4 participants