@@ -43,11 +43,11 @@ var (
4343 Name : EXECUTION_TIME ,
4444 Help : "Function duration" ,
4545 Buckets : durationBuckets ,
46- }, []string {"node" , " function" })
46+ }, []string {"function" })
4747 metricInitializationTime = promauto .NewHistogramVec (prometheus.HistogramOpts {
4848 Name : INITIALIZATION_TIME ,
4949 Help : "Function initialization time (cold start duration)" ,
50- }, []string {"node" , " function" })
50+ }, []string {"function" })
5151 metricOutputSize = promauto .NewHistogramVec (prometheus.HistogramOpts {
5252 Name : OUTPUT_SIZE ,
5353 Help : "Function output size" ,
@@ -122,7 +122,9 @@ func Init() {
122122 select {
123123 case <- ticker .C :
124124 // Push the entire registry in one go
125- err := push .New (pushgatewayUrl , "serverledge" ).Gatherer (registry ).Push ()
125+ err := push .New (pushgatewayUrl , "serverledge" ).Gatherer (registry ).
126+ Grouping ("node" , node .LocalNode .String ()).
127+ Add ()
126128 if err != nil {
127129 log .Printf ("Could not push metrics: %v" , err )
128130 }
@@ -142,10 +144,10 @@ func AddCompletedInvocation(funcName string, coldStart bool) {
142144 }
143145}
144146func AddFunctionDurationValue (funcName string , duration float64 ) {
145- metricExecutionTime .With (prometheus.Labels {"function" : funcName , "node" : node . LocalNode . String () }).Observe (duration )
147+ metricExecutionTime .With (prometheus.Labels {"function" : funcName }).Observe (duration )
146148}
147149func AddFunctionInitTimeValue (funcName string , initTime float64 ) {
148- metricInitializationTime .With (prometheus.Labels {"function" : funcName , "node" : node . LocalNode . String () }).Observe (initTime )
150+ metricInitializationTime .With (prometheus.Labels {"function" : funcName }).Observe (initTime )
149151}
150152func AddFunctionOutputSizeValue (funcName string , size float64 ) {
151153 metricOutputSize .With (prometheus.Labels {"function" : funcName }).Observe (size )
0 commit comments