-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add basic info metrics to spin-operator
Signed-off-by: Rajat Jindal <[email protected]>
- Loading branch information
1 parent
6ea5fae
commit 2a970a6
Showing
3 changed files
with
65 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package controller | ||
|
||
import ( | ||
"github.com/prometheus/client_golang/prometheus" | ||
"sigs.k8s.io/controller-runtime/pkg/metrics" | ||
) | ||
|
||
func init() { | ||
registerPrometheusMetrics() | ||
} | ||
|
||
func registerPrometheusMetrics() { | ||
metrics.Registry.MustRegister(spinOperatorSpinAppInfo) | ||
metrics.Registry.MustRegister(spinOperatorSpinAppExecutorInfo) | ||
} | ||
|
||
var ( | ||
spinOperatorSpinAppInfo = prometheus.NewGaugeVec( | ||
prometheus.GaugeOpts{ | ||
Name: "spin_operator_spinapp_info", | ||
Help: "info about spinapp labeled by name, namespace, executor", | ||
}, | ||
[]string{ | ||
"name", | ||
"namespace", | ||
"executor", | ||
}, | ||
) | ||
|
||
spinOperatorSpinAppExecutorInfo = prometheus.NewGaugeVec( | ||
prometheus.GaugeOpts{ | ||
Name: "spin_operator_spinapp_executor_info", | ||
Help: "info about spinapp executor labeled by name, namespace, create_deployment and runtimeclass", | ||
}, | ||
[]string{ | ||
"name", | ||
"namespace", | ||
"create_deployment", | ||
"runtimeclass", | ||
}, | ||
) | ||
) |
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