adding container gc metrics
@@ -80,6 +80,9 @@ type PrometheusEmitter struct {
droppedContainer *prometheus.GaugeVec
destroyingVolumesToBeGarbageCollected prometheus.Counter
+ creatingContainersToBeGarbageCollected prometheus.Counter
+ createdContainersToBeGarbageCollected prometheus.Counter
+
workerContainersLabels map[string]map[string]prometheus.Labels
workerVolumesLabels map[string]map[string]prometheus.Labels
workerTasksLabels map[string]map[string]prometheus.Labels
@@ -548,27 +551,48 @@ func (config *PrometheusConfig) NewEmitter(attributes map[string]string) (metric
)
prometheus.MustRegister(workerOrphanedVolumesToBeCollected)
- droppedContainer := prometheus.NewGaugeVec(
- prometheus.GaugeOpts{
+ destroyingVolumesToBeGarbageCollected := prometheus.NewCounter(
+ prometheus.CounterOpts{
Namespace: "concourse",
Subsystem: "volumes",
- Name: "GC container collector job dropped",
- Help: "Workers that have the container collector job dropped",
+ Name: "destroying volumes to be garbage collected",
+ Help: "Volumes being destroyed to be garbage collected",
ConstLabels: attributes,
- }, []string{"worker"},
+ },
)
+ prometheus.MustRegister(destroyingVolumesToBeGarbageCollected)
- destroyingVolumesToBeGarbageCollected := prometheus.NewCounter(
+ creatingContainersToBeGarbageCollected := prometheus.NewCounter(
prometheus.CounterOpts{
Namespace: "concourse",
- Subsystem: "volumes",
- Name: "destroying volumes to be garbage collected",
- Help: "Volumes being destroyed to be garbage collected",
+ Subsystem: "containers",
+ Name: "creating containers to be garbage collected",
+ Help: "Creating Containers being garbage collected",
ConstLabels: attributes,
},
)
+ prometheus.MustRegister(creatingContainersToBeGarbageCollected)
- prometheus.MustRegister(destroyingVolumesToBeGarbageCollected)
+ createdContainersToBeGarbageCollected := prometheus.NewCounter(
+ prometheus.CounterOpts{
+ Namespace: "concourse",
+ Subsystem: "containers",
+ Name: "created containers to be garbage collected",
+ Help: "Created Containers being garbage collected",
+ ConstLabels: attributes,
+ },
+ )
+ prometheus.MustRegister(createdContainersToBeGarbageCollected)
+
+ droppedContainer := prometheus.NewGaugeVec(
+ prometheus.GaugeOpts{
+ Namespace: "concourse",
+ Subsystem: "volumes",
+ Name: "GC container collector job dropped",
+ Help: "Workers that have the container collector job dropped",
+ ConstLabels: attributes,
+ }, []string{"worker"},
+ )
getStepCacheHits := prometheus.NewCounter(
prometheus.CounterOpts{
@@ -724,6 +748,10 @@ func (emitter *PrometheusEmitter) Emit(logger lager.Logger, event metric.Event)
emitter.checkBuildFinishedMetrics(logger, event)
case "worker containers":
emitter.workerContainersMetric(logger, event)
+ case "creating containers to be garbage collected":
+ emitter.creatingContainersToBeGarbageCollected.Add(event.Value)
+ case "created containers to be garbage collected":
+ emitter.createdContainersToBeGarbageCollected.Add(event.Value)
case "worker volumes":
emitter.workerVolumesMetric(logger, event)
case "worker unknown containers":
