Comments (7)
When running in debug mode I see an error "address is empty" which seems to be related (I don't see that with other apps):
logger=plugin.grafana-llm-app t=2023-11-02T17:03:36.360031792+01:00 level=info msg="Starting plugin process"
logger=plugin.grafana-llm-app t=2023-11-02T17:03:36.360083469+01:00 level=debug msg=Profiler enabled=false
logger=plugin.grafana-llm-app t=2023-11-02T17:03:36.36011727+01:00 level=debug msg=Tracing enabled=false propagation=
logger=plugin.grafana-llm-app t=2023-11-02T17:03:36.360135526+01:00 level=debug msg="2023/11/02 17:03:36 Error: address is empty"
logger=plugin.grafana-llm-app t=2023-11-02T17:03:36.360159282+01:00 level=debug msg="Serving plugin" plugins="[diagnostics resource data stream]"
logger=plugin.grafana-llm-app t=2023-11-02T17:03:36.360288951+01:00 level=debug msg="plugin address" address=/tmp/plugin1476197245 network=unix
logger=plugin.grafana-llm-app t=2023-11-02T17:03:36.360316465+01:00 level=debug msg="using plugin" version=2
logger=plugin.grafana-llm-app t=2023-11-02T17:03:36.360681938+01:00 level=debug msg="Plugin restarted"
But I am unable to see what's the root cause.
from grafana-plugin-sdk-go.
The error seems to originate from here and saying that there's no standalone address set:
grafana-plugin-sdk-go/internal/standalone/standalone.go
Lines 109 to 116 in ebfab9f
from grafana-plugin-sdk-go.
@marefr I'm not seeing an error about an empty standalone address 🤔 I spent a little time tracing through the standlone machinery in the sdk and it seems like the pid and address are created correctly when launching a debugging session.
Also, I'm able to get a breakpoint to pause execution if I put a breakpoint in main.go
but any breakpoints further in the plugin, e.g. in app.go
, will not pause.
from grafana-plugin-sdk-go.
@asimpson where have you put the breakpoint in app,go? If NewApp please note that it will run whenever the first request comes in. You should see the log message "Creating new app instance" when that happens and be able to put a breakpoint there. Let us know if it still doesn't work and we'll try investigate further.
from grafana-plugin-sdk-go.
I put the breakpoint on that message actually but I don't see the message and the breakpoint never fires.
from grafana-plugin-sdk-go.
@asimpson I just tested this and works as expected for me. Did use the following steps:
- Clone the llm repo
npm install
mage -v
mage build:debug
- Edit custom.ini of Grafana
[plugin.grafana-llm-app]
path = /home/marcus/go/src/github.com/grafana/grafana-llm-app
[log]
filters = plugin.grafana-llm-app:debug
- Start grafana and configure/enable grafana-llm-app with dummy setting and click Save & test
- Verify that log messages from plugin are in grafana's server log
DEBUG[11-14|15:26:26] Creating new app instance logger=plugin.grafana-llm-app
DEBUG[11-14|15:26:26] Loading settings logger=plugin.grafana-llm-app
- Add .vscode/launch.json for plugin
{
"version": "0.2.0",
"configurations": [
{
"name": "Standalone debug mode",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/pkg",
"env": {},
"args": ["-standalone"]
}
]
}
- Set breakpoint at https://github.com/grafana/grafana-llm-app/blob/549bb92516fe7f6836841e82056d565a2e6f29c1/pkg/plugin/app.go#L40
- VS code start debugging using "Standalone debug mode"
- Navigate to http://localhost:3000/plugins/grafana-llm-app and click Save & test
- Breakpoint are hit
from grafana-plugin-sdk-go.
Closing this. Feel free to reach out if it still doesn't work and we can re-open
from grafana-plugin-sdk-go.
Related Issues (20)
- An error occurred when executing mage - v HOT 9
- Add a way to get the Grafana instance URL from backend plugins HOT 2
- Darwin ARM64 not built for build:debug mage target HOT 3
- Frame incorrectly parses Uint64 values HOT 1
- Support building plugins for FreeBSD amd64 HOT 1
- sqlutil.FrameFromRows: multiple results sets with different columns fail HOT 1
- Allow to set the same header multiple time in Prometheus Datascources HOT 1
- Fix flaky test
- Errorsource's RoundTripper returns custom error alongside response HOT 8
- Supports "Host" custom header for DataSources HOT 2
- Update functionality brought in from sqlds
- Macros can consume too much of a query containing parentheses
- getMacroMatches panics if given a macro arg string missing its close bracket HOT 1
- Standalone not erroring when required files are missing
- PDC request values should be handled as file contents instead of file paths
- Internal Data Links: Go & Typescript mismatch
- Support for executing queries in parallel
- Support build tags in Magefile HOT 1
- Improve building of nested plugins
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grafana-plugin-sdk-go.