Client to import measurements to timestream databases.

Go Reference GitHub go.mod Go version GitHub release (latest by date) Go Report Card Actions Status

Timestream DB Client

Client to import measurements to timestream databases.

Supported Databases/Services

  • AWS Timestream

AWS Timestream

Run NewTimestreamPublisher to create a new client for AWS Timestream. You've to pass a config which defines region, database, table name and batch size. If you don't pass a logger a new stdout logger will be created. See https://github.com/tommzn/go-log for more details about used logger.

package main

import (
    "fmt"

    metrics "github.com/tommzn/go-metrics"
    config "github.com/tommzn/go-config"
)

func main() {

    // Assumes a config.yml file in current folter.
    conf, err := config.NewConfigSource().Load()
    if err != nil {
        panic(err)
    }
    publisher := metrics.NewTimestreamPublisher(conf. nil)
    measurement := Measurement{
		MetricName: "test-metric",
		Tags: []MeasurementTag{MeasurementTag{
			Name:  "host",
			Value: "ip-10.0.1.12",
		}},
		Values: []MeasurementValue{MeasurementValue{
			Name:  "load",
			Value: 0.53,
		}},
	}

    // If batch size is not set or 0 this will directly import passed measurement to AWS Timestream.
    publisher.Send(measurement)
    // To ensure import of a aavailable measurements you've to flush the publisher.
    publisher.Flush()

    // Any errors that occur when importing measurements are collected.
    if err := publisher.Error(); err != nil {
        fmt.Println(err)
    }
}

Config

Following examples show a config with all available values.

aws:
  timestream:
    awsregion: eu-west-1
    database: timestream-db
    table: data
    batch_size: 10

AWS Credentials

Credentials for AWS access have to be setup separately as described in AWS SDK Docs.

Similar Resources

Use SQL to instantly query instances, networks, databases, and more from Scaleway. Open source CLI. No DB required.

Use SQL to instantly query instances, networks, databases, and more from Scaleway. Open source CLI. No DB required.

Scaleway Plugin for Steampipe Use SQL to query infrastructure servers, networks, databases and more from your Scaleway project. Get started → Document

Nov 16, 2022

Manage SQL databases, users and grant using kubernetes manifests

SqlOperator Operate sql databases, users and grants. This is a WIP project and should not at all be used in production at this time. Feel free to vali

Nov 28, 2021

Manage Schema for KubeDB managed Databases

schema-manager Manage Schema for KubeDB managed Databases Installation To install KubeDB, please follow the guide here. Using KubeDB Want to learn how

Feb 19, 2022

A go Library for scan database/sql rows to struct、slice、other types. And it support multiple databases connection management

ploto A go Library for scan database/sql rows to struct、slice、other types. And it support multiple databases connection management It's not an ORM. wo

Nov 3, 2022

SQLite extension for accessing other SQL databases

dblite SQLite extension for accessing other SQL databases, in SQLite. Similar to how Postgres Foreign Data Wrappers enable access to other databases i

Dec 23, 2022

Use SQL to query databases, logs and more from PlanetScale

Use SQL to instantly query PlanetScale databases, branches and more. Open source CLI. No DB required.

Sep 30, 2022

This is the code example how to use SQL to query data from any relational databases in Go programming language.

Go with SQL example This is the code example how to use SQL to query data from any relational databases in Go programming language. To start, please m

Mar 12, 2022

A simple auditor of SQL databases.

DBAuditor SQL数据库审计系统,目前支持SQL注入攻击审计 环境配置 sudo apt install golang 运行方式 将待审计语句填入test.txt中,然后运行主程序: 直接运行: go run main.go 编译运行: go build main.go ./main 主要目

Nov 9, 2022

Devcloud-go provides a sql-driver for mysql which named devspore driver and a redis client which named devspore client,

Devcloud-go Devcloud-go provides a sql-driver for mysql which named devspore driver and a redis client which named devspore client, you can use them w

Jun 9, 2022
Cross-platform client for PostgreSQL databases

pgweb Web-based PostgreSQL database browser written in Go. Overview Pgweb is a web-based database browser for PostgreSQL, written in Go and works on O

Dec 30, 2022
🏋️ dbbench is a simple database benchmarking tool which supports several databases and own scripts

dbbench Table of Contents Description Example Installation Supported Databases Usage Custom Scripts Troubeshooting Development Acknowledgements Descri

Dec 30, 2022
Go package for sharding databases ( Supports every ORM or raw SQL )
Go package for sharding databases ( Supports every ORM or raw SQL )

Octillery Octillery is a Go package for sharding databases. It can use with every OR Mapping library ( xorm , gorp , gorm , dbr ...) implementing data

Dec 16, 2022
Universal command-line interface for SQL databases

usql A universal command-line interface for PostgreSQL, MySQL, Oracle Database, SQLite3, Microsoft SQL Server, and many other databases including NoSQ

Jan 9, 2023
OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL.
OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL.

OctoSQL OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases, streaming sources and file formats using

Dec 29, 2022
Redis-shake is a tool for synchronizing data between two redis databases. Redis-shake是一个用于在两个redis之间同步数据的工具,满足用户非常灵活的同步、迁移需求。
Redis-shake is a tool for synchronizing data between two redis databases. Redis-shake是一个用于在两个redis之间同步数据的工具,满足用户非常灵活的同步、迁移需求。

RedisShake is mainly used to synchronize data from one redis to another. Thanks to the Douyu's WSD team for the support. 中文文档 English tutorial 中文使用文档

Dec 29, 2022
SQL API is designed to be able to run queries on databases without any configuration by simple HTTP call.

SQL API SQL API is designed to be able to run queries on databases without any configuration by simple HTTP call. The request contains the DB credenti

Dec 2, 2022
Go sqlite3 http vfs: query sqlite databases over http with range headers

sqlite3vfshttp: a Go sqlite VFS for querying databases over http(s) sqlite3vfshttp is a sqlite3 VFS for querying remote databases over http(s). This a

Dec 27, 2022
The open-source collaborative IDE for your databases.
The open-source collaborative IDE for your databases.

The open-source collaborative IDE for your databases in your browser. About Slashbase is an open-source collaborative IDE for your databases in your b

Sep 4, 2022
test ALL the databases

This project is an integration test, testing various Go database drivers (for the database/sql package). To run these tests, in this directory, run:

Dec 12, 2022