Built in panel change

I have my panel ready but there is some issue while deploying. I think some build script issue. Can someone guide me through it?

There is not much thing I found in here related to that : http://docs.grafana.org/plugins/developing/development/

1 Like

Can you describe your problem in more detail?

If I’m guessing than it probably has something to do with the plugin id in the plugin.json file not being the same as plugin id you use in a path. For example:

The bubble chart plugin has an id: digrich-bubblechart-panel in the plugin.json file. When it loads the editor partial, the link looks like this:

public/plugins/digrich-bubblechart-panel/editor.html

Or maybe you are missing the plugin.json file? You should be able to see any errors in the Grafana Server log. It tries to load plugins on startup.

I updated the singlestat panel and made it doublestat meaning that it displays two values on the same tile. It runs on my localhost but when I tried to deploy it on my company’s environment, I could not. Seems like some buildscript problem.

So what should I change in order to keep the folder name doublestat instead of singlestat?

Currently what I did is I manipulated the singlestat code locally. When the panel was running fine, I pushed only the single stat folder which initially was on the path public/app/plugins/panel/. I changed folder name to doublestat. Now I have pushed only the folder to the git repository in order to deploy it.

If I try to change the id with respect to the folder name, it stops working. It is still singlestat id in plugin.json. When I tried to keep both simliar, it says ‘Unknown panel type singlstat’ on the localhost panel.

The folder name does not matter. For example, if the the path to the plugin is /data/plugins/this-name-does-not-matter, it is the plugin id that is the path that Grafana uses when loading the plugin.

There is already a plugin called Singlestat so you cannot have a plugin with the same name. Can you explain your problem a bit more clearly? I am only guessing at what your problem is.

@daniellee

This is the link to the panel (manipulation I made in singlestat ). How should I successfully deploy it without any build script errors? My need is that it becomes installable and also wants to keep the original grafana singlestat working.

Don’t see any build script here? If you are using TypeScript then you have to convert it to JavaScript. Grafana does not build plugins, it expects them to be ready to run. Plugins should be placed in the data/plugins directory. This is all explained in the documentation.

Copying the Singlestat plugin which is a built-in plugin is included in the Grafana build process is not the easiest way to build your first plugin. You will have to create your own build script.

Here is an example of a recent plugin using TypeScript:

How much JavaScript/TypeScript do you know? It is not so hard if you know how to setup a Grunt script and there are lots of plugins to look at so you copy most of what you need.

Singlestat is part of core Grafana and is therefore built by the Grafana grunt script. A plugin must have its own build script or be in plain JavaScript. It’s standard web development.

There are some existing plugins that are very similar to yours: