我是 Grafana 的新手,我已经安装了 Grafana 并执行了自述文件中给出的所有说明。 我现在正在使用 Visual Code for go lang 我只想调试 Grafana 代码,以便我可以理解这个过程。
任何人都可以建议我做什么。 我听说过名为 Delve 的调试器。 任何人都可以告诉我如何使用它,因为当我使用 Delve 时,它不会连接 grafana 服务器。
如何启动 grafana-server 以及如何调试代码。请任何人帮助我!!!
我遵循了以下链接: https : //github.com/derekparker/delve
我不确定,还没有调试 golang。
请在谷歌搜索或将问题发布到 Grafana 邮件列表
我也遇到了这个问题。
我通过编辑 .vscode/launch.json 让它工作:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/pkg/cmd/grafana-server/main.go",
"env": {},
"args": [
"--homepath", "${workspaceFolder}",
"--packaging", "dev"
]
}
]
}
最有用的评论
我通过编辑 .vscode/launch.json 让它工作: