github.com/juju/juju@v0.0.0-20240327075706-a90865de2538/core/charm/metrics/metrics.go (about) 1 // Copyright 2021 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package metrics 5 6 // MetricKey represents metrics keys collected and sent to charmhub. 7 type MetricKey string 8 9 func (c MetricKey) String() string { 10 return string(c) 11 } 12 13 const ( 14 // Controller is used in RequestMetrics 15 Controller MetricKey = "controller" 16 17 // Model is used in RequestMetrics 18 Model MetricKey = "model" 19 20 // 21 // Controller and Model, included in the RefreshRequest Metrics. 22 // 23 24 // UUID is the uuid of a model, either controller or model. 25 UUID MetricKey = "uuid" 26 // JujuVersion is the version of juju running in this model. 27 JujuVersion MetricKey = "juju-version" 28 29 // 30 // Model metrics, included in the RefreshRequest Metrics. 31 // 32 33 // Provider matches the provider type defined in juju. 34 Provider MetricKey = "provider" 35 // Region is the region this model is operating in. 36 Region MetricKey = "region" 37 // Cloud is the name of the cloud this model is operating in. 38 Cloud MetricKey = "cloud" 39 // NumApplications is the number of applications in the model. 40 NumApplications MetricKey = "applications" 41 // NumMachines is the number of machines in the model. 42 NumMachines MetricKey = "machines" 43 // NumUnits is the number of units in the model. 44 NumUnits MetricKey = "units" 45 46 // 47 // Charm metrics, included in the RefreshRequestContext Metrics. 48 // 49 50 // Relations is a common separated list of charms currently related 51 // to an application. (no spaces) 52 Relations MetricKey = "relations" 53 )