mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2025-08-14 06:52:58 +02:00
.github
collectors
internal
receivers
scripts
sinks
README.md
gangliaCommon.go
gangliaSink.go
gangliaSink.md
httpSink.go
httpSink.md
influxAsyncSink.go
influxAsyncSink.md
influxSink.go
influxSink.md
libgangliaSink.go
libgangliaSink.md
metricSink.go
natsSink.go
natsSink.md
prometheusSink.go
prometheusSink.md
sampleSink.go
sinkManager.go
stdoutSink.go
stdoutSink.md
.gitignore
.gitmodules
LICENSE
Makefile
README.md
collectors.json
config.json
go.mod
go.sum
metric-collector.go
receivers.json
router.json
sinks.json
28 lines
686 B
Go
28 lines
686 B
Go
package sinks
|
|
|
|
import (
|
|
lp "github.com/ClusterCockpit/cc-metric-collector/internal/ccMetric"
|
|
)
|
|
|
|
type defaultSinkConfig struct {
|
|
MetaAsTags bool `json:"meta_as_tags,omitempty"`
|
|
Type string `json:"type"`
|
|
}
|
|
|
|
type sink struct {
|
|
meta_as_tags bool // Use meta data tags as tags
|
|
name string // Name of the sink
|
|
}
|
|
|
|
type Sink interface {
|
|
Write(point lp.CCMetric) error // Write metric to the sink
|
|
Flush() error // Flush buffered metrics
|
|
Close() // Close / finish metric sink
|
|
Name() string // Name of the metric sink
|
|
}
|
|
|
|
// Name returns the name of the metric sink
|
|
func (s *sink) Name() string {
|
|
return s.name
|
|
}
|