Skip to content

haohanyang/dynamodb-datasource

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grafana DynamoDB data source

Query your Amazon DynamoDB using PartiQL and visualize the results in your Grafana dashboards.

Graph

screenshot1

Table

screenshot2

Get started

Quick start

Run the script quick_start.py in the root directory to start Grafana containers with the DynamoDB plugin

python3 scripts/quick_start.py

Visit your Grafana at http://localhost:3000 and configure the data source with your AWS credentials

Full steps

  1. Download: Obtain the latest plugin build haohanyang-dynamodb-datasource-<version>.zip from the Release.

  2. Install:

    • Extract the downloaded archive (haohanyang-dynamodb-datasource-<version>.zip) into your Grafana plugins directory (/var/lib/grafana/plugins or similar).
    • Ensure the plugin binaries (dynamodb-datasource/gpx_dynamodb_datasource_*) have execute permissions (chmod +x).

Data source Configuration

The plugin uses grafana-aws-sdk-react in the configuration page, a common package used for all AWS-related plugins(including plugins made by Grafana Lab). In addition, to test the connection, the plugin requires a "test table", to which the plugin makes a DescribeTable request.

Query data

The plugin currently supports query via PartiQL. The plugin performs ExecuteStatement on the PartiQL statement that user enters.

Datetime attribute

To parse datetime attributes in Grafana, user needs to provide attribute names and format. The format can be unix timestamp (for integers) or day.js format (for strings)

Datetime Format
1731017392 Unix timestamp(s)
1731017406839 Unix timestamp(ms)
2024-10-31T22:04:29+01:00 YYYY-MM-DDTHH:mm:ssZ
2024-10-31T21:04:29Z YYYY-MM-DDTHH:mm:ss[Z]
2023-08-07T22:18:48.790770 YYYY-MM-DDTHH:mm:ss.SSSSSS
Thu, 31 Oct 2024 21:04:29 GMT ddd, DD MMM YYYY HH:mm:ss z

Variables

  • $__from and $__to (built-in): start and end in Unix timestamp(ms)
  • $from and $to: start and end in Unix timestamp(s)

You can filter data within the current time range:

SELECT * FROM MyTable WHERE TimeStamp BETWEEN $from AND $to