-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added metric report on saga timeout (#114)
1) added reporting saga timeouts to the glue component 2) fixed mysql timeoutmanager error when trying to clear a timeout
- Loading branch information
Guy Baron
committed
Aug 9, 2019
1 parent
858d962
commit 2b4ea92
Showing
5 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package metrics | ||
|
||
import ( | ||
"github.com/prometheus/client_golang/prometheus" | ||
"github.com/prometheus/client_golang/prometheus/promauto" | ||
io_prometheus_client "github.com/prometheus/client_model/go" | ||
) | ||
|
||
var SagaTimeoutCounter = newSagaTimeoutCounter() | ||
|
||
func GetSagaTimeoutCounterValue() (float64, error) { | ||
m := &io_prometheus_client.Metric{} | ||
err := SagaTimeoutCounter.Write(m) | ||
|
||
if err != nil { | ||
return 0, err | ||
} | ||
|
||
return m.GetCounter().GetValue(), nil | ||
} | ||
|
||
func newSagaTimeoutCounter() prometheus.Counter { | ||
return promauto.NewCounter(prometheus.CounterOpts{ | ||
Namespace: grabbitPrefix, | ||
Subsystem: "saga", | ||
Name: "timeedout_sagas", | ||
Help: "counting the number of timedout saga instances", | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters