Giter Site home page Giter Site logo

grafana / mqtt-datasource Goto Github PK

View Code? Open in Web Editor NEW
164.0 137.0 47.0 3.64 MB

MQTT Datasource for Grafana allows streaming data from any MQTT broker running either locally or remotely.

License: Apache License 2.0

JavaScript 6.23% Go 72.51% TypeScript 21.25%
mqtt-datasource mqtt-protocol mqtt-client grafana-datasource grafana-plugin mqtt

mqtt-datasource's Introduction

Build Status

MQTT data source for Grafana

The MQTT data source plugin allows you to visualize streaming MQTT data from within Grafana.

Requirements

The MQTT data source has the following requirements:

  • Grafana user with a server or organization administration role; refer to Permissions.
  • Access to a MQTT broker.

Configure the data source

Add a data source by filling in the following fields:

Basic fields

Field Description
Name A name for this particular MQTT data source
URI The scheme, host, and port of the MQTT Broker. Supported schemes: TCP (tcp://), TLS (tls://), and WebSocket (ws://)

Authentication fields

Field Description
Username (Optional) The username to use when connecting to the MQTT broker
Password (Optional) The password to use when connecting to the MQTT broker

Query the data source

The query editor allows you to specify which MQTT topics the panel will subscribe to. Refer to the MQTT v3.1.1 specification for more information about valid topic names and filters.

mqtt dashboard

Known limitations

  • The plugin currently does not support all of the MQTT CONNECT packet options.
  • This plugin automatically supports topics publishing numbers, strings, booleans, and JSON formatted values. Nested object values can be extracted using the Extract Fields transformation.
  • This plugin automatically attaches timestamps to the messages when they are received. Timestamps included in the message body can be parsed using the Convert field type transformation.

Install the plugin

Installation Pre-requisites

Refer to: Building a Streaming Datasource Backend Plugin

Details: Ubuntu Windows

Meet compatibility requirements

This plugin currently supports MQTT v3.1.x.

Note: Since this plugin uses the Grafana Live Streaming API, make sure to use Grafana v8.0+

Installation Steps

  1. Clone the plugin to your Grafana plugins directory.
  2. Build the plugin by running yarn install and then yarn build.

NOTE: The yarn build command above might fail on a non-unix-like system, like Windows, where you can try replacing the rm -rf command with rimraf in the ./package.json file to make it work.

  1. Run mage reloadPlugin or restart Grafana for the plugin to load.

Verify that the plugin is installed

  1. In Grafana from the left-hand menu, navigate to Configuration > Data sources.
  2. From the top-right corner, click the Add data source button.
  3. Search for MQTT in the search field, and hover over the MQTT search result.
  4. Click the Select button for MQTT.

mqtt-datasource's People

Contributors

atifali avatar fzambia avatar jdbaldry avatar niklasci avatar ryantxu avatar toddtreece avatar tolzhabayev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mqtt-datasource's Issues

Building and installing the MQTT plugin

i have a small problem in building the Grafana mqtt plugin
i tried to build it in windows but i failed specially when i run the yarn build command i always get that -rm and mage in not recognized
then i switched to try to build it in ubuntu linux but i also faced the problem of mage is not recognized even though i had installed go and tried to install mage
can you help me in setting the necessary setup to be able to build the mqtt plugin correctly i hope that it will be bundled with grafana 8.1 release and this didn't happen
maybe how i can install mage orn something like that

Plugin unavailable

Sorry if this is not the right place for this issue. But I'm not able to make the mqtt-datasource plugin working. after compile(yarn install and Yarn build) and setup the "allow_loading_unsigned_plugins = grafana-mqtt-datasource" in the ini file I get Plugin unavailable when saving "Save and test" in grafana.

I do have a problem with build that might create this problem, but lack of skills cant solve what's the issue. During compile I get error code 127

✔ Compiling...
/bin/sh: 1: mage: not found
error Command failed with exit code 127.

Grafana interface
image

Complete compile log (raspberry pi 4)

############################################## Yarn install ######################################
root@pi4:/var/lib/grafana/plugins/mqtt-datasource-main# yarn install
yarn install v1.22.11
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
warning Pattern ["@grafana/ui@next"] is trying to unpack in the same destination "/usr/local/share/.cache/yarn/v6/npm-@grafana-ui-8.0.0-beta.3-2b293c3824b22fbca3a1d64d74893f1f27f75eb8-integrity/node_modules/@grafana/ui" as pattern ["@grafana/[email protected]","@grafana/[email protected]"]. This could result in non-deterministic behavior, skipping.
warning Pattern ["@types/lodash@latest"] is trying to unpack in the same destination "/usr/local/share/.cache/yarn/v6/npm-@types-lodash-4.14.170-0d67711d4bf7f4ca5147e9091b847479b87925d6-integrity/node_modules/@types/lodash" as pattern ["@types/lodash@^4.14.146"]. This could result in non-deterministic behavior, skipping.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning "@grafana/ui > @visx/[email protected]" has incorrect peer dependency "react@^15.0.0-0 || ^16.0.0-0".
warning "@grafana/ui > @visx/[email protected]" has incorrect peer dependency "react@^16.3.0-0".
warning "@grafana/ui > @visx/[email protected]" has incorrect peer dependency "react@^16.8.0-0".
warning "@grafana/ui > @visx/[email protected]" has incorrect peer dependency "react-dom@^16.8.0-0".
warning "@grafana/ui > [email protected]" has incorrect peer dependency "react@^15.0.0 || ^16.0.0".
warning "@grafana/ui > [email protected]" has incorrect peer dependency "react-dom@^15.0.0 || ^16.0.0".
warning "@grafana/ui > [email protected]" has incorrect peer dependency "react@^16.8.5".
warning "@grafana/ui > [email protected]" has incorrect peer dependency "react-dom@^16.8.5".
warning "@grafana/ui > [email protected]" has incorrect peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0".
warning "@grafana/ui > [email protected]" has incorrect peer dependency "react-dom@^0.14.0 || ^15.0.0 || ^16.0.0".
warning "@grafana/ui > [email protected]" has incorrect peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0-0".
warning "@grafana/ui > [email protected]" has incorrect peer dependency "react@^15.x || ^16.x".
warning "@grafana/ui > [email protected]" has incorrect peer dependency "react@^16.8.3".
warning "@grafana/runtime > @grafana/ui > @emotion/css > @emotion/[email protected]" has unmet peer dependency "@babel/core@^7.0.0".
warning "@grafana/runtime > @grafana/ui > @grafana/slate-react > [email protected]" has unmet peer dependency "slate-react@>=0.22.0".
warning "@grafana/runtime > @grafana/ui > @visx/shape > @visx/[email protected]" has incorrect peer dependency "react@^15.0.0-0 || ^16.0.0-0".
warning "@grafana/runtime > @grafana/ui > @visx/tooltip > @visx/[email protected]" has incorrect peer dependency "react@^15.0.0-0 || ^16.0.0-0".
warning "@grafana/runtime > @grafana/ui > @visx/tooltip > @visx/[email protected]" has incorrect peer dependency "react-dom@^15.0.0-0 || ^16.0.0-0".
warning "@grafana/runtime > @grafana/ui > @emotion/css > @emotion/babel-plugin > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "@grafana/runtime > @grafana/ui > rc-cascader > rc-trigger > [email protected]" has incorrect peer dependency "react@^16.0.0".
warning "@grafana/runtime > @grafana/ui > rc-cascader > rc-trigger > [email protected]" has incorrect peer dependency "react-dom@^16.0.0".
[5/5] Building fresh packages...
Done in 367.92s.

################################ Build ####################################################

root@pi4:/var/lib/grafana/plugins/mqtt-datasource-main# yarn build
yarn run v1.22.11
$ rm -rf dist && grafana-toolkit plugin:build && mage build:backend
Using Node.js v14.17.2
Using @grafana/toolkit v8.0.0-beta.3
✔ Preparing
✔ Linting
ts-jest[config] (WARN) The option tsConfig is deprecated and will be removed in ts-jest 27, use tsconfig instead
PASS src/handleEvent.test.ts

Test Suites: 1 passed, 1 total
Tests: 2 passed, 2 total
Snapshots: 2 passed, 2 total
Time: 3.77 s
Ran all test suites with tests matching "".
✔ Running tests
⠙ Compiling... Starting type checking service...
Using 1 worker with 2048MB memory limit
⠋ Compiling...
Hash: 6b5a018b08c2ac55e195
Version: webpack 4.41.5
Time: 21481ms
Built at: 28.07.2021 19.07.52
Asset Size Chunks Chunk Names
CHANGELOG.md 53 bytes [emitted]
LICENSE 11.1 KiB [emitted]
README.md 2.64 KiB [emitted]
img/mqtt.svg 1.31 KiB [emitted]
module.js 3.8 KiB 0 [emitted] module
module.js.LICENSE.txt 808 bytes [emitted]
module.js.map 24 KiB 0 [emitted] [dev] module
plugin.json 1000 bytes [emitted]
Entrypoint module = module.js module.js.map
[0] external "react" 42 bytes {0} [built]
[1] external "@grafana/ui" 42 bytes {0} [built]
[2] external "lodash" 42 bytes {0} [built]
[3] external "@grafana/data" 42 bytes {0} [built]
[4] external "@grafana/runtime" 42 bytes {0} [built]
[5] ./module.ts + 5 modules 14.5 KiB {0} [built]
| ./module.ts 296 bytes [built]
| ./datasource.ts 352 bytes [built]
| ./ConfigEditor.tsx 2.78 KiB [built]
| ./QueryEditor.tsx 658 bytes [built]
| ../node_modules/tslib/tslib.es6.js 10 KiB [built]
| ./handleEvent.ts 395 bytes [built]

✔ Compiling...
/bin/sh: 1: mage: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
root@pi4:/var/lib/grafana/plugins/mqtt-datasource-main# ^C

thanks in advance

Connected but not receiving on subscibed topic

I got the plugin installed (using grafana 9.3.1) on ubuntu 20.04
Added the data source, (using password auth) and got it correctly connected.
image

No data is received on test topic (to which I publish an integer as raw data).
image

Tried also with /test an also using json with no difference. Data is no coming. Looked for info in grafana logs but could not find anything relevant (do I need to set up logging somewhere?)

Closing Web Browser Causes DatasourceNoData Alert And Graph Data To Be Cleared (MQTT Datasource)

What happened:

During the process of setting up my new Grafana dashboard, any edit involving the mqtt-datasource topic reset all of the collected data. When I was first just editing the dashboard panels, I assumed this was working "as intended" during the edit/save cycle. When I started work on the alarms, I thought it was odd that this also reset the data.

I took my system live yesterday and noticed last night that if I close the browser window that I was simply watching the dashboard from, my data would reset and a DatasourceNoData alarm condition was raised. There was no editing or no saving of panels. I repeated this several times from both of my computers with different browsers. In each case, I had the same result - data wipe and alarm generated.

After about a minute, the DatasourceNoData condition is resolved and normal data collection resumes.

What you expected to happen:

I expect to be able to close the browser without resetting all of my collected data and without receiving a no-data alarm via email. I should be able to observe the visualization without destroying the data or generating false alarms.

How to reproduce it (as minimally and precisely as possible):

I initially configured this in a VM, then moved it to a Raspberry Pi4. I followed the same steps both times with identical results.

  1. Install latest Grafana via apt
  2. Install Mosqutto MQTT broker via apt
  3. Build grafana/mqtt-datasource plugin from source
  4. Start live data collection from IoT device
  5. Create simple time series panel to start graphing data
  6. Set up an alarm threshold with No Data alarm
  7. Allow some data to collect
  8. Close web browser
  9. Wait a minute for no data alarm
  10. Re-open browser and see the previously collected data is gone

Anything else we need to know?:

Other than spurious data loss and associated alarms, all systems are working as expected.

grafana.log shows the following relevant entries, most of which are just the alarm cycle. The key entry seems to be the "stop streaming" at the moment the browser closes.

logger=context t=2022-03-17T08:38:08-0400 lvl=info msg="Request Completed" method=GET path=/ status=302 remote_addr=192.168.2.10 time_ms=0 size=29 referer=
logger=http.server t=2022-03-17T08:38:24.64-0400 lvl=info msg="Successful Login" User=admin@localhost
logger=context t=2022-03-17T08:38:25.22-0400 lvl=info msg="Request Completed" method=GET path=/api/live/ws status=0 remote_addr=192.168.2.10 time_ms=2 size=0 referer=
logger=plugin.grafana-mqtt-datasource t=2022-03-17T08:39:35.39-0400 lvl=info msg="stop streaming (context canceled)"
logger=alertmanager org=1 level=debug component=dispatcher msg="Received alert" alert=DatasourceNoData[24f10d8][active]
logger=alertmanager org=1 level=debug component=dispatcher aggrGroup="{}/{scope=\"house\"}:{}" msg=flushing alerts=[DatasourceNoData[24f10d8][active]]
logger=alertmanager org=1 level=debug component=dispatcher receiver="House Alert" integration=email[0] msg="Notify success" attempts=1
logger=alertmanager org=1 level=debug component=dispatcher aggrGroup="{}/{scope=\"house\"}:{}" msg=flushing alerts=[DatasourceNoData[24f10d8][resolved]]
logger=alertmanager org=1 level=debug component=dispatcher receiver="House Alert" integration=email[0] msg="Notify success" attempts=1

Environment:
As noted, this was originally set up clean a few days ago using amd64 binaries in a VM rather than the arm64 packages for the Raspberry Pi. I'm confident the hardware platform is not the issue.

  • Grafana version: grafana/stable,now 8.4.3 arm64 (Edit: Not fixed with 8.4.4)
  • Data source type & version: grafana/mqtt-datasource (latest)
  • OS Grafana is installed on: Debian 11.2
  • User OS & Browser: macOS 10.15.7 and Win 11, Firefox, Chrome and Safari
  • Grafana plugins: only mqtt-datasource
  • Others: Mosquitto MQTT - mosquitto/stable, now 2.0.11-1 arm64

Live data stops being showed

I have set up a Grafana local server v8.4.5 which is connected through an MQTT broker plugin for grafana which can be found here: GitHub - grafana/mqtt-datasource: MQTT Datasource for Grafana allows streaming data from any MQTT broker running either locally or remotely. 1 Succesfully installed that and works fine. The only problem i face is that my realtime data stops being showed after some minutes. I taught it was the auto refresh option but it wasn’t. Once i refresh the browser my live data is back and will be shown for another minute or two. I would like to have realtime data or data with 5-10 seconds delay.Does someone has any suggestions? Couldn’t find any thing on the forum.In the MQTT explorer application if see my realtime data so its very weird why it stops
pEEEU
.

Enhancement: Add plugin to be installed via UI

Adding it to the plugin registry so that it can be installed via the UI would be very useful.
There are a lot of dev dependencies and tools that need to be installed in order to build and install this plugin.
The process took me close to an hour on a Pi4 due to the sheer amount of dependencies. An easier way to install it given its an official plugin would be really great.

Many mqtt topic queries in same table makes it flash during update

Already huge fan of the MQTT plugin for Grafana :)

But when I use multiple topic queries in the table plugin, the table flashes during update. even with slow updates eg. 5-10s. The issue is not a problem with only a few topics. hope that it can be solved in future versions.

Notice table in video clip

mqtt.and.table.plugin.flashing.during.update.mp4

Docker desktop for windows installation

Hi,

I try to install MQTT-datasource to my docker container. I use Docker Desktop for windows.
I was wondering how to compile the source and how to install it in the container ?

Here is my docker-compose file :

grafana:
image: grafana/grafana:8.4.4
container_name: grafana-server
restart: always
depends_on:
- influxdb
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_INSTALL_PLUGINS=grafana-mqtt-datasource
- GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=grafana-mqtt-datasource
links:
- influxdb
ports:
- 3000:3000
volumes:
- grafana_data:/var/lib/grafana
networks:
- influxdb_network

Best regards,
Pat

After changing time range, no data

When changing the time range for a plot, an error message pops up, and no data available anymore.

When changing from e.g. "last 2 minutes" to "last 1 minute" it works, but changing back to "last 2 minutes" results in
Streaming channel error: Subscription to the channel 1/ds/a8cojTcVk/200ms/coffee/Bricoletta/sensordata already exists

mqtt_datasource

String only as 0

Hello,

we are testing the Plugin now (with Grafana 8.1.1)
Values are interpreted correctly and easy JSON as well.
But this seems to be limited to Values (Float, ...), Strings are replaced by "0".

Also String in JSON payload gives error:
"error unmarshalling json message: json: cannot unmarshal string into Go value of type float64"

Is it planned to support Strings as well?

Thanks

Error when trying to yarn build

I get the following error when executing yarn build.

Any idea what im doing wrong?

/bin/sh: 1: mage: not found
error Command failed with exit code 127.

mage -version shows:

Mage Build Tool v1.11.0-2-g4cf3cfc
Build Date: 2021-08-22T20:05:12+02:00
Commit: 4cf3cfc
built with: go1.11.6

Confusion in README.md in the "very simple JSON-formatted messages" support between single and double quotes

Hi !

Just to let you know that the in the JSON message sent over MQTT, the key must be enclosed in double quotes and not single quotes (as it is written in the README.md). Messages with single quotes aren't recognised by the plugin at all, and it can be painful to debug such a simple mistake... especially since it's mentionned that it's the only supported format. People might want to adhere strictly to it. (no no no, it didn't happen to me 0:) )

If you could make it clearer the README.md, it might save some time to other users!

Sincerely,

Louis

send MQTT messages from html panel

Hi, once the datasource is installed and connected to the broker, there is a way to send MQTT messages from the html panel. Since the library is already installed, it would be great if you could make available a standard command to do it.

Error when adding source

New to grafana, so this may be a rookie question. I see 4 entries for the MQTT data source in the configuration view (default, 1, 2 and 3).

I built mqtt-datasource but got the following error in grafana when I tried to add it. No obvious grafana logs to share.
Running on Ubuntu 20.04, not using a container. Grafana v7.0.

An unexpected error happened
Details
Error: Minified React error #130

in form
    in tm
    in Unknown
    in div
    in t
    in form
    in div
    in div
    in t
    in div
    in div
    in div
    in t
    in t
    in div
    in t
    in t
    in x
    in ConnectWithCleanUp(Connect(t))
    in r
    in Unknown
    in t
    in Unknown
    in m
    in Unknown
    in Unknown
    in t
    in t
    in s

Streaming is not working? Have to manually refresh

Hi, from the animated GIF in the README I got the impression that a panel using the MQTT data would auto update as new data came in. I was hoping to use this to show my data at 10 Hz which the normal refresh method does not support.

However, for me, the panel does not auto update as in the README GIF. Do I have to activate that somewhere? I do to see all datapoints (10 are published each second) when I manually refresh or set the dashboard refresh to 1s. But then the whole dashboard updates at 1 Hz and it just fills in 10 datapoints at a time, and not 1 datapoint every 100ms, as I had hoped.

Do I have to activate streaming somewhere? Or am I missing something?

Grafana 8.1.1 on Debian 11, used the Ubuntu steps from the README to install the plugin. That seems to have worked at least.

Query error

I have compiled the mqtt-datasource with this procedure: #15 (comment)
Mqtt Cloud is the name I gave to the datasource.

It throws this error when I add a topic.
image

Plugin unavailable

I have an issue when I trying to use the plugin, I downloaded the code.. build, execute mage -v and I have a successful message.

I uploaded the package to grafana with all files, the plugins and gpx files, for all operative systems... But when I tried to create the datasource, I have the message "Plugin unavailable"

image

image

Support Counting Messages on Subtopics

Hey,

for our project we have a very complex message on our topics. So they didn't contain any usefull information for monitoring.

But what I'd like to do is monitoring my subtopics.

For example I have a topic structure like /Version/+/Services/+

So I wan't to monitor when something was published on one of my services.

In my head this isn't to hard to implement.

  1. Subscribe to a topic
  2. Each subtopic which appears gets a value in the grahp
  3. Each time a new message arrives on the subtopic create point with timestamp

I tried to implemented myself. But I am very new to Grafana an Go. So any help would be nice.

value as string, not number

Hi, I'm trying to send messages as string, since I would like to use mqtt with different panels other then time series, and I need text string
I tried with different syntax but nothing. I always get a very old data )(something like " 1750 ... ") and value 0.
Is that possible?

Missing signature

Hi I tried to install the mqtt plugin, but I get "Missing Signature" in Grafana Data source overview. Will there be a version that can run under Grafana 8.x. Or due I missing something during installation?

Updating mqtt plugin to new version 1.0.0-beta.1 within Grafana

I am trying to upgrade the MQTT plugin (windows 64bit) which I recently installed from version 0.0.1- dev. to version 1.0.0-beta.1
In the plugins section of Grafana, I see a prompt to update the plugin, however after selecting it I get a green popup which states the plugin was updated, followed by a yellow popup below stating "cannot install or change a core plugin". I've restarted the Grafana instance (windows) and looping back to my plugins page, it states there is still an update for the MQTT plugin.

Would it be best to uninstall the legacy MQTT plugin via Grafana, and manually install it via the Windows procedure?
Screenshot_2

Thanks again,

Streaming channel error: Subscription to the channel already exists

I'm trying to use Grafana to display MQTT data coming from The Things Network (a LoRaWAN network).

I have added the MQTT plugin and launched the dashboard. In the setting gear (on left side), I have clicked on Data sources and selected MQTT. I have provided the credentials. When I click on "Save & Test", Grafana says that the MQTT connection is OK.

I have then created a new Dashboard and added a new panel. In the Data Source I have selected MQTT and I have filled the "Topic".
However nothing gets displayed. In the Query inspector I get the following error:
"Streaming channel error: Subscription to the channel 1/ds/zTPvjx2Vk/30s/v3/my-mqtt-test-app@ttn/devices/eui-0080e115000ad609/join already exists"

Independently of that, I have installed a MQTT Client on my mobile (MyMQTT). I have here also provided the credentials and the Topic. Here it works, it properly received the MQTT notifications.

Would you have some advices to help me to understand why I have the above error in Grafana?
Thank you

Installing on windows

Hi, a few questions, first will this eventually appear in the usual place for grafana plugins, if so any idea when that might be?Additionally i get the error that a self signed certificate was detected in the chain, appreciate i could set it to load anyway, but doesnt that open me up to supply chain attacks?

I need information about how to preset MQTT with /provisioning/datasources/default.yml

Hello, I want to add this plugin as default, but I don't know what variables should be used to set it correctly:

datasources:
- name: MQTT
  access: websockets
  type: ammpio-mqtt-datasource
  websocket_url: wss://ws.mywebsocket.com/
  user: grafana
  pass: grafana
  isDefault: true
  editable: true

It works, but the WebSocket URL is not generated automatically, the password and the user are not generated either.

image
image

Support complex MQTT Payloads

Hello!

Nice plugin. Can you please update the documentation with information on how to format the payload?
No matter what I try, all I get is "Data does not have a time field"

Can I have complex objects with multiple values? Can I instruct it to parse the json?
E.g

{
  foo: { 
   bar: 1337
  }
  baz: 555
}

Thanks!

MQTT messages lost

when i have more than 1 or 2 panels using the mqtt data source, i will loose some messages, see the log below.

How to reproduce:
i have created a dummy configuration with emModbus2Influx (emModbus2Influx --configfile=config_03.conf) that sends 3 mqtt topics once a second. All 3 includes a count value that is always equal for all 3 topics.

ad/test/Live1 ad/test/Live2 ad/test/temp

All updates are received by grafana-mqtt-datasource but not all are forwarded, see my comments in the logfile below marked with >>

`logger=datasources t=2022-11-16T16:27:13.675580327+01:00 level=debug msg="Querying for data source via SQL store" id=1 orgId=1
logger=query_data t=2022-11-16T16:27:13.675811647+01:00 level=debug msg="Processing metrics query" query="unsupported value type"
logger=secrets.kvstore t=2022-11-16T16:27:13.67597391+01:00 level=debug msg="got secret value" orgId=1 type=datasource namespace=MQTT
logger=accesscontrol.service t=2022-11-16T16:27:13.67613391+01:00 level=debug msg="using cached permissions" key=rbac-permissions-1-user-2
logger=query_data t=2022-11-16T16:27:13.676219901+01:00 level=debug msg="Processing metrics query" query="unsupported value type"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:13.676257927+01:00 level=debug msg="Subscribing to MQTT topic: ad/test/Live2"
logger=secrets.kvstore t=2022-11-16T16:27:13.67626031+01:00 level=debug msg="got secret value from cache" orgId=1 type=datasource namespace=MQTT
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:13.67639417+01:00 level=debug msg="Subscribing to MQTT topic: ad/test/Live1"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:13.676423149+01:00 level=debug msg="Received MQTT Message for topic ad/test/Live2"
logger=accesscontrol.service t=2022-11-16T16:27:13.683297121+01:00 level=debug msg="using cached permissions" key=rbac-permissions-1-user-2
logger=query_data t=2022-11-16T16:27:13.683358611+01:00 level=debug msg="Processing metrics query" query="unsupported value type"
logger=secrets.kvstore t=2022-11-16T16:27:13.683406845+01:00 level=debug msg="got secret value from cache" orgId=1 type=datasource namespace=MQTT
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:13.683596016+01:00 level=debug msg="Subscribing to MQTT topic: ad/test/temp"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:13.683750535+01:00 level=debug msg="Received MQTT Message for topic ad/test/Live1"
logger=live t=2022-11-16T16:27:13.691270352+01:00 level=debug msg="Client wants to subscribe" user=2 client=f87862d2-1c6e-4bab-828d-45f60e9831bd channel=1/ds/WqLUxaI4k/ad/test/Live2
logger=live t=2022-11-16T16:27:13.691300881+01:00 level=debug msg="Found cached channel handler" channel=ds/WqLUxaI4k/ad/test/Live2
logger=secrets.kvstore t=2022-11-16T16:27:13.691394813+01:00 level=debug msg="got secret value from cache" orgId=1 type=datasource namespace=MQTT
logger=live.features t=2022-11-16T16:27:13.691626945+01:00 level=debug msg="Running a new unidirectional stream" path=ad/test/Live2
logger=live t=2022-11-16T16:27:13.691644867+01:00 level=debug msg="Client subscribed" user=2 client=f87862d2-1c6e-4bab-828d-45f60e9831bd channel=1/ds/WqLUxaI4k/ad/test/Live2
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:13.691852513+01:00 level=debug msg="Sending message to client for topic ad/test/Live2"
logger=live t=2022-11-16T16:27:13.707822959+01:00 level=debug msg="Client wants to subscribe" user=2 client=f87862d2-1c6e-4bab-828d-45f60e9831bd channel=1/ds/WqLUxaI4k/ad/test/Live1
logger=live t=2022-11-16T16:27:13.707851169+01:00 level=debug msg="Found cached channel handler" channel=ds/WqLUxaI4k/ad/test/Live1
logger=secrets.kvstore t=2022-11-16T16:27:13.707949187+01:00 level=debug msg="got secret value from cache" orgId=1 type=datasource namespace=MQTT
logger=live.features t=2022-11-16T16:27:13.708108432+01:00 level=debug msg="Running a new unidirectional stream" path=ad/test/Live1
logger=live t=2022-11-16T16:27:13.70812821+01:00 level=debug msg="Client subscribed" user=2 client=f87862d2-1c6e-4bab-828d-45f60e9831bd channel=1/ds/WqLUxaI4k/ad/test/Live1
logger=live t=2022-11-16T16:27:13.721369874+01:00 level=debug msg="Client wants to subscribe" user=2 client=f87862d2-1c6e-4bab-828d-45f60e9831bd channel=1/ds/WqLUxaI4k/ad/test/temp
logger=live t=2022-11-16T16:27:13.721418496+01:00 level=debug msg="Found cached channel handler" channel=ds/WqLUxaI4k/ad/test/temp
logger=secrets.kvstore t=2022-11-16T16:27:13.721577594+01:00 level=debug msg="got secret value from cache" orgId=1 type=datasource namespace=MQTT
logger=live.features t=2022-11-16T16:27:13.721825165+01:00 level=debug msg="Running a new unidirectional stream" path=ad/test/temp
logger=live t=2022-11-16T16:27:13.721871792+01:00 level=debug msg="Client subscribed" user=2 client=f87862d2-1c6e-4bab-828d-45f60e9831bd channel=1/ds/WqLUxaI4k/ad/test/temp

logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:13.724357377+01:00 level=debug msg="Received MQTT Message for topic ad/test/temp"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:14.33442008+01:00 level=debug msg="Received MQTT Message for topic ad/test/Live1"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:14.334460529+01:00 level=debug msg="Sending message to client for topic ad/test/Live1"
>>Received temp and Live1 but sending Live1 only

logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:14.337465347+01:00 level=debug msg="Received MQTT Message for topic ad/test/Live2"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:14.337488165+01:00 level=debug msg="Received MQTT Message for topic ad/test/temp"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:15.338292212+01:00 level=debug msg="Received MQTT Message for topic ad/test/Live1"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:15.338522928+01:00 level=debug msg="Sending message to client for topic ad/test/Live1"
>>Received 3 but send only Live1

logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:15.34111404+01:00 level=debug msg="Received MQTT Message for topic ad/test/Live2"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:15.341272993+01:00 level=debug msg="Received MQTT Message for topic ad/test/temp"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:15.341347859+01:00 level=debug msg="Sending message to client for topic ad/test/temp"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:15.341410063+01:00 level=debug msg="Sending message to client for topic ad/test/Live2"
>>ok

logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:16.340872849+01:00 level=debug msg="Received MQTT Message for topic ad/test/Live1"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:16.341019543+01:00 level=debug msg="Sending message to client for topic ad/test/Live1"
>>ok

logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:16.343194401+01:00 level=debug msg="Received MQTT Message for topic ad/test/Live2"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:16.343324883+01:00 level=debug msg="Received MQTT Message for topic ad/test/temp"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:17.343235473+01:00 level=debug msg="Received MQTT Message for topic ad/test/Live1"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:17.343272471+01:00 level=debug msg="Sending message to client for topic ad/test/Live1"
>>2 missing

logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:17.346370486+01:00 level=debug msg="Received MQTT Message for topic ad/test/Live2"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:17.346419652+01:00 level=debug msg="Received MQTT Message for topic ad/test/temp"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:18.347473028+01:00 level=debug msg="Received MQTT Message for topic ad/test/Live1"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:18.347564976+01:00 level=debug msg="Sending message to client for topic ad/test/Live1"
>>2 missing

logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:18.348677675+01:00 level=debug msg="Received MQTT Message for topic ad/test/Live2"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:18.348752423+01:00 level=debug msg="Received MQTT Message for topic ad/test/temp"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:18.348793068+01:00 level=debug msg="Sending message to client for topic ad/test/Live2"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:18.348824901+01:00 level=debug msg="Sending message to client for topic ad/test/temp"
>>ok

logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:19.35297471+01:00 level=debug msg="Received MQTT Message for topic ad/test/Live1"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:19.353043616+01:00 level=debug msg="Sending message to client for topic ad/test/Live1"

ok

logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:19.35393365+01:00 level=debug msg="Received MQTT Message for topic ad/test/Live2"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:19.353958364+01:00 level=debug msg="Sending message to client for topic ad/test/Live2"
>>ok

logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:19.353971612+01:00 level=debug msg="Received MQTT Message for topic ad/test/temp"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:19.353982034+01:00 level=debug msg="Sending message to client for topic ad/test/temp"
>>ok

logger=ngalert.scheduler t=2022-11-16T16:27:20.000199076+01:00 level=debug msg="Alert rules fetched" rulesCount=0 foldersCount=0
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:20.354546413+01:00 level=debug msg="Received MQTT Message for topic ad/test/Live1"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:20.354597225+01:00 level=debug msg="Sending message to client for topic ad/test/Live1"
>>ok

logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:20.355737634+01:00 level=debug msg="Received MQTT Message for topic ad/test/Live2"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:20.355770107+01:00 level=debug msg="Received MQTT Message for topic ad/test/temp"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:20.355789649+01:00 level=debug msg="Sending message to client for topic ad/test/Live2"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:20.355808337+01:00 level=debug msg="Sending message to client for topic ad/test/temp"
>>ok

logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:21.359707188+01:00 level=debug msg="Received MQTT Message for topic ad/test/Live1"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:21.359746331+01:00 level=debug msg="Sending message to client for topic ad/test/Live1"
>>ok

logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:21.360872038+01:00 level=debug msg="Received MQTT Message for topic ad/test/Live2"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:21.360893181+01:00 level=debug msg="Received MQTT Message for topic ad/test/temp"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:21.360905592+01:00 level=debug msg="Sending message to client for topic ad/test/temp"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:21.360917236+01:00 level=debug msg="Sending message to client for topic ad/test/Live2"
>>ok

logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:22.36365329+01:00 level=debug msg="Received MQTT Message for topic ad/test/Live1"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:22.363716+01:00 level=debug msg="Sending message to client for topic ad/test/Live1"
>>ok

logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:22.367414092+01:00 level=debug msg="Received MQTT Message for topic ad/test/Live2"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:22.36746368+01:00 level=debug msg="Received MQTT Message for topic ad/test/temp"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:23.369098973+01:00 level=debug msg="Received MQTT Message for topic ad/test/Live1"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:23.369278097+01:00 level=debug msg="Sending message to client for topic ad/test/Live1"
>>2 missing

logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:23.37020893+01:00 level=debug msg="Received MQTT Message for topic ad/test/Live2"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:23.370343106+01:00 level=debug msg="Received MQTT Message for topic ad/test/temp"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:23.370418303+01:00 level=debug msg="Sending message to client for topic ad/test/Live2"
logger=plugin.grafana-mqtt-datasource t=2022-11-16T16:27:23.37047651+01:00 level=debug msg="Sending message to client for topic ad/test/temp"
>>ok

`

mqtt-datasource on Raspberry Pi

Hi, tolzhabayev!

I tried to install the MQTT plugin on my Grafana server installed on the Raspberry Pi and I had the following issue when running the "yarn build"
Could you please help me with it?

yarn run v1.22.17
$ rm -rf dist && grafana-toolkit plugin:build && mage build:backend
Using Node.js v14.18.2
Using @grafana/toolkit v8.0.0-beta.3
✔ Preparing
✔ Linting
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
ts-jest[config] (WARN) The option tsConfig is deprecated and will be removed in ts-jest 27, use tsconfig instead
PASS src/handleEvent.test.ts

Test Suites: 1 passed, 1 total
Tests: 2 passed, 2 total
Snapshots: 2 passed, 2 total
Time: 6.285 s
Ran all test suites with tests matching "".
✔ Running tests
⠙ Compiling... Starting type checking service...
Using 1 worker with 2048MB memory limit
⠇ Compiling...
Hash: 6b5a018b08c2ac55e195
Version: webpack 4.41.5
Time: 37912ms
Built at: 01/29/2022 2:00:56 PM
Asset Size Chunks Chunk Names
CHANGELOG.md 53 bytes [emitted]
LICENSE 11.1 KiB [emitted]
EADME.md 3.69 KiB [emitted]
img/mqtt.svg 1.31 KiB [emitted]
module.js 3.8 KiB 0 [emitted] module
module.js.LICENSE.txt 808 bytes [emitted]
module.js.map 24 KiB 0 [emitted] [dev] module
plugin.json 1000 bytes [emitted]
Entrypoint module = module.js module.js.map
[0] external "react" 42 bytes {0} [built]
[1] external "@grafana/ui" 42 bytes {0} [built]
[2] external "lodash" 42 bytes {0} [built]
[3] external "@grafana/data" 42 bytes {0} [built]
[4] external "@grafana/runtime" 42 bytes {0} [built]
[5] ./module.ts + 5 modules 14.5 KiB {0} [built]
| ./module.ts 296 bytes [built]
| ./datasource.ts 352 bytes [built]
| ./ConfigEditor.tsx 2.78 KiB [built]
| ./QueryEditor.tsx 658 bytes [built]
| ../node_modules/tslib/tslib.es6.js 10 KiB [built]
| ./handleEvent.ts 395 bytes [built]

✔ Compiling...
/bin/sh: 1: mage: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Data storage

Hi, it seems that the plugin only show live data, from when you open the panel containing the query.
Is there any plan to save data in a database and show it when the panel is opened?
Previously i was using mqtt2prometheus for this task,
Regards,
Exander

Issue building on PiOS Bullseye

Hi,

I've been trying to build on PiOS Bullseye (Debain 11) 32Bit on a Pi3B and ran into a couple of problems.

Following the instructions here for Ubuntu, https://github.com/grafana/mqtt-datasource/issues/15#issuecomment-894477802

Firstly, it appears Node 16 is now required, there was an error thrown, easily fixed with this;

curl -sL https://deb.nodesource.com/setup_16.x | sudo bash -

Secondly, I got this error;

✔ Compiling... /home/pi/go/pkg/mod/github.com/grafana/[email protected]/build/common.go:5:2: package embed is not in GOROOT (/usr/lib/go-1.15/src/embed) Error: error compiling magefiles error Command failed with exit code 1.

PiOS Bullseye (Debain 11) apparently ships with go1.15 but embed was only included in go1.16

Is there a way around this? I suppose I could use Ubuntu on the Pi but I am out of my comfort zone there, and would like to stick to PiOS if at all possible...

Many Thanks.

Problem to receive MQTT notifications

I'm trying to use Grafana to display MQTT data coming from a MQTT Server on "The Things Network", a LoRaWAN network.

I have added the MQTT plugin and launched the dashboard. In the setting gear (on left side), I have clicked on Data sources and selected MQTT. I have provided the credentials. When I click on "Save & Test", Grafana says that the MQTT connection is OK.

I have then created a new Dashboard and added a new panel. In the Data Source I have selected MQTT and I have filled the "Topic".
For the moment, I don't succeed to get data displayed.
In the query inspector, I can see that the response has the status 200 so it was OK but it only contains empty data.

I don't think that the problem is on the MQTT server side (on The Things Network) because I have installed a MQTT Client on my mobile (MyMQTT) and configured it with the same Topic. It does receive the MQTT notifications so the MQTT server is working. The problem seems on Grafana side.

Would you have some advices?

Thank you

Variables as Topic

Hi, I'm trying to use variables as topic. I've tryed several syntax without success. Is it a problem related to Grafana or to the plugin itself?
I've installed the officilia mqtt datasource plugin directly from within grafana 9.3.2
Thanks

Plugin is showing unsigned

Hi,
Using grafana 8.1.
Installed go,yarn,mage,nodejs 14+
Cloned mqtt-datasource and executed yarn install then yarn build
Then
changed /etc/grafana/grafana.ini file with below config

plugins = /var/lib/grafana/plugins

allow_loading_unsigned_plugins = grafana-mqtt-datasource

then restarted
systemctl restart grafana-server.

In datasources mqtt is showing but while clicking mqtt datasource it is showing like
Screenshot from 2021-08-09 23-23-36

Screenshot from 2021-08-09 23-23-39

Multiple times restarted grafana but getting same .

GRAFANA -LOGS

t=2021-08-09T23:09:18+0530 lvl=warn msg="Running an unsigned plugin" logger=plugins pluginID=grafana-mqtt-datasource
pluginDir=/var/lib/grafana/plugins/mqtt-datasource/dist
t=2021-08-09T23:09:18+0530 lvl=info msg=Profiler logger=plugins.backend pluginId=grafana-mqtt-datasource enabled=false
t=2021-08-09T23:09:18+0530 lvl=info msg="Registering plugin" logger=plugins id=grafana-mqtt-datasource
t=2021-08-09T23:09:18+0530 lvl=info msg="Live Push Gateway initialization" logger=live.push_http
t=2021-08-09T23:09:18+0530 lvl=info msg="HTTP Server Listen" logger=http.server address=[::]:3000 protocol=http subUrl= socket=
t=2021-08-09T23:09:20+0530 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=0
remote_addr=[::1] time_ms=2 size=0 referer=
t=2021-08-09T23:10:03+0530 lvl=info msg="Request Completed" logger=context userId=1 orgId=1
uname=admin method=GET path=/api/live/ws status=0 remote_addr=[::1] time_ms=1 size=0 referer=
t=2021-08-09T23:10:06+0530 lvl=info msg="Request Completed" logger=context
userId=1 orgId=1 uname=admin method=GET path="/public/img/icons/unicons/icon-gf icon-gf-panel.svg" status=404 remote_addr=[::1] time_ms=3 size=31221
referer=http://localhost:3000/plugins/grafana-mqtt-datasource/

Any other configuration need change .

Enhancement Request: backfill history upon panel initialization

Hello,

It would be great to have the opportunity to backfill some data upon panel refresh or initialization.
How? I don't know...

  • Use an other datasource (sql request, ...)?
  • Keep last N messages in memory for all registered topics even if panel is not open?

Lionel;

tls ... how to configure to make it working ?

Hi all,
I a just beginning to use Grafana & I decided to use as datasource MQTT with Mosquito brocker on Windows configured like this :

listener 8884
protocol mqtt
require_certificate false
allow_anonymous true

cafile C:\Program Files\mosquitto\certs\mqtt_ca.crt
certfile C:\Program Files\mosquitto\certs\mqtt_srv.crt
keyfile C:\Program Files\mosquitto\certs\mqtt_srv.key
tls_version tlsv1.1

Grafana is on a Linux 22.04 VM and I configured the MQTT Data sources plugin like this:
URI : tls://192.168.0.108:8884
Username : tester
Password:

After a Save & Test :
error connecting to MQTT broker: network Error : x509: cannot validate certificate for 192.168.0.108 because it doesn't contain any IP SANs

Look like a cetificate probleme & I tried to modify grafana.ini to give the cert file but with no chance yet.
How to proceed i.e. where should I put certificate and what to modify ?
Thx in advance.

Error install plugins

I got this error ✔ Compiling...
/bin/sh: 1: mage: not found
error Command failed with exit code 127. Help please, Thanks!

retained MQTT messages not received upon panel refresh

Hello,

I have set up the mqtt-datasource and it works.
But I get only messages sent after panel is shown, even for messages set with "retained flag" in MQTT broker.
So, my panel is empty until the next message is sent.
I expect to get the retained message upon panel initialization or refresh for better user experience.

Lionel.

not working withing docker images

Hello,

i'm trying to get this plugin work with Grafana 8 in docker.
I'm using the official Grafana Image Version 8.0.4 (Alpine and Ubuntu).

After installing yarn i can install and build the plugin as described.
It fails with error
"
/bin/sh: mage: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
"

But after a restart of Grafana, the plugin is there (and has to be allowed by env var, because it's not signed).
I can configure this, but while saving there is the error: plugin unavailable.
In Log i get:
t=2021-07-07T10:25:54+0000 lvl=eror msg="Plugin unavailable" logger=context userId=1 orgId=1 uname=admin error="plugin unavailable" remote_addr=XXX

So after testing Alpine Version, i downloaded the ubuntu one, but same error.

mage is not installed, but there is no package to install.
So i tried to install golang and downloaded mage, but installation throws errors:
"
root@grafana:~/mage# go run bootstrap.go
Running target: Install
exec: go env GOBIN
exec: go env GOPATH
Error: failed to create "/root/go/bin": mkdir /root/go/bin: no such file or directory
exit status 1
"

So is there a way to get this run in docker environment with the official images?
Or can you bring this as a grafana plugin?

Plugin not showing

I was able to run the install without errors, but I don't see the plugin listed in data sources or plugins.

The newest version doesn't compile on Windows.

Hey guys, I have all the dependencies installed. and all the paths set so that these things are found..

  • yarn
  • rimraf
  • mage
  • npm
  • go

Yarn build however doesnt compile and throws a Type A not assignable to Type B error on my windows machine..

PS C:\Users\kib\Desktop\Projects\mqtt datasource for grafana\grafana-plugins\mqtt-datasource> yarn build
yarn run v1.22.15
warning ..\..\..\..\..\package.json: No license field
$ rm -rf dist && grafana-toolkit plugin:build && mage build:backend
'rm' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
PS C:\Users\kib\Desktop\Projects\mqtt datasource for grafana\grafana-plugins\mqtt-datasource> yarn build
yarn run v1.22.15
warning ..\..\..\..\..\package.json: No license field
$ rimraf dist && grafana-toolkit plugin:build && mage build:backend
  Using Node.js v16.5.0
  Using @grafana/toolkit v8.2.0-beta.2
√ Preparing
√ Linting
 PASS  src/handleEvent.test.ts

Test Suites: 1 passed, 1 total
Tests:       2 passed, 2 total
Snapshots:   2 passed, 2 total
Time:        5.271 s
Ran all test suites with tests matching "".
√ Running tests
- Compiling...  Starting type checking service...
  Using 1 worker with 2048MB memory limit
- Compiling...  ERROR in C:/Users/kib/Desktop/Projects/mqtt datasource for grafana/grafana-plugins/mqtt-datasource/src/ConfigEditor.tsx(53,17):
  TS2322: Type '{ name: string; required: true; value: string; css: string; autoComplete: string; onChange: (event: ChangeEvent<HTMLInputElement>) => void; }' is not assignable to type 'IntrinsicAttributes & Pick<Props, "onSubmit" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | ... 354 more ... | "addonAfter"> & RefAttributes<...>'.
    Property 'css' does not exist on type 'IntrinsicAttributes & Pick<Props, "onSubmit" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | ... 354 more ... | "addonAfter"> & RefAttributes<...>'.
  ERROR in C:/Users/kib/Desktop/Projects/mqtt datasource for grafana/grafana-plugins/mqtt-datasource/src/ConfigEditor.tsx(64,17):
  TS2322: Type '{ type: string; name: string; required: true; value: number; css: string; autoComplete: string; onChange: (event: ChangeEvent<HTMLInputElement>) => void; }' is not assignable to type 'IntrinsicAttributes & Pick<Props, "onSubmit" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | ... 354 more ... | "addonAfter"> & RefAttributes<...>'.
    Property 'css' does not exist on type 'IntrinsicAttributes & Pick<Props, "onSubmit" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | ... 354 more ... | "addonAfter"> & RefAttributes<...>'.
  ERROR in C:/Users/kib/Desktop/Projects/mqtt datasource for grafana/grafana-plugins/mqtt-datasource/src/ConfigEditor.tsx(76,17):
  TS2322: Type '{ name: string; value: string | undefined; css: string; autoComplete: string; onChange: (event: ChangeEvent<HTMLInputElement>) => void; }' is not assignable to type 'IntrinsicAttributes & Pick<Props, "onSubmit" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | ... 354 more ... | "addonAfter"> & RefAttributes<...>'.
    Property 'css' does not exist on type 'IntrinsicAttributes & Pick<Props, "onSubmit" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | ... 354 more ... | "addonAfter"> & RefAttributes<...>'.
  ERROR in C:/Users/kib/Desktop/Projects/mqtt datasource for grafana/grafana-plugins/mqtt-datasource/src/ConfigEditor.tsx(85,17):
  TS2322: Type '{ type: string; name: string; css: string; autoComplete: string; placeholder: string; value: string; onChange: (event: ChangeEvent<HTMLInputElement>) => void; onReset: () => void; }' is not assignable to type 'IntrinsicAttributes & Pick<Props, "onSubmit" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | ... 354 more ... | "addonAfter"> & RefAttributes<...>'.
    Property 'css' does not exist on type 'IntrinsicAttributes & Pick<Props, "onSubmit" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | ... 354 more ... | "addonAfter"> & RefAttributes<...>'.
  ERROR in C:/Users/kib/Desktop/Projects/mqtt datasource for grafana/grafana-plugins/mqtt-datasource/src/QueryEditor.tsx(22,13):
  TS2322: Type '{ name: string; required: true; value: string | undefined; css: string; autoComplete: string; onChange: (event: ChangeEvent<HTMLInputElement>) => void; }' is not assignable to type 'IntrinsicAttributes & Pick<Props, "onSubmit" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | ... 354 more ... | "addonAfter"> & RefAttributes<...>'.
    Property 'css' does not exist on type 'IntrinsicAttributes & Pick<Props, "onSubmit" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | ... 354 more ... | "addonAfter"> & RefAttributes<...>'.
× Build failed
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Faulty files

  1. src\configEditor.tsx
  • image
  1. src\QueryEditor.tsx

Versions

  1. Yarn : v1.22.15
  2. Go : go1.17.1 windows/amd64
  3. Mage: Mage Build Tool v1.11.0-4-gdd94424, Commit: dd94424
  4. Node: v16.5.0

failed to list gofiles tagged with "mage"

Compiling executing "yarn build" I get the following error.
Someone experienced the same?
✔ Compiling...
Error determining list of magefiles: listing mage files: failed to list gofiles tagged with "mage": exit status 1: go: finding github.com/stretchr/testify v1.4.0
go: finding github.com/prometheus/client_model v0.2.0
go: finding github.com/davecgh/go-spew v1.1.1
go: finding github.com/golang/protobuf v1.3.3

Mage version is:
Mage Build Tool v1.13.0-8-g26cdb5c
Build Date: 2022-06-21T09:02:01+02:00
Commit: 26cdb5c
built with: go1.11.6

Looking for "Extract field" feature

The readme file says:

"This plugin automatically supports topics publishing numbers, strings, booleans, and JSON formatted values. Nested object values can be extracted using the Extract Fields transformation."

Where can I find this Extract Fields transformation?

Thanks

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.