From 2e9cec5488249732c1c16cc20f36946bb1255249 Mon Sep 17 00:00:00 2001 From: Thomas Roehl Date: Tue, 18 May 2021 15:39:02 +0200 Subject: [PATCH] Update README for sinks and rename file --- sinks/README.md | 9 ++++----- sinks/{sink.go => metricSink.go} | 0 2 files changed, 4 insertions(+), 5 deletions(-) rename sinks/{sink.go => metricSink.go} (100%) diff --git a/sinks/README.md b/sinks/README.md index 08a1de8..1de92d3 100644 --- a/sinks/README.md +++ b/sinks/README.md @@ -1,10 +1,9 @@ This folder contains the sinks for the cc-metric-collector. -# `sink.go` -The base class/configuration is located in `sink.go`. +# `metricSink.go` +The base class/configuration is located in `metricSink.go`. # Sinks -There are currently two sinks shipped with the cc-metric-collector: * `stdoutSink.go`: Writes all metrics to `stdout` in InfluxDB line protocol. The sink does not use https://github.com/influxdata/line-protocol to reduce the executed code for debugging * `influxSink.go`: Writes all metrics to an InfluxDB database instance using a blocking writer. It uses https://github.com/influxdata/influxdb-client-go . Configuration for the server, port, user, password and database name are in the global configuration file * `natsSink.go`: Sends all metrics to an NATS server using the InfluxDB line protocol as encoding. It uses https://github.com/nats-io/nats.go . Configuration for the server, port, user, password and database name are in the global configuration file. The database name is used as subject for the NATS messages. @@ -13,8 +12,8 @@ There are currently two sinks shipped with the cc-metric-collector: Nothing to do, all sinks are pure Go code # Contributing own sinks -A sink contains three functions and is derived from the type `Sink` (in `sink.go`): -* `Init(host string, port string, user string, password string, database string) error` +A sink contains three functions and is derived from the type `Sink` (in `metricSink.go`): +* `Init(config SinkConfig) error` * `Write(measurement string, tags map[string]string, fields map[string]interface{}, t time.Time) error` * `Close()` diff --git a/sinks/sink.go b/sinks/metricSink.go similarity index 100% rename from sinks/sink.go rename to sinks/metricSink.go