Coder Social home page Coder Social logo

Comments (2)

kylebrandt avatar kylebrandt commented on May 28, 2024

Works on my machine:

$.get("/api/datasources/33/resources/boom")

DBUG[04-29|09:01:45] panic: BOOM                              logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45]                                          logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] goroutine 69 [running]:                  logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] github.com/grafana/test-datasource/pkg/datasource.(*testDatasource).testPanicHandler(...) logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] 	/home/kbrandt/go/github.com/grafana/test-datasource/pkg/datasource/resource_handler.go:102 logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] net/http.HandlerFunc.ServeHTTP(0xc0000ac5a0, 0xbe9ea0, 0xc000214a50, 0xc0001f4100) logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] 	/usr/local/go/src/net/http/server.go:2012 +0x44 logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] net/http.(*ServeMux).ServeHTTP(0xc0000c4280, 0xbe9ea0, 0xc000214a50, 0xc0001f4100) logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] 	/usr/local/go/src/net/http/server.go:2387 +0x1a5 logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] github.com/grafana/grafana-plugin-sdk-go/backend/resource/httpadapter.(*httpResourceHandler).CallResource(0xc0000ac5b0, 0xbece60, 0xc000214420, 0xc0003c6100, 0xbde380, 0xc000542200, 0xc00006c380, 0x7f032ecaa560) logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] 	/home/kbrandt/go/pkg/mod/github.com/grafana/[email protected]/backend/resource/httpadapter/handler.go:58 +0x42b logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] github.com/grafana/grafana-plugin-sdk-go/backend.(*resourceSDKAdapter).CallResource(0xc0000ac5c0, 0xc0003c6000, 0xbf1900, 0xc00056c440, 0x1, 0xc00056c440) logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] 	/home/kbrandt/go/pkg/mod/github.com/grafana/[email protected]/backend/resource_adapter.go:37 +0xec logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] github.com/grafana/grafana-plugin-sdk-go/backend/grpcplugin.(*resourceGRPCServer).CallResource(0xc0000ac860, 0xc0003c6000, 0xbf1900, 0xc00056c440, 0xc0000ac860, 0x20) logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] 	/home/kbrandt/go/pkg/mod/github.com/grafana/[email protected]/backend/grpcplugin/grpc_resource.go:42 +0x51 logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] github.com/grafana/grafana-plugin-sdk-go/genproto/pluginv2._Resource_CallResource_Handler(0xa16be0, 0xc0000ac860, 0xbefc80, 0xc0005421e0, 0x1f, 0xc00057c0a0) logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] 	/home/kbrandt/go/pkg/mod/github.com/grafana/[email protected]/genproto/pluginv2/backend.pb.go:1213 +0x109 logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] github.com/grpc-ecosystem/go-grpc-prometheus.(*ServerMetrics).StreamServerInterceptor.func1(0xa16be0, 0xc0000ac860, 0xbefe00, 0xc0002a20c0, 0xc000542160, 0xb279e8, 0xc000542180, 0xc000542160) logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] 	/home/kbrandt/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/server_metrics.go:121 +0xeb logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] github.com/grpc-ecosystem/go-grpc-middleware.ChainStreamServer.func1.1.1(0xa16be0, 0xc0000ac860, 0xbefe00, 0xc0002a20c0, 0xc000112c50, 0x40ce28) logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] 	/home/kbrandt/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:49 +0x5f logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] github.com/grpc-ecosystem/go-grpc-middleware.ChainStreamServer.func1(0xa16be0, 0xc0000ac860, 0xbefe00, 0xc0002a20c0, 0xc000542160, 0xb279e8, 0xbece60, 0xc000214420) logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] 	/home/kbrandt/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:58 +0xcf logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] google.golang.org/grpc.(*Server).processStreamingRPC(0xc000092480, 0xbf39a0, 0xc000130780, 0xc0001f4000, 0xc0000b13e0, 0x1056e60, 0x0, 0x0, 0x0) logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] 	/home/kbrandt/go/pkg/mod/google.golang.org/[email protected]/server.go:1244 +0x505 logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] google.golang.org/grpc.(*Server).handleStream(0xc000092480, 0xbf39a0, 0xc000130780, 0xc0001f4000, 0x0) logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] 	/home/kbrandt/go/pkg/mod/google.golang.org/[email protected]/server.go:1317 +0xcd6 logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc000117760, 0xc000092480, 0xbf39a0, 0xc000130780, 0xc0001f4000) logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] 	/home/kbrandt/go/pkg/mod/google.golang.org/[email protected]/server.go:722 +0xa1 logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] created by google.golang.org/grpc.(*Server).serveStreams.func1 logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] 	/home/kbrandt/go/pkg/mod/google.golang.org/[email protected]/server.go:720 +0xa1 logger=plugins.backend pluginId=grafana-test-datasource
DBUG[04-29|09:01:45] plugin process exited                    logger=plugins.backend pluginId=grafana-test-datasource path=/home/kbrandt/go/github.com/grafana/test-datasource/dist/gpx_test_linux_amd64 pid=15335 error="exit status 2"
EROR[04-29|09:01:45] Failed to                                logger=context userId=1 orgId=1 uname=admin error="Failed to receive response from resource call: rpc error: code = Unavailable desc = transport is closing"
EROR[04-29|09:01:45] Request Completed                        logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/33/resources/boom status=500 remote_addr=[::1] time_ms=9 size=148 referer="http://localhost:3000/d/DnYrXoNZk/new-dashboard-copy?editPanel=8&orgId=1"

from grafana-plugin-sdk-go.

joeblubaugh avatar joeblubaugh commented on May 28, 2024

@kylebrandt @marefr what do you think about giving panics a higher logging level? I understand that crashy plugins could cause problems, but catching panics is extremely valuable in production environments and debug logging often isn't turned on.

If we're worried about a ton of noise here, maybe Grafana itself could expose some kind of logEvery handler that would log only 1/10 panics or something similar.

from grafana-plugin-sdk-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.