Skip to content

Instantly share code, notes, and snippets.

View david-martin's full-sized avatar

David Martin david-martin

View GitHub Profile
@david-martin
david-martin / metric_by_namespace_redhat-rhmi-amq-online.json
Last active July 6, 2020 08:58
count by (__name__, namespace) ({__name__=~".+",namespace="openshift-enmasse",job!="kube-state-metrics",job!="node-exporter",job!="kubelet"})
accepted_deliveries
addresses
ALERTS_FOR_STATE
ALERTS
artemis_connection_count
artemis_consumer_count
artemis_message_count
auto_links
connections
deliveries_delayed_10sec
@david-martin
david-martin / metrics_by_job.json
Last active May 7, 2020 16:03
oc -n redhat-rhmi-middleware-monitoring-operator exec prometheus-application-monitoring-0 -c prometheus -- curl -g 'http://localhost:9090/api/v1/query?' --data-urlencode 'query=count by (__name__, job) ({__name__=~".+",job!=""})' | jq '.data.result | group_by(.metric.job) | [.[]|{(.[0].metric.job):[.[].metric.__name__]|sort}]'
[
{
"3scale-apicast-pods": [
"nginx_http_connections",
"nginx_metric_errors_total",
"openresty_shdict_capacity",
"openresty_shdict_free_space",
"que_job_duration_seconds_bucket",
"que_job_duration_seconds_count",
"que_job_duration_seconds_sum",
@david-martin
david-martin / dashboard.json
Last active April 7, 2020 08:28
rhmi slo dashboard
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@david-martin
david-martin / alertmanager.cr.yml
Last active March 23, 2020 15:27
Application Monitoring Operator (AMO) example CRs
apiVersion: monitoring.coreos.com/v1
kind: Alertmanager
metadata:
name: application-monitoring
namespace: redhat-rhmi-middleware-monitoring-operator
spec:
baseImage: quay.io/openshift/origin-prometheus-alertmanager
containers:
- args:
- -provider=openshift
oc get blackboxtarget --all-namespaces -o yaml | grep -i -2 url
- module: http_2xx
service: 3scale-admin-ui
url: https://3scale-admin.apps.dkirwan.f6t9.s1.devshift.org//p/login/
status:
phase: 2
--
- module: http_2xx
service: 3scale-developer-console-ui
url: https://3scale.apps.dkirwan.f6t9.s1.devshift.org
{"level":"info","ts":1582290939.3897698,"logger":"controller_grafanadashboard","msg":"dashboard redhat-rhmi-rhsso/keycloak successfully submitted"}
E0221 13:15:39.391112 1 event.go:240] Server rejected event '&v1.Event{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{Name:"keycloak.15f534e311965d6b", GenerateName:"", Namespace:"redhat-rhmi-rhsso", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:"", ManagedFields:[]v1.ManagedFieldsEntry(nil)}, InvolvedObject:v1.ObjectReference{Kind:"GrafanaDashboard", Namespace:"redhat-rhmi-rhsso", Name:"keycloak", UID:"1b43179d-facb-45c4-af7d-b5565e3c2ac8", APIVersion:"integreatly.org/v1alpha1", Res
PLAY [localhost] ***************************************************************
TASK [Gathering Facts] *********************************************************
ok: [127.0.0.1]
TASK [include_role : prerequisites] ********************************************
TASK [prerequisites : Ensure cluster type is set] ******************************
included: /root/installation/roles/prerequisites/tasks/check_cluster_type.yml for 127.0.0.1
@david-martin
david-martin / _files_review.txt
Last active November 27, 2019 14:54
`git diff v1.5 master` `git diff v1.5 master --name-status --oneline`
These are all non code changes and can be dismissed.
M .github/PULL_REQUEST_TEMPLATE.md
A CHANGELOG.md
M README.adoc
M docs/customisation.md
A docs/monitoring/customisation.md
A docs/monitoring/grafana-endpoints-detailed.png
A docs/monitoring/prometheus-alert-working.png
A docs/monitoring_docs.asciidoc
@david-martin
david-martin / 3scale-metrics.log
Created November 25, 2019 17:20
3scale operator metrics
sh-4.2$ curl localhost:8383/metrics
# HELP controller_runtime_reconcile_errors_total Total number of reconciliation errors per controller
# TYPE controller_runtime_reconcile_errors_total counter
controller_runtime_reconcile_errors_total{controller="apimanager-controller"} 1
# HELP controller_runtime_reconcile_time_seconds Length of time per reconciliation per controller
# TYPE controller_runtime_reconcile_time_seconds histogram
controller_runtime_reconcile_time_seconds_bucket{controller="apimanager-controller",le="0.005"} 39
controller_runtime_reconcile_time_seconds_bucket{controller="apimanager-controller",le="0.01"} 48
controller_runtime_reconcile_time_seconds_bucket{controller="apimanager-controller",le="0.025"} 62
controller_runtime_reconcile_time_seconds_bucket{controller="apimanager-controller",le="0.05"} 77
@david-martin
david-martin / mdc_delete.log
Created October 30, 2019 11:12
mdc delete resources
TASK [mdc : Delete available resources] ****************************************
changed: [127.0.0.1] => (item=oauthclient.oauth.openshift.io/3scale)
changed: [127.0.0.1] => (item=oauthclient.oauth.openshift.io/cockpit-oauth-client)
changed: [127.0.0.1] => (item=oauthclient.oauth.openshift.io/console-oauth)
changed: [127.0.0.1] => (item=oauthclient.oauth.openshift.io/kibana-proxy)
changed: [127.0.0.1] => (item=oauthclient.oauth.openshift.io/launcher)
changed: [127.0.0.1] => (item=oauthclient.oauth.openshift.io/mobile-developer-console)
changed: [127.0.0.1] => (item=oauthclient.oauth.openshift.io/openshift-browser-client)
changed: [127.0.0.1] => (item=oauthclient.oauth.openshift.io/openshift-challenging-client)
changed: [127.0.0.1] => (item=oauthclient.oauth.openshift.io/openshift-console)