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.
Get our latest code.
go install github.com/bartmika/tpoller-server@latest
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")
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.
If you'd like to setup the project for development. Here are the installation steps:
-
Go to your development folder.
cd ~/go/src/github.com/bartmika
-
Clone the repository.
git clone https://github.com/bartmika/tpoller-server.git cd tpoller-server
-
Install the package dependencies
go mod tidy
-
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"
-
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
-
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"
Found a bug? Need Help? Please create an issue.
This application is licensed under the ISC License. See LICENSE for more information.