Skip to content

Application written in Go which polls Time-series data at specific intervals and saves to persistent storage

License

Notifications You must be signed in to change notification settings

bartmika/tpoller-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TPoller Server

Overview

The purpose of this application is to poll time-series data per time interval from any (telemetry) application running a gRPC server which implements the the following gRPC service definition:

service Telemetry {
    rpc GetTimeSeriesData (google.protobuf.Empty) returns (stream TelemetryDatum) {}
}

message TelemetryLabel {
    string name = 1;
    string value = 2;
}

message TelemetryDatum {
    string metric = 1;
    repeated TelemetryLabel labels = 2;
    double value = 3;
    google.protobuf.Timestamp timestamp = 4;
}

Your server which implemented the gRPC service definition is called a data reader. tpoller-server will then send your polled data over gRPC to a fast time-series data storage server called tstorage-server.

Installation

Get our latest code.

go install github.com/bartmika/tpoller-server@latest

Usage

Run our application.

$GOBIN/tpoller-server serve --telemetry_addr="127.0.0.1:50051" --storage_addr="127.0.0.1:50052"

If the server successfully starts you should see a message in your termnal:

2021/07/15 00:51:00 Storage connected
2021/07/15 00:51:00 Telemeter connected
2021/07/15 00:51:00 Synching with local time...
2021/07/15 00:52:00 Synchronized with local time.
2021/07/15 00:52:00 TPoller is now running.

More sub-command details:

Run the tpoller service in the foreground which will periodically call the "data reader" to retrieve time-series data and save it to "tstorage" server.

Usage:
  tpoller-server serve [flags]

Flags:
  -h, --help                    help for serve
  -o, --storage_addr string     The time-series data storage gRPC server address. (default "localhost:50051")
  -i, --telemetry_addr string   The telemetry gRPC server address with the 'data reader'. (default "localhost:50052")

Used by:

This server is confirmed to successfully poll from the following application(s):

If you'd like to add your app, please create a pull request with a link to your app.

Contributing

Development

If you'd like to setup the project for development. Here are the installation steps:

  1. Go to your development folder.

    cd ~/go/src/github.com/bartmika
  2. Clone the repository.

    git clone https://github.com/bartmika/tpoller-server.git
    cd tpoller-server
  3. Install the package dependencies

    go mod tidy
  4. In your terminal, make sure we export our path (if you haven’t done this before) by writing the following:

    export PATH="$PATH:$(go env GOPATH)/bin"
  5. Run the following to generate our new gRPC interface. Please note in your development, if you make any changes to the gRPC service definition then you'll need to rerun the following:

    protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative proto/telemetry.proto
  6. You are now ready to start the server and begin contributing!

    go run main.go serve --telemetry_addr="127.0.0.1:50051" --storage_addr="127.0.0.1:50052"

Quality Assurance

Found a bug? Need Help? Please create an issue.

License

This application is licensed under the ISC License. See LICENSE for more information.

About

Application written in Go which polls Time-series data at specific intervals and saves to persistent storage

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages