26 lines
409 B
Go
26 lines
409 B
Go
package core
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
)
|
|
|
|
type Metric struct {
|
|
Name string
|
|
Help string
|
|
Type string // "counter", "gauge", "histogram"
|
|
Value float64
|
|
Labels map[string]string
|
|
Timestamp time.Time
|
|
}
|
|
|
|
type Reader interface {
|
|
Name() string
|
|
Read(ctx context.Context) ([]Metric, error)
|
|
}
|
|
|
|
type Exporter interface {
|
|
Name() string
|
|
Write(ctx context.Context, metrics []Metric) error
|
|
}
|