mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-11-10 04:27:25 +01:00
57629a2e0a
* Change ccMetric->Influx functions * Use a meta_as_tags string list in config but create a lookup map afterwards * Add meta as tag logic to sampleSink
28 lines
708 B
Go
28 lines
708 B
Go
package sinks
|
|
|
|
import (
|
|
lp "github.com/ClusterCockpit/cc-metric-collector/internal/ccMetric"
|
|
)
|
|
|
|
type defaultSinkConfig struct {
|
|
MetaAsTags []string `json:"meta_as_tags,omitempty"`
|
|
Type string `json:"type"`
|
|
}
|
|
|
|
type sink struct {
|
|
meta_as_tags map[string]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
|
|
}
|