Fixed mqtrigger scaling issue (#2986)

* Fixed mqtrigger scaling issue

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

* Resolve review comments

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

* Set goreleaser version to v1
Remove armv7 references from goreleaser file

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
This commit is contained in:
soharab-ic
2024-08-09 11:58:44 +05:30
committed by GitHub
parent 1732d9f4b0
commit 90d781ca2d
5 changed files with 58 additions and 133 deletions
+32
View File
@@ -45,6 +45,20 @@ var (
},
[]string{"trigger_name", "trigger_namespace", "topic", "partition"},
)
triggerStatus = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "fission_mqt_status",
Help: "Status of an individual trigger 1 if processing otherwise 0",
},
[]string{"trigger_name", "trigger_namespace"},
)
mqtInprocessCount = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "fission_mqt_inprocess",
Help: "Total number of MQTs in active processing",
},
[]string{},
)
)
func IncreaseSubscriptionCount() {
@@ -55,6 +69,22 @@ func DecreaseSubscriptionCount() {
subscriptionCount.WithLabelValues().Dec()
}
func SetTriggerStatus(trigname, trignamespace string) {
triggerStatus.WithLabelValues(trigname, trignamespace).Inc()
}
func ResetTriggerStatus(trigname, trignamespace string) {
triggerStatus.WithLabelValues(trigname, trignamespace).Dec()
}
func IncreaseInprocessCount() {
mqtInprocessCount.WithLabelValues().Inc()
}
func DecreaseInprocessCount() {
mqtInprocessCount.WithLabelValues().Dec()
}
func IncreaseMessageCount(trigname, trignamespace string) {
messageCount.WithLabelValues(trigname, trignamespace).Inc()
}
@@ -68,4 +98,6 @@ func init() {
registry.MustRegister(subscriptionCount)
registry.MustRegister(messageCount)
registry.MustRegister(messageLagCount)
registry.MustRegister(mqtInprocessCount)
registry.MustRegister(triggerStatus)
}