Documentation ¶
Index ¶
- Constants
- func GetAndResetFloat(name string) *expvar.Float
- func GetAndResetInt(name string) *expvar.Int
- func GetFloat(name string) *expvar.Float
- func GetInt(name string) *expvar.Int
- func GetString(name string) *expvar.String
- func SetEdition(edition string)
- func SetTarget(target string)
- type ClusterSeed
- type Config
- type Counter
- type Report
- type Reporter
- type RequestsMiddleware
Constants ¶
const ( EditionOSS = "oss" EditionEnterprise = "enterprise" )
const (
// ClusterSeedFileName is the file name for the cluster seed file.
ClusterSeedFileName = "mimir_cluster_seed.json"
)
const ( // DefaultReportSendInterval is the interval at which anonymous usage statistics are reported. DefaultReportSendInterval = 4 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
func GetAndResetFloat ¶
GetAndResetFloat calls GetFloat and then reset it to 0.
func GetAndResetInt ¶
GetAndResetInt calls GetInt and then reset it to 0.
func GetFloat ¶
GetFloat returns a new Float stats object for the given name. It creates the stats object if it doesn't exist yet.
func GetInt ¶
GetInt returns a new Int stats object for the given name. It creates the stats object if it doesn't exist yet.
Types ¶
type ClusterSeed ¶
type ClusterSeed struct { // UID is the unique cluster ID. UID string `json:"UID"` // CreatedAt is the timestamp when the seed file was created. CreatedAt time.Time `json:"created_at"` }
ClusterSeed is the seed for the usage stats.
type Config ¶
type Config struct { Enabled bool `yaml:"enabled"` InstallationMode string `yaml:"installation_mode"` }
func (*Config) RegisterFlags ¶
RegisterFlags adds the flags required to config this to the given FlagSet
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
func GetAndResetCounter ¶
GetAndResetCounter calls GetCounter and then reset it to 0.
func GetCounter ¶
GetCounter returns a new Counter stats object for the given name. It creates the stats object if it doesn't exist yet.
type Report ¶
type Report struct { // ClusterID is the unique Mimir cluster ID. ClusterID string `json:"clusterID"` // CreatedAt is when the cluster was created. CreatedAt time.Time `json:"createdAt"` // Interval is when the report was created (value is aligned across all replicas of the same Mimir cluster). Interval time.Time `json:"interval"` // IntervalPeriod is how frequently the report is sent, in seconds. IntervalPeriod float64 `json:"intervalPeriod"` // Target used to run Mimir. Target string `json:"target"` // Version holds information about the Mimir version. Version prom.PrometheusVersion `json:"version"` // Os is the operating system where Mimir is running. Os string `json:"os"` // Arch is the architecture where Mimir is running. Arch string `json:"arch"` // Edition is the Mimir edition ("oss" or "enterprise"). Edition string `json:"edition"` // Metrics holds custom metrics tracked by Mimir. Can contain nested objects. Metrics map[string]interface{} `json:"metrics"` }
Report is the JSON object sent to the stats server
type Reporter ¶
func NewReporter ¶
func NewReporter(bucketClient objstore.InstrumentedBucket, logger log.Logger, reg prometheus.Registerer) *Reporter
type RequestsMiddleware ¶
type RequestsMiddleware struct {
// contains filtered or unexported fields
}
RequestsMiddleware tracks the number of requests.
func NewRequestsMiddleware ¶
func NewRequestsMiddleware(name string) *RequestsMiddleware
NewRequestsMiddleware makes a new RequestsMiddleware.