def api_call_latency(title, metric, verb, scope, threshold): return d.Graph( title=title, targets=[ d.Target(expr=str(threshold), legendFormat="threshold"), d.Target( expr='quantile_over_time(0.99, %(metric)s{quantile="0.99", verb=~"%(verb)s", scope=~"%(scope)s"}[12h])' % {"metric": metric, "verb": verb, "scope": scope} ), ], yAxes=g.single_y_axis(format=g.SECONDS_FORMAT), )
def api_call_latency(title, verb, scope, threshold): return d.Graph( title=title, targets=[ g.Target(expr=str(threshold), legendFormat="threshold"), g.Target( expr='apiserver:apiserver_request_latency_1m:histogram_quantile{quantile="0.99", verb=~"%(verb)s", scope=~"%(scope)s"}' % {"verb": verb, "scope": scope}, legendFormat="{{verb}} {{scope}}/{{resource}}", ), ], yAxes=g.single_y_axis(format=g.SECONDS_FORMAT), )
def api_call_latency(title, verb, scope, threshold): return d.Graph( title=title, targets=[ g.Target(expr=str(threshold), legendFormat="threshold"), g.Target( expr=d.one_line(expression % { "verb": verb, "scope": scope }), # TODO(github.com/grafana/grafana/issues/19410): uncomment once fixed # legendFormat="{{verb}} {{scope}}/{{resource}}", ), ], yAxes=g.single_y_axis(format=g.SECONDS_FORMAT), )
def api_call_latency(title, verb, scope, threshold): return d.Graph( title=title, targets=[ g.Target(expr=str(threshold), legendFormat="threshold"), g.Target( expr=d.one_line(""" apiserver:apiserver_request_latency_1m:histogram_quantile{ quantile="0.99", verb=~"%(verb)s", scope=~"%(scope)s", resource=~"${resource:regex}s*", }""" % { "verb": verb, "scope": scope }), # TODO(github.com/grafana/grafana/issues/19410): uncomment once fixed # legendFormat="{{verb}} {{scope}}/{{resource}}", ), ], yAxes=g.single_y_axis(format=g.SECONDS_FORMAT), )
# Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from grafanalib import core as g import defaults as d DNS_LATENCY_PANEL = [ d.Graph( title="In-cluster DNS latency SLI", targets=d.show_quantiles( ("quantile_over_time(" + "0.99, " + 'probes:dns_lookup_latency:histogram_quantile{{quantile="{quantile}"}}[24h])' ), legend="{{quantile}}", ), yAxes=g.single_y_axis(format=g.SECONDS_FORMAT), nullPointMode="null", ), d.Graph( title="DNS latency", targets=d.show_quantiles( 'probes:dns_lookup_latency:histogram_quantile{{quantile="{quantile}"}}', legend="{{quantile}}", ), yAxes=g.single_y_axis(format=g.SECONDS_FORMAT), nullPointMode="null", ), d.Graph(
d.simple_graph( "etcd_disk_backend_commit_duration_seconds", "histogram_quantile(0.99, sum(rate(etcd_disk_backend_commit_duration_seconds[1m])) by (le, instance))", yAxes=g.single_y_axis(format=g.SECONDS_FORMAT), ), d.simple_graph( "etcd wal fsync duration", "histogram_quantile(1.0, sum(rate(etcd_disk_wal_fsync_duration_seconds_bucket[1m])) by (le, endpoint))", yAxes=g.single_y_axis(format=g.SECONDS_FORMAT), ), d.Graph( title="etcd compaction max pause", points=True, lines=False, targets=[ g.Target( expr= "histogram_quantile(1.0, sum(rate(etcd_debugging_mvcc_db_compaction_pause_duration_milliseconds_bucket[1m])) by (le, instance))" ) ], yAxes=g.single_y_axis(format=g.MILLISECONDS_FORMAT), ), d.simple_graph( "etcd objects", "sum(etcd_object_counts) by (resource, instance)", legend="{{instance}}: {{resource}}", ), d.simple_graph( "etcd db size", [ "etcd_mvcc_db_total_size_in_bytes", "etcd_mvcc_db_total_size_in_use_in_bytes",
), d.simple_graph( "etcd compaction pause num chunks", "delta(etcd_debugging_mvcc_db_compaction_pause_duration_milliseconds_count[1m])", ), d.simple_graph( "etcd_disk_backend_commit_duration_seconds", "histogram_quantile(0.99, sum(rate(etcd_disk_backend_commit_duration_seconds[1m])) by (le, instance))", g.single_y_axis(format=g.SECONDS_FORMAT), ), d.Graph( title="etcd compaction max pause", points=True, lines=False, targets=[ g.Target( expr= "histogram_quantile(1.0, sum(rate(etcd_debugging_mvcc_db_compaction_pause_duration_milliseconds_bucket[1m])) by (le, instance))" ) ], yAxes=g.single_y_axis(format=g.MILLISECONDS_FORMAT), ), d.simple_graph("etcd objects", "sum(etcd_object_counts) by (resource, instance)"), d.simple_graph( "etcd db size", [ "etcd_mvcc_db_total_size_in_bytes", "etcd_mvcc_db_total_size_in_use_in_bytes", "etcd_server_quota_backend_bytes", ], g.single_y_axis(format=g.BYTES_FORMAT),
from grafanalib import core as g import defaults as d NETWORK_PROGRAMMING_PANEL = [ d.Graph( title="SLI: Network programming latency", description=( "NetworkProgrammingLatency is defined as the time it took to " + "program the network - from the time the service or pod has " + "changed to the time the change was propagated and the proper " + "kube-proxy rules were synced. Exported for each endpoints object " + "that were part of the rules sync." ), targets=d.show_quantiles( ( "quantile_over_time(" + "0.99, " + 'kubeproxy:kubeproxy_network_programming_duration:histogram_quantile{{quantile="{quantile}"}}[24h])' ), legend="{{quantile}}", ), yAxes=g.single_y_axis(format=g.SECONDS_FORMAT), ), d.Graph( title="Network programming latency", description=( "NetworkProgrammingLatency is defined as the time it took to " + "program the network - from the time the service or pod has " + "changed to the time the change was propagated and the proper "
q = "{:.2f}".format(quantile) l = legend or q targets.append( g.Target(expr=queryTemplate.format(quantile=q), legendFormat=l)) return targets NETWORK_PROGRAMMING_PANEL = [ d.Graph( title="SLI: Network programming latency", description=( "NetworkProgrammingLatency is defined as the time it took to " + "program the network - from the time the service or pod has " + "changed to the time the change was propagated and the proper " + "kube-proxy rules were synced. Exported for each endpoints object " + "that were part of the rules sync."), targets=show_quantiles( ("quantile_over_time(" + "0.99, " + 'kubeproxy:kubeproxy_network_programming_duration:histogram_quantile{{quantile="{quantile}"}}[24h])' ), legend="{{quantile}}", ), yAxes=g.single_y_axis(format=g.SECONDS_FORMAT), ), d.Graph( title="Network programming latency", description=( "NetworkProgrammingLatency is defined as the time it took to " + "program the network - from the time the service or pod has " + "changed to the time the change was propagated and the proper " + "kube-proxy rules were synced. Exported for each endpoints object " + "that were part of the rules sync."),