The plugin has a backend that runs on the Grafana server, started by Grafana as a child process. Every request to MoleSignal leaves from the Grafana server with the datasource’s token; browsers never reach MoleSignal. Grafana Cloud reaches a MoleSignal in a private network through Private data source connect.
Requirements
Create a token for Grafana
- Open Identity & Access → Service accounts and select Create service account.
- Enter the Name
grafanaand choose the Viewer role. - Select Create account and token, and copy the token. It expires in 365 days and is shown only once.
Install the plugin
Install the release archive with the Grafana CLI, or unpack it into the plugins directory of Grafana,/var/lib/grafana/plugins in the Linux packages and the Docker image:
grafana.ini, or with the environment variable GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=molesignal-datasource, then restart Grafana:
Add the datasource
- In Grafana, open Connections → Data sources, select Add new data source, and choose MoleSignal.
- Enter the URL of MoleSignal, such as
https://molesignal.example.com, and paste the API token. - Select Save & test.
streams.read and streams.query, counts the streams of each type, and checks that MoleSignal reads field queries.
Query types
PromQL
A range query reads one point per step. The step is the panel’s interval, never finer than Min step and never more than 11,000 steps per series. Legend names each series, with{{label}} for the value of a label. Exemplars draws the exemplars of the series, each of which opens its trace. MoleSignal implements a subset of PromQL.
Field queries
Logs, Trace search, and RED take the field query of the MoleSignal Logs and Traces pages, so a query means the same in both places:
The Add a condition row builds a comparison from a Field, an Operator, and a Value, and adds it with
AND. RED reads the Entry spans, where a service took a request in, or All spans.
SQL
SQL reads any stream. Stream names the stream the statement is planned against, the table afterFROM when empty. Format draws a Table, Time series, or Logs. These macros take the panel’s window:
$__interval, $__rate_interval, and $__range work in PromQL and SQL, in alert rules too.
Explore
Variables and ad hoc filters
A query variable lists one of these:
A variable with several values selected is written as each language reads a list:
(a|b) for =~ in PromQL, 'a', 'b' for IN (...) in SQL, and 'a', 'b' for in (...) in a trace field query.
Ad hoc filters narrow PromQL as label matchers in every selector, and field queries as AND conditions. Their keys and values come from the Logs stream of the datasource.
Annotations
An annotation query marks one Source on the panels of a dashboard:Alerting
Grafana alert rules run PromQL and SQL queries through the backend of the plugin. The alerting of MoleSignal goes further with real-time rules, incidents, on-call, and escalation. An alert that fires in Grafana can still reach MoleSignal as an external alert.Dashboards
The Dashboards tab of the datasource imports two dashboards:Limits
The Logs, Traces, and Metrics Drilldown apps of Grafana read Loki, Tempo, and Prometheus only, so they do not open this datasource.