-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding observation and performable metrics (#313)
* Add observation and performable metrics * Group metrics by label * Add missing metric label * Track performables added in reports() step * align performables reports step * Resolve lint complaint --------- Co-authored-by: amirylm <[email protected]>
- Loading branch information
1 parent
22812a0
commit 2740fc7
Showing
3 changed files
with
67 additions
and
4 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package prommetrics | ||
|
||
import ( | ||
"github.com/prometheus/client_golang/prometheus" | ||
"github.com/prometheus/client_golang/prometheus/promauto" | ||
) | ||
|
||
// NamespaceAutomation is the namespace for all Automation related metrics | ||
const NamespaceAutomation = "automation" | ||
|
||
// Plugin error types | ||
const ( | ||
PluginErrorTypeInvalidOracleObservation = "invalid_oracle_observation" | ||
PluginErrorTypeDecodeOutcome = "decode_outcome" | ||
PluginErrorTypeEncodeReport = "encode_report" | ||
) | ||
|
||
// Plugin steps | ||
const ( | ||
PluginStepResultStore = "result_store" | ||
PluginStepObservation = "observation" | ||
PluginStepOutcome = "outcome" | ||
PluginStepReports = "reports" | ||
) | ||
|
||
// Automation metrics | ||
var ( | ||
AutomationPluginPerformables = promauto.NewGaugeVec(prometheus.GaugeOpts{ | ||
Namespace: NamespaceAutomation, | ||
Name: "plugin_performables", | ||
Help: "How many performables were present at a given step in the plugin flow", | ||
}, []string{ | ||
"step", | ||
}) | ||
AutomationPluginError = promauto.NewCounterVec(prometheus.CounterOpts{ | ||
Namespace: NamespaceAutomation, | ||
Name: "plugin_error", | ||
Help: "Count of how many errors were encountered in the plugin by label", | ||
}, []string{ | ||
"step", | ||
"error", | ||
}) | ||
) |