OpenSearch data source
The OpenSearch data source plugin lets you query and visualize data from OpenSearch and Amazon OpenSearch Service in Grafana. You can build queries using Lucene or Piped Processing Language (PPL), visualize logs, metrics, and traces, and create annotations from OpenSearch data. The plugin also supports AWS Signature Version 4 (SigV4) authentication for Amazon OpenSearch Service and Amazon OpenSearch Serverless.
Requirements
- Grafana version 10.4.0 or later
Supported features
The following table lists the features available with the OpenSearch data source:
Get started
The following pages help you set up and use the OpenSearch data source:
- Configure the OpenSearch data source
- OpenSearch query editor
- Template variables
- Annotations
- Alerting
- Troubleshooting
Additional features
After configuring the data source, you can:
- Use Explore to run ad hoc queries and investigate your OpenSearch data without building a dashboard.
- Import the sample dashboards included with the plugin to get started quickly with traces, ecommerce, and web traffic visualizations. Navigate to the data source settings page and select the Dashboards tab.
- Add transformations to manipulate query results.
- Set up alerting to receive notifications when your data matches specific conditions.
Plugin updates
Always ensure that your plugin version is up-to-date so you have access to all current features and improvements. Navigate to Plugins and data > Plugins to check for updates. Grafana recommends upgrading to the latest Grafana version, and this applies to plugins as well.
Note
Plugins are automatically updated in Grafana Cloud.
Query with the Grafana CLI
You can query this data source from the command line and from AI coding agents using the Grafana CLI, gcx. gcx gives you and your agent structured, terminal-based access to your Grafana data sources, which is useful for automation and agent-driven investigations.
gcx supports Grafana Cloud and Grafana OSS or Enterprise v12 and later. Before you query, install and authenticate gcx. Refer to the
gcx CLI documentation for installation, configuration, and the full command reference.
For example, to query your OpenSearch data source, use gcx datasources opensearch:
# Search documents with a Lucene query
gcx datasources opensearch query -d <DATASOURCE_UID> 'app:frontend AND level:error' --since 1h
# Aggregate document counts over time, split by a field
gcx datasources opensearch metrics -d <DATASOURCE_UID> 'level:error' --group-by app.keyword --since 6h
# List indices and mapped fields to explore the data
gcx datasources opensearch list-indices -d <DATASOURCE_UID>
gcx datasources opensearch list-fields -d <DATASOURCE_UID>Replace <DATASOURCE_UID> with the UID of your OpenSearch data source. The query command takes a Lucene expression and a time range (--since); metrics buckets documents over time and can split series with --group-by; list-indices and list-fields let you explore available indices and their mapped fields.


