Skip to content
Tutorials Center
My learning

Topics

Lesson 14 of 37 ยท Data Sources

Other Data Sources: InfluxDB, Elasticsearch, CloudWatch and Plugins

A tour of other Grafana data sources: InfluxDB, Elasticsearch/OpenSearch, CloudWatch, Azure Monitor, Tempo, TestData, Infinity for JSON/CSV APIs, plus how to install plugins.

Beyond Prometheus, Loki and SQL, Grafana connects to dozens of systems. You will not use all of them, but knowing what exists helps you choose well and avoid moving data you do not need to move. Each source has its own query editor, yet the shape of the work is the same: connect, query, get data frames, draw.

None of these services run on this site. Query examples are read-only. The runnable stand-ins mimic the query ideas (time-bucket aggregations, JSON flattening, search filters) on in-page data.

InfluxDB

A purpose-built time series database. Grafana supports InfluxQL (SQL-like), Flux (a functional pipeline language for InfluxDB 2.x) and SQL (InfluxDB 3). Example InfluxQL:

TEXT
SELECT mean("usage_idle") FROM "cpu" WHERE $timeFilter GROUP BY time($__interval), "host" fill(null)

Flux example:

TEXT
from(bucket: "metrics")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r._measurement == "cpu" and r._field == "usage_idle")
  |> aggregateWindow(every: v.windowPeriod, fn: mean)

Elasticsearch and OpenSearch

Search engines used for logs and documents. The editor offers Metrics (count, average, max, raw data...), Group by (date histogram, terms, filters) and Lucene query text such as status:[500 TO 599] AND service:"checkout". Set the index name or pattern (for example logs-*) and the time field (@timestamp).

AWS CloudWatch, Azure Monitor, Google Cloud Monitoring

Cloud-native sources with their own authentication: IAM roles or access keys (CloudWatch), service principals (Azure), service account keys (Google). You pick a namespace, metric name, dimensions (such as InstanceId) and a statistic (Average, Sum, p99). CloudWatch also offers Logs Insights queries and a SQL-like Metric Insights. Note that cloud APIs may bill per request, so avoid very short refresh intervals.

Tempo, Jaeger, Zipkin

Trace backends. The usual workflow is to look up a trace by ID or search by service and duration, and to open the trace view: a waterfall of spans. Tempo's TraceQL can filter spans, e.g. { resource.service.name = "checkout" && duration > 500ms }. Links from logs and metrics (exemplars) usually lead here.

TestData

Built in; generates series without any backend. Scenarios include Random Walk, CSV Metric Values, Predictable Pulse, Streaming Client, Logs and Raw frames. It is ideal for learning, for demos and for reproducing a panel bug without sharing real data.

Infinity (a plugin) for JSON, CSV, XML and GraphQL

If your data comes from an HTTP API or a file rather than a database, the Infinity community plugin queries it directly, parses the response, lets you pick rows by a path and define column types. It is a quick way to chart a REST API.

Installing plugins

  1. Browse Administration > Plugins and data or the grafana.com catalog.
  2. Click Install (needs permission and, for Docker, network access), or use the CLI: grafana cli plugins install <plugin-id> and restart the server.
  3. In Docker, set GF_INSTALL_PLUGINS=grafana-clock-panel,yesoreyeram-infinity-datasource.
  4. Unsigned plugins need allow_loading_unsigned_plugins = <id>; avoid that in production.

Plugins come in three flavors: data source, panel and app (bundles of pages and integrations).

Choosing between sources

If your data is... Use
Infrastructure and app metrics Prometheus / Mimir, or InfluxDB
Logs Loki or Elasticsearch/OpenSearch
Business tables MySQL, PostgreSQL, SQL Server
Cloud resources CloudWatch, Azure Monitor, Google Cloud Monitoring
A REST API or file Infinity
Nothing yet TestData

Prefer querying data where it already lives. Copying data into another store only to chart it adds a pipeline to maintain.

Stand-in: flatten an API response

Infinity-style work: take JSON, choose a root path, and turn it into table rows. This stand-in does that for a sample response.

JS Stand-in: JSON to table rows

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Stand-in: an aggregation like Influx or Elasticsearch

Both engines group by time and tag, then compute a statistic. Here is the idea with mean per host per window.

JS Stand-in: group by time and tag

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which source is best for charting a REST API's JSON response without a database?

    Infinity fetches and parses JSON, CSV, XML or GraphQL over HTTP.
  2. 2. Which language does InfluxDB 2.x use for pipeline-style queries?

    Flux is InfluxDB 2.x's functional query language (InfluxQL is the SQL-like alternative).
  3. 3. In Elasticsearch data sources, which setting names the timestamp field?

    The time field (often @timestamp) tells Grafana which field to filter and group by time.
  4. 4. How do you install a plugin in a Docker Grafana without the UI?

    GF_INSTALL_PLUGINS (comma separated) installs plugins at container start.

Summary

  • Choose the source where the data already lives; Grafana speaks to many systems.
  • InfluxDB, Elasticsearch, cloud monitors and trace stores each have their own editors.
  • TestData and Infinity are handy for learning and APIs.
  • Plugins are installed from the catalog, the CLI or GF_INSTALL_PLUGINS.
  • Avoid unsigned plugins and over-frequent refreshes on billed APIs.

Next: Panel Basics: Editor, Options and Inspection