how to create Grafana Custom Plugins? - grafana

I am new to grafana and I have to make custom plugins in grafana.
I have searched the web and also read the documentations in grafana org and found the following way on how to make a custom panel plugin:
npx #grafana/toolkit plugin:create [plugin_name]
now, what happens after I run the above command it creates an environment and after completion ask me to execute yarn Install and when I execute this it throws the following error:
how can I resolve this ? I have search a lot but couldn't find any solution I have also tried downgrading node version but that also didn't help.

Related

Plugin-helpers not found in wazuh-kibana-app

I have cloned the Wazuh-Kibana-app source code from https://github.com/wazuh/wazuh-kibana-app
I have made some changes in the styling. So, i am making build of the app by running npm run build but i am getting this error
Command "plugin-helpers" not found
I think it is because in package.json file, it gets like that "plugin-helpers": "node ../../scripts/plugin_helpers" as it is getting out of the directory. So how to resolve this issue?
The Wazuh Kibana plugin uses the Kibana plugin_helpers to build a distributable archive of the plugin, information on how to create a Kibana development installation which is capable of building the Wazuh plugin can be found here: https://github.com/wazuh/wazuh-kibana-app/wiki/Develop-new-features
There is also the option of building the Kibana plugin using the wazuh-packages tools as explained here: https://documentation.wazuh.com/current/development/packaging/generate-wazuh-kibana-app.html , however as of right now this only accepts branches from the official Wazuh plugin.
Let me know if you have any more questions!

Skaffold and mutiple Sub Charts

lately I was experimenting with Skaffold with our Helm Charts and I am in little bit in a dilemma that our Helm Chart \ Sub Charts are compatible with Skaffold or not.
Our helm Charts are looking like the following
my-helm-charts
+-charts
+-project1
+-project2
+-project3
+-project4
+-infrastructure_kafka
+-charts
+-kafka
+-zookeeper
+-infrastructure_cassandra
+-infrastructure_elasticsearch
+-Charts.yaml
+-Values.yaml
The reason we choosed to structure the Helm Charts this way, is that if necessary to spin up extra stages for our project.
Now when I want to develop project2 with Google Cloud Code / Skaffold (which I configured correctly and I can start without problem in IntelliJ) I have to start whole my-helm-charts.
That is actually Ok but the problem is, if I use Debug in Kubernetes, I have a feeling Google Cloud Code/Skaffold can really locate the project2 and no debugging occurs.
My feeling is Google Cloud/Skaffold is more oriented to work with following contruct...
project2-helm
+-templates
+-Charts.yaml
+-Values.yaml
My Subcharts contructs starts in Google Cloud Code/Skaffold without any exception but I can't debug, is it possible to achieve want I want with my structure and if yes, how?
Or is it not possible at all...
Thx for answers...
We recently added a feature called config dependencies which might help here. It allows you to create more specific skaffold.yamls and then map them together with a "requires" field:
https://skaffold.dev/docs/design/config/#configuration-dependencies
Once you have the skaffold.yamls created and the right dependency mapping you can run skaffold with the -m flag to choose once slice of your services:
skaffold dev -m project3
Cloud Code support for modules is incoming.
Cloud Code IntelliJ and Cloud Code VS Code recently added preview level support for deploying and debugging modules of a larger application which uses Skaffold. See more here https://cloud.google.com/code/docs/intellij/skaffold-modules

Can't Deploy additionnal packages in a pipeline job

I use a nodejs App in the continuous delivery. Recently I installed a package (puppeteer) which fails to launch because it requires some shared librairies (xlib). This issue is documented (here) and I just need to install additionnal packages.
So I have added in my "BUILD" job additional lines:
#!/bin/bash
npm install
sudo apt-get update
sudo apt-get install -y --fix-missing libx11-6 libx11-xcb1 libxcb1 .......
It installs successfully (couple of errors though), the build job ends with success. (6 upgraded, 133 newly installed, 0 to remove and 55 not upgraded.)
But when I start the App in the "deploy" stage. the file is still missing!
Am I installing this properly?
2020-05-20T08:27:03.83+0000 [APP/PROC/WEB/0] ERR Unhandled Rejection at: Error: Failed to launch the browser process!
2020-05-20T08:27:03.83+0000 [APP/PROC/WEB/0] ERR /home/vcap/deps/0/node_modules/puppeteer/.local-chromium/linux-756035/chrome-linux/chrome: error while loading shared libraries: libX11-xcb.so.1: cannot open shared object file: No such file or directory
you may want to discuss this problem directly on our public Slack.
Self register here: https://ic-devops-slack-invite.us-south.devops.cloud.ibm.com/
then ask your question here https://ibm-devops-services.slack.com/
I suspect you should add the missing dependencies to your package.json
sorry to hear that registration did not work.
Simply go here https://ic-devops-slack-invite.us-south.devops.cloud.ibm.com/
put your email address
and get your invite.
You should receive an email to register - pick a password of your choice.
Anyhow, I'll check on your issue ASAP
1 - ensure puppeteer dependencies are installed without any errors.
You wrote "It installs successfully (couple of errors though)"
and "55 not upgraded".
Possibly, dependencies are not fully installed or at the required level.
2 - As suggested in previous comments, you are using the pipeline base image.
You may want to build and use your own custom image, an image that would match all your prereqs.
https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-custom_docker_images
Ok got it sorted. data_Henrik was right from start.
What I was doing above in the deployment jobs was useless. It is NOT what will be deployed with the APP.
Instead, you need to deploy "multi buildpack" with (for my APP) the standard nodejs buildpack and also a buildpack specially made to install debian dependencies : https://github.com/cloudfoundry/apt-buildpack. example here: https://ict.swisscom.ch/2019/11/no-root-access-no-debian-packages-on-cloud-foundry-thats-past-with-the-apt-buildpack/
So for my nodejs app it ends up with:
1- a specific apt.yml files containing the list of dependencies (note I had to add a couple more eg libgbm-dev)
2- a specific multi-buildpack.yml containing the list of buildpacks
And that is it. I run the usual build and deploy jobs..

Does anyone have tried the HLF 2.0 feature "External Builders and Launchers" and wants to get in touch?

I'm getting my way through the HLF 2.0 docs and would love to discuss and try out the new features "External Builders and Launchers" and "Chaincode as an external service".
My goal is to run HLF2.0 on an K8s cluster (OpenShift). Does anyone wants to get in touch or has anyone already figured his way through?
Cheers from Germany
Also trying to use the ExternalBuilder. Setup core.yaml, rebuilt the containers to use it. I get an error that on "peer lifecycle chaincode install .tgz...", that the path to the scripts in core.yaml can not be found.
I've added volume bind commands in the peer-base.yaml, and in docker-compose-cli.yaml, and am using the first-network setup. Dropped out the part of the byfn.sh that would connect to the cli container, so that I do that part manually, do the create, join, update anchors successfully, and then try to do the install and fail. However, on the install, I'm failing on the /bin/detect, because it can't find that file to fork/exec it. To get that far, peer was able to read my external configuration, and read the core.yaml file. At the moment, trying the "mode: dev" in the core.yaml which seems to indicate that the scripts and the chaincode will be run "locally", which I think means it should run in the cli container. Otherwise, tried to walk the code to see how the docker containers are being created dynamically, and from what image, but haven't been able to nail that down yet.

Writing a custom panel plugin for grafana

So I need to write a custom grafana plugin, that works like a funnel. I decided to try and integrate this funnel. Note that it is supposed to get the data from a mysql Server and use it just as a table and not as time series.
So far I read the grafana documentation and then watched this video. In the video a dataFormat is declared in the plugin.json file, however when I checked other working Plugins I didn't see that part written in the plugin.json. The GitHub repos in the video are also gone. I stumbled upon this one though, so then I copied it in the data/plugin directory. I restarted the Server and it was detected but when I tried making a new Panel I got an error saying that it could not be found. I was planning on starting with this example and then working my way towards integrating the funnel part but I can't seem to get it working. Any ideas where to start?
I have reproduced your problem with the same actions and got same error:
Panel plugin not found: myorgid-simple-panel
Just a guess: there is a dependency section in plugin.json file
"dependencies": {
"grafanaVersion": "6.3.x",
"plugins": []
}
My Grafana version is v6.2.5. Isn't this plugin template for future Grafana release (master or developement version)?
I had the same problem with simple-react-panel. To solve it, I ran in the simple-react-panel-master directory :
npm i #grafana/toolkit
npm i #grafana/ui
yarn build
and after I restart grafana service