Example of GRPC echo service with go-metrics exported to InfluxDB instance running in Docker by go-metrics-influxdb reporter.
Prerequisites:
- Protocol Buffer Compiler (see protoc installation guide).
- Docker Compose (see docker-compose installation guide).
Generate golang code from echo.proto definition:
./generate-proto.shStart docker-compose with InfluxDB and Chronograf:
docker-compose up -dThe configuration for InfluxDB reporter is in influxdb-config.yaml file. Don't need to create localBucketId database, it will be done automatically.
Server and client available by the next commands:
go run server/main.go
go run client/main.goRun them in different terminals.
After docker-compose up -d is executed, then Chronograf instance is available on http://localhost:8888.
If you would like to see the rate for echo calls, then follow next link http://localhost:8888/sources/0/chronograf/data-explorer. Or use the query:
SELECT stddev("echo.count") AS "stddev_echo.count" FROM "localBucketId"."autogen"."measurement" WHERE time > :dashboardTime: AND time < :upperDashboardTime: GROUP BY time(1m) FILL(null)
go-metrics-influxdb-grpc-example is licensed under the MIT license. See the LICENSE file for details.