Skip to content

Commit

Permalink
Add haproxy metric (openshift#983)
Browse files Browse the repository at this point in the history
Co-authored-by: Isaac <ijimeno@redhat.com>
  • Loading branch information
openshift-cherrypick-robot and ncaak authored Sep 11, 2024
1 parent 89ed9a3 commit f0c44f6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/gathered-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,7 @@ None
- `openshift_apps_deploymentconfigs_strategy_total` introduced in version 4.13+ and backported to 4.12.5+ version
- `etcd_server_slow_apply_total` introduced in version 4.16+
- `etcd_server_slow_read_indexes_total` introduced in version 4.16+
- `haproxy_exporter_server_threshold` introduced in version 4.17+


## MutatingWebhookConfigurations
Expand Down
5 changes: 5 additions & 0 deletions docs/insights-archive-sample/config/metrics
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ etcd_server_slow_apply_total{endpoint="etcd-metrics",instance="10.0.96.175:9979"
etcd_server_slow_read_indexes_total{endpoint="etcd-metrics",instance="10.0.109.44:9979",job="etcd",namespace="openshift-etcd",pod="etcd-ip-10-0-109-44.us-west-1.compute.internal",service="etcd",prometheus="openshift-monitoring/k8s",prometheus_replica="prometheus-k8s-1"} 0 1706601229875
etcd_server_slow_read_indexes_total{endpoint="etcd-metrics",instance="10.0.63.176:9979",job="etcd",namespace="openshift-etcd",pod="etcd-ip-10-0-63-176.us-west-1.compute.internal",service="etcd",prometheus="openshift-monitoring/k8s",prometheus_replica="prometheus-k8s-1"} 0 1706601227589
etcd_server_slow_read_indexes_total{endpoint="etcd-metrics",instance="10.0.96.175:9979",job="etcd",namespace="openshift-etcd",pod="etcd-ip-10-0-96-175.us-west-1.compute.internal",service="etcd",prometheus="openshift-monitoring/k8s",prometheus_replica="prometheus-k8s-1"} 0 1706601209352
# TYPE haproxy_exporter_server_threshold untyped
haproxy_exporter_server_threshold{container="router",endpoint="metrics",instance="10.128.2.6:1936",job="router-internal-default",namespace="openshift-ingress",pod="router-default-6d5d498b64-g78rk",service="router-internal-default",type="current",prometheus="openshift-monitoring/k8s",prometheus_replica="prometheus-k8s-1"} 20 1720178542159
haproxy_exporter_server_threshold{container="router",endpoint="metrics",instance="10.128.2.6:1936",job="router-internal-default",namespace="openshift-ingress",pod="router-default-6d5d498b64-g78rk",service="router-internal-default",type="limit",prometheus="openshift-monitoring/k8s",prometheus_replica="prometheus-k8s-1"} 500 1720178542159
haproxy_exporter_server_threshold{container="router",endpoint="metrics",instance="10.131.0.5:1936",job="router-internal-default",namespace="openshift-ingress",pod="router-default-6d5d498b64-f7t92",service="router-internal-default",type="current",prometheus="openshift-monitoring/k8s",prometheus_replica="prometheus-k8s-1"} 20 1720178536552
haproxy_exporter_server_threshold{container="router",endpoint="metrics",instance="10.131.0.5:1936",job="router-internal-default",namespace="openshift-ingress",pod="router-default-6d5d498b64-f7t92",service="router-internal-default",type="limit",prometheus="openshift-monitoring/k8s",prometheus_replica="prometheus-k8s-1"} 500 1720178536552
# TYPE console_helm_installs_total untyped
console_helm_installs_total{chart_name="elasticsearch-sed",chart_version="1.0.0",container="console",endpoint="https",instance="10.129.0.63:8443",job="console",namespace="openshift-console",pod="console-8d5d6d756-6nscn",service="console",prometheus="openshift-monitoring/k8s",prometheus_replica="prometheus-k8s-0"} 1 1660729192308
console_helm_installs_total{chart_name="redis-sed",chart_version="1.0.1",container="console",endpoint="https",instance="10.129.0.63:8443",job="console",namespace="openshift-console",pod="console-8d5d6d756-6nscn",service="console",prometheus="openshift-monitoring/k8s",prometheus_replica="prometheus-k8s-0"} 1 1660729192308
Expand Down
2 changes: 2 additions & 0 deletions pkg/gatherers/clusterconfig/gather_most_recent_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const (
// - `openshift_apps_deploymentconfigs_strategy_total` introduced in version 4.13+ and backported to 4.12.5+ version
// - `etcd_server_slow_apply_total` introduced in version 4.16+
// - `etcd_server_slow_read_indexes_total` introduced in version 4.16+
// - `haproxy_exporter_server_threshold` introduced in version 4.17+
func (g *Gatherer) GatherMostRecentMetrics(ctx context.Context) ([]record.Record, []error) {
metricsRESTClient, err := rest.RESTClientFor(g.metricsGatherKubeConfig)
if err != nil {
Expand All @@ -91,6 +92,7 @@ func gatherMostRecentMetrics(ctx context.Context, metricsClient rest.Interface)
Param("match[]", "openshift_apps_deploymentconfigs_strategy_total").
Param("match[]", "etcd_server_slow_apply_total").
Param("match[]", "etcd_server_slow_read_indexes_total").
Param("match[]", "haproxy_exporter_server_threshold").
DoRaw(ctx)
if err != nil {
klog.Errorf("Unable to retrieve most recent metrics: %v", err)
Expand Down

0 comments on commit f0c44f6

Please sign in to comment.