mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-02-19 15:30:17 +00:00

Co-authored-by: Andrew Chubatiuk <andrew.chubatiuk@motional.com> Co-authored-by: Nikolay <https://github.com/f41gh7> Co-authored-by: Roman Khavronenko <roman@victoriametrics.com>
27 lines
660 B
Go
27 lines
660 B
Go
package datadog
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/prompbmarshal"
|
|
)
|
|
|
|
// SplitTag splits DataDog tag into tag name and value.
|
|
//
|
|
// See https://docs.datadoghq.com/getting_started/tagging/#define-tags
|
|
func SplitTag(tag string) (string, string) {
|
|
n := strings.IndexByte(tag, ':')
|
|
if n < 0 {
|
|
// No tag value.
|
|
return tag, "no_label_value"
|
|
}
|
|
return tag[:n], tag[n+1:]
|
|
}
|
|
|
|
// Request represents DataDog submit metrics request
|
|
//
|
|
// See https://docs.datadoghq.com/api/latest/metrics/#submit-metrics
|
|
type Request interface {
|
|
Extract(func(prompbmarshal.TimeSeries) error, func(string) string) error
|
|
Unmarshal([]byte) error
|
|
}
|