diff --git a/Makefile b/Makefile index 33a77fa..f02e620 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ $(ALLDIRS): mkdir -p $(ALLDIRS) format: deps - $(BINDIR)/jsonnetfmt -i $(TEMPLATES) + $(BINDIR)/jsonnetfmt -i $(TEMPLATES) $(ASSETS) build: deps $(LIBRARY_PATH) $(outputs) diff --git a/assets/api-performance-overview/panels.libsonnet b/assets/api-performance-overview/panels.libsonnet index 68cf721..fbbbace 100644 --- a/assets/api-performance-overview/panels.libsonnet +++ b/assets/api-performance-overview/panels.libsonnet @@ -1,63 +1,63 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; { - timeSeries: { - local timeSeries = g.panel.timeSeries, - local custom = timeSeries.fieldConfig.defaults.custom, - local options = timeSeries.options, + timeSeries: { + local timeSeries = g.panel.timeSeries, + local custom = timeSeries.fieldConfig.defaults.custom, + local options = timeSeries.options, - base(title, unit, targets, gridPos): - timeSeries.new(title) - + timeSeries.queryOptions.withTargets(targets) - + timeSeries.datasource.withType('prometheus') - + timeSeries.datasource.withUid('$Datasource') - + timeSeries.standardOptions.withUnit(unit) - + timeSeries.gridPos.withX(gridPos.x) - + timeSeries.gridPos.withY(gridPos.y) - + timeSeries.gridPos.withH(gridPos.h) - + timeSeries.gridPos.withW(gridPos.w) - + custom.withDrawStyle("line") - + custom.withLineInterpolation("linear") - + custom.withBarAlignment(0) - + custom.withLineWidth(1) - + custom.withFillOpacity(10) - + custom.withGradientMode("none") - + custom.withSpanNulls(false) - + custom.withPointSize(5) - + custom.withSpanNulls(false) - + custom.stacking.withGroup("A") - + custom.stacking.withMode("none") - + custom.withShowPoints('never') - + options.tooltip.withSort('desc') - + timeSeries.queryOptions.withTimeFrom(null) - + timeSeries.queryOptions.withTimeShift(null) - + options.legend.withSortDesc(true), + base(title, unit, targets, gridPos): + timeSeries.new(title) + + timeSeries.queryOptions.withTargets(targets) + + timeSeries.datasource.withType('prometheus') + + timeSeries.datasource.withUid('$Datasource') + + timeSeries.standardOptions.withUnit(unit) + + timeSeries.gridPos.withX(gridPos.x) + + timeSeries.gridPos.withY(gridPos.y) + + timeSeries.gridPos.withH(gridPos.h) + + timeSeries.gridPos.withW(gridPos.w) + + custom.withDrawStyle('line') + + custom.withLineInterpolation('linear') + + custom.withBarAlignment(0) + + custom.withLineWidth(1) + + custom.withFillOpacity(10) + + custom.withGradientMode('none') + + custom.withSpanNulls(false) + + custom.withPointSize(5) + + custom.withSpanNulls(false) + + custom.stacking.withGroup('A') + + custom.stacking.withMode('none') + + custom.withShowPoints('never') + + options.tooltip.withSort('desc') + + timeSeries.queryOptions.withTimeFrom(null) + + timeSeries.queryOptions.withTimeShift(null) + + options.legend.withSortDesc(true), - legendRightPlacement(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + options.legend.withCalcs([ - 'max' - ]) - + options.legend.withShowLegend(true) - + options.legend.withDisplayMode('table') - + options.legend.withPlacement('right') - + options.legend.withAsTable(true) - + options.tooltip.withMode('multi'), + legendRightPlacement(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + options.legend.withCalcs([ + 'max', + ]) + + options.legend.withShowLegend(true) + + options.legend.withDisplayMode('table') + + options.legend.withPlacement('right') + + options.legend.withAsTable(true) + + options.tooltip.withMode('multi'), - legendBottomPlacement(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + options.tooltip.withMode('multi') - + options.legend.withShowLegend(true) - + options.legend.withDisplayMode('list') - + options.legend.withPlacement('bottom') - + options.tooltip.withMode('multi'), - - withRequestWaitDurationAggregations(title, unit, targets, gridPos): - self.legendRightPlacement(title, unit, targets, gridPos) - + options.legend.withCalcs([ - 'mean', - 'max', - 'lastNotNull' - ]) - } -} \ No newline at end of file + legendBottomPlacement(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + options.tooltip.withMode('multi') + + options.legend.withShowLegend(true) + + options.legend.withDisplayMode('list') + + options.legend.withPlacement('bottom') + + options.tooltip.withMode('multi'), + + withRequestWaitDurationAggregations(title, unit, targets, gridPos): + self.legendRightPlacement(title, unit, targets, gridPos) + + options.legend.withCalcs([ + 'mean', + 'max', + 'lastNotNull', + ]), + }, +} diff --git a/assets/api-performance-overview/queries.libsonnet b/assets/api-performance-overview/queries.libsonnet index e242160..6ae03f8 100644 --- a/assets/api-performance-overview/queries.libsonnet +++ b/assets/api-performance-overview/queries.libsonnet @@ -1,189 +1,192 @@ -local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local variables = import './variables.libsonnet'; +local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local prometheus = g.query.prometheus; { - request_duration_99th_quantile: { - query(): - prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_request_duration_seconds_bucket{apiserver=~"$apiserver",instance=~"$instance",resource=~"$resource",subresource!="log",verb!~"WATCH|WATCHLIST|PROXY"}[$interval])) by(verb,le))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{verb}}') - + prometheus.withDatasource('$Datasource') - }, - - requestRateByInstance: { - query(): - prometheus.withExpr('sum(rate(apiserver_request_total{apiserver=~"$apiserver",instance=~"$instance",resource=~"$resource",code=~"$code",verb=~"$verb"}[$interval])) by(instance)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{instance}}') - + prometheus.withDatasource('$Datasource') - }, - - requestDuarationByResource: { - query(): - prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_request_duration_seconds_bucket{apiserver=~"$apiserver",instance=~"$instance",resource=~"$resource",subresource!="log",verb!~"WATCH|WATCHLIST|PROXY"}[$interval])) by(resource,le))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{resource}}') - + prometheus.withDatasource('$Datasource') - }, - - requestDurationBy99Quatile: { - query(): - prometheus.withExpr('sum(rate(apiserver_request_total{apiserver=~"$apiserver",instance=~"$instance",resource=~"$resource",code=~"$code",verb=~"$verb"}[$interval])) by(resource)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{resource}}') - + prometheus.withDatasource('$Datasource') - }, - - requestDurationReadWrite: { - query(): - [ prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_request_duration_seconds_bucket{apiserver=~"$apiserver",instance=~"$instance",resource=~"$resource",verb=~"LIST|GET"}[$interval])) by(le))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('read') - + prometheus.withDatasource('$Datasource'), - - prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_request_duration_seconds_bucket{apiserver=~"$apiserver",instance=~"$instance",resource=~"$resource",verb=~"POST|PUT|PATCH|UPDATE|DELETE"}[$interval])) by(le))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('write') - + prometheus.withDatasource('$Datasource')] - }, - - requestRateReadWrite: { - query(): - [prometheus.withExpr('sum(rate(apiserver_request_total{apiserver=~"$apiserver",instance=~"$instance",resource=~"$resource",verb=~"LIST|GET"}[$interval]))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('read') - + prometheus.withDatasource('$Datasource'), - - prometheus.withExpr('sum(rate(apiserver_request_total{apiserver=~"$apiserver",instance=~"$instance",resource=~"$resource",verb=~"POST|PUT|PATCH|UPDATE|DELETE"}[$interval]))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('write') - + prometheus.withDatasource('$Datasource') - ] - }, - - requestRateDropped: { - query(): - prometheus.withExpr('sum(rate(apiserver_dropped_requests_total{instance=~"$instance"}[$interval])) by (requestKind)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('') - + prometheus.withDatasource('$Datasource') - }, - - requestRateTerminated: { - query(): - prometheus.withExpr('sum(rate(apiserver_request_terminations_total{instance=~"$instance",resource=~"$resource",code=~"$code"}[$interval])) by(component)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('') - + prometheus.withDatasource('$Datasource') - }, - - requestRateStatus: { - query(): - prometheus.withExpr('sum(rate(apiserver_request_total{apiserver=~"$apiserver",instance=~"$instance",resource=~"$resource",verb=~"$verb",code=~"$code"}[$interval])) by(code)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{code}}') - + prometheus.withDatasource('$Datasource') - }, - - requestsLongRunning: { - query(): - prometheus.withExpr('sum(apiserver_longrunning_gauge{instance=~"$instance",resource=~"$resource",verb=~"$verb"}) by(instance)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{instance}}') - + prometheus.withDatasource('$Datasource') - }, - - requestInFlight: { - query(): - prometheus.withExpr('sum(apiserver_current_inflight_requests{instance=~"$instance"}) by (instance,requestKind)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{requestKind}}-{{instance}}') - + prometheus.withDatasource('$Datasource') - }, - - requestRejectPandF: { - query(): - prometheus.withExpr('sum(rate(apiserver_flowcontrol_rejected_requests_total{instance=~"$instance",flowSchema=~"$flowSchema",priorityLevel=~"$priorityLevel"}[$interval])) by (reason)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('') - + prometheus.withDatasource('$Datasource') - }, - - responseSize99Quatile: { - query(): - prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_response_sizes_bucket{instance=~"$instance",resource=~"$resource",verb=~"$verb"}[$interval])) by(instance,le))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{instance}}') - + prometheus.withDatasource('$Datasource') - }, - - requestQueueLengthPandF: { - query(): - prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_flowcontrol_request_queue_length_after_enqueue_bucket{instance=~"$instance",flowSchema=~"$flowSchema",priorityLevel=~"$priorityLevel"}[$interval])) by(flowSchema, priorityLevel, le))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{flowSchema}}:{{priorityLevel}}') - + prometheus.withDatasource('$Datasource') - }, - - requestWaitDuration99QuatilePandF: { - query(): - prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_flowcontrol_request_wait_duration_seconds_bucket{instance=~"$instance"}[5m])) by(flow_schema, priority_level, le))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('') - + prometheus.withDatasource('$Datasource') - }, - - requestDispatchRatePandF: { - query(): - prometheus.withExpr('sum(rate(apiserver_flowcontrol_dispatched_requests_total{instance=~"$instance",flowSchema=~"$flowSchema",priorityLevel=~"$priorityLevel"}[$interval])) by(flowSchema,priorityLevel)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{flowSchema}}:{{priorityLevel}}') - + prometheus.withDatasource('$Datasource') - }, - - requestExecutionDurationPandF: { - query(): - prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_flowcontrol_request_execution_seconds_bucket{instance=~"$instance",flowSchema=~"$flowSchema",priorityLevel=~"$priorityLevel"}[$interval])) by(flowSchema, priorityLevel, le))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{flowSchema}}:{{priorityLevel}}') - + prometheus.withDatasource('$Datasource') - }, - - pendingInQueuePandF: { - query(): - prometheus.withExpr('sum(apiserver_flowcontrol_current_inqueue_requests{instance=~"$instance",flowSchema=~"$flowSchema",priorityLevel=~"$priorityLevel"}) by (flowSchema,priorityLevel)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{flowSchema}}:{{priorityLevel}}') - + prometheus.withDatasource('$Datasource') - }, - - concurrencyLimitByKubeapiserverPandF: { - query(): - prometheus.withExpr('sum(apiserver_flowcontrol_request_concurrency_limit{instance=~".*:6443",priorityLevel=~"$priorityLevel"}) by (instance,priorityLevel)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('') - + prometheus.withDatasource('$Datasource') - } -} \ No newline at end of file + request_duration_99th_quantile: { + query(): + prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_request_duration_seconds_bucket{apiserver=~"$apiserver",instance=~"$instance",resource=~"$resource",subresource!="log",verb!~"WATCH|WATCHLIST|PROXY"}[$interval])) by(verb,le))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{verb}}') + + prometheus.withDatasource('$Datasource'), + }, + + requestRateByInstance: { + query(): + prometheus.withExpr('sum(rate(apiserver_request_total{apiserver=~"$apiserver",instance=~"$instance",resource=~"$resource",code=~"$code",verb=~"$verb"}[$interval])) by(instance)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{instance}}') + + prometheus.withDatasource('$Datasource'), + }, + + requestDuarationByResource: { + query(): + prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_request_duration_seconds_bucket{apiserver=~"$apiserver",instance=~"$instance",resource=~"$resource",subresource!="log",verb!~"WATCH|WATCHLIST|PROXY"}[$interval])) by(resource,le))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{resource}}') + + prometheus.withDatasource('$Datasource'), + }, + + requestDurationBy99Quatile: { + query(): + prometheus.withExpr('sum(rate(apiserver_request_total{apiserver=~"$apiserver",instance=~"$instance",resource=~"$resource",code=~"$code",verb=~"$verb"}[$interval])) by(resource)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{resource}}') + + prometheus.withDatasource('$Datasource'), + }, + + requestDurationReadWrite: { + query(): + [ + prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_request_duration_seconds_bucket{apiserver=~"$apiserver",instance=~"$instance",resource=~"$resource",verb=~"LIST|GET"}[$interval])) by(le))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('read') + + prometheus.withDatasource('$Datasource'), + + prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_request_duration_seconds_bucket{apiserver=~"$apiserver",instance=~"$instance",resource=~"$resource",verb=~"POST|PUT|PATCH|UPDATE|DELETE"}[$interval])) by(le))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('write') + + prometheus.withDatasource('$Datasource'), + ], + }, + + requestRateReadWrite: { + query(): + [ + prometheus.withExpr('sum(rate(apiserver_request_total{apiserver=~"$apiserver",instance=~"$instance",resource=~"$resource",verb=~"LIST|GET"}[$interval]))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('read') + + prometheus.withDatasource('$Datasource'), + + prometheus.withExpr('sum(rate(apiserver_request_total{apiserver=~"$apiserver",instance=~"$instance",resource=~"$resource",verb=~"POST|PUT|PATCH|UPDATE|DELETE"}[$interval]))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('write') + + prometheus.withDatasource('$Datasource'), + ], + }, + + requestRateDropped: { + query(): + prometheus.withExpr('sum(rate(apiserver_dropped_requests_total{instance=~"$instance"}[$interval])) by (requestKind)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('') + + prometheus.withDatasource('$Datasource'), + }, + + requestRateTerminated: { + query(): + prometheus.withExpr('sum(rate(apiserver_request_terminations_total{instance=~"$instance",resource=~"$resource",code=~"$code"}[$interval])) by(component)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('') + + prometheus.withDatasource('$Datasource'), + }, + + requestRateStatus: { + query(): + prometheus.withExpr('sum(rate(apiserver_request_total{apiserver=~"$apiserver",instance=~"$instance",resource=~"$resource",verb=~"$verb",code=~"$code"}[$interval])) by(code)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{code}}') + + prometheus.withDatasource('$Datasource'), + }, + + requestsLongRunning: { + query(): + prometheus.withExpr('sum(apiserver_longrunning_gauge{instance=~"$instance",resource=~"$resource",verb=~"$verb"}) by(instance)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{instance}}') + + prometheus.withDatasource('$Datasource'), + }, + + requestInFlight: { + query(): + prometheus.withExpr('sum(apiserver_current_inflight_requests{instance=~"$instance"}) by (instance,requestKind)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{requestKind}}-{{instance}}') + + prometheus.withDatasource('$Datasource'), + }, + + requestRejectPandF: { + query(): + prometheus.withExpr('sum(rate(apiserver_flowcontrol_rejected_requests_total{instance=~"$instance",flowSchema=~"$flowSchema",priorityLevel=~"$priorityLevel"}[$interval])) by (reason)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('') + + prometheus.withDatasource('$Datasource'), + }, + + responseSize99Quatile: { + query(): + prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_response_sizes_bucket{instance=~"$instance",resource=~"$resource",verb=~"$verb"}[$interval])) by(instance,le))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{instance}}') + + prometheus.withDatasource('$Datasource'), + }, + + requestQueueLengthPandF: { + query(): + prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_flowcontrol_request_queue_length_after_enqueue_bucket{instance=~"$instance",flowSchema=~"$flowSchema",priorityLevel=~"$priorityLevel"}[$interval])) by(flowSchema, priorityLevel, le))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{flowSchema}}:{{priorityLevel}}') + + prometheus.withDatasource('$Datasource'), + }, + + requestWaitDuration99QuatilePandF: { + query(): + prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_flowcontrol_request_wait_duration_seconds_bucket{instance=~"$instance"}[5m])) by(flow_schema, priority_level, le))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('') + + prometheus.withDatasource('$Datasource'), + }, + + requestDispatchRatePandF: { + query(): + prometheus.withExpr('sum(rate(apiserver_flowcontrol_dispatched_requests_total{instance=~"$instance",flowSchema=~"$flowSchema",priorityLevel=~"$priorityLevel"}[$interval])) by(flowSchema,priorityLevel)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{flowSchema}}:{{priorityLevel}}') + + prometheus.withDatasource('$Datasource'), + }, + + requestExecutionDurationPandF: { + query(): + prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_flowcontrol_request_execution_seconds_bucket{instance=~"$instance",flowSchema=~"$flowSchema",priorityLevel=~"$priorityLevel"}[$interval])) by(flowSchema, priorityLevel, le))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{flowSchema}}:{{priorityLevel}}') + + prometheus.withDatasource('$Datasource'), + }, + + pendingInQueuePandF: { + query(): + prometheus.withExpr('sum(apiserver_flowcontrol_current_inqueue_requests{instance=~"$instance",flowSchema=~"$flowSchema",priorityLevel=~"$priorityLevel"}) by (flowSchema,priorityLevel)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{flowSchema}}:{{priorityLevel}}') + + prometheus.withDatasource('$Datasource'), + }, + + concurrencyLimitByKubeapiserverPandF: { + query(): + prometheus.withExpr('sum(apiserver_flowcontrol_request_concurrency_limit{instance=~".*:6443",priorityLevel=~"$priorityLevel"}) by (instance,priorityLevel)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('') + + prometheus.withDatasource('$Datasource'), + }, +} diff --git a/assets/api-performance-overview/variables.libsonnet b/assets/api-performance-overview/variables.libsonnet index 6a522ca..9ea0382 100644 --- a/assets/api-performance-overview/variables.libsonnet +++ b/assets/api-performance-overview/variables.libsonnet @@ -2,73 +2,73 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn local var = g.dashboard.variable; { - Datasource: - var.datasource.new('Datasource','prometheus') - + var.datasource.withRegex("") - + var.query.generalOptions.withLabel('Datasource') - + var.query.withRefresh(1), - apiserver: - var.query.new('apiserver','label_values(apiserver_request_duration_seconds_bucket, apiserver)') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.generalOptions.withLabel('apisever') - + var.query.withRefresh(2), + Datasource: + var.datasource.new('Datasource', 'prometheus') + + var.datasource.withRegex('') + + var.query.generalOptions.withLabel('Datasource') + + var.query.withRefresh(1), + apiserver: + var.query.new('apiserver', 'label_values(apiserver_request_duration_seconds_bucket, apiserver)') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.generalOptions.withLabel('apisever') + + var.query.withRefresh(2), - instance: - var.query.new('instance','label_values(apiserver_request_total, instance)') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.generalOptions.withLabel('instance') - + var.query.withRefresh(2), + instance: + var.query.new('instance', 'label_values(apiserver_request_total, instance)') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.generalOptions.withLabel('instance') + + var.query.withRefresh(2), - resource: - var.query.new('resource','label_values(apiserver_request_duration_seconds_bucket, resource)') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.generalOptions.withLabel('resource') - + var.query.withRefresh(2), - - code: - var.query.new('code','label_values(code)') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.generalOptions.withLabel('code') - + var.query.withRefresh(2), + resource: + var.query.new('resource', 'label_values(apiserver_request_duration_seconds_bucket, resource)') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.generalOptions.withLabel('resource') + + var.query.withRefresh(2), - verb: - var.query.new('verb','label_values(verb)') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.generalOptions.withLabel('verb') - + var.query.withRefresh(2), + code: + var.query.new('code', 'label_values(code)') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.generalOptions.withLabel('code') + + var.query.withRefresh(2), - flowSchema: - var.query.new('flowSchema','label_values(flowSchema)') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.generalOptions.withLabel('flow-schema') - + var.query.withRefresh(2), + verb: + var.query.new('verb', 'label_values(verb)') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.generalOptions.withLabel('verb') + + var.query.withRefresh(2), - priorityLevel: - var.query.new('priorityLevel','label_values(priorityLevel)') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.generalOptions.withLabel('priority-level') - + var.query.withRefresh(2), + flowSchema: + var.query.new('flowSchema', 'label_values(flowSchema)') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.generalOptions.withLabel('flow-schema') + + var.query.withRefresh(2), - interval: - var.interval.new('interval',['1m','5m']) - + var.query.withDatasourceFromVariable(self.Datasource) - + var.interval.generalOptions.withLabel('interval') - + var.interval.withAutoOption(count=30, minInterval='10s') - + var.query.withRefresh(2) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true) -} \ No newline at end of file + priorityLevel: + var.query.new('priorityLevel', 'label_values(priorityLevel)') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.generalOptions.withLabel('priority-level') + + var.query.withRefresh(2), + + interval: + var.interval.new('interval', ['1m', '5m']) + + var.query.withDatasourceFromVariable(self.Datasource) + + var.interval.generalOptions.withLabel('interval') + + var.interval.withAutoOption(count=30, minInterval='10s') + + var.query.withRefresh(2) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true), +} diff --git a/assets/cilium-k8s-perf/panels.libsonnet b/assets/cilium-k8s-perf/panels.libsonnet index 8df9447..9ffd9f3 100644 --- a/assets/cilium-k8s-perf/panels.libsonnet +++ b/assets/cilium-k8s-perf/panels.libsonnet @@ -1,78 +1,78 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; { - timeSeries: { - local timeSeries = g.panel.timeSeries, - local custom = timeSeries.fieldConfig.defaults.custom, - local options = timeSeries.options, + timeSeries: { + local timeSeries = g.panel.timeSeries, + local custom = timeSeries.fieldConfig.defaults.custom, + local options = timeSeries.options, - base(title, unit, targets, gridPos): - timeSeries.new(title) - + timeSeries.queryOptions.withTargets(targets) - + timeSeries.datasource.withType('prometheus') - + timeSeries.datasource.withUid('$Datasource') - + timeSeries.standardOptions.withUnit(unit) - + timeSeries.gridPos.withX(gridPos.x) - + timeSeries.gridPos.withY(gridPos.y) - + timeSeries.gridPos.withH(gridPos.h) - + timeSeries.gridPos.withW(gridPos.w) - + custom.withDrawStyle("line") - + custom.withLineInterpolation("linear") - + custom.withBarAlignment(0) - + custom.withLineWidth(1) - + custom.withFillOpacity(10) - + custom.withGradientMode("none") - + custom.withSpanNulls(false) - + custom.withPointSize(5) - + custom.withSpanNulls(false) - + custom.stacking.withMode("none") - + custom.withShowPoints('never'), - - withCiliumAgg(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + options.tooltip.withMode('multi') - + options.tooltip.withSort('desc') - + options.legend.withShowLegend(true) - + options.legend.withPlacement('bottom') - + options.legend.withDisplayMode('table') - + options.legend.withCalcs([ - 'mean', - 'max' - ]), - - withClusterAgg(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + options.tooltip.withMode('multi') - + options.tooltip.withSort('desc') - + options.legend.withShowLegend(true) - + options.legend.withPlacement('bottom') - + options.legend.withDisplayMode('table') - + options.legend.withCalcs([]) - }, + base(title, unit, targets, gridPos): + timeSeries.new(title) + + timeSeries.queryOptions.withTargets(targets) + + timeSeries.datasource.withType('prometheus') + + timeSeries.datasource.withUid('$Datasource') + + timeSeries.standardOptions.withUnit(unit) + + timeSeries.gridPos.withX(gridPos.x) + + timeSeries.gridPos.withY(gridPos.y) + + timeSeries.gridPos.withH(gridPos.h) + + timeSeries.gridPos.withW(gridPos.w) + + custom.withDrawStyle('line') + + custom.withLineInterpolation('linear') + + custom.withBarAlignment(0) + + custom.withLineWidth(1) + + custom.withFillOpacity(10) + + custom.withGradientMode('none') + + custom.withSpanNulls(false) + + custom.withPointSize(5) + + custom.withSpanNulls(false) + + custom.stacking.withMode('none') + + custom.withShowPoints('never'), - stat: { - local stat = g.panel.stat, - local options = stat.options, + withCiliumAgg(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + options.tooltip.withMode('multi') + + options.tooltip.withSort('desc') + + options.legend.withShowLegend(true) + + options.legend.withPlacement('bottom') + + options.legend.withDisplayMode('table') + + options.legend.withCalcs([ + 'mean', + 'max', + ]), - base(title, unit, targets, gridPos): - stat.new(title) - + stat.datasource.withType('prometheus') - + stat.datasource.withUid('$Datasource') - + stat.standardOptions.withUnit(unit) - + stat.queryOptions.withTargets(targets) - + stat.gridPos.withX(gridPos.x) - + stat.gridPos.withY(gridPos.y) - + stat.gridPos.withH(gridPos.h) - + stat.gridPos.withW(gridPos.w) - + options.withJustifyMode("auto") - + options.withGraphMode("area") - + options.text.withTitleSize(12), + withClusterAgg(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + options.tooltip.withMode('multi') + + options.tooltip.withSort('desc') + + options.legend.withShowLegend(true) + + options.legend.withPlacement('bottom') + + options.legend.withDisplayMode('table') + + options.legend.withCalcs([]), + }, - withclusterAgg(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + options.reduceOptions.withCalcs([ - 'last', - ]) - + stat.standardOptions.thresholds.withSteps([]), - } -} \ No newline at end of file + stat: { + local stat = g.panel.stat, + local options = stat.options, + + base(title, unit, targets, gridPos): + stat.new(title) + + stat.datasource.withType('prometheus') + + stat.datasource.withUid('$Datasource') + + stat.standardOptions.withUnit(unit) + + stat.queryOptions.withTargets(targets) + + stat.gridPos.withX(gridPos.x) + + stat.gridPos.withY(gridPos.y) + + stat.gridPos.withH(gridPos.h) + + stat.gridPos.withW(gridPos.w) + + options.withJustifyMode('auto') + + options.withGraphMode('area') + + options.text.withTitleSize(12), + + withclusterAgg(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + options.reduceOptions.withCalcs([ + 'last', + ]) + + stat.standardOptions.thresholds.withSteps([]), + }, +} diff --git a/assets/cilium-k8s-perf/queries.libsonnet b/assets/cilium-k8s-perf/queries.libsonnet index 9ca634c..5d85083 100644 --- a/assets/cilium-k8s-perf/queries.libsonnet +++ b/assets/cilium-k8s-perf/queries.libsonnet @@ -1,360 +1,361 @@ -local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local variables = import './variables.libsonnet'; +local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local prometheus = g.query.prometheus; { - ciliumControllerFailures: { - query(): - prometheus.withExpr('cilium_controllers_failing') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ instance }} - {{ pod }}') - + prometheus.withDatasource('$Datasource') - }, - - ciliumIPAddressAllocation: { - query(): - prometheus.withExpr('cilium_ip_addresses') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ pod }} - {{ family }}') - + prometheus.withDatasource('$Datasource') - }, - - ciliumContainerCPU: { - query(): - prometheus.withExpr('sum(irate(container_cpu_usage_seconds_total{container=~"cilium.*",container!="cilium-operator.*",namespace!=""}[$interval])) by (instance,pod,container,namespace,name,service) * 100') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ instance }} - {{ pod }}') - + prometheus.withDatasource('$Datasource') - }, - - ciliumConatinerMemory: { - query(): - prometheus.withExpr('container_memory_rss{container=~"cilium.*",namespace!=""}') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ instance }} - {{ pod }}') - + prometheus.withDatasource('$Datasource') - }, - - ciliumNetworkPolicesPerAgent: { - query(): - prometheus.withExpr('cilium_policy') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ instance }} - {{ pod }}') - + prometheus.withDatasource('$Datasource') - }, - - ciliumBPFOperations: { - query(): - prometheus.withExpr('sum by (instance,map_name,operation,outcome)(rate(cilium_bpf_map_ops_total[2m]))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{instance}} - {{map_name}} - {{operation}}') - + prometheus.withDatasource('$Datasource') - }, - - currentNodeCount: { - query(): - [ - prometheus.withExpr('sum(kube_node_info{})') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('Number of nodes') - + prometheus.withDatasource('$Datasource') , - - prometheus.withExpr('sum(kube_node_status_condition{status="true"}) by (condition) > 0') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('Node: {{ condition }}') - + prometheus.withDatasource('$Datasource') - ] - }, - - currentNamespaceCount: { - query(): - prometheus.withExpr('sum(kube_namespace_status_phase) by (phase)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ phase }}') - + prometheus.withDatasource('$Datasource') - }, - - currentPodCount: { - query(): - prometheus.withExpr('sum(kube_pod_status_phase{}) by (phase) > 0') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ phase }} Pods') - + prometheus.withDatasource('$Datasource') - }, - - numberOfNodes: { - query(): - [ - prometheus.withExpr('sum(kube_node_info{})') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('Number of nodes') - + prometheus.withDatasource('$Datasource'), - - prometheus.withExpr('sum(kube_node_status_condition{status="true"}) by (condition) > 0') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('Node: {{ condition }}') - + prometheus.withDatasource('$Datasource') - ] - }, - - namespaceCount: { - query(): - prometheus.withExpr('sum(kube_namespace_status_phase) by (phase) > 0') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ phase }} namespaces') - + prometheus.withDatasource('$Datasource') - }, - - podCount: { - query(): - prometheus.withExpr('sum(kube_pod_status_phase{}) by (phase)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{phase}} pods') - + prometheus.withDatasource('$Datasource') - }, - - secretConfigmapCount: { - query(): - [prometheus.withExpr('count(kube_secret_info{})') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('secrets') - + prometheus.withDatasource('$Datasource'), - prometheus.withExpr('count(kube_configmap_info{})') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('Configmaps') - + prometheus.withDatasource('$Datasource') - ] - }, - - deploymentCount: { - query(): - - prometheus.withExpr('count(kube_deployment_labels{})') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('Deployments') - + prometheus.withDatasource('$Datasource') - }, - - serviceCount: { - query(): - prometheus.withExpr('count(kube_service_info{})') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('Services') - + prometheus.withDatasource('$Datasource') - }, - - top10ContainerRSS: { - query(): - prometheus.withExpr('topk(10, container_memory_rss{namespace!="",container!="POD",name!=""})') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ namespace }} - {{ name }}') - + prometheus.withDatasource('$Datasource') - }, - - top10ContainerCPU: { - query(): - prometheus.withExpr('topk(10,irate(container_cpu_usage_seconds_total{namespace!="",container!="POD",name!=""}[$interval])*100)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ namespace }} - {{ name }}') - + prometheus.withDatasource('$Datasource') - }, - - goroutinesCount: { - query(): - prometheus.withExpr('topk(10, sum(go_goroutines{}) by (job,instance))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ job }} - {{ instance }}') - + prometheus.withDatasource('$Datasource') - }, - - podDistribution: { - query(): - prometheus.withExpr('count(kube_pod_info{}) by (exported_node)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ node }}') - + prometheus.withDatasource('$Datasource') - }, - - CPUBasic: { - query(): - prometheus.withExpr('sum by (instance, mode)(rate(node_cpu_seconds_total{node=~"$_worker_node",job=~".*"}[$interval])) * 100') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('Busy {{mode}}') - + prometheus.withDatasource('$Datasource') - }, - - systemMemory: { - query(): - [ - prometheus.withExpr('node_memory_Active_bytes{node=~"$_worker_node"}') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('Active') - + prometheus.withDatasource('$Datasource') , - - prometheus.withExpr('node_memory_MemTotal_bytes{node=~"$_worker_node"}') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('Total') - + prometheus.withDatasource('$Datasource'), - - prometheus.withExpr('node_memory_Cached_bytes{node=~"$_worker_node"} + node_memory_Buffers_bytes{node=~"$_worker_node"}') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('Total') - + prometheus.withDatasource('$Datasource'), - - prometheus.withExpr('node_memory_MemAvailable_bytes{node=~"$_worker_node"}') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('Total') - + prometheus.withDatasource('$Datasource') - - ] - }, - - diskThroughput: { - query(): - [ - prometheus.withExpr('rate(node_disk_read_bytes_total{device=~"$block_device",node=~"$_worker_node"}[$interval])') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ device }} - read') - + prometheus.withDatasource('$Datasource') , - - prometheus.withExpr('rate(node_disk_written_bytes_total{device=~"$block_device",node=~"$_worker_node"}[$interval])') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ device }} - write') - + prometheus.withDatasource('$Datasource') - ] - }, - - diskIOPS: { - query(): - [ - prometheus.withExpr('rate(node_disk_reads_completed_total{device=~"$block_device",node=~"$_worker_node"}[$interval])') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ device }} - read') - + prometheus.withDatasource('$Datasource') , - - prometheus.withExpr('rate(node_disk_writes_completed_total{device=~"$block_device",node=~"$_worker_node"}[$interval])') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ device }} - write') - + prometheus.withDatasource('$Datasource') - ] - }, - - networkUtilization: { - query(): - [ - prometheus.withExpr('rate(node_network_receive_bytes_total{node=~"$_worker_node",device=~"$net_device"}[$interval]) * 8') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{instance}} - {{device}} - RX') - + prometheus.withDatasource('$Datasource'), - - prometheus.withExpr('rate(node_network_transmit_bytes_total{node=~"$_worker_node",device=~"$net_device"}[$interval]) * 8') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{instance}} - {{device}} - TX') - + prometheus.withDatasource('$Datasource') - ] - }, - - networkPackets: { - query(): - [ - prometheus.withExpr('rate(node_network_receive_packets_total{node=~"$_worker_node",device=~"$net_device"}[$interval])') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{instance}} - {{device}} - RX') - + prometheus.withDatasource('$Datasource'), - - prometheus.withExpr('rate(node_network_transmit_packets_total{node=~"$_worker_node",device=~"$net_device"}[$interval])') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{instance}} - {{device}} - TX') - + prometheus.withDatasource('$Datasource') - - - ] - }, - - networkPacketDrop: { - query(): - [ - prometheus.withExpr('topk(10, rate(node_network_receive_drop_total{node=~"$_worker_node"}[$interval]))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('rx-drop-{{ device }}') - + prometheus.withDatasource('$Datasource'), - - prometheus.withExpr('topk(10,rate(node_network_transmit_drop_total{node=~"$_worker_node"}[$interval]))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('tx-drop-{{ device }}') - + prometheus.withDatasource('$Datasource') - ] - }, - - conntrackStats: { - query(): - [ - prometheus.withExpr('node_nf_conntrack_entries{node=~"$_worker_node"}') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('conntrack_entries') - + prometheus.withDatasource('$Datasource'), - - prometheus.withExpr('node_nf_conntrack_entries_limit{node=~"$_worker_node"}') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('conntrack_limit') - + prometheus.withDatasource('$Datasource') - ] - }, - - top10ContainerCPUNode: { - query(): - prometheus.withExpr('topk(10, sum(irate(container_cpu_usage_seconds_total{container!="POD", instance=~"$_worker_node", namespace=~"$namespace"}[$interval])) by (pod, container) * 100)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ pod }}: {{ container }}') - + prometheus.withDatasource('$Datasource') - }, - - top10ContainerRSSNode: { - query(): - prometheus.withExpr('topk(10, container_memory_rss{container!="POD",name!="",instance=~"$_worker_node",namespace!="",namespace=~"$namespace"})') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ pod }}: {{ container }}') - + prometheus.withDatasource('$Datasource') - }, -} \ No newline at end of file + ciliumControllerFailures: { + query(): + prometheus.withExpr('cilium_controllers_failing') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ instance }} - {{ pod }}') + + prometheus.withDatasource('$Datasource'), + }, + + ciliumIPAddressAllocation: { + query(): + prometheus.withExpr('cilium_ip_addresses') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ pod }} - {{ family }}') + + prometheus.withDatasource('$Datasource'), + }, + + ciliumContainerCPU: { + query(): + prometheus.withExpr('sum(irate(container_cpu_usage_seconds_total{container=~"cilium.*",container!="cilium-operator.*",namespace!=""}[$interval])) by (instance,pod,container,namespace,name,service) * 100') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ instance }} - {{ pod }}') + + prometheus.withDatasource('$Datasource'), + }, + + ciliumConatinerMemory: { + query(): + prometheus.withExpr('container_memory_rss{container=~"cilium.*",namespace!=""}') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ instance }} - {{ pod }}') + + prometheus.withDatasource('$Datasource'), + }, + + ciliumNetworkPolicesPerAgent: { + query(): + prometheus.withExpr('cilium_policy') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ instance }} - {{ pod }}') + + prometheus.withDatasource('$Datasource'), + }, + + ciliumBPFOperations: { + query(): + prometheus.withExpr('sum by (instance,map_name,operation,outcome)(rate(cilium_bpf_map_ops_total[2m]))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{instance}} - {{map_name}} - {{operation}}') + + prometheus.withDatasource('$Datasource'), + }, + + currentNodeCount: { + query(): + [ + prometheus.withExpr('sum(kube_node_info{})') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('Number of nodes') + + prometheus.withDatasource('$Datasource'), + + prometheus.withExpr('sum(kube_node_status_condition{status="true"}) by (condition) > 0') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('Node: {{ condition }}') + + prometheus.withDatasource('$Datasource'), + ], + }, + + currentNamespaceCount: { + query(): + prometheus.withExpr('sum(kube_namespace_status_phase) by (phase)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ phase }}') + + prometheus.withDatasource('$Datasource'), + }, + + currentPodCount: { + query(): + prometheus.withExpr('sum(kube_pod_status_phase{}) by (phase) > 0') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ phase }} Pods') + + prometheus.withDatasource('$Datasource'), + }, + + numberOfNodes: { + query(): + [ + prometheus.withExpr('sum(kube_node_info{})') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('Number of nodes') + + prometheus.withDatasource('$Datasource'), + + prometheus.withExpr('sum(kube_node_status_condition{status="true"}) by (condition) > 0') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('Node: {{ condition }}') + + prometheus.withDatasource('$Datasource'), + ], + }, + + namespaceCount: { + query(): + prometheus.withExpr('sum(kube_namespace_status_phase) by (phase) > 0') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ phase }} namespaces') + + prometheus.withDatasource('$Datasource'), + }, + + podCount: { + query(): + prometheus.withExpr('sum(kube_pod_status_phase{}) by (phase)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{phase}} pods') + + prometheus.withDatasource('$Datasource'), + }, + + secretConfigmapCount: { + query(): + [ + prometheus.withExpr('count(kube_secret_info{})') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('secrets') + + prometheus.withDatasource('$Datasource'), + prometheus.withExpr('count(kube_configmap_info{})') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('Configmaps') + + prometheus.withDatasource('$Datasource'), + ], + }, + + deploymentCount: { + query(): + + prometheus.withExpr('count(kube_deployment_labels{})') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('Deployments') + + prometheus.withDatasource('$Datasource'), + }, + + serviceCount: { + query(): + prometheus.withExpr('count(kube_service_info{})') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('Services') + + prometheus.withDatasource('$Datasource'), + }, + + top10ContainerRSS: { + query(): + prometheus.withExpr('topk(10, container_memory_rss{namespace!="",container!="POD",name!=""})') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ namespace }} - {{ name }}') + + prometheus.withDatasource('$Datasource'), + }, + + top10ContainerCPU: { + query(): + prometheus.withExpr('topk(10,irate(container_cpu_usage_seconds_total{namespace!="",container!="POD",name!=""}[$interval])*100)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ namespace }} - {{ name }}') + + prometheus.withDatasource('$Datasource'), + }, + + goroutinesCount: { + query(): + prometheus.withExpr('topk(10, sum(go_goroutines{}) by (job,instance))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ job }} - {{ instance }}') + + prometheus.withDatasource('$Datasource'), + }, + + podDistribution: { + query(): + prometheus.withExpr('count(kube_pod_info{}) by (exported_node)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ node }}') + + prometheus.withDatasource('$Datasource'), + }, + + CPUBasic: { + query(): + prometheus.withExpr('sum by (instance, mode)(rate(node_cpu_seconds_total{node=~"$_worker_node",job=~".*"}[$interval])) * 100') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('Busy {{mode}}') + + prometheus.withDatasource('$Datasource'), + }, + + systemMemory: { + query(): + [ + prometheus.withExpr('node_memory_Active_bytes{node=~"$_worker_node"}') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('Active') + + prometheus.withDatasource('$Datasource'), + + prometheus.withExpr('node_memory_MemTotal_bytes{node=~"$_worker_node"}') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('Total') + + prometheus.withDatasource('$Datasource'), + + prometheus.withExpr('node_memory_Cached_bytes{node=~"$_worker_node"} + node_memory_Buffers_bytes{node=~"$_worker_node"}') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('Total') + + prometheus.withDatasource('$Datasource'), + + prometheus.withExpr('node_memory_MemAvailable_bytes{node=~"$_worker_node"}') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('Total') + + prometheus.withDatasource('$Datasource'), + + ], + }, + + diskThroughput: { + query(): + [ + prometheus.withExpr('rate(node_disk_read_bytes_total{device=~"$block_device",node=~"$_worker_node"}[$interval])') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ device }} - read') + + prometheus.withDatasource('$Datasource'), + + prometheus.withExpr('rate(node_disk_written_bytes_total{device=~"$block_device",node=~"$_worker_node"}[$interval])') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ device }} - write') + + prometheus.withDatasource('$Datasource'), + ], + }, + + diskIOPS: { + query(): + [ + prometheus.withExpr('rate(node_disk_reads_completed_total{device=~"$block_device",node=~"$_worker_node"}[$interval])') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ device }} - read') + + prometheus.withDatasource('$Datasource'), + + prometheus.withExpr('rate(node_disk_writes_completed_total{device=~"$block_device",node=~"$_worker_node"}[$interval])') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ device }} - write') + + prometheus.withDatasource('$Datasource'), + ], + }, + + networkUtilization: { + query(): + [ + prometheus.withExpr('rate(node_network_receive_bytes_total{node=~"$_worker_node",device=~"$net_device"}[$interval]) * 8') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{instance}} - {{device}} - RX') + + prometheus.withDatasource('$Datasource'), + + prometheus.withExpr('rate(node_network_transmit_bytes_total{node=~"$_worker_node",device=~"$net_device"}[$interval]) * 8') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{instance}} - {{device}} - TX') + + prometheus.withDatasource('$Datasource'), + ], + }, + + networkPackets: { + query(): + [ + prometheus.withExpr('rate(node_network_receive_packets_total{node=~"$_worker_node",device=~"$net_device"}[$interval])') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{instance}} - {{device}} - RX') + + prometheus.withDatasource('$Datasource'), + + prometheus.withExpr('rate(node_network_transmit_packets_total{node=~"$_worker_node",device=~"$net_device"}[$interval])') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{instance}} - {{device}} - TX') + + prometheus.withDatasource('$Datasource'), + + + ], + }, + + networkPacketDrop: { + query(): + [ + prometheus.withExpr('topk(10, rate(node_network_receive_drop_total{node=~"$_worker_node"}[$interval]))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('rx-drop-{{ device }}') + + prometheus.withDatasource('$Datasource'), + + prometheus.withExpr('topk(10,rate(node_network_transmit_drop_total{node=~"$_worker_node"}[$interval]))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('tx-drop-{{ device }}') + + prometheus.withDatasource('$Datasource'), + ], + }, + + conntrackStats: { + query(): + [ + prometheus.withExpr('node_nf_conntrack_entries{node=~"$_worker_node"}') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('conntrack_entries') + + prometheus.withDatasource('$Datasource'), + + prometheus.withExpr('node_nf_conntrack_entries_limit{node=~"$_worker_node"}') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('conntrack_limit') + + prometheus.withDatasource('$Datasource'), + ], + }, + + top10ContainerCPUNode: { + query(): + prometheus.withExpr('topk(10, sum(irate(container_cpu_usage_seconds_total{container!="POD", instance=~"$_worker_node", namespace=~"$namespace"}[$interval])) by (pod, container) * 100)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ pod }}: {{ container }}') + + prometheus.withDatasource('$Datasource'), + }, + + top10ContainerRSSNode: { + query(): + prometheus.withExpr('topk(10, container_memory_rss{container!="POD",name!="",instance=~"$_worker_node",namespace!="",namespace=~"$namespace"})') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ pod }}: {{ container }}') + + prometheus.withDatasource('$Datasource'), + }, +} diff --git a/assets/cilium-k8s-perf/variables.libsonnet b/assets/cilium-k8s-perf/variables.libsonnet index 049d303..0a0e620 100644 --- a/assets/cilium-k8s-perf/variables.libsonnet +++ b/assets/cilium-k8s-perf/variables.libsonnet @@ -2,52 +2,52 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn local var = g.dashboard.variable; { - Datasource: - var.datasource.new('Datasource','prometheus') - + var.datasource.withRegex("") - + var.query.generalOptions.withLabel('Datasource') - + var.query.withRefresh(1), + Datasource: + var.datasource.new('Datasource', 'prometheus') + + var.datasource.withRegex('') + + var.query.generalOptions.withLabel('Datasource') + + var.query.withRefresh(1), - _worker_node: - var.query.new('_worker_node','label_values(kube_node_labels{}, exported_node)') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.selectionOptions.withMulti(true) - + var.query.selectionOptions.withIncludeAll(false) - + var.query.generalOptions.withLabel('Worker') - + var.query.withRefresh(2), + _worker_node: + var.query.new('_worker_node', 'label_values(kube_node_labels{}, exported_node)') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(false) + + var.query.generalOptions.withLabel('Worker') + + var.query.withRefresh(2), - namespace: - var.query.new('namespace','label_values(kube_pod_info, exported_namespace)') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.generalOptions.withLabel('Namespace') - + var.query.withRefresh(2), - - block_device: - var.query.new('block_device','label_values(node_disk_written_bytes_total,device)') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.datasource.withRegex('/^(?:(?!dm|rb).)*$/') - + var.query.selectionOptions.withMulti(true) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.generalOptions.withLabel('Block device') - + var.query.withRefresh(2), + namespace: + var.query.new('namespace', 'label_values(kube_pod_info, exported_namespace)') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.generalOptions.withLabel('Namespace') + + var.query.withRefresh(2), - net_device: - var.query.new('net_device','label_values(node_network_receive_bytes_total,device)') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.datasource.withRegex('/^((br|en|et).*)$/') - + var.query.selectionOptions.withMulti(true) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.generalOptions.withLabel('Network device') - + var.query.withRefresh(2), + block_device: + var.query.new('block_device', 'label_values(node_disk_written_bytes_total,device)') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.datasource.withRegex('/^(?:(?!dm|rb).)*$/') + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.generalOptions.withLabel('Block device') + + var.query.withRefresh(2), - interval: - var.interval.new('interval',['2m','3m','4m','5m']) - + var.query.withDatasourceFromVariable(self.Datasource) - + var.interval.generalOptions.withLabel('interval') - + var.query.withRefresh(2) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true) + net_device: + var.query.new('net_device', 'label_values(node_network_receive_bytes_total,device)') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.datasource.withRegex('/^((br|en|et).*)$/') + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.generalOptions.withLabel('Network device') + + var.query.withRefresh(2), -} \ No newline at end of file + interval: + var.interval.new('interval', ['2m', '3m', '4m', '5m']) + + var.query.withDatasourceFromVariable(self.Datasource) + + var.interval.generalOptions.withLabel('interval') + + var.query.withRefresh(2) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true), + +} diff --git a/assets/etcd-on-cluster-dashboard/panels.libsonnet b/assets/etcd-on-cluster-dashboard/panels.libsonnet index 483c98e..b23073c 100644 --- a/assets/etcd-on-cluster-dashboard/panels.libsonnet +++ b/assets/etcd-on-cluster-dashboard/panels.libsonnet @@ -1,116 +1,117 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; { - timeSeries: { - local timeSeries = g.panel.timeSeries, - local custom = timeSeries.fieldConfig.defaults.custom, - local options = timeSeries.options, + timeSeries: { + local timeSeries = g.panel.timeSeries, + local custom = timeSeries.fieldConfig.defaults.custom, + local options = timeSeries.options, - base(title, unit, targets, gridPos): - timeSeries.new(title) - + timeSeries.queryOptions.withTargets(targets) - + timeSeries.datasource.withType('prometheus') - + timeSeries.datasource.withUid('$Datasource') - + timeSeries.standardOptions.withUnit(unit) - + timeSeries.gridPos.withX(gridPos.x) - + timeSeries.gridPos.withY(gridPos.y) - + timeSeries.gridPos.withH(gridPos.h) - + timeSeries.gridPos.withW(gridPos.w) - + custom.withDrawStyle("line") - + custom.withLineInterpolation("linear") - + custom.withBarAlignment(0) - + custom.withLineWidth(1) - + custom.withFillOpacity(10) - + custom.withGradientMode("none") - + custom.withSpanNulls(false) - + custom.withPointSize(5) - + custom.withSpanNulls(false) - + custom.stacking.withMode("none") - + custom.withShowPoints('never') - + options.tooltip.withMode('multi') - + options.tooltip.withSort('desc') - + options.legend.withShowLegend(true) - + options.legend.withPlacement('bottom'), + base(title, unit, targets, gridPos): + timeSeries.new(title) + + timeSeries.queryOptions.withTargets(targets) + + timeSeries.datasource.withType('prometheus') + + timeSeries.datasource.withUid('$Datasource') + + timeSeries.standardOptions.withUnit(unit) + + timeSeries.gridPos.withX(gridPos.x) + + timeSeries.gridPos.withY(gridPos.y) + + timeSeries.gridPos.withH(gridPos.h) + + timeSeries.gridPos.withW(gridPos.w) + + custom.withDrawStyle('line') + + custom.withLineInterpolation('linear') + + custom.withBarAlignment(0) + + custom.withLineWidth(1) + + custom.withFillOpacity(10) + + custom.withGradientMode('none') + + custom.withSpanNulls(false) + + custom.withPointSize(5) + + custom.withSpanNulls(false) + + custom.stacking.withMode('none') + + custom.withShowPoints('never') + + options.tooltip.withMode('multi') + + options.tooltip.withSort('desc') + + options.legend.withShowLegend(true) + + options.legend.withPlacement('bottom'), - generalUsageAgg(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + options.legend.withCalcs([ - 'mean', - 'max' - ]) - + options.legend.withDisplayMode('table'), + generalUsageAgg(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + options.legend.withCalcs([ + 'mean', + 'max', + ]) + + options.legend.withDisplayMode('table'), - withoutCalcsAgg(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + options.legend.withCalcs([]) - + options.legend.withDisplayMode('table'), + withoutCalcsAgg(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + options.legend.withCalcs([]) + + options.legend.withDisplayMode('table'), - GeneralInfoAgg(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + options.legend.withCalcs([ - 'mean', - 'max' - ]) - + options.legend.withDisplayMode('list'), + GeneralInfoAgg(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + options.legend.withCalcs([ + 'mean', + 'max', + ]) + + options.legend.withDisplayMode('list'), - GeneralInfo(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + options.legend.withCalcs([]) - + options.legend.withDisplayMode('list'), - }, + GeneralInfo(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + options.legend.withCalcs([]) + + options.legend.withDisplayMode('list'), + }, - stat: { - local stat = g.panel.stat, - local options = stat.options, + stat: { + local stat = g.panel.stat, + local options = stat.options, - base(title, unit, targets, gridPos): - stat.new(title) - + stat.datasource.withType('prometheus') - + stat.datasource.withUid('$Datasource') - + stat.standardOptions.withUnit(unit) - + stat.queryOptions.withTargets(targets) - + stat.gridPos.withX(gridPos.x) - + stat.gridPos.withY(gridPos.y) - + stat.gridPos.withH(gridPos.h) - + stat.gridPos.withW(gridPos.w) - + options.withJustifyMode("auto") - + options.withGraphMode("none") - + options.text.withTitleSize(12) - + stat.standardOptions.color.withMode('thresholds') - + options.withColorMode('none'), + base(title, unit, targets, gridPos): + stat.new(title) + + stat.datasource.withType('prometheus') + + stat.datasource.withUid('$Datasource') + + stat.standardOptions.withUnit(unit) + + stat.queryOptions.withTargets(targets) + + stat.gridPos.withX(gridPos.x) + + stat.gridPos.withY(gridPos.y) + + stat.gridPos.withH(gridPos.h) + + stat.gridPos.withW(gridPos.w) + + options.withJustifyMode('auto') + + options.withGraphMode('none') + + options.text.withTitleSize(12) + + stat.standardOptions.color.withMode('thresholds') + + options.withColorMode('none'), - etcdLeader(title, unit, target, gridPos): - self.base(title, unit, target, gridPos) - + stat.options.reduceOptions.withCalcs([ - 'mean' - ]) - + stat.standardOptions.withMappings({ - "type": "value", - "options": { - "0": { - "text": "NO" - }, - "1": { - "text": "YES" - } - } - }), + etcdLeader(title, unit, target, gridPos): + self.base(title, unit, target, gridPos) + + stat.options.reduceOptions.withCalcs([ + 'mean', + ]) + + stat.standardOptions.withMappings({ + type: 'value', + options: { + '0': { + text: 'NO', + }, + '1': { + text: 'YES', + }, + }, + }), - failedProposalsSeen(title, unit, target, gridPos): - self.base(title, unit, target, gridPos) - + stat.options.reduceOptions.withCalcs([ - 'mean' - ]) - + stat.standardOptions.withMappings( - { - "type": "special", - "options": { - "match": "null", - "result": { - "text": "N/A" - } - } - }), - } -} \ No newline at end of file + failedProposalsSeen(title, unit, target, gridPos): + self.base(title, unit, target, gridPos) + + stat.options.reduceOptions.withCalcs([ + 'mean', + ]) + + stat.standardOptions.withMappings( + { + type: 'special', + options: { + match: 'null', + result: { + text: 'N/A', + }, + }, + } + ), + }, +} diff --git a/assets/etcd-on-cluster-dashboard/queries.libsonnet b/assets/etcd-on-cluster-dashboard/queries.libsonnet index 483e4f1..a5f5804 100644 --- a/assets/etcd-on-cluster-dashboard/queries.libsonnet +++ b/assets/etcd-on-cluster-dashboard/queries.libsonnet @@ -1,148 +1,148 @@ -local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local variables = import './variables.libsonnet'; +local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local generateTimeSeriesQuery(query, legend) = [ - local prometheusQuery = g.query.prometheus; - prometheusQuery.new('$'+variables.Datasource.name, query) - + prometheusQuery.withFormat('time_series') - + prometheusQuery.withIntervalFactor(2) - + prometheusQuery.withLegendFormat(legend), + local prometheusQuery = g.query.prometheus; + prometheusQuery.new('$' + variables.Datasource.name, query) + + prometheusQuery.withFormat('time_series') + + prometheusQuery.withIntervalFactor(2) + + prometheusQuery.withLegendFormat(legend), ]; { - CPUUsage: { - query(): - generateTimeSeriesQuery('sum(irate(container_cpu_usage_seconds_total{namespace="openshift-etcd", container="etcd"}[2m])) by (pod) * 100','{{ pod }}') - }, - - memoryUsage: { - query(): - generateTimeSeriesQuery('sum(avg_over_time(container_memory_working_set_bytes{container="",pod!="", namespace=~"openshift-etcd.*"}[2m])) BY (pod, namespace)','{{ pod }}') - }, - - diskWalSyncDuration: { - query(): - generateTimeSeriesQuery('histogram_quantile(0.99, sum(irate(etcd_disk_wal_fsync_duration_seconds_bucket{namespace="openshift-etcd"}[2m])) by (pod, le))','{{pod}} WAL fsync') - }, - - diskBackendSyncDuration: { - query(): - generateTimeSeriesQuery('histogram_quantile(0.99, sum(irate(etcd_disk_backend_commit_duration_seconds_bucket{namespace="openshift-etcd"}[2m])) by (pod, le))','{{pod}} DB fsync') - }, - - etcdContainerDiskWrites: { - query(): - generateTimeSeriesQuery('rate(container_fs_writes_bytes_total{namespace="openshift-etcd",container="etcd",device!~".+dm.+"}[2m])','{{ pod }}: {{ device }}') - }, - - dbSize: { - query(): - generateTimeSeriesQuery('etcd_mvcc_db_total_size_in_bytes{namespace="openshift-etcd"}','{{pod}} DB physical size') - + generateTimeSeriesQuery('etcd_mvcc_db_total_size_in_use_in_bytes{namespace="openshift-etcd"}','{{pod}} DB logical size') - }, - - containerNetworkTraffic: { - query(): - generateTimeSeriesQuery('sum(rate(container_network_receive_bytes_total{ container="etcd", namespace=~"openshift-etcd.*"}[2m])) BY (namespace, pod)','rx {{ pod }}') - + generateTimeSeriesQuery('sum(rate(container_network_transmit_bytes_total{ container="etcd", namespace=~"openshift-etcd.*"}[2m])) BY (namespace, pod)','tx {{ pod }}') - }, - - p99PeerToPeerLatency: { - query(): - generateTimeSeriesQuery('histogram_quantile(0.99, rate(etcd_network_peer_round_trip_time_seconds_bucket{namespace="openshift-etcd"}[2m]))','{{pod}}') - }, - - peerNetworkTraffic: { - query(): - generateTimeSeriesQuery('rate(etcd_network_peer_received_bytes_total{namespace="openshift-etcd"}[2m])','rx {{pod}} Peer Traffic') - + generateTimeSeriesQuery('rate(etcd_network_peer_sent_bytes_total{namespace="openshift-etcd"}[2m])','tx {{pod}} Peer Traffic') - }, - - gRPCNetworkTraffic: { - query(): - generateTimeSeriesQuery('rate(etcd_network_client_grpc_received_bytes_total{namespace="openshift-etcd"}[2m])','rx {{pod}}') - + generateTimeSeriesQuery('rate(etcd_network_client_grpc_sent_bytes_total{namespace="openshift-etcd"}[2m])','tx {{pod}}') - }, - - activeStreams: { - query(): - generateTimeSeriesQuery('sum(grpc_server_started_total{namespace="openshift-etcd",grpc_service="etcdserverpb.Watch",grpc_type="bidi_stream"}) - sum(grpc_server_handled_total{namespace="openshift-etcd",grpc_service="etcdserverpb.Watch",grpc_type="bidi_stream"})','Watch Streams') - + generateTimeSeriesQuery('sum(grpc_server_started_total{namespace="openshift-etcd",grpc_service="etcdserverpb.Lease",grpc_type="bidi_stream"}) - sum(grpc_server_handled_total{namespace="openshift-etcd",grpc_service="etcdserverpb.Lease",grpc_type="bidi_stream"})','Lease Streams') - }, - - snapshotDuration: { - query(): - generateTimeSeriesQuery('sum(rate(etcd_debugging_snap_save_total_duration_seconds_sum{namespace="openshift-etcd"}[2m]))','the total latency distributions of save called by snapshot') - }, - - dbSpaceUsed: { - query(): - generateTimeSeriesQuery('(etcd_mvcc_db_total_size_in_bytes{namespace="openshift-etcd"} / etcd_server_quota_backend_bytes{namespace="openshift-etcd"})*100','{{pod}}') - }, - - dbLeftCapacity: { - query(): - generateTimeSeriesQuery('etcd_server_quota_backend_bytes{namespace="openshift-etcd"} - etcd_mvcc_db_total_size_in_bytes{namespace="openshift-etcd"}','{{pod}}') - }, - - dbSizeLimit: { - query(): - generateTimeSeriesQuery('etcd_server_quota_backend_bytes{namespace="openshift-etcd"}','{{ pod }} Quota Bytes') - }, - - raftProposals: { - query(): - generateTimeSeriesQuery('sum(rate(etcd_server_proposals_failed_total{namespace="openshift-etcd"}[2m]))','Proposal Failure Rate') - + generateTimeSeriesQuery('sum(etcd_server_proposals_pending{namespace="openshift-etcd"})','Proposal Pending Total') - + generateTimeSeriesQuery('sum(rate(etcd_server_proposals_committed_total{namespace="openshift-etcd"}[2m]))','Proposal Commit Rate') - + generateTimeSeriesQuery('sum(rate(etcd_server_proposals_applied_total{namespace="openshift-etcd"}[2m]))','Proposal Apply Rate') - }, - - numberOfLeaderChangesSeen: { - query(): - generateTimeSeriesQuery('sum(rate(etcd_server_leader_changes_seen_total{namespace="openshift-etcd"}[2m]))','') - }, - - etcdHasALeader: { - query(): - generateTimeSeriesQuery('max(etcd_server_has_leader{namespace="openshift-etcd"})','') - }, - - totalNumberOfProposalsSeen: { - query(): - generateTimeSeriesQuery('max(etcd_server_proposals_committed_total{namespace="openshift-etcd"})','') - }, - - keys: { - query(): - generateTimeSeriesQuery('etcd_debugging_mvcc_keys_total{namespace="openshift-etcd"}','{{ pod }} Num keys') - }, - - leaderElectionsPerDay: { - query(): - generateTimeSeriesQuery('changes(etcd_server_leader_changes_seen_total{namespace="openshift-etcd"}[1d])','{{instance}} Total Leader Elections Per Day') - }, - - slowOperations: { - query(): - generateTimeSeriesQuery('delta(etcd_server_slow_apply_total{namespace="openshift-etcd"}[2m])','{{ pod }} slow applies') - + generateTimeSeriesQuery('delta(etcd_server_slow_read_indexes_total{namespace="openshift-etcd"}[2m])','{{ pod }} slow read indexes') - }, - - keyOperations: { - query(): - generateTimeSeriesQuery('rate(etcd_mvcc_put_total{namespace="openshift-etcd"}[2m])','{{ pod }} puts/s') - + generateTimeSeriesQuery('rate(etcd_mvcc_delete_total{namespace="openshift-etcd"}[2m])','{{ pod }} deletes/s') - }, - - heartBeatFailure: { - query(): - generateTimeSeriesQuery('etcd_server_heartbeat_send_failures_total{namespace="openshift-etcd"}','{{ pod }} heartbeat failures') - + generateTimeSeriesQuery('etcd_server_health_failures{namespace="openshift-etcd"}','{{ pod }} health failures') - }, - - compactedKeys: { - query(): - generateTimeSeriesQuery('etcd_debugging_mvcc_db_compaction_keys_total{namespace="openshift-etcd"}','{{ pod }} keys compacted') - } -} \ No newline at end of file + CPUUsage: { + query(): + generateTimeSeriesQuery('sum(irate(container_cpu_usage_seconds_total{namespace="openshift-etcd", container="etcd"}[2m])) by (pod) * 100', '{{ pod }}'), + }, + + memoryUsage: { + query(): + generateTimeSeriesQuery('sum(avg_over_time(container_memory_working_set_bytes{container="",pod!="", namespace=~"openshift-etcd.*"}[2m])) BY (pod, namespace)', '{{ pod }}'), + }, + + diskWalSyncDuration: { + query(): + generateTimeSeriesQuery('histogram_quantile(0.99, sum(irate(etcd_disk_wal_fsync_duration_seconds_bucket{namespace="openshift-etcd"}[2m])) by (pod, le))', '{{pod}} WAL fsync'), + }, + + diskBackendSyncDuration: { + query(): + generateTimeSeriesQuery('histogram_quantile(0.99, sum(irate(etcd_disk_backend_commit_duration_seconds_bucket{namespace="openshift-etcd"}[2m])) by (pod, le))', '{{pod}} DB fsync'), + }, + + etcdContainerDiskWrites: { + query(): + generateTimeSeriesQuery('rate(container_fs_writes_bytes_total{namespace="openshift-etcd",container="etcd",device!~".+dm.+"}[2m])', '{{ pod }}: {{ device }}'), + }, + + dbSize: { + query(): + generateTimeSeriesQuery('etcd_mvcc_db_total_size_in_bytes{namespace="openshift-etcd"}', '{{pod}} DB physical size') + + generateTimeSeriesQuery('etcd_mvcc_db_total_size_in_use_in_bytes{namespace="openshift-etcd"}', '{{pod}} DB logical size'), + }, + + containerNetworkTraffic: { + query(): + generateTimeSeriesQuery('sum(rate(container_network_receive_bytes_total{ container="etcd", namespace=~"openshift-etcd.*"}[2m])) BY (namespace, pod)', 'rx {{ pod }}') + + generateTimeSeriesQuery('sum(rate(container_network_transmit_bytes_total{ container="etcd", namespace=~"openshift-etcd.*"}[2m])) BY (namespace, pod)', 'tx {{ pod }}'), + }, + + p99PeerToPeerLatency: { + query(): + generateTimeSeriesQuery('histogram_quantile(0.99, rate(etcd_network_peer_round_trip_time_seconds_bucket{namespace="openshift-etcd"}[2m]))', '{{pod}}'), + }, + + peerNetworkTraffic: { + query(): + generateTimeSeriesQuery('rate(etcd_network_peer_received_bytes_total{namespace="openshift-etcd"}[2m])', 'rx {{pod}} Peer Traffic') + + generateTimeSeriesQuery('rate(etcd_network_peer_sent_bytes_total{namespace="openshift-etcd"}[2m])', 'tx {{pod}} Peer Traffic'), + }, + + gRPCNetworkTraffic: { + query(): + generateTimeSeriesQuery('rate(etcd_network_client_grpc_received_bytes_total{namespace="openshift-etcd"}[2m])', 'rx {{pod}}') + + generateTimeSeriesQuery('rate(etcd_network_client_grpc_sent_bytes_total{namespace="openshift-etcd"}[2m])', 'tx {{pod}}'), + }, + + activeStreams: { + query(): + generateTimeSeriesQuery('sum(grpc_server_started_total{namespace="openshift-etcd",grpc_service="etcdserverpb.Watch",grpc_type="bidi_stream"}) - sum(grpc_server_handled_total{namespace="openshift-etcd",grpc_service="etcdserverpb.Watch",grpc_type="bidi_stream"})', 'Watch Streams') + + generateTimeSeriesQuery('sum(grpc_server_started_total{namespace="openshift-etcd",grpc_service="etcdserverpb.Lease",grpc_type="bidi_stream"}) - sum(grpc_server_handled_total{namespace="openshift-etcd",grpc_service="etcdserverpb.Lease",grpc_type="bidi_stream"})', 'Lease Streams'), + }, + + snapshotDuration: { + query(): + generateTimeSeriesQuery('sum(rate(etcd_debugging_snap_save_total_duration_seconds_sum{namespace="openshift-etcd"}[2m]))', 'the total latency distributions of save called by snapshot'), + }, + + dbSpaceUsed: { + query(): + generateTimeSeriesQuery('(etcd_mvcc_db_total_size_in_bytes{namespace="openshift-etcd"} / etcd_server_quota_backend_bytes{namespace="openshift-etcd"})*100', '{{pod}}'), + }, + + dbLeftCapacity: { + query(): + generateTimeSeriesQuery('etcd_server_quota_backend_bytes{namespace="openshift-etcd"} - etcd_mvcc_db_total_size_in_bytes{namespace="openshift-etcd"}', '{{pod}}'), + }, + + dbSizeLimit: { + query(): + generateTimeSeriesQuery('etcd_server_quota_backend_bytes{namespace="openshift-etcd"}', '{{ pod }} Quota Bytes'), + }, + + raftProposals: { + query(): + generateTimeSeriesQuery('sum(rate(etcd_server_proposals_failed_total{namespace="openshift-etcd"}[2m]))', 'Proposal Failure Rate') + + generateTimeSeriesQuery('sum(etcd_server_proposals_pending{namespace="openshift-etcd"})', 'Proposal Pending Total') + + generateTimeSeriesQuery('sum(rate(etcd_server_proposals_committed_total{namespace="openshift-etcd"}[2m]))', 'Proposal Commit Rate') + + generateTimeSeriesQuery('sum(rate(etcd_server_proposals_applied_total{namespace="openshift-etcd"}[2m]))', 'Proposal Apply Rate'), + }, + + numberOfLeaderChangesSeen: { + query(): + generateTimeSeriesQuery('sum(rate(etcd_server_leader_changes_seen_total{namespace="openshift-etcd"}[2m]))', ''), + }, + + etcdHasALeader: { + query(): + generateTimeSeriesQuery('max(etcd_server_has_leader{namespace="openshift-etcd"})', ''), + }, + + totalNumberOfProposalsSeen: { + query(): + generateTimeSeriesQuery('max(etcd_server_proposals_committed_total{namespace="openshift-etcd"})', ''), + }, + + keys: { + query(): + generateTimeSeriesQuery('etcd_debugging_mvcc_keys_total{namespace="openshift-etcd"}', '{{ pod }} Num keys'), + }, + + leaderElectionsPerDay: { + query(): + generateTimeSeriesQuery('changes(etcd_server_leader_changes_seen_total{namespace="openshift-etcd"}[1d])', '{{instance}} Total Leader Elections Per Day'), + }, + + slowOperations: { + query(): + generateTimeSeriesQuery('delta(etcd_server_slow_apply_total{namespace="openshift-etcd"}[2m])', '{{ pod }} slow applies') + + generateTimeSeriesQuery('delta(etcd_server_slow_read_indexes_total{namespace="openshift-etcd"}[2m])', '{{ pod }} slow read indexes'), + }, + + keyOperations: { + query(): + generateTimeSeriesQuery('rate(etcd_mvcc_put_total{namespace="openshift-etcd"}[2m])', '{{ pod }} puts/s') + + generateTimeSeriesQuery('rate(etcd_mvcc_delete_total{namespace="openshift-etcd"}[2m])', '{{ pod }} deletes/s'), + }, + + heartBeatFailure: { + query(): + generateTimeSeriesQuery('etcd_server_heartbeat_send_failures_total{namespace="openshift-etcd"}', '{{ pod }} heartbeat failures') + + generateTimeSeriesQuery('etcd_server_health_failures{namespace="openshift-etcd"}', '{{ pod }} health failures'), + }, + + compactedKeys: { + query(): + generateTimeSeriesQuery('etcd_debugging_mvcc_db_compaction_keys_total{namespace="openshift-etcd"}', '{{ pod }} keys compacted'), + }, +} diff --git a/assets/etcd-on-cluster-dashboard/variables.libsonnet b/assets/etcd-on-cluster-dashboard/variables.libsonnet index ded8516..6edcc56 100644 --- a/assets/etcd-on-cluster-dashboard/variables.libsonnet +++ b/assets/etcd-on-cluster-dashboard/variables.libsonnet @@ -2,11 +2,11 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn local var = g.dashboard.variable; { - Datasource: - var.datasource.new('Datasource','prometheus') - + var.datasource.withRegex("") - + var.query.generalOptions.withLabel('Datasource') - + var.query.withRefresh(1) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(false), -} \ No newline at end of file + Datasource: + var.datasource.new('Datasource', 'prometheus') + + var.datasource.withRegex('') + + var.query.generalOptions.withLabel('Datasource') + + var.query.withRefresh(1) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(false), +} diff --git a/assets/hypershift-perf-dashboard/panels.libsonnet b/assets/hypershift-perf-dashboard/panels.libsonnet index 4750f57..c2cc8ab 100644 --- a/assets/hypershift-perf-dashboard/panels.libsonnet +++ b/assets/hypershift-perf-dashboard/panels.libsonnet @@ -1,229 +1,229 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; { - stat: { - local stat = g.panel.stat, - local options = stat.options, - - base(title, unit, targets, datasource, gridPos): - stat.new(title) - + stat.datasource.withType('prometheus') - + stat.datasource.withUid(datasource) - + stat.standardOptions.withUnit(unit) - + stat.queryOptions.withTargets(targets) - + stat.gridPos.withX(gridPos.x) - + stat.gridPos.withY(gridPos.y) - + stat.gridPos.withH(gridPos.h) - + stat.gridPos.withW(gridPos.w) - + options.withJustifyMode("auto") - + options.withGraphMode("none") - + options.text.withTitleSize(12), - - m_infrastructure(title, unit, targets, datasource, gridPos): - self.base(title, unit, targets, datasource, gridPos) - + options.withTextMode('name') - + options.withColorMode('value') - + stat.standardOptions.thresholds.withSteps([{ - "color": "green", - "value": null - }]) - + options.withJustifyMode('auto'), - - m_region(title, unit, targets, datasource, gridPos): - self.base(title, unit, targets, datasource, gridPos) - + options.withTextMode('name') - + options.withColorMode('value') - + stat.standardOptions.thresholds.withSteps([{ - "color": "green", - "value": null - }]) - + options.withJustifyMode('auto'), - - m_ocp_version(title, unit, targets, datasource, gridPos): - self.base(title, unit, targets, datasource, gridPos) - + options.withTextMode('name') - + options.withColorMode('value') - + stat.standardOptions.thresholds.withSteps([{ - "color": "green", - "value": null - }]) - + options.withJustifyMode('auto'), - - num_hosted_cluster(title, unit, targets, datasource, gridPos): - self.base(title, unit, targets, datasource, gridPos) - + options.withTextMode('auto') - + options.withColorMode('value') - + options.withJustifyMode('auto') - + stat.standardOptions.thresholds.withSteps([{ - "color": "green", - "value": null - }]) - + options.reduceOptions.withCalcs([ - 'max', - ]), - - current_namespace_count(title, unit, targets, datasource, gridPos): - self.base(title, unit, targets, datasource, gridPos) - + options.withTextMode('auto') - + options.withColorMode('value') - + options.withJustifyMode('auto') - + stat.standardOptions.thresholds.withSteps([]) - + stat.standardOptions.thresholds.withMode('absolute') - + options.reduceOptions.withCalcs([ - 'last', - ]), - - current_node_count(title, unit, targets, datasource, gridPos): - self.base(title, unit, targets, datasource, gridPos) - + options.withTextMode('auto') - + options.withColorMode('value') - + options.withJustifyMode('auto') - + options.withGraphMode('area') - + stat.standardOptions.thresholds.withSteps([]) - + stat.standardOptions.thresholds.withMode('absolute') - + options.reduceOptions.withCalcs([ - 'last', - ]), - - current_pod_count(title, unit, targets, datasource, gridPos): - self.base(title, unit, targets, datasource, gridPos) - + options.withTextMode('auto') - + options.withColorMode('value') - + options.withJustifyMode('auto') - + options.withGraphMode('area') - + stat.standardOptions.thresholds.withSteps([]) - + stat.standardOptions.thresholds.withMode('absolute') - + options.reduceOptions.withCalcs([ - 'last', - ]), - - etcd_has_leader(title, unit, targets, datasource, gridPos): - self.base(title, unit, targets, datasource, gridPos) - + options.withOrientation('horizontal') - + options.withColorMode('none') - + stat.standardOptions.withMappings([ - { - "type": "value", - "options": { - "0": { - "text": "NO" - }, - "1": { - "text": "YES" - } - } - } - ]), - - mgmt_num_failed_proposals(title, unit, targets, datasource, gridPos): - self.base(title, unit, targets, datasource, gridPos) - + options.withOrientation('horizontal') - + options.withColorMode('none') - + options.withTextMode('auto') - + options.withGraphMode('none') - + options.withJustifyMode('auto'), - - hostedControlPlaneStats(title, unit, targets, datasource, gridPos): - self.base(title, unit, targets, datasource, gridPos) - + options.withTextMode('name') - + options.withColorMode('value') - + options.withJustifyMode('auto') - + options.withGraphMode('none') - + stat.standardOptions.thresholds.withSteps([{ - "color": "green", - "value": null - }]), - }, - - timeSeries: { - local timeSeries = g.panel.timeSeries, - local custom = timeSeries.fieldConfig.defaults.custom, - local options = timeSeries.options, - - base(title, unit, targets, datasource, gridPos): - timeSeries.new(title) - + timeSeries.queryOptions.withTargets(targets) - + timeSeries.datasource.withType('prometheus') - + timeSeries.datasource.withUid(datasource) - + timeSeries.standardOptions.withUnit(unit) - + timeSeries.gridPos.withX(gridPos.x) - + timeSeries.gridPos.withY(gridPos.y) - + timeSeries.gridPos.withH(gridPos.h) - + timeSeries.gridPos.withW(gridPos.w) - + custom.withSpanNulls(false) - + custom.withFillOpacity(25) - + options.legend.withShowLegend(true), - - managementClustersStatsTimeseriesSettings(title, unit, targets, datasource, gridPos): - self.base(title, unit, targets, datasource, gridPos) - + options.legend.withPlacement('bottom') - + options.legend.withDisplayMode('table') - + options.tooltip.withMode('multi') - + options.tooltip.withSort('desc') - + custom.withDrawStyle('line') - + custom.withLineInterpolation('linear') - + options.legend.withDisplayMode('table') - + options.legend.withCalcs([ - 'mean', - 'max' - ]), - - mgmt(title, unit, targets, datasource, gridPos): - self.base(title, unit, targets, datasource, gridPos) - + options.legend.withDisplayMode('table') - + options.legend.withShowLegend(true) - + options.legend.withPlacement('bottom') - + options.legend.withCalcs([ - 'mean', - 'max' - ]) - + options.tooltip.withMode('multi') - + options.tooltip.withSort('desc') - + options.legend.withSortBy('max'), - - DBPanelsSettings(title, unit, targets, datasource, gridPos): - self.base(title, unit, targets, datasource, gridPos) - + options.legend.withDisplayMode('list') - + options.legend.withShowLegend(true) - + options.legend.withPlacement('bottom') - + options.tooltip.withMode('multi') - + options.tooltip.withSort('none'), - - genericGraphLegendPanel(title, unit, targets, datasource, gridPos): - self.base(title, unit, targets, datasource, gridPos) - + options.legend.withDisplayMode('table') - + options.legend.withShowLegend(true) - + options.legend.withPlacement('bottom') - + options.legend.withCalcs([ - 'mean', - 'max' - ]) - + options.tooltip.withMode('multi') - + options.tooltip.withSort('desc') - + options.legend.withSortBy('max'), - - genericGraphLegendPanelRightSide(title, unit, targets, datasource, gridPos): - self.base(title, unit, targets, datasource, gridPos) - + options.legend.withDisplayMode('table') - + options.legend.withShowLegend(true) - + options.legend.withPlacement('right') - + options.legend.withCalcs([ - 'lastNotNull', - ]) - + options.tooltip.withMode('multi') - + options.tooltip.withSort('desc') - + options.legend.withSortBy('max'), - - genericGraphLegendPanelList(title, unit, targets, datasource, gridPos): - self.base(title, unit, targets, datasource, gridPos) - + options.legend.withDisplayMode('list') - + options.legend.withShowLegend(true) - + options.legend.withPlacement('bottom') - + options.legend.withCalcs([ - 'lastNotNull', - ]) - + options.tooltip.withMode('multi') - + options.tooltip.withSort('desc') - + options.legend.withSortBy('max'), - }, -} \ No newline at end of file + stat: { + local stat = g.panel.stat, + local options = stat.options, + + base(title, unit, targets, datasource, gridPos): + stat.new(title) + + stat.datasource.withType('prometheus') + + stat.datasource.withUid(datasource) + + stat.standardOptions.withUnit(unit) + + stat.queryOptions.withTargets(targets) + + stat.gridPos.withX(gridPos.x) + + stat.gridPos.withY(gridPos.y) + + stat.gridPos.withH(gridPos.h) + + stat.gridPos.withW(gridPos.w) + + options.withJustifyMode('auto') + + options.withGraphMode('none') + + options.text.withTitleSize(12), + + m_infrastructure(title, unit, targets, datasource, gridPos): + self.base(title, unit, targets, datasource, gridPos) + + options.withTextMode('name') + + options.withColorMode('value') + + stat.standardOptions.thresholds.withSteps([{ + color: 'green', + value: null, + }]) + + options.withJustifyMode('auto'), + + m_region(title, unit, targets, datasource, gridPos): + self.base(title, unit, targets, datasource, gridPos) + + options.withTextMode('name') + + options.withColorMode('value') + + stat.standardOptions.thresholds.withSteps([{ + color: 'green', + value: null, + }]) + + options.withJustifyMode('auto'), + + m_ocp_version(title, unit, targets, datasource, gridPos): + self.base(title, unit, targets, datasource, gridPos) + + options.withTextMode('name') + + options.withColorMode('value') + + stat.standardOptions.thresholds.withSteps([{ + color: 'green', + value: null, + }]) + + options.withJustifyMode('auto'), + + num_hosted_cluster(title, unit, targets, datasource, gridPos): + self.base(title, unit, targets, datasource, gridPos) + + options.withTextMode('auto') + + options.withColorMode('value') + + options.withJustifyMode('auto') + + stat.standardOptions.thresholds.withSteps([{ + color: 'green', + value: null, + }]) + + options.reduceOptions.withCalcs([ + 'max', + ]), + + current_namespace_count(title, unit, targets, datasource, gridPos): + self.base(title, unit, targets, datasource, gridPos) + + options.withTextMode('auto') + + options.withColorMode('value') + + options.withJustifyMode('auto') + + stat.standardOptions.thresholds.withSteps([]) + + stat.standardOptions.thresholds.withMode('absolute') + + options.reduceOptions.withCalcs([ + 'last', + ]), + + current_node_count(title, unit, targets, datasource, gridPos): + self.base(title, unit, targets, datasource, gridPos) + + options.withTextMode('auto') + + options.withColorMode('value') + + options.withJustifyMode('auto') + + options.withGraphMode('area') + + stat.standardOptions.thresholds.withSteps([]) + + stat.standardOptions.thresholds.withMode('absolute') + + options.reduceOptions.withCalcs([ + 'last', + ]), + + current_pod_count(title, unit, targets, datasource, gridPos): + self.base(title, unit, targets, datasource, gridPos) + + options.withTextMode('auto') + + options.withColorMode('value') + + options.withJustifyMode('auto') + + options.withGraphMode('area') + + stat.standardOptions.thresholds.withSteps([]) + + stat.standardOptions.thresholds.withMode('absolute') + + options.reduceOptions.withCalcs([ + 'last', + ]), + + etcd_has_leader(title, unit, targets, datasource, gridPos): + self.base(title, unit, targets, datasource, gridPos) + + options.withOrientation('horizontal') + + options.withColorMode('none') + + stat.standardOptions.withMappings([ + { + type: 'value', + options: { + '0': { + text: 'NO', + }, + '1': { + text: 'YES', + }, + }, + }, + ]), + + mgmt_num_failed_proposals(title, unit, targets, datasource, gridPos): + self.base(title, unit, targets, datasource, gridPos) + + options.withOrientation('horizontal') + + options.withColorMode('none') + + options.withTextMode('auto') + + options.withGraphMode('none') + + options.withJustifyMode('auto'), + + hostedControlPlaneStats(title, unit, targets, datasource, gridPos): + self.base(title, unit, targets, datasource, gridPos) + + options.withTextMode('name') + + options.withColorMode('value') + + options.withJustifyMode('auto') + + options.withGraphMode('none') + + stat.standardOptions.thresholds.withSteps([{ + color: 'green', + value: null, + }]), + }, + + timeSeries: { + local timeSeries = g.panel.timeSeries, + local custom = timeSeries.fieldConfig.defaults.custom, + local options = timeSeries.options, + + base(title, unit, targets, datasource, gridPos): + timeSeries.new(title) + + timeSeries.queryOptions.withTargets(targets) + + timeSeries.datasource.withType('prometheus') + + timeSeries.datasource.withUid(datasource) + + timeSeries.standardOptions.withUnit(unit) + + timeSeries.gridPos.withX(gridPos.x) + + timeSeries.gridPos.withY(gridPos.y) + + timeSeries.gridPos.withH(gridPos.h) + + timeSeries.gridPos.withW(gridPos.w) + + custom.withSpanNulls(false) + + custom.withFillOpacity(25) + + options.legend.withShowLegend(true), + + managementClustersStatsTimeseriesSettings(title, unit, targets, datasource, gridPos): + self.base(title, unit, targets, datasource, gridPos) + + options.legend.withPlacement('bottom') + + options.legend.withDisplayMode('table') + + options.tooltip.withMode('multi') + + options.tooltip.withSort('desc') + + custom.withDrawStyle('line') + + custom.withLineInterpolation('linear') + + options.legend.withDisplayMode('table') + + options.legend.withCalcs([ + 'mean', + 'max', + ]), + + mgmt(title, unit, targets, datasource, gridPos): + self.base(title, unit, targets, datasource, gridPos) + + options.legend.withDisplayMode('table') + + options.legend.withShowLegend(true) + + options.legend.withPlacement('bottom') + + options.legend.withCalcs([ + 'mean', + 'max', + ]) + + options.tooltip.withMode('multi') + + options.tooltip.withSort('desc') + + options.legend.withSortBy('max'), + + DBPanelsSettings(title, unit, targets, datasource, gridPos): + self.base(title, unit, targets, datasource, gridPos) + + options.legend.withDisplayMode('list') + + options.legend.withShowLegend(true) + + options.legend.withPlacement('bottom') + + options.tooltip.withMode('multi') + + options.tooltip.withSort('none'), + + genericGraphLegendPanel(title, unit, targets, datasource, gridPos): + self.base(title, unit, targets, datasource, gridPos) + + options.legend.withDisplayMode('table') + + options.legend.withShowLegend(true) + + options.legend.withPlacement('bottom') + + options.legend.withCalcs([ + 'mean', + 'max', + ]) + + options.tooltip.withMode('multi') + + options.tooltip.withSort('desc') + + options.legend.withSortBy('max'), + + genericGraphLegendPanelRightSide(title, unit, targets, datasource, gridPos): + self.base(title, unit, targets, datasource, gridPos) + + options.legend.withDisplayMode('table') + + options.legend.withShowLegend(true) + + options.legend.withPlacement('right') + + options.legend.withCalcs([ + 'lastNotNull', + ]) + + options.tooltip.withMode('multi') + + options.tooltip.withSort('desc') + + options.legend.withSortBy('max'), + + genericGraphLegendPanelList(title, unit, targets, datasource, gridPos): + self.base(title, unit, targets, datasource, gridPos) + + options.legend.withDisplayMode('list') + + options.legend.withShowLegend(true) + + options.legend.withPlacement('bottom') + + options.legend.withCalcs([ + 'lastNotNull', + ]) + + options.tooltip.withMode('multi') + + options.tooltip.withSort('desc') + + options.legend.withSortBy('max'), + }, +} diff --git a/assets/hypershift-perf-dashboard/queries.libsonnet b/assets/hypershift-perf-dashboard/queries.libsonnet index bb1fe65..3cffe54 100644 --- a/assets/hypershift-perf-dashboard/queries.libsonnet +++ b/assets/hypershift-perf-dashboard/queries.libsonnet @@ -1,1061 +1,1063 @@ -local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local variables = import './variables.libsonnet'; +local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local prometheus = g.query.prometheus; { - m_infrastructure: { - query(): - prometheus.withExpr('cluster_infrastructure_provider{namespace="openshift-kube-apiserver-operator"}') - + prometheus.withInstant(true) - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{type}}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A') - - }, - - m_region: { - query(): - prometheus.withExpr('cluster_infrastructure_provider{namespace="openshift-kube-apiserver-operator"}') - + prometheus.withInstant(true) - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{region}}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A') - }, - - m_ocp_version: { - query(): - prometheus.withExpr('cluster_version{type="completed",version!="",namespace="openshift-cluster-version"}') - + prometheus.withInstant(true) - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{version}}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A') - }, - - num_hosted_cluster: { - query(): - prometheus.withExpr('count(kube_namespace_labels{namespace=~"^ocm-.*"})') - + prometheus.withInstant(true) - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('PF55DCC5EC58ABF5A') - }, - - current_namespace_count: { - query(): - prometheus.withExpr('sum(kube_namespace_status_phase) by (phase)') - + prometheus.withInstant(true) - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ phase }}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A') - }, - - current_node_count: { - query(): - [prometheus.withExpr('sum(kube_node_info{})') - + prometheus.withInstant(true) - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('Number of nodes') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - - prometheus.withExpr('sum(kube_node_status_condition{status="true"}) by (condition) > 0') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('Node: {{ condition }}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - - prometheus.withExpr('sum(kube_node_role{}) by (role)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('Role: {{ role }}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A') - ] - }, - - current_pod_count: { - query(): - prometheus.withExpr('sum(kube_pod_status_phase{}) by (phase) > 0') - + prometheus.withInstant(true) - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ phase}} Pods') - + prometheus.withDatasource('PF55DCC5EC58ABF5A') - }, - - top10ContCPUHosted: { - query(): - prometheus.withExpr('topk(10,irate(container_cpu_usage_seconds_total{namespace=~"^ocm-.*",container!="POD",name!=""}[2m])*100)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ namespace }} - {{ name }}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A') - }, - - top10ContMemHosted: { - query(): - prometheus.withExpr('topk(10, container_memory_rss{namespace=~"^ocm-.*",container!="POD",name!=""})') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ namespace }} - {{ name }}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A') - }, - - top10ContCPUManagement: { - query(): - prometheus.withExpr('topk(10,irate(container_cpu_usage_seconds_total{namespace!="",container!="POD",name!=""}[2m])*100)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ namespace }} - {{ name }}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A') - }, - - top10ContMemManagement: { - query(): - prometheus.withExpr('topk(10, container_memory_rss{namespace!="",container!="POD",name!=""})') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ namespace }} - {{ name }}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A') - }, - - top10ContCPUOBOManagement: { - query(): - prometheus.withExpr('topk(10,irate(container_cpu_usage_seconds_total{namespace="openshift-observability-operator",container!="POD",name!=""}[2m])*100)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ pod }}/{{ container }}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A') - }, - - top10ContMemOBOManagement: { - query(): - prometheus.withExpr('topk(10, container_memory_rss{namespace="openshift-observability-operator",container!="POD",name!=""})') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ pod }}/{{ container }}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A') - }, - - top10ContCPUHypershiftManagement: { - query(): - prometheus.withExpr('topk(10,irate(container_cpu_usage_seconds_total{namespace="hypershift",container!="POD",name!=""}[2m])*100)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ pod }}/{{ container }}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A') - }, - - top10ContMemHypershiftManagement: { - query(): - prometheus.withExpr('topk(10, container_memory_rss{namespace="hypershift",container!="POD",name!=""})') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ pod }}/{{ container }}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A') - }, - - dynaactivegateMem: { - query(): - prometheus.withExpr('sum(container_memory_rss{namespace=~"dynatrace",pod=~".*-activegate-.*",container!=""}) by (node, namespace, pod)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ node }}: {{ namespace }} : {{ pod }}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A') - }, - - dynaactivegateCPU: { - query(): - prometheus.withExpr('sum(irate(container_cpu_usage_seconds_total{namespace=~"dynatrace", pod=~".*-activegate-.*", container!~"POD|"}[2m])*100) by (node, namespace, pod)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ node }}: {{ namespace }} : {{ pod }}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A') - }, - - opentelemetryCPU: { - query(): - prometheus.withExpr('sum(irate(container_cpu_usage_seconds_total{namespace=~"dynatrace", pod=~"opentelemetry-.*", container!~"POD|"}[2m])*100) by (node, namespace, pod)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ node }}: {{ namespace }} : {{ pod }}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A') - }, - - opentelemetryMem: { - query(): - prometheus.withExpr('sum(container_memory_rss{namespace=~"dynatrace",pod=~"opentelemetry-.*",container!=""}) by (node, namespace, pod)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ node }}: {{ namespace }} : {{ pod }}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A') - }, - - nodeCount: { - query(): - [ - prometheus.withExpr('sum(kube_node_info{})') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('Number of nodes') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - prometheus.withExpr('sum(kube_node_status_condition{status="true"}) by (node,condition) > 0') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{node}}: {{ condition }}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A') - ] - }, - - current_machine_set_replica_count: { - query(): - [ - prometheus.withExpr('mapi_machine_set_status_replicas{name=~".*worker.*"}') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('Replicas: {{ name }}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - - prometheus.withExpr('mapi_machine_set_status_replicas_available{name=~".*worker.*"}') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('Available: {{ name }}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - - prometheus.withExpr('mapi_machine_set_status_replicas_ready{name=~".*worker.*"}') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('Ready: {{ name }}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - ] - }, - - nsCount: { - query(): - prometheus.withExpr('sum(kube_namespace_status_phase) by (phase) > 0') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{ phase }} namespaces') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - podCount: { - query(): - prometheus.withExpr('sum(kube_pod_status_phase{}) by (phase)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{phase}} pods') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - clusterOperatorsInformation: { - query(): - prometheus.withExpr('cluster_operator_conditions{name!="",reason!=""}') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{name}} - {{reason}}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - clusterOperatorsDegraded: { - query(): - prometheus.withExpr('cluster_operator_conditions{condition="Degraded",name!="",reason!=""}') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{name}} - {{reason}}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - FailedPods: { - query(): - [ - prometheus.withExpr('kube_pod_status_phase{phase="Failed"}') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{namespace}}/{{ pod }}:{{ phase }}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - prometheus.withExpr('count(kube_pod_status_phase{phase="Failed"})') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{phase}} pods') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - ] - }, - - alerts: { - query(): - prometheus.withExpr('topk(10,sum(ALERTS{severity!="none"}) by (alertname, severity))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{severity}}: {{alertname}}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - mgmt_disk_wal_sync_duration: { - query(): - prometheus.withExpr('histogram_quantile(0.99, sum(irate(etcd_disk_wal_fsync_duration_seconds_bucket{namespace=~"openshift-etcd"}[2m])) by (namespace, pod, le))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{namespace}} - {{pod}} WAL fsync') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - mgmt_disk_backend_sync_duration: { - query(): - prometheus.withExpr('histogram_quantile(0.99, sum(irate(etcd_disk_backend_commit_duration_seconds_bucket{namespace=~"openshift-etcd"}[2m])) by (namespace, pod, le))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{namespace}} - {{pod}} DB fsync') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - mgmt_percent_db_used: { - query(): - prometheus.withExpr('(etcd_mvcc_db_total_size_in_bytes{namespace=~"openshift-etcd"} / etcd_server_quota_backend_bytes{namespace=~"openshift-etcd"})*100') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{namespace}} - {{pod}}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - mgmt_db_capacity_left: { - query(): - prometheus.withExpr('etcd_server_quota_backend_bytes{namespace=~"openshift-etcd"} - etcd_mvcc_db_total_size_in_bytes{namespace=~"openshift-etcd"}') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{namespace}} - {{pod}}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - mgmt_db_size_limit: { - query(): - prometheus.withExpr('etcd_server_quota_backend_bytes{namespace=~"openshift-etcd"}') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{namespace}} - {{ pod }} Quota Bytes') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - mgmt_db_size: { - query(): - [ - prometheus.withExpr('etcd_mvcc_db_total_size_in_bytes{namespace=~"openshift-etcd"}') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{namespace}} - {{pod}} DB physical size') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - - prometheus.withExpr('etcd_mvcc_db_total_size_in_use_in_bytes{namespace=~"openshift-etcd"}') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{namespace}} - {{pod}} DB logical size') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - ] - }, - - mgmt_grpc_traffic: { - query(): - [ - prometheus.withExpr('rate(etcd_network_client_grpc_received_bytes_total{namespace=~"openshift-etcd"}[2m])') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('rx {{namespace}} - {{pod}}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - - prometheus.withExpr('rate(etcd_network_client_grpc_sent_bytes_total{namespace=~"openshift-etcd"}[2m])') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('tx {{namespace}} - {{pod}}') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - ] - }, - - mgmt_active_streams: { - query(): - [ - prometheus.withExpr('sum(grpc_server_started_total{namespace=~"openshift-etcd",grpc_service="etcdserverpb.Watch",grpc_type="bidi_stream"}) - sum(grpc_server_handled_total{namespace=~"openshift-etcd",grpc_service="etcdserverpb.Watch",grpc_type="bidi_stream"})') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{namespace}} - Watch Streams') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - - prometheus.withExpr('sum(grpc_server_started_total{namespace=~"openshift-etcd",grpc_service="etcdserverpb.Lease",grpc_type="bidi_stream"}) - sum(grpc_server_handled_total{namespace=~"openshift-etcd",grpc_service="etcdserverpb.Lease",grpc_type="bidi_stream"})') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{namespace}} - Lease Streams') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - ] - }, - - mgmt_snapshot_duration: { - query(): - prometheus.withExpr('sum(rate(etcd_debugging_snap_save_total_duration_seconds_sum{namespace=~"openshift-etcd"}[2m]))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('the total latency distributions of save called by snapshot') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - mgmt_raft_proposals: { - query(): - [ - prometheus.withExpr('sum(rate(etcd_server_proposals_failed_total{namespace=~"openshift-etcd"}[2m]))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{namespace}} - Proposal Failure Rate') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - - prometheus.withExpr('sum(etcd_server_proposals_pending{namespace=~"openshift-etcd"})') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{namespace}} - Proposal Pending Total') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - - prometheus.withExpr('sum(rate(etcd_server_proposals_committed_total{namespace=~"openshift-etcd"}[2m]))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{namespace}} - Proposal Commit Rate') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - - prometheus.withExpr('sum(rate(etcd_server_proposals_applied_total{namespace=~"openshift-etcd"}[2m]))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withLegendFormat('{{namespace}} - Proposal Apply Rate') - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - ] - }, - - mgmt_num_leader_changes: { - query(): - prometheus.withExpr('sum(rate(etcd_server_leader_changes_seen_total{namespace=~"openshift-etcd"}[2m]))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - mgmt_etcd_has_leader: { - query(): - prometheus.withExpr('max(etcd_server_has_leader{namespace=~"openshift-etcd"})') - + prometheus.withFormat('time_series') - + prometheus.withInstant(true) - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - mgmt_num_failed_proposals: { - query(): - prometheus.withExpr('max(etcd_server_proposals_committed_total{namespace=~"openshift-etcd"})') - + prometheus.withFormat('time_series') - + prometheus.withInstant(true) - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - mgmt_leader_elections_per_day: { - query(): - prometheus.withExpr('changes(etcd_server_leader_changes_seen_total{namespace=~"openshift-etcd"}[1d])') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{instance}} Total Leader Elections Per Day') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - mgmt_keys: { - query(): - prometheus.withExpr('etcd_debugging_mvcc_keys_total{namespace=~"openshift-etcd"}') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{ pod }} Num keys') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - mgmt_slow_operations: { - query(): - [ - prometheus.withExpr('delta(etcd_server_slow_apply_total{namespace=~"openshift-etcd"}[2m])') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{ pod }} slow applies') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - - prometheus.withExpr('delta(etcd_server_slow_read_indexes_total{namespace=~"openshift-etcd"}[2m])') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{ pod }} slow read indexes') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - ] - }, - - mgmt_key_operations: { - query(): - [ - prometheus.withExpr('rate(etcd_mvcc_put_total{namespace=~"openshift-etcd"}[2m])') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{ pod }} puts/s') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - - prometheus.withExpr('rate(etcd_mvcc_delete_total{namespace=~"openshift-etcd"}[2m])') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{ pod }} deletes/s') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - ] - }, - - mgmt_heartbeat_failures: { - query(): - [ - prometheus.withExpr('etcd_server_heartbeat_send_failures_total{namespace=~"openshift-etcd"}') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{ pod }} heartbeat failures') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - - prometheus.withExpr('etcd_server_health_failures{namespace=~"openshift-etcd"}') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{ pod }} health failures') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - ] - }, - - mgmt_compacted_keys: { - query(): - [ - prometheus.withExpr('etcd_debugging_mvcc_db_compaction_keys_total{namespace=~"openshift-etcd"}') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{ pod }} keys compacted') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - ] - }, - - nodeCPU: { - query(): - prometheus.withExpr('sum by (instance, mode)(irate(node_cpu_seconds_total{job=~".*"}[2m])) * 100 and on (instance) label_replace(cluster:nodes_roles{label_hypershift_openshift_io_cluster=~"$namespace"}, "instance", "$1", "node", "(.+)")') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{instance}} - {{mode}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - nodeMemory: { - query(): - prometheus.withExpr('node_memory_Active_bytes and on (instance) label_replace(cluster:nodes_roles{label_hypershift_openshift_io_cluster=~"$namespace"}, "instance", "$1", "node", "(.+)")') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{instance}} - Active') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - suricataCPU: { - query(): - prometheus.withExpr('sum(irate(container_cpu_usage_seconds_total{namespace=~"openshift-suricata",container!="POD",name!=""}[2m])*100) by (node) and on (node) label_replace(cluster:nodes_roles{label_hypershift_openshift_io_cluster=~"$namespace"}, "node", "$1", "node", "(.+)")') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{node}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - suricataMemory: { - query(): - prometheus.withExpr('sum(container_memory_rss{namespace=~"openshift-suricata",container!="POD",name!=""}) by (node) and on (node) label_replace(cluster:nodes_roles{label_hypershift_openshift_io_cluster=~"$namespace"}, "node", "$1", "node", "(.+)")') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{node}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - dynaoneagentCPU: { - query(): - prometheus.withExpr('sum(irate(container_cpu_usage_seconds_total{namespace=~"dynatrace", pod=~".*-oneagent-.*", container!~"POD|"}[2m])*100) by (node, namespace, pod)') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{ node }}: {{ namespace }} : {{ pod }}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - dynaoneagentMem: { - query(): - prometheus.withExpr('sum(container_memory_rss{namespace=~"dynatrace",pod=~".*-oneagent-.*",container!=""}) by (node, namespace, pod)') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{ node }}: {{ namespace }} : {{ pod }}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - infrastructure: { - query(): - prometheus.withExpr('cluster_infrastructure_provider{namespace=~"$namespace"}') - + prometheus.withFormat('time_series') - + prometheus.withInstant(true) - + prometheus.withLegendFormat('{{type}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - region: { - query(): - prometheus.withExpr('cluster_infrastructure_provider{namespace=~"$namespace"}') - + prometheus.withFormat('time_series') - + prometheus.withInstant(true) - + prometheus.withLegendFormat('{{region}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - ocp_version: { - query(): - prometheus.withExpr('cluster_version{type="completed",version!="",namespace=~"$namespace"}') - + prometheus.withFormat('time_series') - + prometheus.withInstant(true) - + prometheus.withLegendFormat('{{version}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - hostedControlPlaneCPU: { - query(): - prometheus.withExpr('cluster_version{type="completed",version!="",namespace=~"$namespace"}') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{version}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - hostedControlPlaneMemory: { - query(): - prometheus.withExpr('topk(10, container_memory_rss{namespace=~"$namespace",container!="POD",name!=""})') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{pod}}/{{container}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('PF55DCC5EC58ABF5A'), - }, - - request_duration_99th_quantile: { - query(): - prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_request_duration_seconds_bucket{namespace=~"$namespace",resource=~"$resource",subresource!="log",verb!~"WATCH|WATCHLIST|PROXY"}[2m])) by(verb,le))') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{verb}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - request_rate_by_instance: { - query(): - prometheus.withExpr('sum(rate(apiserver_request_total{namespace=~"$namespace",resource=~"$resource",code=~"$code",verb=~"$verb"}[2m])) by(instance)') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{instance}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - request_duration_99th_quantile_by_resource: { - query(): - prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_request_duration_seconds_bucket{namespace=~"$namespace",resource=~"$resource",subresource!="log",verb!~"WATCH|WATCHLIST|PROXY"}[2m])) by(resource, namespace, verb, le))') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{verb}}:{{resource}}/{{namespace}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - request_rate_by_resource: { - query(): - prometheus.withExpr('sum(rate(apiserver_request_total{namespace=~"$namespace",resource=~"$resource",code=~"$code",verb=~"$verb"}[2m])) by(resource)') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{resource}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - request_duration_read_write: { - query(): - [ - prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_request_duration_seconds_bucket{namespace=~"$namespace",resource=~"$resource",verb=~"LIST|GET"}[2m])) by(le))') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('read') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - - prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_request_duration_seconds_bucket{namespace=~"$namespace",resource=~"$resource",verb=~"POST|PUT|PATCH|UPDATE|DELETE"}[2m])) by(le))') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('write') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - ] - }, - - request_rate_read_write: { - query(): - [ - prometheus.withExpr('sum(rate(apiserver_request_total{namespace=~"$namespace",resource=~"$resource",verb=~"LIST|GET"}[2m]))') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('read') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - - prometheus.withExpr('sum(rate(apiserver_request_total{namespace=~"$namespace",resource=~"$resource",verb=~"POST|PUT|PATCH|UPDATE|DELETE"}[2m]))') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('write') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - ] - }, - - requests_dropped_rate: { - query(): - prometheus.withExpr('sum(rate(apiserver_dropped_requests_total{namespace=~"$namespace"}[2m])) by (requestKind)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - requests_terminated_rate: { - query(): - prometheus.withExpr('sum(rate(apiserver_request_terminations_total{namespace=~"$namespace",resource=~"$resource",code=~"$code"}[2m])) by(component)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - requests_status_rate: { - query(): - prometheus.withExpr('sum(rate(apiserver_request_total{namespace=~"$namespace",resource=~"$resource",verb=~"$verb",code=~"$code"}[2m])) by(code)') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{code}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - long_running_requests: { - query(): - prometheus.withExpr('sum(apiserver_longrunning_gauge{namespace=~"$namespace",resource=~"$resource",verb=~"$verb"}) by(instance)') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{instance}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - request_in_flight: { - query(): - prometheus.withExpr('sum(apiserver_current_inflight_requests{namespace=~"$namespace"}) by (instance,requestKind)') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{requestKind}}-{{instance}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - pf_requests_rejected: { - query(): - prometheus.withExpr('sum(rate(apiserver_flowcontrol_rejected_requests_total{namespace=~"$namespace"}[2m])) by (reason)') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - response_size_99th_quartile: { - query(): - prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_response_sizes_bucket{namespace=~"$namespace",resource=~"$resource",verb=~"$verb"}[2m])) by(instance,le))') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{instance}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - pf_request_queue_length: { - query(): - prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_flowcontrol_request_queue_length_after_enqueue_bucket{namespace=~"$namespace"}[2m])) by(flowSchema, priorityLevel, le))') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{flowSchema}}:{{priorityLevel}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - pf_request_wait_duration_99th_quartile: { - query(): - prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_flowcontrol_request_wait_duration_seconds_bucket{namespace=~"$namespace"}[2m])) by(flowSchema, priorityLevel, le))') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{flowSchema}}:{{priorityLevel}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - pf_request_execution_duration: { - query(): - prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_flowcontrol_request_execution_seconds_bucket{namespace=~"$namespace"}[2m])) by(flowSchema, priorityLevel, le))') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{flowSchema}}:{{priorityLevel}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - pf_request_dispatch_rate: { - query(): - prometheus.withExpr('sum(rate(apiserver_flowcontrol_dispatched_requests_total{namespace=~"$namespace"}[2m])) by(flowSchema,priorityLevel)') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{flowSchema}}:{{priorityLevel}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - pf_concurrency_limit: { - query(): - prometheus.withExpr('sum(apiserver_flowcontrol_request_concurrency_limit{namespace=~"$namespace"}) by (priorityLevel)') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{priorityLevel}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - pf_pending_in_queue: { - query(): - prometheus.withExpr('sum(apiserver_flowcontrol_current_inqueue_requests{namespace=~"$namespace"}) by (flowSchema,priorityLevel)') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{flowSchema}}:{{priorityLevel}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - disk_wal_sync_duration: { - query(): - prometheus.withExpr('histogram_quantile(0.99, sum(irate(etcd_disk_wal_fsync_duration_seconds_bucket{namespace=~"$namespace"}[2m])) by (namespace, pod, le))') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{pod}} WAL fsync') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - disk_backend_sync_duration: { - query(): - prometheus.withExpr('histogram_quantile(0.99, sum(irate(etcd_disk_backend_commit_duration_seconds_bucket{namespace=~"$namespace"}[2m])) by (namespace, pod, le))') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{pod}} DB fsync') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - percent_db_used: { - query(): - prometheus.withExpr('(etcd_mvcc_db_total_size_in_bytes{namespace=~"$namespace"} / etcd_server_quota_backend_bytes{namespace=~"$namespace"})*100') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{pod}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - db_capacity_left: { - query(): - prometheus.withExpr('etcd_server_quota_backend_bytes{namespace=~"$namespace"} - etcd_mvcc_db_total_size_in_bytes{namespace=~"$namespace"}') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{pod}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - - db_size_limit: { - query(): - prometheus.withExpr('etcd_server_quota_backend_bytes{namespace=~"$namespace"}') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{ pod }} Quota Bytes') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - db_size: { - query(): - [ - prometheus.withExpr('etcd_mvcc_db_total_size_in_bytes{namespace=~"$namespace"}') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{pod}} DB physical size') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - - prometheus.withExpr('etcd_mvcc_db_total_size_in_use_in_bytes{namespace=~"$namespace"}') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{pod}} DB logical size') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - ] - }, - - grpc_traffic: { - query(): - [ - prometheus.withExpr('rate(etcd_network_client_grpc_received_bytes_total{namespace=~"$namespace"}[2m])') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('rx {{namespace}} - {{pod}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - - prometheus.withExpr('rate(etcd_network_client_grpc_sent_bytes_total{namespace=~"$namespace"}[2m])') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('tx {{namespace}} - {{pod}}') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - ] - }, - - active_streams: { - query(): - [ - prometheus.withExpr('sum(grpc_server_started_total{namespace=~"$namespace",grpc_service="etcdserverpb.Watch",grpc_type="bidi_stream"}) - sum(grpc_server_handled_total{namespace=~"$namespace",grpc_service="etcdserverpb.Watch",grpc_type="bidi_stream"})') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - Watch Streams') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - - prometheus.withExpr('sum(grpc_server_started_total{namespace=~"$namespace",grpc_service="etcdserverpb.Lease",grpc_type="bidi_stream"}) - sum(grpc_server_handled_total{namespace=~"$namespace",grpc_service="etcdserverpb.Lease",grpc_type="bidi_stream"})') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - Lease Streams') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - ] - }, - - snapshot_duration: { - query(): - prometheus.withExpr('sum(rate(etcd_debugging_snap_save_total_duration_seconds_sum{namespace=~"$namespace"}[2m]))') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('the total latency distributions of save called by snapshot') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3') - }, - - raft_proposals: { - query(): - [ prometheus.withExpr('sum(rate(etcd_server_proposals_failed_total{namespace=~"openshift-etcd"}[2m]))') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - Proposal Failure Rate') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - - prometheus.withExpr('sum(etcd_server_proposals_pending{namespace=~"$namespace"})') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - Proposal Pending Total') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - - prometheus.withExpr('sum(rate(etcd_server_proposals_committed_total{namespace=~"$namespace"}[2m]))') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - Proposal Commit Rate') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - - prometheus.withExpr('sum(rate(etcd_server_proposals_applied_total{namespace=~"$namespace"}[2m]))') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - Proposal Apply Rate') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - - ] - }, - - num_leader_changes: { - query(): - prometheus.withExpr('sum(rate(etcd_server_leader_changes_seen_total{namespace=~"$namespace"}[2m]))') - + prometheus.withFormat('time_series') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - etcd_has_leader: { - query(): - prometheus.withExpr('max(etcd_server_has_leader{namespace=~"$namespace"})') - + prometheus.withFormat('time_series') - + prometheus.withInstant(true) - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - num_failed_proposals: { - query(): - prometheus.withExpr('max(etcd_server_proposals_committed_total{namespace=~"$namespace"})') - + prometheus.withFormat('time_series') - + prometheus.withInstant(true) - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - leader_elections_per_day: { - query(): - prometheus.withExpr('changes(etcd_server_leader_changes_seen_total{namespace=~"$namespace"}[1d])') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{instance}} Total Leader Elections Per Day') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - keys: { - query(): - prometheus.withExpr('etcd_debugging_mvcc_keys_total{namespace=~"$namespace"}') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{ pod }} Num keys') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - }, - - slow_operations: { - query(): - [ - prometheus.withExpr('delta(etcd_server_slow_apply_total{namespace=~"$namespace"}[2m])') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{ pod }} slow applies') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - - prometheus.withExpr('delta(etcd_server_slow_read_indexes_total{namespace=~"$namespace"}[2m])') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{ pod }} slow read indexes') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - ] - }, - - key_operations: { - query(): - [ - prometheus.withExpr('rate(etcd_mvcc_put_total{namespace=~"$namespace"}[2m])') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{ pod }} puts/s') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - - prometheus.withExpr('rate(etcd_mvcc_delete_total{namespace=~"$namespace"}[2m])') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{ pod }} deletes/s') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - ] - }, - - heartbeat_failures: { - query(): - [ - prometheus.withExpr('etcd_server_heartbeat_send_failures_total{namespace=~"$namespace"}') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{ pod }} heartbeat failures') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - - prometheus.withExpr('etcd_server_health_failures{namespace=~"$namespace') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{ pod }} health failures') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - ] - }, - - compacted_keys: { - query(): - prometheus.withExpr('etcd_debugging_mvcc_db_compaction_keys_total{namespace=~"$namespace"}') - + prometheus.withFormat('time_series') - + prometheus.withLegendFormat('{{namespace}} - {{ pod }} keys compacted') - + prometheus.withIntervalFactor(2) - + prometheus.withDatasource('P1BA917A37525EDF3'), - } - -} \ No newline at end of file + m_infrastructure: { + query(): + prometheus.withExpr('cluster_infrastructure_provider{namespace="openshift-kube-apiserver-operator"}') + + prometheus.withInstant(true) + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{type}}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + + }, + + m_region: { + query(): + prometheus.withExpr('cluster_infrastructure_provider{namespace="openshift-kube-apiserver-operator"}') + + prometheus.withInstant(true) + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{region}}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + m_ocp_version: { + query(): + prometheus.withExpr('cluster_version{type="completed",version!="",namespace="openshift-cluster-version"}') + + prometheus.withInstant(true) + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{version}}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + num_hosted_cluster: { + query(): + prometheus.withExpr('count(kube_namespace_labels{namespace=~"^ocm-.*"})') + + prometheus.withInstant(true) + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + current_namespace_count: { + query(): + prometheus.withExpr('sum(kube_namespace_status_phase) by (phase)') + + prometheus.withInstant(true) + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ phase }}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + current_node_count: { + query(): + [ + prometheus.withExpr('sum(kube_node_info{})') + + prometheus.withInstant(true) + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('Number of nodes') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + + prometheus.withExpr('sum(kube_node_status_condition{status="true"}) by (condition) > 0') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('Node: {{ condition }}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + + prometheus.withExpr('sum(kube_node_role{}) by (role)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('Role: {{ role }}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + ], + }, + + current_pod_count: { + query(): + prometheus.withExpr('sum(kube_pod_status_phase{}) by (phase) > 0') + + prometheus.withInstant(true) + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ phase}} Pods') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + top10ContCPUHosted: { + query(): + prometheus.withExpr('topk(10,irate(container_cpu_usage_seconds_total{namespace=~"^ocm-.*",container!="POD",name!=""}[2m])*100)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ namespace }} - {{ name }}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + top10ContMemHosted: { + query(): + prometheus.withExpr('topk(10, container_memory_rss{namespace=~"^ocm-.*",container!="POD",name!=""})') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ namespace }} - {{ name }}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + top10ContCPUManagement: { + query(): + prometheus.withExpr('topk(10,irate(container_cpu_usage_seconds_total{namespace!="",container!="POD",name!=""}[2m])*100)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ namespace }} - {{ name }}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + top10ContMemManagement: { + query(): + prometheus.withExpr('topk(10, container_memory_rss{namespace!="",container!="POD",name!=""})') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ namespace }} - {{ name }}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + top10ContCPUOBOManagement: { + query(): + prometheus.withExpr('topk(10,irate(container_cpu_usage_seconds_total{namespace="openshift-observability-operator",container!="POD",name!=""}[2m])*100)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ pod }}/{{ container }}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + top10ContMemOBOManagement: { + query(): + prometheus.withExpr('topk(10, container_memory_rss{namespace="openshift-observability-operator",container!="POD",name!=""})') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ pod }}/{{ container }}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + top10ContCPUHypershiftManagement: { + query(): + prometheus.withExpr('topk(10,irate(container_cpu_usage_seconds_total{namespace="hypershift",container!="POD",name!=""}[2m])*100)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ pod }}/{{ container }}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + top10ContMemHypershiftManagement: { + query(): + prometheus.withExpr('topk(10, container_memory_rss{namespace="hypershift",container!="POD",name!=""})') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ pod }}/{{ container }}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + dynaactivegateMem: { + query(): + prometheus.withExpr('sum(container_memory_rss{namespace=~"dynatrace",pod=~".*-activegate-.*",container!=""}) by (node, namespace, pod)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ node }}: {{ namespace }} : {{ pod }}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + dynaactivegateCPU: { + query(): + prometheus.withExpr('sum(irate(container_cpu_usage_seconds_total{namespace=~"dynatrace", pod=~".*-activegate-.*", container!~"POD|"}[2m])*100) by (node, namespace, pod)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ node }}: {{ namespace }} : {{ pod }}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + opentelemetryCPU: { + query(): + prometheus.withExpr('sum(irate(container_cpu_usage_seconds_total{namespace=~"dynatrace", pod=~"opentelemetry-.*", container!~"POD|"}[2m])*100) by (node, namespace, pod)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ node }}: {{ namespace }} : {{ pod }}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + opentelemetryMem: { + query(): + prometheus.withExpr('sum(container_memory_rss{namespace=~"dynatrace",pod=~"opentelemetry-.*",container!=""}) by (node, namespace, pod)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ node }}: {{ namespace }} : {{ pod }}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + nodeCount: { + query(): + [ + prometheus.withExpr('sum(kube_node_info{})') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('Number of nodes') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + prometheus.withExpr('sum(kube_node_status_condition{status="true"}) by (node,condition) > 0') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{node}}: {{ condition }}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + ], + }, + + current_machine_set_replica_count: { + query(): + [ + prometheus.withExpr('mapi_machine_set_status_replicas{name=~".*worker.*"}') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('Replicas: {{ name }}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + + prometheus.withExpr('mapi_machine_set_status_replicas_available{name=~".*worker.*"}') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('Available: {{ name }}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + + prometheus.withExpr('mapi_machine_set_status_replicas_ready{name=~".*worker.*"}') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('Ready: {{ name }}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + ], + }, + + nsCount: { + query(): + prometheus.withExpr('sum(kube_namespace_status_phase) by (phase) > 0') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{ phase }} namespaces') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + podCount: { + query(): + prometheus.withExpr('sum(kube_pod_status_phase{}) by (phase)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{phase}} pods') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + clusterOperatorsInformation: { + query(): + prometheus.withExpr('cluster_operator_conditions{name!="",reason!=""}') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{name}} - {{reason}}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + clusterOperatorsDegraded: { + query(): + prometheus.withExpr('cluster_operator_conditions{condition="Degraded",name!="",reason!=""}') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{name}} - {{reason}}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + FailedPods: { + query(): + [ + prometheus.withExpr('kube_pod_status_phase{phase="Failed"}') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{namespace}}/{{ pod }}:{{ phase }}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + prometheus.withExpr('count(kube_pod_status_phase{phase="Failed"})') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{phase}} pods') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + ], + }, + + alerts: { + query(): + prometheus.withExpr('topk(10,sum(ALERTS{severity!="none"}) by (alertname, severity))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{severity}}: {{alertname}}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + mgmt_disk_wal_sync_duration: { + query(): + prometheus.withExpr('histogram_quantile(0.99, sum(irate(etcd_disk_wal_fsync_duration_seconds_bucket{namespace=~"openshift-etcd"}[2m])) by (namespace, pod, le))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{namespace}} - {{pod}} WAL fsync') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + mgmt_disk_backend_sync_duration: { + query(): + prometheus.withExpr('histogram_quantile(0.99, sum(irate(etcd_disk_backend_commit_duration_seconds_bucket{namespace=~"openshift-etcd"}[2m])) by (namespace, pod, le))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{namespace}} - {{pod}} DB fsync') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + mgmt_percent_db_used: { + query(): + prometheus.withExpr('(etcd_mvcc_db_total_size_in_bytes{namespace=~"openshift-etcd"} / etcd_server_quota_backend_bytes{namespace=~"openshift-etcd"})*100') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{namespace}} - {{pod}}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + mgmt_db_capacity_left: { + query(): + prometheus.withExpr('etcd_server_quota_backend_bytes{namespace=~"openshift-etcd"} - etcd_mvcc_db_total_size_in_bytes{namespace=~"openshift-etcd"}') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{namespace}} - {{pod}}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + mgmt_db_size_limit: { + query(): + prometheus.withExpr('etcd_server_quota_backend_bytes{namespace=~"openshift-etcd"}') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{namespace}} - {{ pod }} Quota Bytes') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + mgmt_db_size: { + query(): + [ + prometheus.withExpr('etcd_mvcc_db_total_size_in_bytes{namespace=~"openshift-etcd"}') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{namespace}} - {{pod}} DB physical size') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + + prometheus.withExpr('etcd_mvcc_db_total_size_in_use_in_bytes{namespace=~"openshift-etcd"}') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{namespace}} - {{pod}} DB logical size') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + ], + }, + + mgmt_grpc_traffic: { + query(): + [ + prometheus.withExpr('rate(etcd_network_client_grpc_received_bytes_total{namespace=~"openshift-etcd"}[2m])') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('rx {{namespace}} - {{pod}}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + + prometheus.withExpr('rate(etcd_network_client_grpc_sent_bytes_total{namespace=~"openshift-etcd"}[2m])') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('tx {{namespace}} - {{pod}}') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + ], + }, + + mgmt_active_streams: { + query(): + [ + prometheus.withExpr('sum(grpc_server_started_total{namespace=~"openshift-etcd",grpc_service="etcdserverpb.Watch",grpc_type="bidi_stream"}) - sum(grpc_server_handled_total{namespace=~"openshift-etcd",grpc_service="etcdserverpb.Watch",grpc_type="bidi_stream"})') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{namespace}} - Watch Streams') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + + prometheus.withExpr('sum(grpc_server_started_total{namespace=~"openshift-etcd",grpc_service="etcdserverpb.Lease",grpc_type="bidi_stream"}) - sum(grpc_server_handled_total{namespace=~"openshift-etcd",grpc_service="etcdserverpb.Lease",grpc_type="bidi_stream"})') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{namespace}} - Lease Streams') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + ], + }, + + mgmt_snapshot_duration: { + query(): + prometheus.withExpr('sum(rate(etcd_debugging_snap_save_total_duration_seconds_sum{namespace=~"openshift-etcd"}[2m]))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('the total latency distributions of save called by snapshot') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + mgmt_raft_proposals: { + query(): + [ + prometheus.withExpr('sum(rate(etcd_server_proposals_failed_total{namespace=~"openshift-etcd"}[2m]))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{namespace}} - Proposal Failure Rate') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + + prometheus.withExpr('sum(etcd_server_proposals_pending{namespace=~"openshift-etcd"})') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{namespace}} - Proposal Pending Total') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + + prometheus.withExpr('sum(rate(etcd_server_proposals_committed_total{namespace=~"openshift-etcd"}[2m]))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{namespace}} - Proposal Commit Rate') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + + prometheus.withExpr('sum(rate(etcd_server_proposals_applied_total{namespace=~"openshift-etcd"}[2m]))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withLegendFormat('{{namespace}} - Proposal Apply Rate') + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + ], + }, + + mgmt_num_leader_changes: { + query(): + prometheus.withExpr('sum(rate(etcd_server_leader_changes_seen_total{namespace=~"openshift-etcd"}[2m]))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + mgmt_etcd_has_leader: { + query(): + prometheus.withExpr('max(etcd_server_has_leader{namespace=~"openshift-etcd"})') + + prometheus.withFormat('time_series') + + prometheus.withInstant(true) + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + mgmt_num_failed_proposals: { + query(): + prometheus.withExpr('max(etcd_server_proposals_committed_total{namespace=~"openshift-etcd"})') + + prometheus.withFormat('time_series') + + prometheus.withInstant(true) + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + mgmt_leader_elections_per_day: { + query(): + prometheus.withExpr('changes(etcd_server_leader_changes_seen_total{namespace=~"openshift-etcd"}[1d])') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{instance}} Total Leader Elections Per Day') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + mgmt_keys: { + query(): + prometheus.withExpr('etcd_debugging_mvcc_keys_total{namespace=~"openshift-etcd"}') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{ pod }} Num keys') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + mgmt_slow_operations: { + query(): + [ + prometheus.withExpr('delta(etcd_server_slow_apply_total{namespace=~"openshift-etcd"}[2m])') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{ pod }} slow applies') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + + prometheus.withExpr('delta(etcd_server_slow_read_indexes_total{namespace=~"openshift-etcd"}[2m])') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{ pod }} slow read indexes') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + ], + }, + + mgmt_key_operations: { + query(): + [ + prometheus.withExpr('rate(etcd_mvcc_put_total{namespace=~"openshift-etcd"}[2m])') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{ pod }} puts/s') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + + prometheus.withExpr('rate(etcd_mvcc_delete_total{namespace=~"openshift-etcd"}[2m])') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{ pod }} deletes/s') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + ], + }, + + mgmt_heartbeat_failures: { + query(): + [ + prometheus.withExpr('etcd_server_heartbeat_send_failures_total{namespace=~"openshift-etcd"}') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{ pod }} heartbeat failures') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + + prometheus.withExpr('etcd_server_health_failures{namespace=~"openshift-etcd"}') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{ pod }} health failures') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + ], + }, + + mgmt_compacted_keys: { + query(): + [ + prometheus.withExpr('etcd_debugging_mvcc_db_compaction_keys_total{namespace=~"openshift-etcd"}') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{ pod }} keys compacted') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + ], + }, + + nodeCPU: { + query(): + prometheus.withExpr('sum by (instance, mode)(irate(node_cpu_seconds_total{job=~".*"}[2m])) * 100 and on (instance) label_replace(cluster:nodes_roles{label_hypershift_openshift_io_cluster=~"$namespace"}, "instance", "$1", "node", "(.+)")') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{instance}} - {{mode}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + nodeMemory: { + query(): + prometheus.withExpr('node_memory_Active_bytes and on (instance) label_replace(cluster:nodes_roles{label_hypershift_openshift_io_cluster=~"$namespace"}, "instance", "$1", "node", "(.+)")') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{instance}} - Active') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + suricataCPU: { + query(): + prometheus.withExpr('sum(irate(container_cpu_usage_seconds_total{namespace=~"openshift-suricata",container!="POD",name!=""}[2m])*100) by (node) and on (node) label_replace(cluster:nodes_roles{label_hypershift_openshift_io_cluster=~"$namespace"}, "node", "$1", "node", "(.+)")') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{node}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + suricataMemory: { + query(): + prometheus.withExpr('sum(container_memory_rss{namespace=~"openshift-suricata",container!="POD",name!=""}) by (node) and on (node) label_replace(cluster:nodes_roles{label_hypershift_openshift_io_cluster=~"$namespace"}, "node", "$1", "node", "(.+)")') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{node}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + dynaoneagentCPU: { + query(): + prometheus.withExpr('sum(irate(container_cpu_usage_seconds_total{namespace=~"dynatrace", pod=~".*-oneagent-.*", container!~"POD|"}[2m])*100) by (node, namespace, pod)') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{ node }}: {{ namespace }} : {{ pod }}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + dynaoneagentMem: { + query(): + prometheus.withExpr('sum(container_memory_rss{namespace=~"dynatrace",pod=~".*-oneagent-.*",container!=""}) by (node, namespace, pod)') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{ node }}: {{ namespace }} : {{ pod }}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + infrastructure: { + query(): + prometheus.withExpr('cluster_infrastructure_provider{namespace=~"$namespace"}') + + prometheus.withFormat('time_series') + + prometheus.withInstant(true) + + prometheus.withLegendFormat('{{type}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + region: { + query(): + prometheus.withExpr('cluster_infrastructure_provider{namespace=~"$namespace"}') + + prometheus.withFormat('time_series') + + prometheus.withInstant(true) + + prometheus.withLegendFormat('{{region}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + ocp_version: { + query(): + prometheus.withExpr('cluster_version{type="completed",version!="",namespace=~"$namespace"}') + + prometheus.withFormat('time_series') + + prometheus.withInstant(true) + + prometheus.withLegendFormat('{{version}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + hostedControlPlaneCPU: { + query(): + prometheus.withExpr('cluster_version{type="completed",version!="",namespace=~"$namespace"}') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{version}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + hostedControlPlaneMemory: { + query(): + prometheus.withExpr('topk(10, container_memory_rss{namespace=~"$namespace",container!="POD",name!=""})') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{pod}}/{{container}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('PF55DCC5EC58ABF5A'), + }, + + request_duration_99th_quantile: { + query(): + prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_request_duration_seconds_bucket{namespace=~"$namespace",resource=~"$resource",subresource!="log",verb!~"WATCH|WATCHLIST|PROXY"}[2m])) by(verb,le))') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{verb}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + request_rate_by_instance: { + query(): + prometheus.withExpr('sum(rate(apiserver_request_total{namespace=~"$namespace",resource=~"$resource",code=~"$code",verb=~"$verb"}[2m])) by(instance)') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{instance}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + request_duration_99th_quantile_by_resource: { + query(): + prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_request_duration_seconds_bucket{namespace=~"$namespace",resource=~"$resource",subresource!="log",verb!~"WATCH|WATCHLIST|PROXY"}[2m])) by(resource, namespace, verb, le))') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{verb}}:{{resource}}/{{namespace}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + request_rate_by_resource: { + query(): + prometheus.withExpr('sum(rate(apiserver_request_total{namespace=~"$namespace",resource=~"$resource",code=~"$code",verb=~"$verb"}[2m])) by(resource)') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{resource}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + request_duration_read_write: { + query(): + [ + prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_request_duration_seconds_bucket{namespace=~"$namespace",resource=~"$resource",verb=~"LIST|GET"}[2m])) by(le))') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('read') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + + prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_request_duration_seconds_bucket{namespace=~"$namespace",resource=~"$resource",verb=~"POST|PUT|PATCH|UPDATE|DELETE"}[2m])) by(le))') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('write') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + ], + }, + + request_rate_read_write: { + query(): + [ + prometheus.withExpr('sum(rate(apiserver_request_total{namespace=~"$namespace",resource=~"$resource",verb=~"LIST|GET"}[2m]))') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('read') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + + prometheus.withExpr('sum(rate(apiserver_request_total{namespace=~"$namespace",resource=~"$resource",verb=~"POST|PUT|PATCH|UPDATE|DELETE"}[2m]))') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('write') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + ], + }, + + requests_dropped_rate: { + query(): + prometheus.withExpr('sum(rate(apiserver_dropped_requests_total{namespace=~"$namespace"}[2m])) by (requestKind)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + requests_terminated_rate: { + query(): + prometheus.withExpr('sum(rate(apiserver_request_terminations_total{namespace=~"$namespace",resource=~"$resource",code=~"$code"}[2m])) by(component)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + requests_status_rate: { + query(): + prometheus.withExpr('sum(rate(apiserver_request_total{namespace=~"$namespace",resource=~"$resource",verb=~"$verb",code=~"$code"}[2m])) by(code)') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{code}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + long_running_requests: { + query(): + prometheus.withExpr('sum(apiserver_longrunning_gauge{namespace=~"$namespace",resource=~"$resource",verb=~"$verb"}) by(instance)') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{instance}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + request_in_flight: { + query(): + prometheus.withExpr('sum(apiserver_current_inflight_requests{namespace=~"$namespace"}) by (instance,requestKind)') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{requestKind}}-{{instance}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + pf_requests_rejected: { + query(): + prometheus.withExpr('sum(rate(apiserver_flowcontrol_rejected_requests_total{namespace=~"$namespace"}[2m])) by (reason)') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + response_size_99th_quartile: { + query(): + prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_response_sizes_bucket{namespace=~"$namespace",resource=~"$resource",verb=~"$verb"}[2m])) by(instance,le))') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{instance}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + pf_request_queue_length: { + query(): + prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_flowcontrol_request_queue_length_after_enqueue_bucket{namespace=~"$namespace"}[2m])) by(flowSchema, priorityLevel, le))') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{flowSchema}}:{{priorityLevel}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + pf_request_wait_duration_99th_quartile: { + query(): + prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_flowcontrol_request_wait_duration_seconds_bucket{namespace=~"$namespace"}[2m])) by(flowSchema, priorityLevel, le))') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{flowSchema}}:{{priorityLevel}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + pf_request_execution_duration: { + query(): + prometheus.withExpr('histogram_quantile(0.99, sum(rate(apiserver_flowcontrol_request_execution_seconds_bucket{namespace=~"$namespace"}[2m])) by(flowSchema, priorityLevel, le))') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{flowSchema}}:{{priorityLevel}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + pf_request_dispatch_rate: { + query(): + prometheus.withExpr('sum(rate(apiserver_flowcontrol_dispatched_requests_total{namespace=~"$namespace"}[2m])) by(flowSchema,priorityLevel)') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{flowSchema}}:{{priorityLevel}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + pf_concurrency_limit: { + query(): + prometheus.withExpr('sum(apiserver_flowcontrol_request_concurrency_limit{namespace=~"$namespace"}) by (priorityLevel)') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{priorityLevel}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + pf_pending_in_queue: { + query(): + prometheus.withExpr('sum(apiserver_flowcontrol_current_inqueue_requests{namespace=~"$namespace"}) by (flowSchema,priorityLevel)') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{flowSchema}}:{{priorityLevel}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + disk_wal_sync_duration: { + query(): + prometheus.withExpr('histogram_quantile(0.99, sum(irate(etcd_disk_wal_fsync_duration_seconds_bucket{namespace=~"$namespace"}[2m])) by (namespace, pod, le))') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{pod}} WAL fsync') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + disk_backend_sync_duration: { + query(): + prometheus.withExpr('histogram_quantile(0.99, sum(irate(etcd_disk_backend_commit_duration_seconds_bucket{namespace=~"$namespace"}[2m])) by (namespace, pod, le))') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{pod}} DB fsync') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + percent_db_used: { + query(): + prometheus.withExpr('(etcd_mvcc_db_total_size_in_bytes{namespace=~"$namespace"} / etcd_server_quota_backend_bytes{namespace=~"$namespace"})*100') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{pod}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + db_capacity_left: { + query(): + prometheus.withExpr('etcd_server_quota_backend_bytes{namespace=~"$namespace"} - etcd_mvcc_db_total_size_in_bytes{namespace=~"$namespace"}') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{pod}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + + db_size_limit: { + query(): + prometheus.withExpr('etcd_server_quota_backend_bytes{namespace=~"$namespace"}') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{ pod }} Quota Bytes') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + db_size: { + query(): + [ + prometheus.withExpr('etcd_mvcc_db_total_size_in_bytes{namespace=~"$namespace"}') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{pod}} DB physical size') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + + prometheus.withExpr('etcd_mvcc_db_total_size_in_use_in_bytes{namespace=~"$namespace"}') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{pod}} DB logical size') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + ], + }, + + grpc_traffic: { + query(): + [ + prometheus.withExpr('rate(etcd_network_client_grpc_received_bytes_total{namespace=~"$namespace"}[2m])') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('rx {{namespace}} - {{pod}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + + prometheus.withExpr('rate(etcd_network_client_grpc_sent_bytes_total{namespace=~"$namespace"}[2m])') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('tx {{namespace}} - {{pod}}') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + ], + }, + + active_streams: { + query(): + [ + prometheus.withExpr('sum(grpc_server_started_total{namespace=~"$namespace",grpc_service="etcdserverpb.Watch",grpc_type="bidi_stream"}) - sum(grpc_server_handled_total{namespace=~"$namespace",grpc_service="etcdserverpb.Watch",grpc_type="bidi_stream"})') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - Watch Streams') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + + prometheus.withExpr('sum(grpc_server_started_total{namespace=~"$namespace",grpc_service="etcdserverpb.Lease",grpc_type="bidi_stream"}) - sum(grpc_server_handled_total{namespace=~"$namespace",grpc_service="etcdserverpb.Lease",grpc_type="bidi_stream"})') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - Lease Streams') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + ], + }, + + snapshot_duration: { + query(): + prometheus.withExpr('sum(rate(etcd_debugging_snap_save_total_duration_seconds_sum{namespace=~"$namespace"}[2m]))') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('the total latency distributions of save called by snapshot') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + raft_proposals: { + query(): + [ + prometheus.withExpr('sum(rate(etcd_server_proposals_failed_total{namespace=~"openshift-etcd"}[2m]))') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - Proposal Failure Rate') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + + prometheus.withExpr('sum(etcd_server_proposals_pending{namespace=~"$namespace"})') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - Proposal Pending Total') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + + prometheus.withExpr('sum(rate(etcd_server_proposals_committed_total{namespace=~"$namespace"}[2m]))') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - Proposal Commit Rate') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + + prometheus.withExpr('sum(rate(etcd_server_proposals_applied_total{namespace=~"$namespace"}[2m]))') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - Proposal Apply Rate') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + + ], + }, + + num_leader_changes: { + query(): + prometheus.withExpr('sum(rate(etcd_server_leader_changes_seen_total{namespace=~"$namespace"}[2m]))') + + prometheus.withFormat('time_series') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + etcd_has_leader: { + query(): + prometheus.withExpr('max(etcd_server_has_leader{namespace=~"$namespace"})') + + prometheus.withFormat('time_series') + + prometheus.withInstant(true) + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + num_failed_proposals: { + query(): + prometheus.withExpr('max(etcd_server_proposals_committed_total{namespace=~"$namespace"})') + + prometheus.withFormat('time_series') + + prometheus.withInstant(true) + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + leader_elections_per_day: { + query(): + prometheus.withExpr('changes(etcd_server_leader_changes_seen_total{namespace=~"$namespace"}[1d])') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{instance}} Total Leader Elections Per Day') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + keys: { + query(): + prometheus.withExpr('etcd_debugging_mvcc_keys_total{namespace=~"$namespace"}') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{ pod }} Num keys') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + + slow_operations: { + query(): + [ + prometheus.withExpr('delta(etcd_server_slow_apply_total{namespace=~"$namespace"}[2m])') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{ pod }} slow applies') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + + prometheus.withExpr('delta(etcd_server_slow_read_indexes_total{namespace=~"$namespace"}[2m])') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{ pod }} slow read indexes') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + ], + }, + + key_operations: { + query(): + [ + prometheus.withExpr('rate(etcd_mvcc_put_total{namespace=~"$namespace"}[2m])') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{ pod }} puts/s') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + + prometheus.withExpr('rate(etcd_mvcc_delete_total{namespace=~"$namespace"}[2m])') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{ pod }} deletes/s') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + ], + }, + + heartbeat_failures: { + query(): + [ + prometheus.withExpr('etcd_server_heartbeat_send_failures_total{namespace=~"$namespace"}') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{ pod }} heartbeat failures') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + + prometheus.withExpr('etcd_server_health_failures{namespace=~"$namespace') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{ pod }} health failures') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + ], + }, + + compacted_keys: { + query(): + prometheus.withExpr('etcd_debugging_mvcc_db_compaction_keys_total{namespace=~"$namespace"}') + + prometheus.withFormat('time_series') + + prometheus.withLegendFormat('{{namespace}} - {{ pod }} keys compacted') + + prometheus.withIntervalFactor(2) + + prometheus.withDatasource('P1BA917A37525EDF3'), + }, + +} diff --git a/assets/hypershift-perf-dashboard/variables.libsonnet b/assets/hypershift-perf-dashboard/variables.libsonnet index 6fdab32..faa1508 100644 --- a/assets/hypershift-perf-dashboard/variables.libsonnet +++ b/assets/hypershift-perf-dashboard/variables.libsonnet @@ -2,39 +2,39 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn local var = g.dashboard.variable; { - Namespace: - var.query.new('namespace','label_values(kube_pod_info, namespace)') - + var.query.withDatasource('prometheus','PF55DCC5EC58ABF5A') - + var.datasource.withRegex("/^ocm/") - + var.query.selectionOptions.withMulti(true) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.generalOptions.withLabel('Namespace') - + var.query.withRefresh(2), + Namespace: + var.query.new('namespace', 'label_values(kube_pod_info, namespace)') + + var.query.withDatasource('prometheus', 'PF55DCC5EC58ABF5A') + + var.datasource.withRegex('/^ocm/') + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.generalOptions.withLabel('Namespace') + + var.query.withRefresh(2), - Resource: - var.query.new('resource','label_values(apiserver_request_duration_seconds_bucket, resource)') - + var.query.withDatasource('prometheus','PF55DCC5EC58ABF5A') - + var.datasource.withRegex("") - + var.query.selectionOptions.withMulti(true) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.generalOptions.withLabel('resource') - + var.query.withRefresh(2), + Resource: + var.query.new('resource', 'label_values(apiserver_request_duration_seconds_bucket, resource)') + + var.query.withDatasource('prometheus', 'PF55DCC5EC58ABF5A') + + var.datasource.withRegex('') + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.generalOptions.withLabel('resource') + + var.query.withRefresh(2), - Code: - var.query.new('code','label_values(code)') - + var.query.withDatasource('prometheus','PF55DCC5EC58ABF5A') - + var.datasource.withRegex("") - + var.query.selectionOptions.withMulti(true) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.generalOptions.withLabel('code') - + var.query.withRefresh(2), + Code: + var.query.new('code', 'label_values(code)') + + var.query.withDatasource('prometheus', 'PF55DCC5EC58ABF5A') + + var.datasource.withRegex('') + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.generalOptions.withLabel('code') + + var.query.withRefresh(2), - Verb: - var.query.new('verb','label_values(verb)') - + var.query.withDatasource('prometheus','PF55DCC5EC58ABF5A') - + var.datasource.withRegex("") - + var.query.selectionOptions.withMulti(true) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.generalOptions.withLabel('verb') - + var.query.withRefresh(2), + Verb: + var.query.new('verb', 'label_values(verb)') + + var.query.withDatasource('prometheus', 'PF55DCC5EC58ABF5A') + + var.datasource.withRegex('') + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.generalOptions.withLabel('verb') + + var.query.withRefresh(2), } diff --git a/assets/ingress-performance-ocp/panels.libsonnet b/assets/ingress-performance-ocp/panels.libsonnet index 9e744d4..42ab638 100644 --- a/assets/ingress-performance-ocp/panels.libsonnet +++ b/assets/ingress-performance-ocp/panels.libsonnet @@ -1,6 +1,6 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; -{ +{ gauge: { local gauge = g.panel.gauge, local options = gauge.options, @@ -20,41 +20,41 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn + options.withShowThresholdLabels(false) + options.withShowThresholdMarkers(true) + options.text.withTitleSize(12), - - withAvgRPS(title, unit, targets, gridPos): + + withAvgRPS(title, unit, targets, gridPos): self.base(title, unit, targets, gridPos) + options.reduceOptions.withCalcs([ - 'stdDev' + 'stdDev', ]) + options.reduceOptions.withValues(true) + options.reduceOptions.withFields('/^CV$/'), - withAvgTimeThresholds(title, unit, targets, gridPos): - self.withAvgRPS(title, unit, targets, gridPos) - + gauge.standardOptions.thresholds.withMode("absolute") - + gauge.standardOptions.thresholds.withSteps([{"value": null,"color": "green"}, {"value": 0.3,"color": "#EAB839"},{"value": 0.5 , "color": "red"}]) - + gauge.standardOptions.color.withMode("thresholds") - + gauge.standardOptions.withMin(0) - + gauge.standardOptions.withMax(1) - + gauge.queryOptions.withTransformations([ - { - "id": "calculateField", - "options": { - "alias": "CV", - "binary": { - "left": "Std Dev", - "operator": "/", - "reducer": "sum", - "right": "Average" - }, - "mode": "binary", - "reduce": { - "reducer": "sum" - }, - "replaceFields": false - } - } - ]), + withAvgTimeThresholds(title, unit, targets, gridPos): + self.withAvgRPS(title, unit, targets, gridPos) + + gauge.standardOptions.thresholds.withMode('absolute') + + gauge.standardOptions.thresholds.withSteps([{ value: null, color: 'green' }, { value: 0.3, color: '#EAB839' }, { value: 0.5, color: 'red' }]) + + gauge.standardOptions.color.withMode('thresholds') + + gauge.standardOptions.withMin(0) + + gauge.standardOptions.withMax(1) + + gauge.queryOptions.withTransformations([ + { + id: 'calculateField', + options: { + alias: 'CV', + binary: { + left: 'Std Dev', + operator: '/', + reducer: 'sum', + right: 'Average', + }, + mode: 'binary', + reduce: { + reducer: 'sum', + }, + replaceFields: false, + }, + }, + ]), }, bargauge: { @@ -87,11 +87,11 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn withAvgTimeThresholds(title, unit, targets, gridPos): self.withAvgRPS(title, unit, targets, gridPos) - + bargauge.standardOptions.thresholds.withMode("absolute") - + bargauge.standardOptions.thresholds.withSteps([{"value": null,"color": "green"}, {"value": 80,"color": "red"}]) - + bargauge.standardOptions.color.withMode("palette-classic") + + bargauge.standardOptions.thresholds.withMode('absolute') + + bargauge.standardOptions.thresholds.withSteps([{ value: null, color: 'green' }, { value: 80, color: 'red' }]) + + bargauge.standardOptions.color.withMode('palette-classic') + bargauge.standardOptions.withDecimals(2) - + bargauge.standardOptions.withMin(0), + + bargauge.standardOptions.withMin(0), }, timeSeries: { @@ -122,7 +122,7 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn + options.legend.withCalcs([ 'mean', 'max', - 'min' + 'min', ]), withMeanReq(title, unit, targets, gridPos): @@ -152,8 +152,8 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn + stat.gridPos.withY(gridPos.y) + stat.gridPos.withH(gridPos.h) + stat.gridPos.withW(gridPos.w) - + options.withJustifyMode("auto") - + options.withGraphMode("none") + + options.withJustifyMode('auto') + + options.withGraphMode('none') + options.text.withTitleSize(12), withAvgCalcs(title, unit, targets, gridPos): @@ -161,35 +161,36 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn + options.reduceOptions.withCalcs([ 'lastNotNull', ]), - + withAvgThresholds(title, unit, targets, gridPos): self.withAvgCalcs(title, unit, targets, gridPos) + stat.panelOptions.withRepeat('termination') + stat.panelOptions.withRepeatDirection('h') - + stat.standardOptions.thresholds.withMode("absolute") - + stat.standardOptions.thresholds.withSteps([{"value": null,"color": "green"}, {"value": 80,"color": "red"}]) - + stat.standardOptions.color.withMode("thresholds") + + stat.standardOptions.thresholds.withMode('absolute') + + stat.standardOptions.thresholds.withSteps([{ value: null, color: 'green' }, { value: 80, color: 'red' }]) + + stat.standardOptions.color.withMode('thresholds') + stat.queryOptions.withTransformations([ { - "id": "convertFieldType", - "options": { - "conversions": [ - { - "destinationType": "string", - "targetField": "ocpMajorVersion.keyword" - } - ], - "fields": {} - } - }]), + id: 'convertFieldType', + options: { + conversions: [ + { + destinationType: 'string', + targetField: 'ocpMajorVersion.keyword', + }, + ], + fields: {}, + }, + }, + ]), - withAvgTimeThresholds(title,unit,targets,gridPos): + withAvgTimeThresholds(title, unit, targets, gridPos): self.withAvgCalcs(title, unit, targets, gridPos) + stat.panelOptions.withRepeat('termination') + stat.panelOptions.withRepeatDirection('h') - + stat.standardOptions.thresholds.withMode("absolute") - + stat.standardOptions.thresholds.withSteps([{"value": null,"color": "green"}]) - + stat.standardOptions.color.withMode("thresholds") + + stat.standardOptions.thresholds.withMode('absolute') + + stat.standardOptions.thresholds.withSteps([{ value: null, color: 'green' }]) + + stat.standardOptions.color.withMode('thresholds') + stat.queryOptions.withTransformations([]), }, @@ -211,573 +212,574 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn withTerminationRawData(title, unit, targets, gridPos): self.base(title, unit, targets, gridPos) + options.withShowHeader(true) - + options.withCellHeight("sm") + + options.withCellHeight('sm') + options.withFrameIndex(0) + options.sortBy.withDesc(false) - + options.sortBy.withDisplayName("ocpVersion") + + options.sortBy.withDisplayName('ocpVersion') + options.footer.TableFooterOptions.withShow(false) - + options.footer.TableFooterOptions.withReducer(["sum"]) + + options.footer.TableFooterOptions.withReducer(['sum']) + options.footer.TableFooterOptions.withCountRows(false) - + options.footer.TableFooterOptions.withFields("") + + options.footer.TableFooterOptions.withFields('') + options.footer.TableFooterOptions.withEnablePagination(false) + table.standardOptions.withFilterable(true) + table.standardOptions.withOverrides([ { - "matcher": { - "id": "byName", - "options": "Samples" + matcher: { + id: 'byName', + options: 'Samples', + }, + properties: [ + { + id: 'decimals', + value: 0, + }, + ], }, - "properties": [ - { - "id": "decimals", - "value": 0 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Avg Lat" + { + matcher: { + id: 'byName', + options: 'Avg Lat', + }, + properties: [ + { + id: 'unit', + value: 'µs', + }, + ], }, - "properties": [ - { - "id": "unit", - "value": "µs" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Concurrency" + { + matcher: { + id: 'byName', + options: 'Concurrency', + }, + properties: [ + { + id: 'decimals', + value: 0, + }, + ], }, - "properties": [ - { - "id": "decimals", - "value": 0 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Duration" + { + matcher: { + id: 'byName', + options: 'Duration', + }, + properties: [ + { + id: 'unit', + value: 'ns', + }, + ], }, - "properties": [ - { - "id": "unit", - "value": "ns" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Max Lat" + { + matcher: { + id: 'byName', + options: 'Max Lat', + }, + properties: [ + { + id: 'unit', + value: 'µs', + }, + ], }, - "properties": [ - { - "id": "unit", - "value": "µs" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "P90 Lat" + { + matcher: { + id: 'byName', + options: 'P90 Lat', + }, + properties: [ + { + id: 'unit', + value: 'µs', + }, + ], }, - "properties": [ - { - "id": "unit", - "value": "µs" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "P95 Lat" + { + matcher: { + id: 'byName', + options: 'P95 Lat', + }, + properties: [ + { + id: 'unit', + value: 'µs', + }, + ], }, - "properties": [ - { - "id": "unit", - "value": "µs" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "P99 Lat" + { + matcher: { + id: 'byName', + options: 'P99 Lat', + }, + properties: [ + { + id: 'unit', + value: 'µs', + }, + ], }, - "properties": [ - { - "id": "unit", - "value": "µs" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Avg RPS " + { + matcher: { + id: 'byName', + options: 'Avg RPS ', + }, + properties: [ + { + id: 'unit', + value: 'reqps', + }, + ], }, - "properties": [ - { - "id": "unit", - "value": "reqps" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Requests" + { + matcher: { + id: 'byName', + options: 'Requests', + }, + properties: [ + { + id: 'unit', + value: 'none', + }, + ], }, - "properties": [ - { - "id": "unit", - "value": "none" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Tuning" + { + matcher: { + id: 'byName', + options: 'Tuning', + }, + properties: [ + { + id: 'custom.width', + }, + ], }, - "properties": [ - { - "id": "custom.width" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "config.Delay" + { + matcher: { + id: 'byName', + options: 'config.Delay', + }, + properties: [ + { + id: 'unit', + value: 'ns', + }, + ], }, - "properties": [ - { - "id": "unit", - "value": "ns" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Timeout" + { + matcher: { + id: 'byName', + options: 'Timeout', + }, + properties: [ + { + id: 'unit', + value: 'ns', + }, + ], }, - "properties": [ - { - "id": "unit", - "value": "ns" - } - ] - } ]) + table.queryOptions.withTransformations([ { - "id": "organize", - "options": { - "excludeByName": { - "_id": true, - "_index": true, - "_type": true, - "avg_lat_us": true, - "clusterName": true, - "clusterType": true, - "config.Delay": true, - "config.delay": true, - "config.duration": true, - "config.procs": false, - "config.samples": false, - "config.termination": true, - "config.tool": true, - "haproxyVersion": true, - "highlight": true, - "infraNodesCount": true, - "infraNodesType": true, - "k8sVersion": true, - "masterNodesCount": true, - "masterNodesType": true, - "max_lat_us": true, - "metricName": true, - "ocpMajorVersion": true, - "ocpVersion": true, - "otherNodesCount": true, - "p90_lat_us": true, - "p99_lat_us": true, - "platform": true, - "pods": true, - "region": true, - "requests": true, - "rps_stdev": true, - "sdnType": true, - "sort": true, - "stdev_lat": true, - "timeouts": false, - "timestamp": true, - "tool": true, - "totalNodes": true, - "workerNodesCount": true, - "workerNodesType": true - }, - "indexByName": { - "_id": 7, - "_index": 8, - "_type": 9, - "avg_lat_us": 17, - "clusterName": 26, - "config.Delay": 27, - "config.concurrency": 10, - "config.connections": 11, - "config.duration": 12, - "config.path": 2, - "config.samples": 5, - "config.serverReplicas": 13, - "config.termination": 3, - "config.tool": 14, - "config.tuningPatch": 28, - "highlight": 15, - "http_errors": 29, - "infraNodesCount": 30, - "infraNodesType": 31, - "k8sVersion": 32, - "masterNodesCount": 33, - "masterNodesType": 34, - "max_lat_us": 18, - "metricName": 35, - "ocpVersion": 1, - "p90_lat_us": 19, - "p95_lat_us": 20, - "p99_lat_us": 21, - "platform": 36, - "pods": 22, - "region": 37, - "requests": 38, - "rps_stdev": 23, - "sample": 4, - "sdnType": 39, - "sort": 24, - "stdev_lat": 25, - "timeouts": 40, - "timestamp": 6, - "totalNodes": 41, - "total_avg_rps": 16, - "uuid": 0, - "workerNodesCount": 42, - "workerNodesType": 43 + id: 'organize', + options: { + excludeByName: { + _id: true, + _index: true, + _type: true, + avg_lat_us: true, + clusterName: true, + clusterType: true, + 'config.Delay': true, + 'config.delay': true, + 'config.duration': true, + 'config.procs': false, + 'config.samples': false, + 'config.termination': true, + 'config.tool': true, + haproxyVersion: true, + highlight: true, + infraNodesCount: true, + infraNodesType: true, + k8sVersion: true, + masterNodesCount: true, + masterNodesType: true, + max_lat_us: true, + metricName: true, + ocpMajorVersion: true, + ocpVersion: true, + otherNodesCount: true, + p90_lat_us: true, + p99_lat_us: true, + platform: true, + pods: true, + region: true, + requests: true, + rps_stdev: true, + sdnType: true, + sort: true, + stdev_lat: true, + timeouts: false, + timestamp: true, + tool: true, + totalNodes: true, + workerNodesCount: true, + workerNodesType: true, + }, + indexByName: { + _id: 7, + _index: 8, + _type: 9, + avg_lat_us: 17, + clusterName: 26, + 'config.Delay': 27, + 'config.concurrency': 10, + 'config.connections': 11, + 'config.duration': 12, + 'config.path': 2, + 'config.samples': 5, + 'config.serverReplicas': 13, + 'config.termination': 3, + 'config.tool': 14, + 'config.tuningPatch': 28, + highlight: 15, + http_errors: 29, + infraNodesCount: 30, + infraNodesType: 31, + k8sVersion: 32, + masterNodesCount: 33, + masterNodesType: 34, + max_lat_us: 18, + metricName: 35, + ocpVersion: 1, + p90_lat_us: 19, + p95_lat_us: 20, + p99_lat_us: 21, + platform: 36, + pods: 22, + region: 37, + requests: 38, + rps_stdev: 23, + sample: 4, + sdnType: 39, + sort: 24, + stdev_lat: 25, + timeouts: 40, + timestamp: 6, + totalNodes: 41, + total_avg_rps: 16, + uuid: 0, + workerNodesCount: 42, + workerNodesType: 43, + }, + renameByName: { + avg_lat_us: 'Avg Lat', + clusterType: '', + 'config.Delay': 'Delay', + 'config.RequestTimeout': 'Timeout', + 'config.concurrency': 'Concurrency', + 'config.connections': 'Connections', + 'config.delay': 'Delay', + 'config.duration': 'Duration', + 'config.http2': 'HTTP2', + 'config.keepalive': 'Keepalive', + 'config.path': 'Path', + 'config.procs': 'Procs', + 'config.requestRate': 'Rate', + 'config.requestTimeout': 'Timeout', + 'config.samples': 'Samples', + 'config.serverReplicas': 'Servers', + 'config.termination': 'Termination', + 'config.tuning.routers': 'Routers', + 'config.tuning.threadCount': 'Threads', + 'config.tuningPatch': 'Tuning', + http_errors: 'Errors', + max_lat_us: 'Max Lat', + p90_lat_us: 'P90 Lat', + p95_lat_us: 'P95 Lat', + p99_lat_us: 'P99 Lat', + pods: '', + requests: 'Requests', + rps_stdev: '', + sample: '# Sample', + stdev_lat: '', + timeouts: 'Timeouts', + totalNodes: '', + total_avg_rps: 'Avg RPS ', + uuid: 'UUID', + write_errors: '', + }, + }, }, - "renameByName": { - "avg_lat_us": "Avg Lat", - "clusterType": "", - "config.Delay": "Delay", - "config.RequestTimeout": "Timeout", - "config.concurrency": "Concurrency", - "config.connections": "Connections", - "config.delay": "Delay", - "config.duration": "Duration", - "config.http2": "HTTP2", - "config.keepalive": "Keepalive", - "config.path": "Path", - "config.procs": "Procs", - "config.requestRate": "Rate", - "config.requestTimeout": "Timeout", - "config.samples": "Samples", - "config.serverReplicas": "Servers", - "config.termination": "Termination", - "config.tuning.routers": "Routers", - "config.tuning.threadCount": "Threads", - "config.tuningPatch": "Tuning", - "http_errors": "Errors", - "max_lat_us": "Max Lat", - "p90_lat_us": "P90 Lat", - "p95_lat_us": "P95 Lat", - "p99_lat_us": "P99 Lat", - "pods": "", - "requests": "Requests", - "rps_stdev": "", - "sample": "# Sample", - "stdev_lat": "", - "timeouts": "Timeouts", - "totalNodes": "", - "total_avg_rps": "Avg RPS ", - "uuid": "UUID", - "write_errors": "" - } - } - }]), + ]), withWorkloadSummary(title, unit, targets, gridPos): self.base(title, unit, targets, gridPos) - + table.queryOptions.withTransformations([ - { - "id": "groupBy", - "options": { - "fields": { - "Cluster name": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "Infras": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "Infras type": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "Masters": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "Masters type": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "Version": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "Workers": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "Workers type": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "clusterName": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "clusterType": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "config.RequestTimeout": { - "aggregations": [ - "lastNotNull" - ] - }, - "config.tool": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "haproxyVersion": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "infraNodesCount": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "infraNodesType": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "k8s version": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "ocpMajorVersion": { - "aggregations": [] - }, - "ocpVersion": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "otherNodesCount": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "platform": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "region": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "sdnType": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "timestamp": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "totalNodes": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "uuid": { - "aggregations": [ - "lastNotNull" - ], - "operation": "groupby" - }, - "version": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - }, - "workerNodesCount": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" + + table.queryOptions.withTransformations([ + { + id: 'groupBy', + options: { + fields: { + 'Cluster name': { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + Infras: { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + 'Infras type': { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + Masters: { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + 'Masters type': { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + Version: { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + Workers: { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + 'Workers type': { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + clusterName: { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + clusterType: { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + 'config.RequestTimeout': { + aggregations: [ + 'lastNotNull', + ], + }, + 'config.tool': { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + haproxyVersion: { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + infraNodesCount: { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + infraNodesType: { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + 'k8s version': { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + ocpMajorVersion: { + aggregations: [], + }, + ocpVersion: { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + otherNodesCount: { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + platform: { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + region: { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + sdnType: { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + timestamp: { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + totalNodes: { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + uuid: { + aggregations: [ + 'lastNotNull', + ], + operation: 'groupby', + }, + version: { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + workerNodesCount: { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + workerNodesType: { + aggregations: [ + 'lastNotNull', + ], + operation: 'aggregate', + }, + }, }, - "workerNodesType": { - "aggregations": [ - "lastNotNull" - ], - "operation": "aggregate" - } - } - } - }, - { - "id": "organize", - "options": { - "excludeByName": { - "_id": true, - "_index": true, - "_type": true, - "avg_lat_us": true, - "config.Delay": true, - "config.concurrency": true, - "config.connections": true, - "config.duration": true, - "config.path": true, - "config.samples": true, - "config.serverReplicas": true, - "config.termination": true, - "config.tool": true, - "config.tuningPatch": true, - "highlight": true, - "http_errors": true, - "infraNodesCount": false, - "masterNodesType": false, - "max_lat_us": true, - "metricName": true, - "otherNodesCount (lastNotNull)": true, - "p90_lat_us": true, - "p95_lat_us": true, - "p99_lat_us": true, - "platform": false, - "pods": true, - "region (lastNotNull)": true, - "requests": true, - "rps_stdev": true, - "sample": true, - "sort": true, - "stdev_lat": true, - "timeouts": true, - "timestamp": true, - "timestamp (lastNotNull)": false, - "totalNodes (lastNotNull)": true, - "total_avg_rps": true, - "uuid": false }, - "indexByName": { - "clusterName (lastNotNull)": 4, - "clusterType (lastNotNull)": 3, - "config.tool (lastNotNull)": 15, - "haproxyVersion (lastNotNull)": 6, - "infraNodesCount (lastNotNull)": 11, - "infraNodesType (lastNotNull)": 12, - "ocpVersion (lastNotNull)": 5, - "otherNodesCount (lastNotNull)": 7, - "platform (lastNotNull)": 2, - "region (lastNotNull)": 8, - "sdnType (lastNotNull)": 9, - "timestamp (lastNotNull)": 1, - "totalNodes (lastNotNull)": 10, - "uuid": 0, - "version (lastNotNull)": 16, - "workerNodesCount (lastNotNull)": 13, - "workerNodesType (lastNotNull)": 14 + { + id: 'organize', + options: { + excludeByName: { + _id: true, + _index: true, + _type: true, + avg_lat_us: true, + 'config.Delay': true, + 'config.concurrency': true, + 'config.connections': true, + 'config.duration': true, + 'config.path': true, + 'config.samples': true, + 'config.serverReplicas': true, + 'config.termination': true, + 'config.tool': true, + 'config.tuningPatch': true, + highlight: true, + http_errors: true, + infraNodesCount: false, + masterNodesType: false, + max_lat_us: true, + metricName: true, + 'otherNodesCount (lastNotNull)': true, + p90_lat_us: true, + p95_lat_us: true, + p99_lat_us: true, + platform: false, + pods: true, + 'region (lastNotNull)': true, + requests: true, + rps_stdev: true, + sample: true, + sort: true, + stdev_lat: true, + timeouts: true, + timestamp: true, + 'timestamp (lastNotNull)': false, + 'totalNodes (lastNotNull)': true, + total_avg_rps: true, + uuid: false, + }, + indexByName: { + 'clusterName (lastNotNull)': 4, + 'clusterType (lastNotNull)': 3, + 'config.tool (lastNotNull)': 15, + 'haproxyVersion (lastNotNull)': 6, + 'infraNodesCount (lastNotNull)': 11, + 'infraNodesType (lastNotNull)': 12, + 'ocpVersion (lastNotNull)': 5, + 'otherNodesCount (lastNotNull)': 7, + 'platform (lastNotNull)': 2, + 'region (lastNotNull)': 8, + 'sdnType (lastNotNull)': 9, + 'timestamp (lastNotNull)': 1, + 'totalNodes (lastNotNull)': 10, + uuid: 0, + 'version (lastNotNull)': 16, + 'workerNodesCount (lastNotNull)': 13, + 'workerNodesType (lastNotNull)': 14, + }, + renameByName: { + clusterName: 'Cluster name', + 'clusterName (lastNotNull)': 'Cluster name', + 'clusterType (lastNotNull)': 'Cluster type', + 'config.tool (lastNotNull)': 'Tool', + 'haproxyVersion (lastNotNull)': 'HAProxy version', + http_errors: '', + infraNodesCount: 'Infras', + 'infraNodesCount (lastNotNull)': 'Infras', + infraNodesType: 'Infras type', + 'infraNodesType (lastNotNull)': 'Infra type', + k8sVersion: 'k8s version', + masterNodesCount: 'Masters', + masterNodesType: 'Masters type', + ocpVersion: 'Version', + 'ocpVersion (lastNotNull)': 'Version', + 'otherNodesCount (lastNotNull)': 'Other nodes', + 'platform (lastNotNull)': 'Platform', + 'region (lastNotNull)': 'Region', + 'sdnType (lastNotNull)': 'SDN', + 'timestamp (lastNotNull)': 'Timestamp', + 'totalNodes (lastNotNull)': 'Total nodes', + uuid: 'UUID', + 'version (lastNotNull)': 'ingress-perf v', + workerNodesCount: 'Workers', + 'workerNodesCount (lastNotNull)': 'Workers', + workerNodesType: 'Workers type', + 'workerNodesType (lastNotNull)': 'Workers type', + }, + }, }, - "renameByName": { - "clusterName": "Cluster name", - "clusterName (lastNotNull)": "Cluster name", - "clusterType (lastNotNull)": "Cluster type", - "config.tool (lastNotNull)": "Tool", - "haproxyVersion (lastNotNull)": "HAProxy version", - "http_errors": "", - "infraNodesCount": "Infras", - "infraNodesCount (lastNotNull)": "Infras", - "infraNodesType": "Infras type", - "infraNodesType (lastNotNull)": "Infra type", - "k8sVersion": "k8s version", - "masterNodesCount": "Masters", - "masterNodesType": "Masters type", - "ocpVersion": "Version", - "ocpVersion (lastNotNull)": "Version", - "otherNodesCount (lastNotNull)": "Other nodes", - "platform (lastNotNull)": "Platform", - "region (lastNotNull)": "Region", - "sdnType (lastNotNull)": "SDN", - "timestamp (lastNotNull)": "Timestamp", - "totalNodes (lastNotNull)": "Total nodes", - "uuid": "UUID", - "version (lastNotNull)": "ingress-perf v", - "workerNodesCount": "Workers", - "workerNodesCount (lastNotNull)": "Workers", - "workerNodesType": "Workers type", - "workerNodesType (lastNotNull)": "Workers type" - } - } - } - ]) - }, -} \ No newline at end of file + ]), + }, +} diff --git a/assets/ingress-performance-ocp/queries.libsonnet b/assets/ingress-performance-ocp/queries.libsonnet index 9d65908..5edd68b 100644 --- a/assets/ingress-performance-ocp/queries.libsonnet +++ b/assets/ingress-performance-ocp/queries.libsonnet @@ -1,353 +1,355 @@ -local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local variables = import './variables.libsonnet'; +local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local elasticsearch = g.query.elasticsearch; { - avgRPSAll: { - query(): - elasticsearch.withAlias("{{ocpMajorVersion.keyword}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("ocpMajorVersion.keyword") - + elasticsearch.bucketAggs.Terms.withId("8") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('asc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("9") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("total_avg_rps") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg') - ]) - + elasticsearch.withQuery("uuid.keyword: $all_uuids AND config.termination.keyword: $termination AND ocpMajorVersion.keyword: $ocpMajorVersion") - + elasticsearch.withTimeField('timestamp') - }, + avgRPSAll: { + query(): + elasticsearch.withAlias('{{ocpMajorVersion.keyword}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('ocpMajorVersion.keyword') + + elasticsearch.bucketAggs.Terms.withId('8') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('asc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('9') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('total_avg_rps') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $all_uuids AND config.termination.keyword: $termination AND ocpMajorVersion.keyword: $ocpMajorVersion') + + elasticsearch.withTimeField('timestamp'), + }, - avgRPS: { - query(): - elasticsearch.withAlias("{{ocpMajorVersion.keyword}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("ocpMajorVersion.keyword") - + elasticsearch.bucketAggs.Terms.withId("8") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('asc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("9") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("total_avg_rps") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg') - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND config.termination.keyword: $termination AND ocpMajorVersion.keyword: $ocpMajorVersion") - + elasticsearch.withTimeField('timestamp') - }, + avgRPS: { + query(): + elasticsearch.withAlias('{{ocpMajorVersion.keyword}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('ocpMajorVersion.keyword') + + elasticsearch.bucketAggs.Terms.withId('8') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('asc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('9') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('total_avg_rps') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND config.termination.keyword: $termination AND ocpMajorVersion.keyword: $ocpMajorVersion') + + elasticsearch.withTimeField('timestamp'), + }, - avgTime: { - query(): - elasticsearch.withAlias("{{ocpMajorVersion.keyword}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("ocpMajorVersion.keyword") - + elasticsearch.bucketAggs.Terms.withId("7") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('asc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') , - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("8") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("$latency_metric") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg') + avgTime: { + query(): + elasticsearch.withAlias('{{ocpMajorVersion.keyword}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('ocpMajorVersion.keyword') + + elasticsearch.bucketAggs.Terms.withId('7') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('asc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('8') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('$latency_metric') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $all_uuids AND config.termination.keyword: $termination AND ocpMajorVersion.keyword: $ocpMajorVersion") - + elasticsearch.withTimeField('timestamp') - }, + ]) + + elasticsearch.withQuery('uuid.keyword: $all_uuids AND config.termination.keyword: $termination AND ocpMajorVersion.keyword: $ocpMajorVersion') + + elasticsearch.withTimeField('timestamp'), + }, - workloadSummary: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([]) - + elasticsearch.withHide(false) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.RawData.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withType("raw_data") - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid") - + elasticsearch.withTimeField('timestamp') - }, + workloadSummary: { + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([]) + + elasticsearch.withHide(false) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withType('raw_data'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid') + + elasticsearch.withTimeField('timestamp'), + }, - trendRPS: { - query(): - elasticsearch.withAlias("{{$compare_by}}") - + elasticsearch.withHide(false) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by") - + elasticsearch.bucketAggs.Terms.withId("7") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("8") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("total_avg_rps") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND config.termination.keyword: $termination") - + elasticsearch.withTimeField('timestamp') - }, + trendRPS: { + query(): + elasticsearch.withAlias('{{$compare_by}}') + + elasticsearch.withHide(false) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by') + + elasticsearch.bucketAggs.Terms.withId('7') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('8') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('total_avg_rps') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND config.termination.keyword: $termination') + + elasticsearch.withTimeField('timestamp'), + }, - latencyTrend: { - query(): - elasticsearch.withAlias("{{$compare_by}}") - + elasticsearch.withHide(false) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by") - + elasticsearch.bucketAggs.Terms.withId("7") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("8") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("0") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges("0"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("$latency_metric") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND config.termination.keyword: $termination") - + elasticsearch.withTimeField('timestamp') - }, + latencyTrend: { + query(): + elasticsearch.withAlias('{{$compare_by}}') + + elasticsearch.withHide(false) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by') + + elasticsearch.bucketAggs.Terms.withId('7') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('8') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('0') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges('0'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('$latency_metric') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND config.termination.keyword: $termination') + + elasticsearch.withTimeField('timestamp'), + }, - terminationRPS: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by") - + elasticsearch.bucketAggs.Terms.withId("7") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("8") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("0") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges("0"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("total_avg_rps") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND config.termination.keyword: $termination") - + elasticsearch.withTimeField('timestamp') - }, + terminationRPS: { + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by') + + elasticsearch.bucketAggs.Terms.withId('7') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('8') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('0') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges('0'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('total_avg_rps') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND config.termination.keyword: $termination') + + elasticsearch.withTimeField('timestamp'), + }, - latencyTermination: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withHide(false) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by") - + elasticsearch.bucketAggs.Terms.withId("7") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("8") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges("0"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("$latency_metric") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND config.termination.keyword: $termination") - + elasticsearch.withTimeField('timestamp') - }, + latencyTermination: { + query(): + elasticsearch.withAlias('') + + elasticsearch.withHide(false) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by') + + elasticsearch.bucketAggs.Terms.withId('7') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('8') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges('0'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('$latency_metric') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND config.termination.keyword: $termination') + + elasticsearch.withTimeField('timestamp'), + }, - HAProxyAvgCPUUsage: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withHide(false) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by") - + elasticsearch.bucketAggs.Terms.withId("7") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("8") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("0") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges("0"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("infra_metrics.avg_cpu_usage_router_pods") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg') - + elasticsearch.metrics.MetricAggregationWithSettings.Average.settings.withScript('_value*100') - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND config.termination.keyword: $termination") - + elasticsearch.withTimeField('timestamp') - }, + HAProxyAvgCPUUsage: { + query(): + elasticsearch.withAlias('') + + elasticsearch.withHide(false) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by') + + elasticsearch.bucketAggs.Terms.withId('7') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('8') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('0') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges('0'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('infra_metrics.avg_cpu_usage_router_pods') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.settings.withScript('_value*100'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND config.termination.keyword: $termination') + + elasticsearch.withTimeField('timestamp'), + }, - InfraNodesCPUUsageEdge: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withHide(false) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by") - + elasticsearch.bucketAggs.Terms.withId("7") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("8") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("0") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges("0"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("infra_metrics.avg_cpu_usage_router_nodes") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg') - + elasticsearch.metrics.MetricAggregationWithSettings.Average.settings.withScript('_value*100') - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND config.termination.keyword: $termination") - + elasticsearch.withTimeField('timestamp') - }, + InfraNodesCPUUsageEdge: { + query(): + elasticsearch.withAlias('') + + elasticsearch.withHide(false) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by') + + elasticsearch.bucketAggs.Terms.withId('7') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('8') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('0') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges('0'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('infra_metrics.avg_cpu_usage_router_nodes') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.settings.withScript('_value*100'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND config.termination.keyword: $termination') + + elasticsearch.withTimeField('timestamp'), + }, - qualityRPS: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withHide(false) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by") - + elasticsearch.bucketAggs.Terms.withId("7") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.ExtendedStats.withField("total_avg_rps") - + elasticsearch.metrics.MetricAggregationWithSettings.ExtendedStats.withMeta( - { - "std_deviation": true, - "std_deviation_bounds_lower": false, - "std_deviation_bounds_upper": false - }) - + elasticsearch.metrics.MetricAggregationWithSettings.ExtendedStats.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.ExtendedStats.withType('extended_stats'), + qualityRPS: { + query(): + elasticsearch.withAlias('') + + elasticsearch.withHide(false) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by') + + elasticsearch.bucketAggs.Terms.withId('7') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.ExtendedStats.withField('total_avg_rps') + + elasticsearch.metrics.MetricAggregationWithSettings.ExtendedStats.withMeta( + { + std_deviation: true, + std_deviation_bounds_lower: false, + std_deviation_bounds_upper: false, + } + ) + + elasticsearch.metrics.MetricAggregationWithSettings.ExtendedStats.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.ExtendedStats.withType('extended_stats'), - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("total_avg_rps") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("8") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND config.termination.keyword: $termination") - + elasticsearch.withTimeField('timestamp') - }, + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('total_avg_rps') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('8') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND config.termination.keyword: $termination') + + elasticsearch.withTimeField('timestamp'), + }, - dataQuality: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withHide(false) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by") - + elasticsearch.bucketAggs.Terms.withId("7") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.ExtendedStats.withField("$latency_metric") - + elasticsearch.metrics.MetricAggregationWithSettings.ExtendedStats.withMeta( - { - "std_deviation": true, - "std_deviation_bounds_lower": false, - "std_deviation_bounds_upper": false - }) - + elasticsearch.metrics.MetricAggregationWithSettings.ExtendedStats.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.ExtendedStats.withType('extended_stats'), + dataQuality: { + query(): + elasticsearch.withAlias('') + + elasticsearch.withHide(false) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by') + + elasticsearch.bucketAggs.Terms.withId('7') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.ExtendedStats.withField('$latency_metric') + + elasticsearch.metrics.MetricAggregationWithSettings.ExtendedStats.withMeta( + { + std_deviation: true, + std_deviation_bounds_lower: false, + std_deviation_bounds_upper: false, + } + ) + + elasticsearch.metrics.MetricAggregationWithSettings.ExtendedStats.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.ExtendedStats.withType('extended_stats'), - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("$latency_metric") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("8") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND config.termination.keyword: $termination") - + elasticsearch.withTimeField('timestamp') - }, + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('$latency_metric') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('8') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND config.termination.keyword: $termination') + + elasticsearch.withTimeField('timestamp'), + }, - rawData: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.RawData.withId("1") - +elasticsearch.metrics.MetricAggregationWithSettings.RawData.settings.withSize("500") - + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withType('raw_data'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND config.termination.keyword: $termination") - + elasticsearch.withTimeField('timestamp') - }, -} \ No newline at end of file + rawData: { + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.RawData.settings.withSize('500') + + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withType('raw_data'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND config.termination.keyword: $termination') + + elasticsearch.withTimeField('timestamp'), + }, +} diff --git a/assets/ingress-performance-ocp/variables.libsonnet b/assets/ingress-performance-ocp/variables.libsonnet index af28f6e..12d2200 100644 --- a/assets/ingress-performance-ocp/variables.libsonnet +++ b/assets/ingress-performance-ocp/variables.libsonnet @@ -2,81 +2,79 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn local var = g.dashboard.variable; { - Datasource: - var.datasource.new('Datasource','elasticsearch') - + var.datasource.withRegex('/.*Ingress.*/') - + var.query.generalOptions.withLabel('Datasource'), + Datasource: + var.datasource.new('Datasource', 'elasticsearch') + + var.datasource.withRegex('/.*Ingress.*/') + + var.query.generalOptions.withLabel('Datasource'), - platform: - var.query.new('platform',"{\"find\": \"terms\", \"field\": \"platform.keyword\"}") - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.withRefresh(2) - + var.query.selectionOptions.withMulti() - + var.query.selectionOptions.withIncludeAll(false) - + var.query.generalOptions.withLabel('Platform'), - clusterType: - var.query.new('clusterType',"{\"find\": \"terms\", \"field\": \"clusterType.keyword\", \"query\": \"platform.keyword: $platform\"}") - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.withRefresh(2) - + var.query.selectionOptions.withMulti(true) - + var.query.selectionOptions.withIncludeAll(false) - + var.query.generalOptions.withLabel('Cluster Type'), + platform: + var.query.new('platform', '{"find": "terms", "field": "platform.keyword"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.withRefresh(2) + + var.query.selectionOptions.withMulti() + + var.query.selectionOptions.withIncludeAll(false) + + var.query.generalOptions.withLabel('Platform'), + clusterType: + var.query.new('clusterType', '{"find": "terms", "field": "clusterType.keyword", "query": "platform.keyword: $platform"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.withRefresh(2) + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(false) + + var.query.generalOptions.withLabel('Cluster Type'), - - workerNodesCount: - var.query.new('workerNodesCount',"{\"find\": \"terms\", \"field\": \"workerNodesCount\", \"query\": \"platform.keyword: $platform AND clusterType.keyword: $clusterType\"}") - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.withRefresh(2) - + var.query.selectionOptions.withMulti(true) - + var.query.selectionOptions.withIncludeAll(false) - + var.query.generalOptions.withLabel('Worker Nodes Count'), - infraNodesType: - var.query.new('infraNodesType',"{\"find\": \"terms\", \"field\": \"infraNodesType.keyword\", \"query\": \"platform.keyword: $platform AND workerNodesCount: $workerNodesCount AND clusterType.keyword: $clusterType\"}") - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.withRefresh(2) - + var.query.selectionOptions.withMulti(true) - + var.query.selectionOptions.withIncludeAll(false) - + var.query.generalOptions.withLabel('Infra Nodes Type'), + workerNodesCount: + var.query.new('workerNodesCount', '{"find": "terms", "field": "workerNodesCount", "query": "platform.keyword: $platform AND clusterType.keyword: $clusterType"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.withRefresh(2) + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(false) + + var.query.generalOptions.withLabel('Worker Nodes Count'), - ocpMajorVersion: - var.query.new('ocpMajorVersion',"{\"find\": \"terms\", \"field\": \"ocpMajorVersion.keyword\", \"query\": \"platform.keyword: $platform AND infraNodesType.keyword: $infraNodesType AND workerNodesCount: $workerNodesCount AND clusterType.keyword: $clusterType\"}") - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.withRefresh(2) - + var.query.selectionOptions.withMulti(true) - + var.query.selectionOptions.withIncludeAll(false) - + var.query.generalOptions.withLabel('Major Version'), + infraNodesType: + var.query.new('infraNodesType', '{"find": "terms", "field": "infraNodesType.keyword", "query": "platform.keyword: $platform AND workerNodesCount: $workerNodesCount AND clusterType.keyword: $clusterType"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.withRefresh(2) + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(false) + + var.query.generalOptions.withLabel('Infra Nodes Type'), - uuid: - var.query.new('uuid',"{\"find\": \"terms\", \"field\": \"uuid.keyword\", \"query\": \"platform.keyword: $platform AND infraNodesType.keyword: $infraNodesType AND workerNodesCount: $workerNodesCount AND clusterType.keyword: $clusterType AND ocpMajorVersion.keyword: $ocpMajorVersion\"}") - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.withRefresh(2) - + var.query.selectionOptions.withMulti(true) - + var.query.selectionOptions.withIncludeAll(false) - + var.query.generalOptions.withLabel('UUID'), - - termination: - var.query.new('termination',"{\"find\": \"terms\", \"field\": \"config.termination.keyword\"}") - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.withRefresh(2) - + var.query.selectionOptions.withMulti(true) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.generalOptions.withLabel('Termination'), - - latency_metric: - var.custom.new('latency_metric', ['avg_lat_us', 'max_lat_us','p99_lat_us', 'p95_lat_us', 'p90_lat_us'],) - + var.custom.generalOptions.withLabel('Latency Metric'), - - compare_by: - var.custom.new('compare_by',['uuid.keyword','ocpVersion.keyword','ocpMajorVersion.keyword','clusterName.keyword','haproxyVersion.keyword'],) - + var.custom.generalOptions.withLabel('Compare By'), + ocpMajorVersion: + var.query.new('ocpMajorVersion', '{"find": "terms", "field": "ocpMajorVersion.keyword", "query": "platform.keyword: $platform AND infraNodesType.keyword: $infraNodesType AND workerNodesCount: $workerNodesCount AND clusterType.keyword: $clusterType"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.withRefresh(2) + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(false) + + var.query.generalOptions.withLabel('Major Version'), - all_uuids: - var.query.new('all_uuids',"{\"find\": \"terms\", \"field\": \"uuid.keyword\", \"query\": \"platform.keyword: $platform AND infraNodesType.keyword: $infraNodesType AND workerNodesCount: $workerNodesCount AND clusterType.keyword: $clusterType AND ocpMajorVersion.keyword: $ocpMajorVersion\"}") - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.withRefresh(2) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true), -} + uuid: + var.query.new('uuid', '{"find": "terms", "field": "uuid.keyword", "query": "platform.keyword: $platform AND infraNodesType.keyword: $infraNodesType AND workerNodesCount: $workerNodesCount AND clusterType.keyword: $clusterType AND ocpMajorVersion.keyword: $ocpMajorVersion"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.withRefresh(2) + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(false) + + var.query.generalOptions.withLabel('UUID'), + + termination: + var.query.new('termination', '{"find": "terms", "field": "config.termination.keyword"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.withRefresh(2) + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.generalOptions.withLabel('Termination'), + + latency_metric: + var.custom.new('latency_metric', ['avg_lat_us', 'max_lat_us', 'p99_lat_us', 'p95_lat_us', 'p90_lat_us'],) + + var.custom.generalOptions.withLabel('Latency Metric'), - \ No newline at end of file + compare_by: + var.custom.new('compare_by', ['uuid.keyword', 'ocpVersion.keyword', 'ocpMajorVersion.keyword', 'clusterName.keyword', 'haproxyVersion.keyword'],) + + var.custom.generalOptions.withLabel('Compare By'), + + all_uuids: + var.query.new('all_uuids', '{"find": "terms", "field": "uuid.keyword", "query": "platform.keyword: $platform AND infraNodesType.keyword: $infraNodesType AND workerNodesCount: $workerNodesCount AND clusterType.keyword: $clusterType AND ocpMajorVersion.keyword: $ocpMajorVersion"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.withRefresh(2) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true), +} diff --git a/assets/k8s-netperf/panels.libsonnet b/assets/k8s-netperf/panels.libsonnet index 1d93ef3..ebc77e2 100644 --- a/assets/k8s-netperf/panels.libsonnet +++ b/assets/k8s-netperf/panels.libsonnet @@ -21,9 +21,9 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn table.new(title) + table.datasource.withType('elasticsearch') + table.datasource.withUid('$datasource') - + table.panelOptions.withRepeat("profile") - + table.panelOptions.withRepeatDirection("h") - + table.standardOptions.color.withMode("thresholds") + + table.panelOptions.withRepeat('profile') + + table.panelOptions.withRepeatDirection('h') + + table.standardOptions.color.withMode('thresholds') + table.queryOptions.withTargets(targets) + table.gridPos.withX(gridPos.x) + table.gridPos.withY(gridPos.y) @@ -31,278 +31,278 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn + table.gridPos.withW(gridPos.w) + table.queryOptions.withTransformations([ { - "id": "organize", - "options": { - "excludeByName": { - "Average latency": true, - "ltcyMetric.keyword": true, - "tputMetric.keyword": true + id: 'organize', + options: { + excludeByName: { + 'Average latency': true, + 'ltcyMetric.keyword': true, + 'tputMetric.keyword': true, }, - "indexByName": { - "Average": 10, - "hostNetwork": 8, - "ltcyMetric.keyword": 7, - "messageSize": 3, - "metadata.clusterName.keyword": 1, - "metadata.platform.keyword": 5, - "metadata.workerNodesType.keyword": 9, - "profile.keyword": 2, - "service": 6, - "tputMetric.keyword": 4, - "uuid.keyword": 0 + indexByName: { + Average: 10, + hostNetwork: 8, + 'ltcyMetric.keyword': 7, + messageSize: 3, + 'metadata.clusterName.keyword': 1, + 'metadata.platform.keyword': 5, + 'metadata.workerNodesType.keyword': 9, + 'profile.keyword': 2, + service: 6, + 'tputMetric.keyword': 4, + 'uuid.keyword': 0, }, - "renameByName": { - "Average": "Throughput", - "Average latency": "P99 latency", - "ltcyMetric.keyword": "", - "metadata.clusterName.keyword": "clusterName", - "metadata.platform.keyword": "Platform", - "metadata.workerNodesType.keyword": "workers", - "profile.keyword": "Profile", - "uuid.keyword": "uuid" - } - } - } + renameByName: { + Average: 'Throughput', + 'Average latency': 'P99 latency', + 'ltcyMetric.keyword': '', + 'metadata.clusterName.keyword': 'clusterName', + 'metadata.platform.keyword': 'Platform', + 'metadata.workerNodesType.keyword': 'workers', + 'profile.keyword': 'Profile', + 'uuid.keyword': 'uuid', + }, + }, + }, ]) + table.standardOptions.withOverrides([ { - "matcher": { - "id": "byName", - "options": "Average" + matcher: { + id: 'byName', + options: 'Average', }, - "properties": [ + properties: [ { - "id": "unit", - "value": "Mbits" - } - ] + id: 'unit', + value: 'Mbits', + }, + ], }, { - "matcher": { - "id": "byName", - "options": "messageSize" + matcher: { + id: 'byName', + options: 'messageSize', }, - "properties": [ + properties: [ { - "id": "unit", - "value": "bytes" - } - ] - } + id: 'unit', + value: 'bytes', + }, + ], + }, ]) - + options.withCellHeight("sm") + + options.withCellHeight('sm') + options.withFooter({ - "countRows": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }) + countRows: false, + fields: '', + reducer: [ + 'sum', + ], + show: false, + }) + options.withSortBy([ - { - "desc": true, - "displayName": "ea7b29d7-8991-4752-a0d4-e26446d34915 TCP_STREAM 4096 Mb/s AWS" - } - ]), + { + desc: true, + displayName: 'ea7b29d7-8991-4752-a0d4-e26446d34915 TCP_STREAM 4096 Mb/s AWS', + }, + ]), workloadSummary(title, targets, gridPos): self.base(title, targets, gridPos) + table.queryOptions.withTransformations([ { - "id": "organize", - "options": { - "excludeByName": { - "_id": true, - "_index": true, - "_type": true, - "clientCPU.idleCPU": true, - "clientCPU.ioCPU": true, - "clientCPU.irqCPU": true, - "clientCPU.niceCPU": true, - "clientCPU.softCPU": true, - "clientCPU.stealCPU": true, - "clientCPU.systemCPU": true, - "clientCPU.userCPU": true, - "clientNodeLabels.beta.kubernetes.io/arch": true, - "clientNodeLabels.beta.kubernetes.io/instance-type": true, - "clientNodeLabels.beta.kubernetes.io/os": true, - "clientNodeLabels.failure-domain.beta.kubernetes.io/region": true, - "clientNodeLabels.failure-domain.beta.kubernetes.io/zone": true, - "clientNodeLabels.hypershift.openshift.io/managed": true, - "clientNodeLabels.hypershift.openshift.io/nodePool": true, - "clientNodeLabels.kubernetes.io/arch": true, - "clientNodeLabels.kubernetes.io/hostname": true, - "clientNodeLabels.kubernetes.io/os": true, - "clientNodeLabels.node-role.kubernetes.io/worker": true, - "clientNodeLabels.node.kubernetes.io/instance-type": true, - "clientNodeLabels.node.openshift.io/os_id": true, - "clientNodeLabels.topology.ebs.csi.aws.com/zone": true, - "clientNodeLabels.topology.kubernetes.io/region": true, - "clientNodeLabels.topology.kubernetes.io/zone": true, - "clientPods": true, - "confidence": true, - "driver": true, - "highlight": true, - "hostNetwork": true, - "latency": true, - "local": true, - "ltcyMetric": true, - "messageSize": true, - "metadata.ipsec": true, - "metadata.k8sVersion": true, - "metadata.kernel": true, - "metadata.masterNodesCount": true, - "metadata.masterNodesType": true, - "metadata.metricName": true, - "metadata.mtu": true, - "metadata.ocpShortVersion": true, - "metadata.totalNodes": true, - "parallelism": true, - "profile": true, - "samples": true, - "serverCPU.idleCPU": true, - "serverCPU.ioCPU": true, - "serverCPU.irqCPU": true, - "serverCPU.niceCPU": true, - "serverCPU.softCPU": true, - "serverCPU.stealCPU": true, - "serverCPU.systemCPU": true, - "serverCPU.userCPU": true, - "serverNodeLabels.beta.kubernetes.io/arch": true, - "serverNodeLabels.beta.kubernetes.io/instance-type": true, - "serverNodeLabels.beta.kubernetes.io/os": true, - "serverNodeLabels.failure-domain.beta.kubernetes.io/region": true, - "serverNodeLabels.failure-domain.beta.kubernetes.io/zone": true, - "serverNodeLabels.hypershift.openshift.io/managed": true, - "serverNodeLabels.hypershift.openshift.io/nodePool": true, - "serverNodeLabels.kubernetes.io/arch": true, - "serverNodeLabels.kubernetes.io/hostname": true, - "serverNodeLabels.kubernetes.io/os": true, - "serverNodeLabels.node-role.kubernetes.io/worker": true, - "serverNodeLabels.node.kubernetes.io/instance-type": true, - "serverNodeLabels.node.openshift.io/os_id": true, - "serverNodeLabels.topology.ebs.csi.aws.com/zone": true, - "serverNodeLabels.topology.kubernetes.io/region": true, - "serverNodeLabels.topology.kubernetes.io/zone": true, - "serverPods": true, - "service": true, - "sort": true, - "tcpRetransmits": true, - "throughput": true, - "tputMetric": true, - "udpLossPercent": true + id: 'organize', + options: { + excludeByName: { + _id: true, + _index: true, + _type: true, + 'clientCPU.idleCPU': true, + 'clientCPU.ioCPU': true, + 'clientCPU.irqCPU': true, + 'clientCPU.niceCPU': true, + 'clientCPU.softCPU': true, + 'clientCPU.stealCPU': true, + 'clientCPU.systemCPU': true, + 'clientCPU.userCPU': true, + 'clientNodeLabels.beta.kubernetes.io/arch': true, + 'clientNodeLabels.beta.kubernetes.io/instance-type': true, + 'clientNodeLabels.beta.kubernetes.io/os': true, + 'clientNodeLabels.failure-domain.beta.kubernetes.io/region': true, + 'clientNodeLabels.failure-domain.beta.kubernetes.io/zone': true, + 'clientNodeLabels.hypershift.openshift.io/managed': true, + 'clientNodeLabels.hypershift.openshift.io/nodePool': true, + 'clientNodeLabels.kubernetes.io/arch': true, + 'clientNodeLabels.kubernetes.io/hostname': true, + 'clientNodeLabels.kubernetes.io/os': true, + 'clientNodeLabels.node-role.kubernetes.io/worker': true, + 'clientNodeLabels.node.kubernetes.io/instance-type': true, + 'clientNodeLabels.node.openshift.io/os_id': true, + 'clientNodeLabels.topology.ebs.csi.aws.com/zone': true, + 'clientNodeLabels.topology.kubernetes.io/region': true, + 'clientNodeLabels.topology.kubernetes.io/zone': true, + clientPods: true, + confidence: true, + driver: true, + highlight: true, + hostNetwork: true, + latency: true, + 'local': true, + ltcyMetric: true, + messageSize: true, + 'metadata.ipsec': true, + 'metadata.k8sVersion': true, + 'metadata.kernel': true, + 'metadata.masterNodesCount': true, + 'metadata.masterNodesType': true, + 'metadata.metricName': true, + 'metadata.mtu': true, + 'metadata.ocpShortVersion': true, + 'metadata.totalNodes': true, + parallelism: true, + profile: true, + samples: true, + 'serverCPU.idleCPU': true, + 'serverCPU.ioCPU': true, + 'serverCPU.irqCPU': true, + 'serverCPU.niceCPU': true, + 'serverCPU.softCPU': true, + 'serverCPU.stealCPU': true, + 'serverCPU.systemCPU': true, + 'serverCPU.userCPU': true, + 'serverNodeLabels.beta.kubernetes.io/arch': true, + 'serverNodeLabels.beta.kubernetes.io/instance-type': true, + 'serverNodeLabels.beta.kubernetes.io/os': true, + 'serverNodeLabels.failure-domain.beta.kubernetes.io/region': true, + 'serverNodeLabels.failure-domain.beta.kubernetes.io/zone': true, + 'serverNodeLabels.hypershift.openshift.io/managed': true, + 'serverNodeLabels.hypershift.openshift.io/nodePool': true, + 'serverNodeLabels.kubernetes.io/arch': true, + 'serverNodeLabels.kubernetes.io/hostname': true, + 'serverNodeLabels.kubernetes.io/os': true, + 'serverNodeLabels.node-role.kubernetes.io/worker': true, + 'serverNodeLabels.node.kubernetes.io/instance-type': true, + 'serverNodeLabels.node.openshift.io/os_id': true, + 'serverNodeLabels.topology.ebs.csi.aws.com/zone': true, + 'serverNodeLabels.topology.kubernetes.io/region': true, + 'serverNodeLabels.topology.kubernetes.io/zone': true, + serverPods: true, + service: true, + sort: true, + tcpRetransmits: true, + throughput: true, + tputMetric: true, + udpLossPercent: true, + }, + indexByName: { + uuid: 0, + timestamp: 1, + 'metadata.platform': 2, + 'metadata.ocpVersion': 3, + 'metadata.clusterName': 4, + 'metadata.sdnType': 5, + 'metadata.infraNodesCount': 6, + 'metadata.infraNodesType': 7, + 'metadata.workerNodesCount': 8, + 'metadata.workerNodesType': 9, + 'metadata.acrossAZ': 10, + 'metadata.region': 11, }, - "indexByName": { - "uuid": 0, - "timestamp": 1, - "metadata.platform": 2, - "metadata.ocpVersion": 3, - "metadata.clusterName": 4, - "metadata.sdnType": 5, - "metadata.infraNodesCount": 6, - "metadata.infraNodesType": 7, - "metadata.workerNodesCount": 8, - "metadata.workerNodesType": 9, - "metadata.acrossAZ": 10, - "metadata.region": 11 + renameByName: { + acrossAZ: 'Multi-AZ', + 'metadata.clusterName': 'Cluster Name', + 'metadata.infraNodesCount': 'Infras', + 'metadata.infraNodesType': 'Infra Type', + 'metadata.ocpVersion': 'Version', + 'metadata.platform': 'Platform', + 'metadata.region': 'Region', + 'metadata.sdnType': 'SDN', + 'metadata.workerNodesCount': 'Workers', + 'metadata.workerNodesType': 'Workers Type', + timestamp: 'Timestamp', + uuid: 'UUID', }, - "renameByName": { - "acrossAZ": "Multi-AZ", - "metadata.clusterName": "Cluster Name", - "metadata.infraNodesCount": "Infras", - "metadata.infraNodesType": "Infra Type", - "metadata.ocpVersion": "Version", - "metadata.platform": "Platform", - "metadata.region": "Region", - "metadata.sdnType": "SDN", - "metadata.workerNodesCount": "Workers", - "metadata.workerNodesType": "Workers Type", - "timestamp": "Timestamp", - "uuid": "UUID" - } - } + }, }, { - "id": "groupBy", - "options": { - "fields": { - "UUID": {"aggregations": [], "operation": "groupby"}, - "Cluster Name": {"aggregations": ["lastNotNull"], "operation": "aggregate"}, - "Infra Type": {"aggregations": ["lastNotNull"], "operation": "aggregate"}, - "Infras": {"aggregations": ["lastNotNull"], "operation": "aggregate"}, - "Platform": {"aggregations": ["lastNotNull"], "operation": "aggregate"}, - "Region": {"aggregations": ["lastNotNull"], "operation": "aggregate"}, - "SDN": {"aggregations": ["lastNotNull"], "operation": "aggregate"}, - "Timestamp": {"aggregations": ["lastNotNull"], "operation": "aggregate"}, - "Version": {"aggregations": ["lastNotNull"], "operation": "aggregate"}, - "Workers": {"aggregations": ["lastNotNull"], "operation": "aggregate"}, - "Workers Type": {"aggregations": ["lastNotNull"], "operation": "aggregate"}, - "duration": {"aggregations": ["lastNotNull"], "operation": "aggregate"}, - "Multi-AZ": {"aggregations": ["last"], "operation": "aggregate"} - } - } - } + id: 'groupBy', + options: { + fields: { + UUID: { aggregations: [], operation: 'groupby' }, + 'Cluster Name': { aggregations: ['lastNotNull'], operation: 'aggregate' }, + 'Infra Type': { aggregations: ['lastNotNull'], operation: 'aggregate' }, + Infras: { aggregations: ['lastNotNull'], operation: 'aggregate' }, + Platform: { aggregations: ['lastNotNull'], operation: 'aggregate' }, + Region: { aggregations: ['lastNotNull'], operation: 'aggregate' }, + SDN: { aggregations: ['lastNotNull'], operation: 'aggregate' }, + Timestamp: { aggregations: ['lastNotNull'], operation: 'aggregate' }, + Version: { aggregations: ['lastNotNull'], operation: 'aggregate' }, + Workers: { aggregations: ['lastNotNull'], operation: 'aggregate' }, + 'Workers Type': { aggregations: ['lastNotNull'], operation: 'aggregate' }, + duration: { aggregations: ['lastNotNull'], operation: 'aggregate' }, + 'Multi-AZ': { aggregations: ['last'], operation: 'aggregate' }, + }, + }, + }, ]), withLatencyOverrides(title, targets, gridPos): self.base(title, targets, gridPos) + table.queryOptions.withTransformations([ { - "id": "organize", - "options": { - "excludeByName": { - "Average latency": true, - "ltcyMetric.keyword": true, - "tputMetric.keyword": true + id: 'organize', + options: { + excludeByName: { + 'Average latency': true, + 'ltcyMetric.keyword': true, + 'tputMetric.keyword': true, }, - "indexByName": { - "Average": 8, - "hostNetwork": 6, - "messageSize": 3, - "metadata.clusterName.keyword": 1, - "metadata.platform.keyword": 4, - "metadata.workerNodesType.keyword": 7, - "profile.keyword": 2, - "service": 5, - "uuid.keyword": 0 + indexByName: { + Average: 8, + hostNetwork: 6, + messageSize: 3, + 'metadata.clusterName.keyword': 1, + 'metadata.platform.keyword': 4, + 'metadata.workerNodesType.keyword': 7, + 'profile.keyword': 2, + service: 5, + 'uuid.keyword': 0, }, - "renameByName": { - "Average": "P99 latency", - "Average latency": "P99 latency", - "ltcyMetric.keyword": "", - "metadata.clusterName.keyword": "clusterName", - "metadata.platform.keyword": "Platform", - "metadata.workerNodesType.keyword": "workers", - "profile.keyword": "Profile", - "uuid.keyword": "uuid" - } - } - } + renameByName: { + Average: 'P99 latency', + 'Average latency': 'P99 latency', + 'ltcyMetric.keyword': '', + 'metadata.clusterName.keyword': 'clusterName', + 'metadata.platform.keyword': 'Platform', + 'metadata.workerNodesType.keyword': 'workers', + 'profile.keyword': 'Profile', + 'uuid.keyword': 'uuid', + }, + }, + }, ]) + table.standardOptions.withOverrides([ { - "matcher": { - "id": "byName", - "options": "Average" + matcher: { + id: 'byName', + options: 'Average', }, - "properties": [ + properties: [ { - "id": "unit", - "value": "µs" - } - ] + id: 'unit', + value: 'µs', + }, + ], }, { - "matcher": { - "id": "byName", - "options": "messageSize" + matcher: { + id: 'byName', + options: 'messageSize', }, - "properties": [ + properties: [ { - "id": "unit", - "value": "bytes" - } - ] - } + id: 'unit', + value: 'bytes', + }, + ], + }, ]), }, barGauge: { @@ -316,26 +316,26 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn + barGauge.datasource.withType('elasticsearch') + barGauge.datasource.withUid('$datasource') + barGauge.options.reduceOptions.withValues(false) - + barGauge.options.reduceOptions.withCalcs(["lastNotNull"]) - + barGauge.options.reduceOptions.withFields("") - + barGauge.options.withOrientation("horizontal") - + barGauge.options.withDisplayMode("gradient") - + barGauge.options.withValueMode("color") - + barGauge.panelOptions.withRepeat("messageSize") - + barGauge.standardOptions.withMin("0") - + barGauge.standardOptions.color.withMode("palette-classic") + + barGauge.options.reduceOptions.withCalcs(['lastNotNull']) + + barGauge.options.reduceOptions.withFields('') + + barGauge.options.withOrientation('horizontal') + + barGauge.options.withDisplayMode('gradient') + + barGauge.options.withValueMode('color') + + barGauge.panelOptions.withRepeat('messageSize') + + barGauge.standardOptions.withMin('0') + + barGauge.standardOptions.color.withMode('palette-classic') + barGauge.gridPos.withX(gridPos.x) + barGauge.gridPos.withY(gridPos.y) + barGauge.gridPos.withH(gridPos.h) + barGauge.gridPos.withW(gridPos.w), - withThroughput(title, targets,gridPos): + withThroughput(title, targets, gridPos): self.base(title, targets, gridPos) - + barGauge.standardOptions.withUnit("Mbits"), + + barGauge.standardOptions.withUnit('Mbits'), - withLatency(title, targets,gridPos): + withLatency(title, targets, gridPos): self.base(title, targets, gridPos) - + barGauge.standardOptions.withUnit("µs"), + + barGauge.standardOptions.withUnit('µs'), }, timeSeries: { local timeSeries = g.panel.timeSeries, @@ -345,8 +345,8 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn base(title, targets, gridPos): timeSeries.new(title) + timeSeries.queryOptions.withTargets(targets) - + timeSeries.panelOptions.withRepeat("messageSize") - + timeSeries.panelOptions.withRepeatDirection("h") + + timeSeries.panelOptions.withRepeat('messageSize') + + timeSeries.panelOptions.withRepeatDirection('h') + timeSeries.datasource.withType('elasticsearch') + timeSeries.datasource.withUid('$datasource') + timeSeries.gridPos.withX(gridPos.x) @@ -354,25 +354,25 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn + timeSeries.gridPos.withH(gridPos.h) + timeSeries.gridPos.withW(gridPos.w) + custom.withLineWidth(2) - + custom.withGradientMode("hue") - + custom.withShowPoints("always") + + custom.withGradientMode('hue') + + custom.withShowPoints('always') + custom.withPointSize(10) + custom.withSpanNulls(true) + custom.withFillOpacity(0) + custom.withScaleDistribution({ - "type": "log", - "log": 2 - }) + type: 'log', + log: 2, + }) + custom.withAxisCenteredZero(false) + custom.withHideFrom({ - "tooltip": false, - "viz": false, - "legend": false - }) + tooltip: false, + viz: false, + legend: false, + }) + custom.withAxisGridShow(true) + custom.withLineStyle({ - "fill": "solid" - }) + fill: 'solid', + }) + options.tooltip.withMode('single') + options.tooltip.withSort('none') + options.legend.withShowLegend(true) @@ -380,38 +380,38 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn + options.legend.withDisplayMode('table') + options.legend.withCalcs(['lastNotNull']) + timeSeries.standardOptions.withOverrides([ - { - "matcher": { - "id": "byFrameRefID", - "options": "A" + { + matcher: { + id: 'byFrameRefID', + options: 'A', + }, + properties: [ + { + id: 'unit', + value: 'µs', + }, + ], }, - "properties": [ - { - "id": "unit", - "value": "µs" - } - ] - } - ]), + ]), withThroughputOverrides(title, targets, gridPos): self.base(title, targets, gridPos) - + options.legend.withSortBy("Last *") + + options.legend.withSortBy('Last *') + options.legend.withPlacement('right') + options.legend.withSortDesc(false) + timeSeries.standardOptions.withOverrides([ - { - "matcher": { - "id": "byFrameRefID", - "options": "A" + { + matcher: { + id: 'byFrameRefID', + options: 'A', + }, + properties: [ + { + id: 'unit', + value: 'Mbits', + }, + ], }, - "properties": [ - { - "id": "unit", - "value": "Mbits" - } - ] - } - ]), + ]), }, } diff --git a/assets/k8s-netperf/queries.libsonnet b/assets/k8s-netperf/queries.libsonnet index fa8ce73..883fcdb 100644 --- a/assets/k8s-netperf/queries.libsonnet +++ b/assets/k8s-netperf/queries.libsonnet @@ -4,209 +4,209 @@ local elasticsearch = g.query.elasticsearch; { all: { query(metric, aggregationMetric): - elasticsearch.withAlias("{{metadata.ocpVersion.keyword}} hostNetwork={{hostNetwork}} procs={{parallelism}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("messageSize") - + elasticsearch.bucketAggs.Terms.withId("2") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("parallelism") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("profile.keyword") - + elasticsearch.bucketAggs.Terms.withId("5") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("metadata.ocpVersion.keyword") - + elasticsearch.bucketAggs.Terms.withId("8") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("hostNetwork") - + elasticsearch.bucketAggs.Terms.withId("9") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("acrossAZ") - + elasticsearch.bucketAggs.Terms.withId("10") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("metadata.clusterName.keyword") - + elasticsearch.bucketAggs.Terms.withId("11") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.Terms.withField("metadata.mtu") - + elasticsearch.bucketAggs.Terms.withId("12") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField('timestamp') - + elasticsearch.bucketAggs.DateHistogram.withId("7") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("0") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField(aggregationMetric) - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid: $uuid AND parallelism: $parallelism AND profile: ' + metric + ' AND messageSize: $messageSize AND driver.keyword: $driver AND hostNetwork: $hostNetwork AND acrossAZ: false AND service: $service') - + elasticsearch.withTimeField('timestamp') + elasticsearch.withAlias('{{metadata.ocpVersion.keyword}} hostNetwork={{hostNetwork}} procs={{parallelism}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('messageSize') + + elasticsearch.bucketAggs.Terms.withId('2') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('parallelism') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('profile.keyword') + + elasticsearch.bucketAggs.Terms.withId('5') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('metadata.ocpVersion.keyword') + + elasticsearch.bucketAggs.Terms.withId('8') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('hostNetwork') + + elasticsearch.bucketAggs.Terms.withId('9') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('acrossAZ') + + elasticsearch.bucketAggs.Terms.withId('10') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('metadata.clusterName.keyword') + + elasticsearch.bucketAggs.Terms.withId('11') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.Terms.withField('metadata.mtu') + + elasticsearch.bucketAggs.Terms.withId('12') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('7') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('0') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField(aggregationMetric) + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid: $uuid AND parallelism: $parallelism AND profile: ' + metric + ' AND messageSize: $messageSize AND driver.keyword: $driver AND hostNetwork: $hostNetwork AND acrossAZ: false AND service: $service') + + elasticsearch.withTimeField('timestamp'), }, parallelismAll: { query(metric, aggregationMetric): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("uuid.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("profile.keyword") - + elasticsearch.bucketAggs.Terms.withId("4") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("messageSize") - + elasticsearch.bucketAggs.Terms.withId("5") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("tputMetric.keyword") - + elasticsearch.bucketAggs.Terms.withId("6") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("metadata.platform.keyword") - + elasticsearch.bucketAggs.Terms.withId("7") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("service") - + elasticsearch.bucketAggs.Terms.withId("8") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("ltcyMetric.keyword") - + elasticsearch.bucketAggs.Terms.withId("9") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.Terms.withField("hostNetwork") - + elasticsearch.bucketAggs.Terms.withId("11") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.Terms.withField("metadata.workerNodesType.keyword") - + elasticsearch.bucketAggs.Terms.withId("12") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.Terms.withField("metadata.clusterName.keyword") - + elasticsearch.bucketAggs.Terms.withId("13") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField(aggregationMetric) - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid: $uuid AND parallelism: $parallelism AND profile: ' + metric + ' AND messageSize: $messageSize AND driver.keyword: $driver AND metadata.platform: $platform AND hostNetwork: $hostNetwork AND service: $service') - + elasticsearch.withTimeField('timestamp') + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('uuid.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('profile.keyword') + + elasticsearch.bucketAggs.Terms.withId('4') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('messageSize') + + elasticsearch.bucketAggs.Terms.withId('5') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('tputMetric.keyword') + + elasticsearch.bucketAggs.Terms.withId('6') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('metadata.platform.keyword') + + elasticsearch.bucketAggs.Terms.withId('7') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('service') + + elasticsearch.bucketAggs.Terms.withId('8') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('ltcyMetric.keyword') + + elasticsearch.bucketAggs.Terms.withId('9') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.Terms.withField('hostNetwork') + + elasticsearch.bucketAggs.Terms.withId('11') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.Terms.withField('metadata.workerNodesType.keyword') + + elasticsearch.bucketAggs.Terms.withId('12') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.Terms.withField('metadata.clusterName.keyword') + + elasticsearch.bucketAggs.Terms.withId('13') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField(aggregationMetric) + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid: $uuid AND parallelism: $parallelism AND profile: ' + metric + ' AND messageSize: $messageSize AND driver.keyword: $driver AND metadata.platform: $platform AND hostNetwork: $hostNetwork AND service: $service') + + elasticsearch.withTimeField('timestamp'), }, summary: { query(metric, aggregationMetric): - elasticsearch.withAlias("") + elasticsearch.withAlias('') + elasticsearch.withBucketAggs([ ]) + elasticsearch.withMetrics([ elasticsearch.metrics.MetricAggregationWithSettings.RawData.withHide(false) - + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withType("raw_data") - + elasticsearch.metrics.MetricAggregationWithSettings.RawData.settings.withSize("500") + + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withType('raw_data') + + elasticsearch.metrics.MetricAggregationWithSettings.RawData.settings.withSize('500'), ]) + elasticsearch.withQuery('uuid: $uuid AND parallelism: $parallelism AND profile: ' + metric + ' AND messageSize: $messageSize AND driver.keyword: $driver AND metadata.platform: $platform AND hostNetwork: $hostNetwork AND service: $service') - + elasticsearch.withTimeField('timestamp') + + elasticsearch.withTimeField('timestamp'), }, metricCompare: { query(metric, aggregationMetric, hostNetwork, service): - elasticsearch.withAlias("{{$compare_by}} Procs: {{parallelism}}") + elasticsearch.withAlias('{{$compare_by}} Procs: {{parallelism}}') + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("parallelism") - + elasticsearch.bucketAggs.Terms.withId("1") + elasticsearch.bucketAggs.Terms.withField('parallelism') + + elasticsearch.bucketAggs.Terms.withId('1') + elasticsearch.bucketAggs.Terms.withType('terms') + elasticsearch.bucketAggs.Terms.settings.withOrder('asc') + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("$compare_by") - + elasticsearch.bucketAggs.Terms.withId("2") + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('$compare_by') + + elasticsearch.bucketAggs.Terms.withId('2') + elasticsearch.bucketAggs.Terms.withType('terms') + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), elasticsearch.bucketAggs.DateHistogram.withField('timestamp') - + elasticsearch.bucketAggs.DateHistogram.withId("3") + + elasticsearch.bucketAggs.DateHistogram.withId('3') + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), ]) + elasticsearch.withMetrics([ elasticsearch.metrics.MetricAggregationWithSettings.Average.withField(aggregationMetric) - + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withType("avg") + + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withType('avg'), ]) - + elasticsearch.withQuery('uuid: $uuid AND parallelism: $parallelism AND profile: ' + metric + ' AND messageSize: $messageSize AND driver.keyword: $driver AND hostNetwork: ' + hostNetwork + ' AND service: ' + service + ' AND acrossAZ: false' ) - + elasticsearch.withTimeField('timestamp') - } + + elasticsearch.withQuery('uuid: $uuid AND parallelism: $parallelism AND profile: ' + metric + ' AND messageSize: $messageSize AND driver.keyword: $driver AND hostNetwork: ' + hostNetwork + ' AND service: ' + service + ' AND acrossAZ: false') + + elasticsearch.withTimeField('timestamp'), + }, } diff --git a/assets/k8s-netperf/variables.libsonnet b/assets/k8s-netperf/variables.libsonnet index e5bdca3..8a50dfa 100644 --- a/assets/k8s-netperf/variables.libsonnet +++ b/assets/k8s-netperf/variables.libsonnet @@ -11,7 +11,7 @@ local var = g.dashboard.variable; + var.query.selectionOptions.withIncludeAll(false), platform: - var.query.new('platform', "{\"find\": \"terms\", \"field\": \"metadata.platform.keyword\"}") + var.query.new('platform', '{"find": "terms", "field": "metadata.platform.keyword"}') + var.query.withDatasourceFromVariable(self.datasource) + var.query.withRefresh(2) + var.query.selectionOptions.withMulti(true) @@ -19,7 +19,7 @@ local var = g.dashboard.variable; + var.query.generalOptions.withLabel('Platform'), workers: - var.query.new('workerNodesType', "{\"find\": \"terms\", \"field\": \"metadata.workerNodesType.keyword\", \"query\": \"metadata.platform.keyword: $platform\"}") + var.query.new('workerNodesType', '{"find": "terms", "field": "metadata.workerNodesType.keyword", "query": "metadata.platform.keyword: $platform"}') + var.query.withDatasourceFromVariable(self.datasource) + var.query.withRefresh(2) + var.query.selectionOptions.withMulti(false) @@ -27,7 +27,7 @@ local var = g.dashboard.variable; + var.query.generalOptions.withLabel('workers'), uuid: - var.query.new('uuid', "{\"find\": \"terms\", \"field\": \"uuid.keyword\", \"query\":\"metadata.platform.keyword: $platform AND metadata.workerNodesType.keyword: $workerNodesType\"}") + var.query.new('uuid', '{"find": "terms", "field": "uuid.keyword", "query":"metadata.platform.keyword: $platform AND metadata.workerNodesType.keyword: $workerNodesType"}') + var.query.withDatasourceFromVariable(self.datasource) + var.query.withRefresh(2) + var.query.selectionOptions.withMulti(true) @@ -47,7 +47,7 @@ local var = g.dashboard.variable; + var.custom.generalOptions.withLabel('service'), streams: - var.query.new('parallelism', "{\"find\": \"terms\", \"field\": \"parallelism\", \"query\":\"uuid: $uuid\"}") + var.query.new('parallelism', '{"find": "terms", "field": "parallelism", "query":"uuid: $uuid"}') + var.query.withDatasourceFromVariable(self.datasource) + var.query.withRefresh(2) + var.query.selectionOptions.withMulti(true) @@ -55,25 +55,25 @@ local var = g.dashboard.variable; + var.query.generalOptions.withLabel('streams'), throughput_profile: - var.query.new('throughput_profile', "{\"find\": \"terms\", \"field\": \"profile.keyword\", \"query\":\"uuid:$uuid\"}") + var.query.new('throughput_profile', '{"find": "terms", "field": "profile.keyword", "query":"uuid:$uuid"}') + var.query.withDatasourceFromVariable(self.datasource) - + var.query.withRegex(".*STREAM.*") + + var.query.withRegex('.*STREAM.*') + var.query.withRefresh(2) + var.query.selectionOptions.withMulti(true) + var.query.selectionOptions.withIncludeAll(true) + var.query.generalOptions.withLabel('Throughput profile'), latency_profile: - var.query.new('latency_profile', "{\"find\": \"terms\", \"field\": \"profile.keyword\", \"query\":\"uuid:$uuid\"}") + var.query.new('latency_profile', '{"find": "terms", "field": "profile.keyword", "query":"uuid:$uuid"}') + var.query.withDatasourceFromVariable(self.datasource) - + var.query.withRegex(".*RR.*") + + var.query.withRegex('.*RR.*') + var.query.withRefresh(2) + var.query.selectionOptions.withMulti(true) + var.query.selectionOptions.withIncludeAll(true) + var.query.generalOptions.withLabel('Latency profile'), messageSize: - var.query.new('messageSize', "{\"find\": \"terms\", \"field\": \"messageSize\",\"query\":\"uuid:$uuid\"}") + var.query.new('messageSize', '{"find": "terms", "field": "messageSize","query":"uuid:$uuid"}') + var.query.withDatasourceFromVariable(self.datasource) + var.query.withRefresh(2) + var.query.selectionOptions.withMulti(true) @@ -81,7 +81,7 @@ local var = g.dashboard.variable; + var.query.generalOptions.withLabel('messageSize'), driver: - var.query.new('driver', "{\"find\": \"terms\", \"field\": \"driver.keyword\",\"query\":\"uuid:$uuid\"}") + var.query.new('driver', '{"find": "terms", "field": "driver.keyword","query":"uuid:$uuid"}') + var.query.withDatasourceFromVariable(self.datasource) + var.query.withRefresh(1) + var.query.selectionOptions.withMulti(false) diff --git a/assets/k8s-perf/panels.libsonnet b/assets/k8s-perf/panels.libsonnet index 0aeed13..00e7176 100644 --- a/assets/k8s-perf/panels.libsonnet +++ b/assets/k8s-perf/panels.libsonnet @@ -1,76 +1,76 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; { - stat: { - local stat = g.panel.stat, - local options = stat.options, + stat: { + local stat = g.panel.stat, + local options = stat.options, - base(title, unit, targets, gridPos): - stat.new(title) - + stat.datasource.withType('prometheus') - + stat.datasource.withUid('$Datasource') - + stat.standardOptions.withUnit(unit) - + stat.queryOptions.withTargets(targets) - + stat.gridPos.withX(gridPos.x) - + stat.gridPos.withY(gridPos.y) - + stat.gridPos.withH(gridPos.h) - + stat.gridPos.withW(gridPos.w) - + options.withJustifyMode("auto") - + options.withGraphMode("none") - + options.text.withTitleSize(12) - + stat.standardOptions.color.withMode('thresholds') - + options.withColorMode('none'), + base(title, unit, targets, gridPos): + stat.new(title) + + stat.datasource.withType('prometheus') + + stat.datasource.withUid('$Datasource') + + stat.standardOptions.withUnit(unit) + + stat.queryOptions.withTargets(targets) + + stat.gridPos.withX(gridPos.x) + + stat.gridPos.withY(gridPos.y) + + stat.gridPos.withH(gridPos.h) + + stat.gridPos.withW(gridPos.w) + + options.withJustifyMode('auto') + + options.withGraphMode('none') + + options.text.withTitleSize(12) + + stat.standardOptions.color.withMode('thresholds') + + options.withColorMode('none'), - genericStatLegendPanel(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + stat.options.reduceOptions.withCalcs([ - 'last' - ]) - }, + genericStatLegendPanel(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + stat.options.reduceOptions.withCalcs([ + 'last', + ]), + }, - timeSeries: { - local timeSeries = g.panel.timeSeries, - local custom = timeSeries.fieldConfig.defaults.custom, - local options = timeSeries.options, + timeSeries: { + local timeSeries = g.panel.timeSeries, + local custom = timeSeries.fieldConfig.defaults.custom, + local options = timeSeries.options, - base(title, unit, targets, gridPos): - timeSeries.new(title) - + timeSeries.queryOptions.withTargets(targets) - + timeSeries.datasource.withType('prometheus') - + timeSeries.datasource.withUid('$Datasource') - + timeSeries.standardOptions.withUnit(unit) - + timeSeries.gridPos.withX(gridPos.x) - + timeSeries.gridPos.withY(gridPos.y) - + timeSeries.gridPos.withH(gridPos.h) - + timeSeries.gridPos.withW(gridPos.w) - + custom.withDrawStyle("line") - + custom.withLineInterpolation("linear") - + custom.withBarAlignment(0) - + custom.withLineWidth(1) - + custom.withFillOpacity(10) - + custom.withGradientMode("none") - + custom.withSpanNulls(false) - + custom.withPointSize(5) - + custom.withSpanNulls(false) - + custom.stacking.withMode("none") - + custom.withShowPoints('never') - + options.tooltip.withMode('multi') - + options.tooltip.withSort('desc') - + options.legend.withShowLegend(true) - + options.legend.withPlacement('bottom'), + base(title, unit, targets, gridPos): + timeSeries.new(title) + + timeSeries.queryOptions.withTargets(targets) + + timeSeries.datasource.withType('prometheus') + + timeSeries.datasource.withUid('$Datasource') + + timeSeries.standardOptions.withUnit(unit) + + timeSeries.gridPos.withX(gridPos.x) + + timeSeries.gridPos.withY(gridPos.y) + + timeSeries.gridPos.withH(gridPos.h) + + timeSeries.gridPos.withW(gridPos.w) + + custom.withDrawStyle('line') + + custom.withLineInterpolation('linear') + + custom.withBarAlignment(0) + + custom.withLineWidth(1) + + custom.withFillOpacity(10) + + custom.withGradientMode('none') + + custom.withSpanNulls(false) + + custom.withPointSize(5) + + custom.withSpanNulls(false) + + custom.stacking.withMode('none') + + custom.withShowPoints('never') + + options.tooltip.withMode('multi') + + options.tooltip.withSort('desc') + + options.legend.withShowLegend(true) + + options.legend.withPlacement('bottom'), - genericTimeSeriesPanel(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + options.legend.withCalcs([]) - + options.legend.withDisplayMode('table'), + genericTimeSeriesPanel(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + options.legend.withCalcs([]) + + options.legend.withDisplayMode('table'), - genericTimeSeriesLegendPanel(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + options.legend.withCalcs([ - "mean", - "max" - ]) - + options.legend.withDisplayMode('table'), + genericTimeSeriesLegendPanel(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + options.legend.withCalcs([ + 'mean', + 'max', + ]) + + options.legend.withDisplayMode('table'), - }, -} \ No newline at end of file + }, +} diff --git a/assets/k8s-perf/queries.libsonnet b/assets/k8s-perf/queries.libsonnet index 5bc9a12..5045354 100644 --- a/assets/k8s-perf/queries.libsonnet +++ b/assets/k8s-perf/queries.libsonnet @@ -1,138 +1,138 @@ -local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local variables = import './variables.libsonnet'; +local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local generateTimeSeriesQuery(query, legend) = [ - local prometheusQuery = g.query.prometheus; - prometheusQuery.new('$'+variables.Datasource.name, query) - + prometheusQuery.withFormat('time_series') - + prometheusQuery.withIntervalFactor(2) - + prometheusQuery.withLegendFormat(legend), + local prometheusQuery = g.query.prometheus; + prometheusQuery.new('$' + variables.Datasource.name, query) + + prometheusQuery.withFormat('time_series') + + prometheusQuery.withIntervalFactor(2) + + prometheusQuery.withLegendFormat(legend), ]; { - currentNodeCount: { - query(): - generateTimeSeriesQuery('sum(kube_node_info{})','Number of nodes') - + generateTimeSeriesQuery('sum(kube_node_status_condition{status="true"}) by (condition) > 0','Node: {{ condition }}') - }, - - currentNamespaceCount: { - query(): - generateTimeSeriesQuery('sum(kube_namespace_status_phase) by (phase)','{{ phase }}') - }, - - currentPodCount: { - query(): - generateTimeSeriesQuery('sum(kube_pod_status_phase{}) by (phase) > 0','{{ phase}} Pods') - }, - - numberOfNodes: { - query(): - generateTimeSeriesQuery('sum(kube_node_info{})','Number of nodes') - + generateTimeSeriesQuery('sum(kube_node_status_condition{status="true"}) by (condition) > 0','Node: {{ condition }}') - }, - - namespaceCount: { - query(): - generateTimeSeriesQuery('sum(kube_namespace_status_phase) by (phase) > 0','{{ phase }} namespaces') - }, - - podCount: { - query(): - generateTimeSeriesQuery('sum(kube_pod_status_phase{}) by (phase)','{{phase}} pods') - }, - - secretAndConfigMapCount: { - query(): - generateTimeSeriesQuery('count(kube_secret_info{})','secrets') - + generateTimeSeriesQuery('count(kube_configmap_info{})','Configmaps') - }, - deployCount: { - query(): - generateTimeSeriesQuery('count(kube_deployment_labels{})','Deployments') - }, - - serviceCount: { - query(): - generateTimeSeriesQuery('count(kube_service_info{})','Services') - }, - - top10ContainerRSS: { - query(): - generateTimeSeriesQuery('topk(10, container_memory_rss{namespace!="",container!="POD",name!=""})','{{ namespace }} - {{ name }}') - }, - - top10ContainerCPU: { - query(): - generateTimeSeriesQuery('topk(10,irate(container_cpu_usage_seconds_total{namespace!="",container!="POD",name!=""}[$interval])*100)','{{ namespace }} - {{ name }}') - }, - - goroutinesCount: { - query(): - generateTimeSeriesQuery('topk(10, sum(go_goroutines{}) by (job,instance))','{{ job }} - {{ instance }}') - }, - - podDistribution: { - query(): - generateTimeSeriesQuery('count(kube_pod_info{}) by (exported_node)','{{ node }}') - }, - - basicCPU: { - query(nodeName): - generateTimeSeriesQuery('sum by (instance, mode)(rate(node_cpu_seconds_total{node=~"' + nodeName + '",job=~".*"}[$interval])) * 100','Busy {{mode}}') - }, - - systemMemory: { - query(nodeName): - generateTimeSeriesQuery('node_memory_Active_bytes{node=~"' + nodeName + '"}','Active') - + generateTimeSeriesQuery('node_memory_MemTotal_bytes{node=~"' + nodeName + '"}','Total') - + generateTimeSeriesQuery('node_memory_Cached_bytes{node=~"' + nodeName + '"} + node_memory_Buffers_bytes{node=~"' + nodeName + '"}','Cached + Buffers') - + generateTimeSeriesQuery('node_memory_MemAvailable_bytes{node=~"' + nodeName + '"}','Available') - }, - - diskThroughput: { - query(nodeName): - generateTimeSeriesQuery('rate(node_disk_read_bytes_total{device=~"$block_device",node=~"' + nodeName + '"}[$interval])','{{ device }} - read') - + generateTimeSeriesQuery('rate(node_disk_written_bytes_total{device=~"$block_device",node=~"' + nodeName + '"}[$interval])','{{ device }} - write') - }, - - diskIOPS: { - query(nodeName): - generateTimeSeriesQuery('rate(node_disk_reads_completed_total{device=~"$block_device",node=~"' + nodeName + '"}[$interval])','{{ device }} - read') - + generateTimeSeriesQuery('rate(node_disk_writes_completed_total{device=~"$block_device",node=~"' + nodeName + '"}[$interval])','{{ device }} - write') - }, - - networkUtilization: { - query(nodeName): - generateTimeSeriesQuery('rate(node_network_receive_bytes_total{node=~"' + nodeName + '",device=~"$net_device"}[$interval]) * 8','{{instance}} - {{device}} - RX') - + generateTimeSeriesQuery('rate(node_network_transmit_bytes_total{node=~"' + nodeName + '",device=~"$net_device"}[$interval]) * 8','{{instance}} - {{device}} - TX') - }, - - networkPackets: { - query(nodeName): - generateTimeSeriesQuery('rate(node_network_receive_packets_total{node=~"' + nodeName + '",device=~"$net_device"}[$interval])','{{instance}} - {{device}} - RX') - + generateTimeSeriesQuery('rate(node_network_transmit_packets_total{node=~"' + nodeName + '",device=~"$net_device"}[$interval])','{{instance}} - {{device}} - TX') - }, - - networkDrop: { - query(nodeName): - generateTimeSeriesQuery('topk(10, rate(node_network_receive_drop_total{node=~"' + nodeName + '"}[$interval]))','rx-drop-{{ device }}') - + generateTimeSeriesQuery('topk(10,rate(node_network_transmit_drop_total{node=~"' + nodeName + '"}[$interval]))','tx-drop-{{ device }}') - }, - - conntrackStats: { - query(nodeName): - generateTimeSeriesQuery('node_nf_conntrack_entries{node=~"' + nodeName + '"}','conntrack_entries') - + generateTimeSeriesQuery('node_nf_conntrack_entries_limit{node=~"' + nodeName + '"}','conntrack_limit') - }, - - top10ContainersCPU: { - query(nodeName): - generateTimeSeriesQuery('topk(10, sum(irate(container_cpu_usage_seconds_total{container!="POD",name!="",instance=~"' + nodeName + '",namespace!="",namespace=~"$namespace"}[$interval])) by (pod,container,namespace,name,service) * 100)','{{ pod }}: {{ container }}') - }, - - top10ContainersRSS: { - query(nodeName): - generateTimeSeriesQuery('topk(10, container_memory_rss{container!="POD",name!="",instance=~"' + nodeName + '",namespace!="",namespace=~"$namespace"})','{{ pod }}: {{ container }}') - } -} \ No newline at end of file + currentNodeCount: { + query(): + generateTimeSeriesQuery('sum(kube_node_info{})', 'Number of nodes') + + generateTimeSeriesQuery('sum(kube_node_status_condition{status="true"}) by (condition) > 0', 'Node: {{ condition }}'), + }, + + currentNamespaceCount: { + query(): + generateTimeSeriesQuery('sum(kube_namespace_status_phase) by (phase)', '{{ phase }}'), + }, + + currentPodCount: { + query(): + generateTimeSeriesQuery('sum(kube_pod_status_phase{}) by (phase) > 0', '{{ phase}} Pods'), + }, + + numberOfNodes: { + query(): + generateTimeSeriesQuery('sum(kube_node_info{})', 'Number of nodes') + + generateTimeSeriesQuery('sum(kube_node_status_condition{status="true"}) by (condition) > 0', 'Node: {{ condition }}'), + }, + + namespaceCount: { + query(): + generateTimeSeriesQuery('sum(kube_namespace_status_phase) by (phase) > 0', '{{ phase }} namespaces'), + }, + + podCount: { + query(): + generateTimeSeriesQuery('sum(kube_pod_status_phase{}) by (phase)', '{{phase}} pods'), + }, + + secretAndConfigMapCount: { + query(): + generateTimeSeriesQuery('count(kube_secret_info{})', 'secrets') + + generateTimeSeriesQuery('count(kube_configmap_info{})', 'Configmaps'), + }, + deployCount: { + query(): + generateTimeSeriesQuery('count(kube_deployment_labels{})', 'Deployments'), + }, + + serviceCount: { + query(): + generateTimeSeriesQuery('count(kube_service_info{})', 'Services'), + }, + + top10ContainerRSS: { + query(): + generateTimeSeriesQuery('topk(10, container_memory_rss{namespace!="",container!="POD",name!=""})', '{{ namespace }} - {{ name }}'), + }, + + top10ContainerCPU: { + query(): + generateTimeSeriesQuery('topk(10,irate(container_cpu_usage_seconds_total{namespace!="",container!="POD",name!=""}[$interval])*100)', '{{ namespace }} - {{ name }}'), + }, + + goroutinesCount: { + query(): + generateTimeSeriesQuery('topk(10, sum(go_goroutines{}) by (job,instance))', '{{ job }} - {{ instance }}'), + }, + + podDistribution: { + query(): + generateTimeSeriesQuery('count(kube_pod_info{}) by (exported_node)', '{{ node }}'), + }, + + basicCPU: { + query(nodeName): + generateTimeSeriesQuery('sum by (instance, mode)(rate(node_cpu_seconds_total{node=~"' + nodeName + '",job=~".*"}[$interval])) * 100', 'Busy {{mode}}'), + }, + + systemMemory: { + query(nodeName): + generateTimeSeriesQuery('node_memory_Active_bytes{node=~"' + nodeName + '"}', 'Active') + + generateTimeSeriesQuery('node_memory_MemTotal_bytes{node=~"' + nodeName + '"}', 'Total') + + generateTimeSeriesQuery('node_memory_Cached_bytes{node=~"' + nodeName + '"} + node_memory_Buffers_bytes{node=~"' + nodeName + '"}', 'Cached + Buffers') + + generateTimeSeriesQuery('node_memory_MemAvailable_bytes{node=~"' + nodeName + '"}', 'Available'), + }, + + diskThroughput: { + query(nodeName): + generateTimeSeriesQuery('rate(node_disk_read_bytes_total{device=~"$block_device",node=~"' + nodeName + '"}[$interval])', '{{ device }} - read') + + generateTimeSeriesQuery('rate(node_disk_written_bytes_total{device=~"$block_device",node=~"' + nodeName + '"}[$interval])', '{{ device }} - write'), + }, + + diskIOPS: { + query(nodeName): + generateTimeSeriesQuery('rate(node_disk_reads_completed_total{device=~"$block_device",node=~"' + nodeName + '"}[$interval])', '{{ device }} - read') + + generateTimeSeriesQuery('rate(node_disk_writes_completed_total{device=~"$block_device",node=~"' + nodeName + '"}[$interval])', '{{ device }} - write'), + }, + + networkUtilization: { + query(nodeName): + generateTimeSeriesQuery('rate(node_network_receive_bytes_total{node=~"' + nodeName + '",device=~"$net_device"}[$interval]) * 8', '{{instance}} - {{device}} - RX') + + generateTimeSeriesQuery('rate(node_network_transmit_bytes_total{node=~"' + nodeName + '",device=~"$net_device"}[$interval]) * 8', '{{instance}} - {{device}} - TX'), + }, + + networkPackets: { + query(nodeName): + generateTimeSeriesQuery('rate(node_network_receive_packets_total{node=~"' + nodeName + '",device=~"$net_device"}[$interval])', '{{instance}} - {{device}} - RX') + + generateTimeSeriesQuery('rate(node_network_transmit_packets_total{node=~"' + nodeName + '",device=~"$net_device"}[$interval])', '{{instance}} - {{device}} - TX'), + }, + + networkDrop: { + query(nodeName): + generateTimeSeriesQuery('topk(10, rate(node_network_receive_drop_total{node=~"' + nodeName + '"}[$interval]))', 'rx-drop-{{ device }}') + + generateTimeSeriesQuery('topk(10,rate(node_network_transmit_drop_total{node=~"' + nodeName + '"}[$interval]))', 'tx-drop-{{ device }}'), + }, + + conntrackStats: { + query(nodeName): + generateTimeSeriesQuery('node_nf_conntrack_entries{node=~"' + nodeName + '"}', 'conntrack_entries') + + generateTimeSeriesQuery('node_nf_conntrack_entries_limit{node=~"' + nodeName + '"}', 'conntrack_limit'), + }, + + top10ContainersCPU: { + query(nodeName): + generateTimeSeriesQuery('topk(10, sum(irate(container_cpu_usage_seconds_total{container!="POD",name!="",instance=~"' + nodeName + '",namespace!="",namespace=~"$namespace"}[$interval])) by (pod,container,namespace,name,service) * 100)', '{{ pod }}: {{ container }}'), + }, + + top10ContainersRSS: { + query(nodeName): + generateTimeSeriesQuery('topk(10, container_memory_rss{container!="POD",name!="",instance=~"' + nodeName + '",namespace!="",namespace=~"$namespace"})', '{{ pod }}: {{ container }}'), + }, +} diff --git a/assets/k8s-perf/variables.libsonnet b/assets/k8s-perf/variables.libsonnet index 9ea1ecc..7c3ef36 100644 --- a/assets/k8s-perf/variables.libsonnet +++ b/assets/k8s-perf/variables.libsonnet @@ -1,54 +1,54 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; -local var = g.dashboard.variable; +local var = g.dashboard.variable; { - Datasource: - var.datasource.new('Datasource','prometheus') - + var.datasource.withRegex('') - + var.query.withRefresh(1) - + var.query.selectionOptions.withIncludeAll(false) - + var.query.selectionOptions.withMulti(false), + Datasource: + var.datasource.new('Datasource', 'prometheus') + + var.datasource.withRegex('') + + var.query.withRefresh(1) + + var.query.selectionOptions.withIncludeAll(false) + + var.query.selectionOptions.withMulti(false), - _worker_node: - var.query.new('_worker_node','label_values(kube_node_labels{}, exported_node)') - + var.query.generalOptions.withLabel('Worker') - + var.query.withSort(0) - + var.query.withRefresh(2) - + var.query.selectionOptions.withIncludeAll(false) - + var.query.selectionOptions.withMulti(true), - - namespace: - var.query.new('namespace','label_values(kube_pod_info, exported_namespace)') - + var.query.generalOptions.withLabel('Namespace') - + var.query.withSort(0) - + var.query.withRefresh(2) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.selectionOptions.withMulti(false), + _worker_node: + var.query.new('_worker_node', 'label_values(kube_node_labels{}, exported_node)') + + var.query.generalOptions.withLabel('Worker') + + var.query.withSort(0) + + var.query.withRefresh(2) + + var.query.selectionOptions.withIncludeAll(false) + + var.query.selectionOptions.withMulti(true), - block_device: - var.query.new('block_device','label_values(node_disk_written_bytes_total,device)') - + var.query.generalOptions.withLabel('Block device') - + var.query.withSort(0) - + var.datasource.withRegex('/^(?:(?!dm|rb).)*$/') - + var.query.withRefresh(2) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.selectionOptions.withMulti(true), - - net_device: - var.query.new('net_device','label_values(node_network_receive_bytes_total,device)') - + var.query.generalOptions.withLabel('Network device') - + var.query.withSort(0) - + var.datasource.withRegex('/^((br|en|et).*)$/') - + var.query.withRefresh(2) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.selectionOptions.withMulti(true), + namespace: + var.query.new('namespace', 'label_values(kube_pod_info, exported_namespace)') + + var.query.generalOptions.withLabel('Namespace') + + var.query.withSort(0) + + var.query.withRefresh(2) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.selectionOptions.withMulti(false), - interval: - var.interval.new('interval',['2m','3m','4m','5m']) - + var.query.withDatasourceFromVariable(self.Datasource) - + var.interval.generalOptions.withLabel('interval') - + var.interval.withAutoOption(count=30, minInterval='10s') - + var.query.withRefresh(2) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(false) -} \ No newline at end of file + block_device: + var.query.new('block_device', 'label_values(node_disk_written_bytes_total,device)') + + var.query.generalOptions.withLabel('Block device') + + var.query.withSort(0) + + var.datasource.withRegex('/^(?:(?!dm|rb).)*$/') + + var.query.withRefresh(2) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.selectionOptions.withMulti(true), + + net_device: + var.query.new('net_device', 'label_values(node_network_receive_bytes_total,device)') + + var.query.generalOptions.withLabel('Network device') + + var.query.withSort(0) + + var.datasource.withRegex('/^((br|en|et).*)$/') + + var.query.withRefresh(2) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.selectionOptions.withMulti(true), + + interval: + var.interval.new('interval', ['2m', '3m', '4m', '5m']) + + var.query.withDatasourceFromVariable(self.Datasource) + + var.interval.generalOptions.withLabel('interval') + + var.interval.withAutoOption(count=30, minInterval='10s') + + var.query.withRefresh(2) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(false), +} diff --git a/assets/kube-burner-report-mode/panels.libsonnet b/assets/kube-burner-report-mode/panels.libsonnet index a1d5c11..ffe0477 100644 --- a/assets/kube-burner-report-mode/panels.libsonnet +++ b/assets/kube-burner-report-mode/panels.libsonnet @@ -1,475 +1,475 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; { - table: { - local table = g.panel.table, - local options = table.options, - - base(title, unit, targets, gridPos): - table.new(title) - + table.datasource.withType('elasticsearch') - + table.datasource.withUid('$Datasource') - + table.standardOptions.withUnit(unit) - + table.queryOptions.withTargets(targets) - + table.gridPos.withX(gridPos.x) - + table.gridPos.withY(gridPos.y) - + table.gridPos.withH(gridPos.h) - + table.gridPos.withW(gridPos.w), - - withPagination(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + options.footer.TableFooterOptions.withEnablePagination(true), - - withBenchmarkOverview(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + table.queryOptions.withTransformations([ - { - "id": "organize", - "options": { - "excludeByName": { - "_id": true, - "_index": true, - "_type": true, - "benchmark": false, - "clustertype": true, - "endDate": true, - "end_date": true, - "highlight": true, - "jobConfig.cleanup": true, - "jobConfig.errorOnVerify": true, - "jobConfig.jobIterationDelay": true, - "jobConfig.jobIterations": false, - "jobConfig.jobPause": true, - "jobConfig.maxWaitTimeout": true, - "jobConfig.namespace": true, - "jobConfig.namespaced": true, - "jobConfig.namespacedIterations": false, - "jobConfig.objects": true, - "jobConfig.preLoadPeriod": true, - "jobConfig.verifyObjects": true, - "jobConfig.waitFor": true, - "jobConfig.waitForDeletion": true, - "jobConfig.waitWhenFinished": true, - "k8sVersion": true, - "metricName": true, - "ocp_version": true, - "platform": false, - "sdn_type": false, - "sort": true, - "timestamp": true, - "total_nodes": false, - "uuid": false, - "workload": true, - "workload_nodes_count": true, - "workload_nodes_type": true - }, - "indexByName": { - "_id": 1, - "_index": 2, - "_type": 3, - "benchmark": 5, - "clusterName": 8, - "endDate": 9, - "highlight": 6, - "infraNodesCount": 20, - "infraNodesType": 21, - "k8sVersion": 10, - "masterNodesType": 16, - "metricName": 13, - "ocpVersion": 11, - "passed": 15, - "platform": 12, - "sdnType": 14, - "sort": 7, - "timestamp": 0, - "totalNodes": 17, - "uuid": 4, - "workerNodesCount": 18, - "workerNodesType": 19 - }, - "renameByName": { - "_type": "", - "clusterName": "Cluster", - "elapsedTime": "Elapsed time", - "endDate": "", - "infraNodesCount": "infra count", - "infraNodesType": "infra type", - "infra_nodes_count": "Infra nodes", - "infra_nodes_type": "Infra flavor", - "jobConfig.burst": "Burst", - "jobConfig.cleanup": "", - "jobConfig.errorOnVerify": "errorOnVerify", - "jobConfig.jobIterationDelay": "jobIterationDelay", - "jobConfig.jobIterations": "Iterations", - "jobConfig.jobPause": "jobPause", - "jobConfig.jobType": "Job Type", - "jobConfig.maxWaitTimeout": "maxWaitTImeout", - "jobConfig.name": "Name", - "jobConfig.namespace": "namespacePrefix", - "jobConfig.namespaced": "", - "jobConfig.namespacedIterations": "Namespaced iterations", - "jobConfig.objects": "", - "jobConfig.podWait": "podWait", - "jobConfig.preLoadImages": "Preload Images", - "jobConfig.preLoadPeriod": "", - "jobConfig.qps": "QPS", - "jobConfig.verifyObjects": "", - "k8sVersion": "k8s version", - "k8s_version": "k8s version", - "masterNodesType": "master type", - "master_nodes_count": "Master nodes", - "master_nodes_type": "Masters flavor", - "metricName": "", - "ocpVersion": "OCP version", - "passed": "Passed", - "platform": "Platform", - "result": "Result", - "sdnType": "SDN", - "sdn_type": "SDN", - "timestamp": "", - "totalNodes": "total nodes", - "total_nodes": "Total nodes", - "uuid": "UUID", - "workerNodesCount": "worker count", - "workerNodesType": "worker type", - "worker_nodes_count": "Worker nodes", - "worker_nodes_type": "Workers flavor", - "workload": "", - "workload_nodes_count": "Workload nodes", - "workload_nodes_type": "Workload flavor" - } - } - } - ]) - + table.standardOptions.withOverrides([ - { - "matcher": { - "id": "byName", - "options": "passed" - }, - "properties": [ - { - "id": "custom.cellOptions", - "value": { - "mode": "basic", - "type": "color-background" - } - } - ] - } - ]) - + table.standardOptions.withMappings([ - { - "options": { - "passed": { - "color": "green", - "index": 0 - } - }, - "type": "value" - } - ]) - + table.standardOptions.thresholds.withSteps([ - { - "color": "green", - "value": null - } - ]), - - withGarbageCollection(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + table.queryOptions.withTransformations([ - { - "id": "organize", - "options": { - "excludeByName": { - "_id": true, - "_index": true, - "_type": true, - "highlight": true, - "jobConfig.churnDelay": true, - "jobConfig.churnDuration": true, - "jobConfig.churnPercent": true, - "jobConfig.cleanup": true, - "jobConfig.errorOnVerify": true, - "jobConfig.iterationsPerNamespace": true, - "jobConfig.jobIterationDelay": true, - "jobConfig.jobIterations": false, - "jobConfig.jobPause": true, - "jobConfig.jobType": true, - "jobConfig.maxWaitTimeout": true, - "jobConfig.name": false, - "jobConfig.namespace": true, - "jobConfig.namespaceLabels.pod-security.kubernetes.io/audit": true, - "jobConfig.namespaceLabels.pod-security.kubernetes.io/enforce": true, - "jobConfig.namespaceLabels.pod-security.kubernetes.io/warn": true, - "jobConfig.namespaceLabels.security.openshift.io/scc.podSecurityLabelSync": true, - "jobConfig.namespaced": true, - "jobConfig.namespacedIterations": true, - "jobConfig.objects": true, - "jobConfig.podWait": true, - "jobConfig.preLoadImages": true, - "jobConfig.preLoadPeriod": true, - "jobConfig.verifyObjects": true, - "jobConfig.waitFor": true, - "jobConfig.waitForDeletion": true, - "jobConfig.waitWhenFinished": true, - "metadata.cloud-bulldozer": true, - "metadata.k8sVersion": true, - "metadata.ocpMajorVersion": true, - "metadata.ocpVersion": true, - "metadata.platform": true, - "metadata.sdnType": true, - "metadata.totalNodes": true, - "metricName": true, - "sort": true, - "timestamp": false, - "uuid": false - }, - "indexByName": { - "_id": 2, - "_index": 3, - "_type": 4, - "elapsedTime": 8, - "highlight": 19, - "jobConfig.burst": 7, - "jobConfig.churnDelay": 20, - "jobConfig.churnDuration": 21, - "jobConfig.churnPercent": 22, - "jobConfig.cleanup": 11, - "jobConfig.errorOnVerify": 12, - "jobConfig.iterationsPerNamespace": 23, - "jobConfig.jobIterations": 9, - "jobConfig.jobType": 10, - "jobConfig.maxWaitTimeout": 13, - "jobConfig.name": 5, - "jobConfig.namespace": 14, - "jobConfig.preLoadImages": 24, - "jobConfig.preLoadPeriod": 25, - "jobConfig.qps": 6, - "jobConfig.verifyObjects": 15, - "jobConfig.waitForDeletion": 16, - "jobConfig.waitWhenFinished": 17, - "metadata.k8sVersion": 26, - "metadata.ocpMajorVersion": 27, - "metadata.ocpVersion": 28, - "metadata.platform": 29, - "metadata.sdnType": 30, - "metadata.totalNodes": 31, - "metricName": 18, - "sort": 32, - "timestamp": 1, - "uuid": 0, - "version": 33 - }, - "renameByName": { - "_type": "", - "elapsedTime": "Elapsed time", - "elapsedTimeNs": "Elapsed Time", - "endTimestamp": "", - "highlight": "", - "jobConfig.burst": "Burst", - "jobConfig.churn": "Churn", - "jobConfig.churnDelay": "", - "jobConfig.churnDeletionStrategy": "Churn Deletion strategy", - "jobConfig.cleanup": "", - "jobConfig.errorOnVerify": "errorOnVerify", - "jobConfig.iterationsPerNamespace": "iterationsPerNs", - "jobConfig.jobIterationDelay": "jobIterationDelay", - "jobConfig.jobIterations": "Iterations", - "jobConfig.jobPause": "jobPause", - "jobConfig.jobType": "Job Type", - "jobConfig.maxWaitTimeout": "maxWaitTImeout", - "jobConfig.name": "Name", - "jobConfig.namespace": "namespacePrefix", - "jobConfig.namespaceLabels.pod-security.kubernetes.io/audit": "", - "jobConfig.namespaced": "", - "jobConfig.namespacedIterations": "Namespaced iterations", - "jobConfig.objects": "", - "jobConfig.podWait": "podWait", - "jobConfig.preLoadImages": "Preload Images", - "jobConfig.preLoadPeriod": "", - "jobConfig.qps": "QPS", - "jobConfig.verifyObjects": "", - "metadata.ocpMajorVersion": "Major version", - "metadata.platform": "Platform", - "metricName": "", - "timestamp": "Date", - "uuid": "UUID", - "version": "Kube-burner version" - } - } - } - ]) - + table.standardOptions.withOverrides([ - { - "matcher": { - "id": "byName", - "options": "Elapsed time" - }, - "properties": [ - { - "id": "unit", - "value": "s" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Elapsed Time" - }, - "properties": [ - { - "id": "unit", - "value": "ns" - } - ] - } - ]) - + table.standardOptions.thresholds.withSteps([ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ]) - }, - - barGauge: { - local bargauge = g.panel.barGauge, - local options = bargauge.options, - - base(title, unit, targets, gridPos): - bargauge.new(title) - + bargauge.queryOptions.withTargets(targets) - + bargauge.datasource.withType('elasticsearch') - + bargauge.datasource.withUid('$Datasource') - + bargauge.standardOptions.withUnit(unit) - + bargauge.gridPos.withX(gridPos.x) - + bargauge.gridPos.withY(gridPos.y) - + bargauge.gridPos.withH(gridPos.h) - + bargauge.gridPos.withW(gridPos.w) - + options.withOrientation('horizontal') - + options.withDisplayMode('gradient') - + options.withValueMode('color') - + options.withShowUnfilled(true) - + options.withMinVizWidth(0) - + options.withMinVizHeight(10) - + options.text.withTitleSize(12), - - withnodeCPUUsage(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + bargauge.panelOptions.withRepeat('node_roles') - + bargauge.standardOptions.withMin(0) - + options.reduceOptions.withCalcs([ - 'lastNotNull', - ]), - - withnodeMemoryUsage(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + bargauge.panelOptions.withRepeat('node_roles') - + bargauge.standardOptions.withMin(5) - + options.reduceOptions.withCalcs([ - 'lastNotNull', - ]) - + bargauge.standardOptions.color.withFixedColor("dark-red") - + bargauge.standardOptions.color.withMode("palette-classic"), - - withP99PodReadyLatency(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + bargauge.standardOptions.withMin(0) - + options.reduceOptions.withCalcs([ - 'lastNotNull', - ]) - + bargauge.standardOptions.color.withMode("palette-classic"), - - etcdCPUusage(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + options.withMinVizHeight(0) - + options.withMinVizWidth(10) - + options.reduceOptions.withCalcs([ - 'lastNotNull', - ]) - + bargauge.standardOptions.color.withMode("palette-classic"), - - - }, - - barChart: { - local barchart = g.panel.barChart, - local options = barchart.options, - local custom = barchart.fieldConfig.defaults.custom, - - base(title, unit, targets, gridPos): - barchart.new(title) - + barchart.datasource.withType('elasticsearch') - + barchart.datasource.withUid('$Datasource') - + barchart.standardOptions.withUnit(unit) - + barchart.queryOptions.withTargets(targets) - + barchart.gridPos.withX(gridPos.x) - + barchart.gridPos.withY(gridPos.y) - + barchart.gridPos.withH(gridPos.h) - + barchart.gridPos.withW(gridPos.w), - - BarchartOptionSettings(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + options.legend.withDisplayMode("list") - + options.legend.withPlacement("bottom") - + options.legend.withShowLegend(true) - + options.withOrientation('horizontal') - + options.withBarWidth(0.97) - + options.withGroupWidth(0.7), - - ReadOnlyAPIrequestP99latency(title, unit, targets, gridPos): - self.BarchartOptionSettings(title, unit, targets, gridPos) - + custom.scaleDistribution.withLog(2) - + custom.scaleDistribution.withType('log'), - - - maxClusterCPUusageRatio(title, unit, targets, gridPos): - self.BarchartOptionSettings(title, unit, targets, gridPos) - + custom.scaleDistribution.withType('linear'), - - etcdScaleDistribution(title, unit, targets, gridPos): - self.BarchartOptionSettings(title, unit, targets, gridPos) - + custom.scaleDistribution.withLog(10) - + custom.scaleDistribution.withType('log'), - - etcdroundtrip(title, unit, targets, gridPos): - self.BarchartOptionSettings(title, unit, targets, gridPos) - + custom.scaleDistribution.withLog(10) - + custom.scaleDistribution.withType('log') - + barchart.standardOptions.color.withMode('continuous-RdYlGr'), - - ComponentRepeatPanelsBlue(title, unit, targets, gridPos): - self.BarchartOptionSettings(title, unit, targets, gridPos) - + custom.scaleDistribution.withLog(2) - + custom.scaleDistribution.withType('log') - + barchart.standardOptions.color.withMode('fixed') - + barchart.standardOptions.color.withFixedColor('blue'), - - ComponentRepeatPanelsRed(title, unit, targets, gridPos): - self.BarchartOptionSettings(title, unit, targets, gridPos) - + custom.scaleDistribution.withLog(2) - + custom.scaleDistribution.withType('log') - + barchart.standardOptions.color.withMode('fixed') - + barchart.standardOptions.color.withFixedColor('red'), - - ComponentRepeatPanelsYellow(title, unit, targets, gridPos): - self.BarchartOptionSettings(title, unit, targets, gridPos) - + custom.scaleDistribution.withLog(2) - + custom.scaleDistribution.withType('log') - + barchart.standardOptions.color.withMode('fixed') - + barchart.standardOptions.color.withFixedColor('yellow'), - - - }, - - timeSeries: { + table: { + local table = g.panel.table, + local options = table.options, + + base(title, unit, targets, gridPos): + table.new(title) + + table.datasource.withType('elasticsearch') + + table.datasource.withUid('$Datasource') + + table.standardOptions.withUnit(unit) + + table.queryOptions.withTargets(targets) + + table.gridPos.withX(gridPos.x) + + table.gridPos.withY(gridPos.y) + + table.gridPos.withH(gridPos.h) + + table.gridPos.withW(gridPos.w), + + withPagination(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + options.footer.TableFooterOptions.withEnablePagination(true), + + withBenchmarkOverview(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + table.queryOptions.withTransformations([ + { + id: 'organize', + options: { + excludeByName: { + _id: true, + _index: true, + _type: true, + benchmark: false, + clustertype: true, + endDate: true, + end_date: true, + highlight: true, + 'jobConfig.cleanup': true, + 'jobConfig.errorOnVerify': true, + 'jobConfig.jobIterationDelay': true, + 'jobConfig.jobIterations': false, + 'jobConfig.jobPause': true, + 'jobConfig.maxWaitTimeout': true, + 'jobConfig.namespace': true, + 'jobConfig.namespaced': true, + 'jobConfig.namespacedIterations': false, + 'jobConfig.objects': true, + 'jobConfig.preLoadPeriod': true, + 'jobConfig.verifyObjects': true, + 'jobConfig.waitFor': true, + 'jobConfig.waitForDeletion': true, + 'jobConfig.waitWhenFinished': true, + k8sVersion: true, + metricName: true, + ocp_version: true, + platform: false, + sdn_type: false, + sort: true, + timestamp: true, + total_nodes: false, + uuid: false, + workload: true, + workload_nodes_count: true, + workload_nodes_type: true, + }, + indexByName: { + _id: 1, + _index: 2, + _type: 3, + benchmark: 5, + clusterName: 8, + endDate: 9, + highlight: 6, + infraNodesCount: 20, + infraNodesType: 21, + k8sVersion: 10, + masterNodesType: 16, + metricName: 13, + ocpVersion: 11, + passed: 15, + platform: 12, + sdnType: 14, + sort: 7, + timestamp: 0, + totalNodes: 17, + uuid: 4, + workerNodesCount: 18, + workerNodesType: 19, + }, + renameByName: { + _type: '', + clusterName: 'Cluster', + elapsedTime: 'Elapsed time', + endDate: '', + infraNodesCount: 'infra count', + infraNodesType: 'infra type', + infra_nodes_count: 'Infra nodes', + infra_nodes_type: 'Infra flavor', + 'jobConfig.burst': 'Burst', + 'jobConfig.cleanup': '', + 'jobConfig.errorOnVerify': 'errorOnVerify', + 'jobConfig.jobIterationDelay': 'jobIterationDelay', + 'jobConfig.jobIterations': 'Iterations', + 'jobConfig.jobPause': 'jobPause', + 'jobConfig.jobType': 'Job Type', + 'jobConfig.maxWaitTimeout': 'maxWaitTImeout', + 'jobConfig.name': 'Name', + 'jobConfig.namespace': 'namespacePrefix', + 'jobConfig.namespaced': '', + 'jobConfig.namespacedIterations': 'Namespaced iterations', + 'jobConfig.objects': '', + 'jobConfig.podWait': 'podWait', + 'jobConfig.preLoadImages': 'Preload Images', + 'jobConfig.preLoadPeriod': '', + 'jobConfig.qps': 'QPS', + 'jobConfig.verifyObjects': '', + k8sVersion: 'k8s version', + k8s_version: 'k8s version', + masterNodesType: 'master type', + master_nodes_count: 'Master nodes', + master_nodes_type: 'Masters flavor', + metricName: '', + ocpVersion: 'OCP version', + passed: 'Passed', + platform: 'Platform', + result: 'Result', + sdnType: 'SDN', + sdn_type: 'SDN', + timestamp: '', + totalNodes: 'total nodes', + total_nodes: 'Total nodes', + uuid: 'UUID', + workerNodesCount: 'worker count', + workerNodesType: 'worker type', + worker_nodes_count: 'Worker nodes', + worker_nodes_type: 'Workers flavor', + workload: '', + workload_nodes_count: 'Workload nodes', + workload_nodes_type: 'Workload flavor', + }, + }, + }, + ]) + + table.standardOptions.withOverrides([ + { + matcher: { + id: 'byName', + options: 'passed', + }, + properties: [ + { + id: 'custom.cellOptions', + value: { + mode: 'basic', + type: 'color-background', + }, + }, + ], + }, + ]) + + table.standardOptions.withMappings([ + { + options: { + passed: { + color: 'green', + index: 0, + }, + }, + type: 'value', + }, + ]) + + table.standardOptions.thresholds.withSteps([ + { + color: 'green', + value: null, + }, + ]), + + withGarbageCollection(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + table.queryOptions.withTransformations([ + { + id: 'organize', + options: { + excludeByName: { + _id: true, + _index: true, + _type: true, + highlight: true, + 'jobConfig.churnDelay': true, + 'jobConfig.churnDuration': true, + 'jobConfig.churnPercent': true, + 'jobConfig.cleanup': true, + 'jobConfig.errorOnVerify': true, + 'jobConfig.iterationsPerNamespace': true, + 'jobConfig.jobIterationDelay': true, + 'jobConfig.jobIterations': false, + 'jobConfig.jobPause': true, + 'jobConfig.jobType': true, + 'jobConfig.maxWaitTimeout': true, + 'jobConfig.name': false, + 'jobConfig.namespace': true, + 'jobConfig.namespaceLabels.pod-security.kubernetes.io/audit': true, + 'jobConfig.namespaceLabels.pod-security.kubernetes.io/enforce': true, + 'jobConfig.namespaceLabels.pod-security.kubernetes.io/warn': true, + 'jobConfig.namespaceLabels.security.openshift.io/scc.podSecurityLabelSync': true, + 'jobConfig.namespaced': true, + 'jobConfig.namespacedIterations': true, + 'jobConfig.objects': true, + 'jobConfig.podWait': true, + 'jobConfig.preLoadImages': true, + 'jobConfig.preLoadPeriod': true, + 'jobConfig.verifyObjects': true, + 'jobConfig.waitFor': true, + 'jobConfig.waitForDeletion': true, + 'jobConfig.waitWhenFinished': true, + 'metadata.cloud-bulldozer': true, + 'metadata.k8sVersion': true, + 'metadata.ocpMajorVersion': true, + 'metadata.ocpVersion': true, + 'metadata.platform': true, + 'metadata.sdnType': true, + 'metadata.totalNodes': true, + metricName: true, + sort: true, + timestamp: false, + uuid: false, + }, + indexByName: { + _id: 2, + _index: 3, + _type: 4, + elapsedTime: 8, + highlight: 19, + 'jobConfig.burst': 7, + 'jobConfig.churnDelay': 20, + 'jobConfig.churnDuration': 21, + 'jobConfig.churnPercent': 22, + 'jobConfig.cleanup': 11, + 'jobConfig.errorOnVerify': 12, + 'jobConfig.iterationsPerNamespace': 23, + 'jobConfig.jobIterations': 9, + 'jobConfig.jobType': 10, + 'jobConfig.maxWaitTimeout': 13, + 'jobConfig.name': 5, + 'jobConfig.namespace': 14, + 'jobConfig.preLoadImages': 24, + 'jobConfig.preLoadPeriod': 25, + 'jobConfig.qps': 6, + 'jobConfig.verifyObjects': 15, + 'jobConfig.waitForDeletion': 16, + 'jobConfig.waitWhenFinished': 17, + 'metadata.k8sVersion': 26, + 'metadata.ocpMajorVersion': 27, + 'metadata.ocpVersion': 28, + 'metadata.platform': 29, + 'metadata.sdnType': 30, + 'metadata.totalNodes': 31, + metricName: 18, + sort: 32, + timestamp: 1, + uuid: 0, + version: 33, + }, + renameByName: { + _type: '', + elapsedTime: 'Elapsed time', + elapsedTimeNs: 'Elapsed Time', + endTimestamp: '', + highlight: '', + 'jobConfig.burst': 'Burst', + 'jobConfig.churn': 'Churn', + 'jobConfig.churnDelay': '', + 'jobConfig.churnDeletionStrategy': 'Churn Deletion strategy', + 'jobConfig.cleanup': '', + 'jobConfig.errorOnVerify': 'errorOnVerify', + 'jobConfig.iterationsPerNamespace': 'iterationsPerNs', + 'jobConfig.jobIterationDelay': 'jobIterationDelay', + 'jobConfig.jobIterations': 'Iterations', + 'jobConfig.jobPause': 'jobPause', + 'jobConfig.jobType': 'Job Type', + 'jobConfig.maxWaitTimeout': 'maxWaitTImeout', + 'jobConfig.name': 'Name', + 'jobConfig.namespace': 'namespacePrefix', + 'jobConfig.namespaceLabels.pod-security.kubernetes.io/audit': '', + 'jobConfig.namespaced': '', + 'jobConfig.namespacedIterations': 'Namespaced iterations', + 'jobConfig.objects': '', + 'jobConfig.podWait': 'podWait', + 'jobConfig.preLoadImages': 'Preload Images', + 'jobConfig.preLoadPeriod': '', + 'jobConfig.qps': 'QPS', + 'jobConfig.verifyObjects': '', + 'metadata.ocpMajorVersion': 'Major version', + 'metadata.platform': 'Platform', + metricName: '', + timestamp: 'Date', + uuid: 'UUID', + version: 'Kube-burner version', + }, + }, + }, + ]) + + table.standardOptions.withOverrides([ + { + matcher: { + id: 'byName', + options: 'Elapsed time', + }, + properties: [ + { + id: 'unit', + value: 's', + }, + ], + }, + { + matcher: { + id: 'byName', + options: 'Elapsed Time', + }, + properties: [ + { + id: 'unit', + value: 'ns', + }, + ], + }, + ]) + + table.standardOptions.thresholds.withSteps([ + { + color: 'green', + value: null, + }, + { + color: 'red', + value: 80, + }, + ]), + }, + + barGauge: { + local bargauge = g.panel.barGauge, + local options = bargauge.options, + + base(title, unit, targets, gridPos): + bargauge.new(title) + + bargauge.queryOptions.withTargets(targets) + + bargauge.datasource.withType('elasticsearch') + + bargauge.datasource.withUid('$Datasource') + + bargauge.standardOptions.withUnit(unit) + + bargauge.gridPos.withX(gridPos.x) + + bargauge.gridPos.withY(gridPos.y) + + bargauge.gridPos.withH(gridPos.h) + + bargauge.gridPos.withW(gridPos.w) + + options.withOrientation('horizontal') + + options.withDisplayMode('gradient') + + options.withValueMode('color') + + options.withShowUnfilled(true) + + options.withMinVizWidth(0) + + options.withMinVizHeight(10) + + options.text.withTitleSize(12), + + withnodeCPUUsage(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + bargauge.panelOptions.withRepeat('node_roles') + + bargauge.standardOptions.withMin(0) + + options.reduceOptions.withCalcs([ + 'lastNotNull', + ]), + + withnodeMemoryUsage(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + bargauge.panelOptions.withRepeat('node_roles') + + bargauge.standardOptions.withMin(5) + + options.reduceOptions.withCalcs([ + 'lastNotNull', + ]) + + bargauge.standardOptions.color.withFixedColor('dark-red') + + bargauge.standardOptions.color.withMode('palette-classic'), + + withP99PodReadyLatency(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + bargauge.standardOptions.withMin(0) + + options.reduceOptions.withCalcs([ + 'lastNotNull', + ]) + + bargauge.standardOptions.color.withMode('palette-classic'), + + etcdCPUusage(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + options.withMinVizHeight(0) + + options.withMinVizWidth(10) + + options.reduceOptions.withCalcs([ + 'lastNotNull', + ]) + + bargauge.standardOptions.color.withMode('palette-classic'), + + + }, + + barChart: { + local barchart = g.panel.barChart, + local options = barchart.options, + local custom = barchart.fieldConfig.defaults.custom, + + base(title, unit, targets, gridPos): + barchart.new(title) + + barchart.datasource.withType('elasticsearch') + + barchart.datasource.withUid('$Datasource') + + barchart.standardOptions.withUnit(unit) + + barchart.queryOptions.withTargets(targets) + + barchart.gridPos.withX(gridPos.x) + + barchart.gridPos.withY(gridPos.y) + + barchart.gridPos.withH(gridPos.h) + + barchart.gridPos.withW(gridPos.w), + + BarchartOptionSettings(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + options.legend.withDisplayMode('list') + + options.legend.withPlacement('bottom') + + options.legend.withShowLegend(true) + + options.withOrientation('horizontal') + + options.withBarWidth(0.97) + + options.withGroupWidth(0.7), + + ReadOnlyAPIrequestP99latency(title, unit, targets, gridPos): + self.BarchartOptionSettings(title, unit, targets, gridPos) + + custom.scaleDistribution.withLog(2) + + custom.scaleDistribution.withType('log'), + + + maxClusterCPUusageRatio(title, unit, targets, gridPos): + self.BarchartOptionSettings(title, unit, targets, gridPos) + + custom.scaleDistribution.withType('linear'), + + etcdScaleDistribution(title, unit, targets, gridPos): + self.BarchartOptionSettings(title, unit, targets, gridPos) + + custom.scaleDistribution.withLog(10) + + custom.scaleDistribution.withType('log'), + + etcdroundtrip(title, unit, targets, gridPos): + self.BarchartOptionSettings(title, unit, targets, gridPos) + + custom.scaleDistribution.withLog(10) + + custom.scaleDistribution.withType('log') + + barchart.standardOptions.color.withMode('continuous-RdYlGr'), + + ComponentRepeatPanelsBlue(title, unit, targets, gridPos): + self.BarchartOptionSettings(title, unit, targets, gridPos) + + custom.scaleDistribution.withLog(2) + + custom.scaleDistribution.withType('log') + + barchart.standardOptions.color.withMode('fixed') + + barchart.standardOptions.color.withFixedColor('blue'), + + ComponentRepeatPanelsRed(title, unit, targets, gridPos): + self.BarchartOptionSettings(title, unit, targets, gridPos) + + custom.scaleDistribution.withLog(2) + + custom.scaleDistribution.withType('log') + + barchart.standardOptions.color.withMode('fixed') + + barchart.standardOptions.color.withFixedColor('red'), + + ComponentRepeatPanelsYellow(title, unit, targets, gridPos): + self.BarchartOptionSettings(title, unit, targets, gridPos) + + custom.scaleDistribution.withLog(2) + + custom.scaleDistribution.withType('log') + + barchart.standardOptions.color.withMode('fixed') + + barchart.standardOptions.color.withFixedColor('yellow'), + + + }, + + timeSeries: { local timeSeries = g.panel.timeSeries, local custom = timeSeries.fieldConfig.defaults.custom, local options = timeSeries.options, @@ -492,13 +492,13 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn + options.legend.withShowLegend(true) + options.legend.withPlacement('bottom') + options.legend.withDisplayMode('table'), - + withCommonAggregations(title, unit, targets, gridPos, maxPoints): self.base(title, unit, targets, gridPos, maxPoints) + options.legend.withCalcs([ 'mean', 'max', - 'min' + 'min', ]), withMeanMax(title, unit, targets, gridPos, maxPoints): @@ -507,12 +507,12 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn 'mean', 'max', ]), - + sortByMean(title, unit, targets, gridPos, maxPoints): self.withMeanMax(title, unit, targets, gridPos, maxPoints) + options.legend.withSortBy('Mean') + options.legend.withSortDesc(true), - + sortByMax(title, unit, targets, gridPos, maxPoints): self.withCommonAggregations(title, unit, targets, gridPos, maxPoints) + options.legend.withCalcs([ @@ -527,7 +527,7 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn + options.legend.withSortBy('Mean') + options.legend.withSortDesc(true), - }, + }, + - -} \ No newline at end of file +} diff --git a/assets/kube-burner-report-mode/queries.libsonnet b/assets/kube-burner-report-mode/queries.libsonnet index ff84285..5fd732b 100644 --- a/assets/kube-burner-report-mode/queries.libsonnet +++ b/assets/kube-burner-report-mode/queries.libsonnet @@ -1,814 +1,814 @@ -local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local variables = import './variables.libsonnet'; +local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local elasticsearch = g.query.elasticsearch; { - benchmarkOveriew: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.RawData.settings.withSize("500") - + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withType('raw_data'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: clusterMetadata') - + elasticsearch.withTimeField('timestamp') - }, - - garbageCollection: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.RawData.settings.withSize("500") - + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withType('raw_data'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: jobSummary') - + elasticsearch.withTimeField('timestamp') - }, - - nodeCPUusage: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("1") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("3") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("0") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges("0") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: cpu-$node_roles') - + elasticsearch.withTimeField('timestamp') - }, - - maximumCPUusage: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("1") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("3") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("0") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges("0") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-cpu-$node_roles') - + elasticsearch.withTimeField('timestamp') - }, - - masterMemoryUsage: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("1") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("3") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("0") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges("0") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: memory-$node_roles') - + elasticsearch.withTimeField('timestamp') - }, - - maximumAggregatedMemory: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("1") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("3") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("0") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges("0") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-memory-sum-$node_roles') - + elasticsearch.withTimeField('timestamp') - }, - - maxClusterCPUusageRatio: { - query(): - elasticsearch.withAlias("Memory") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("2") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-cpu-cluster-usage-ratio') - + elasticsearch.withTimeField('timestamp') - }, - - maxClusterMemoryUsageratio: { - query(): - elasticsearch.withAlias("Memory") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("2") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-memory-cluster-usage-ratio') - + elasticsearch.withTimeField('timestamp') - }, - - P99PodReadyLatency: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("6") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("7") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("0") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges("0") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("P99") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: podLatencyQuantilesMeasurement AND quantileName.keyword: Ready') - + elasticsearch.withTimeField('timestamp') - }, - - P99ServiceReadyLatency: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("6") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("7") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("0") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges("0") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("P99") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: svcLatencyQuantilesMeasurement AND quantileName.keyword: Ready') - + elasticsearch.withTimeField('timestamp') - }, - - ovnKubeMasterPodStats: { - base(alias, query): - elasticsearch.withAlias(alias) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.pod.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), - ]) - + elasticsearch.withQuery(query) - + elasticsearch.withTimeField('timestamp'), + benchmarkOveriew: { + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.RawData.settings.withSize('500') + + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withType('raw_data'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: clusterMetadata') + + elasticsearch.withTimeField('timestamp'), + }, + + garbageCollection: { + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.RawData.settings.withSize('500') + + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withType('raw_data'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: jobSummary') + + elasticsearch.withTimeField('timestamp'), + }, + + nodeCPUusage: { + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('1') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('3') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('0') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges('0') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: cpu-$node_roles') + + elasticsearch.withTimeField('timestamp'), + }, + + maximumCPUusage: { + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('1') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('3') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('0') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges('0') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-cpu-$node_roles') + + elasticsearch.withTimeField('timestamp'), + }, + + masterMemoryUsage: { + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('1') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('3') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('0') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges('0') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: memory-$node_roles') + + elasticsearch.withTimeField('timestamp'), + }, + + maximumAggregatedMemory: { + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('1') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('3') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('0') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges('0') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-memory-sum-$node_roles') + + elasticsearch.withTimeField('timestamp'), + }, + + maxClusterCPUusageRatio: { + query(): + elasticsearch.withAlias('Memory') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('2') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-cpu-cluster-usage-ratio') + + elasticsearch.withTimeField('timestamp'), + }, + + maxClusterMemoryUsageratio: { + query(): + elasticsearch.withAlias('Memory') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('2') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-memory-cluster-usage-ratio') + + elasticsearch.withTimeField('timestamp'), + }, + + P99PodReadyLatency: { + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('6') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('7') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('0') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges('0') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('P99') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: podLatencyQuantilesMeasurement AND quantileName.keyword: Ready') + + elasticsearch.withTimeField('timestamp'), + }, + + P99ServiceReadyLatency: { + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('6') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('7') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('0') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges('0') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('P99') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: svcLatencyQuantilesMeasurement AND quantileName.keyword: Ready') + + elasticsearch.withTimeField('timestamp'), + }, + + ovnKubeMasterPodStats: { + base(alias, query): + elasticsearch.withAlias(alias) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.pod.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), + ]) + + elasticsearch.withQuery(query) + + elasticsearch.withTimeField('timestamp'), queries(metric): [ - self.base("{{labels.pod.keyword}}", "uuid.keyword: $uuid AND metricName: \""+ metric +"\" AND labels.pod.keyword: /ovnkube-master.*/"), - self.base("{{labels.pod.keyword}}", "uuid.keyword: $uuid AND metricName: \""+ metric +"\" AND labels.pod.keyword: /ovnkube-control-plane.*/"), - ] - }, -# OVNkube control plane container stats - ovnKubeMasterContainerStats: { - base(alias, query): - elasticsearch.withAlias(alias) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.container.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), - ]) - + elasticsearch.withQuery(query) - + elasticsearch.withTimeField('timestamp'), + self.base('{{labels.pod.keyword}}', 'uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.pod.keyword: /ovnkube-master.*/'), + self.base('{{labels.pod.keyword}}', 'uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.pod.keyword: /ovnkube-control-plane.*/'), + ], + }, + // OVNkube control plane container stats + ovnKubeMasterContainerStats: { + base(alias, query): + elasticsearch.withAlias(alias) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.container.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), + ]) + + elasticsearch.withQuery(query) + + elasticsearch.withTimeField('timestamp'), queries(metric): [ - self.base("{{labels.container.keyword}}", "uuid.keyword: $uuid AND metricName: \""+ metric +"\" labels.container.keyword: /ovnkube-master.*/"), - self.base("{{labels.container.keyword}}", "uuid.keyword: $uuid AND metricName: \""+ metric +"\" labels.container: /ovnkube-control-plane.*/"), - ] - }, - - ReadOnlyAPIRequestP99LatencyResourceScoped: { - query(): - elasticsearch.withAlias("Memory") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("2") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: avg-ro-apicalls-latency AND labels.scope.keyword: resource') - + elasticsearch.withTimeField('timestamp') - }, - - MaxReadOnlyAPIrequestP99ResourceScoped:{ - query(): - elasticsearch.withAlias("Memory") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("2") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-ro-apicalls-latency AND labels.scope.keyword: resource') - + elasticsearch.withTimeField('timestamp') - }, - - ReadonlyAPIrequestP99LatencyNamespaceScoped: { - query(): - elasticsearch.withAlias("Memory") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("2") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: avg-ro-apicalls-latency AND labels.scope.keyword: namespace') - + elasticsearch.withTimeField('timestamp') - }, - - MaxReadOnlyAPIrequestP99LatencyNamespaceScoped: { - query(): - elasticsearch.withAlias("Memory") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("2") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-ro-apicalls-latency AND labels.scope.keyword: namespace') - + elasticsearch.withTimeField('timestamp'), - }, - - ReadOnlyAPIrequestP99LatencyClusterScoped: { - query(): - elasticsearch.withAlias("Memory") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("2") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: avg-ro-apicalls-latency AND labels.scope.keyword: cluster') - + elasticsearch.withTimeField('timestamp'), - }, - - MaxReadonlyAPIrequestP99LatencyClusterScoped: { - query(): - elasticsearch.withAlias("Memory") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("2") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-ro-apicalls-latency AND labels.scope.keyword: cluster') - + elasticsearch.withTimeField('timestamp'), - }, - - MutatingAPIrequestP99Latency: { - query(): - elasticsearch.withAlias("Memory") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("2") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: avg-mutating-apicalls-latency') - + elasticsearch.withTimeField('timestamp'), - }, - - MaxMutatingAPIrequestP99Latency: { - query(): - elasticsearch.withAlias("Memory") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("2") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-mutating-apicalls-latency') - + elasticsearch.withTimeField('timestamp'), - }, - - etcd99thWALfsync:{ - query(): - elasticsearch.withAlias("{{labels.pod.keyword}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("5") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: 99thEtcdDiskWalFsync') - + elasticsearch.withTimeField('timestamp'), - }, - - Max99thWALfsync:{ - query(): - elasticsearch.withAlias("{{labels.pod.keyword}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("5") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-99thEtcdDiskWalFsync') - + elasticsearch.withTimeField('timestamp'), - }, - - etcd99Roundtrip: { - query(): - elasticsearch.withAlias("{{labels.pod.keyword}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("5") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: 99thEtcdRoundTripTime') - + elasticsearch.withTimeField('timestamp'), - }, - - Max99Roundtrip:{ - query(): - elasticsearch.withAlias("{{labels.pod.keyword}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("5") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-99thEtcdRoundTripTime') - + elasticsearch.withTimeField('timestamp'), - }, - - etcd99BackendIandO: { - query(): - elasticsearch.withAlias("{{labels.pod.keyword}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("5") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: 99thEtcdDiskBackendCommit') - + elasticsearch.withTimeField('timestamp'), - }, - - Max99thBackendIandO:{ - query(): - elasticsearch.withAlias("{{labels.pod.keyword}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("5") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-99thEtcdDiskBackendCommit') - + elasticsearch.withTimeField('timestamp'), - }, - - etcdCPUusage:{ - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("2") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("3") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0) - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: cpu-etcd') - + elasticsearch.withTimeField('timestamp'), - }, - - MaxetcdCPUusage: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("5") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("3") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("0") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0) - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-cpu-etcd') - + elasticsearch.withTimeField('timestamp'), - }, - - etcdRSSusage: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("5") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("3") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("0") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0) - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: memory-etcd') - + elasticsearch.withTimeField('timestamp'), - }, - - etcdMaxRSSusage: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("5") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("3") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("0") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0) - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: memory-etcd') - + elasticsearch.withTimeField('timestamp'), - }, - - AvgRSSUsageComponet: { - query(): - elasticsearch.withAlias("RSS") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("2") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: memory-${component:raw}') - + elasticsearch.withTimeField('timestamp'), - }, - - MaxAggregatedRSSUsageComponent: { - query(): - elasticsearch.withAlias("RSS") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("2") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-memory-sum-${component:raw}') - + elasticsearch.withTimeField('timestamp'), - }, - - MaxRSSUsageComponent: { - query(): - elasticsearch.withAlias("RSS") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("2") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-memory-${component:raw}') - + elasticsearch.withTimeField('timestamp'), - }, - AvgCPUUsageComponent: { - query(): - elasticsearch.withAlias("RSS") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("2") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: cpu-${component:raw}') - + elasticsearch.withTimeField('timestamp'), - }, - - MaxCPUUsageComponent: { - query(): - elasticsearch.withAlias("RSS") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("$compare_by.keyword") - + elasticsearch.bucketAggs.Terms.withId("2") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-cpu-${component:raw}') - + elasticsearch.withTimeField('timestamp'), - } -} \ No newline at end of file + self.base('{{labels.container.keyword}}', 'uuid.keyword: $uuid AND metricName: "' + metric + '" labels.container.keyword: /ovnkube-master.*/'), + self.base('{{labels.container.keyword}}', 'uuid.keyword: $uuid AND metricName: "' + metric + '" labels.container: /ovnkube-control-plane.*/'), + ], + }, + + ReadOnlyAPIRequestP99LatencyResourceScoped: { + query(): + elasticsearch.withAlias('Memory') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('2') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: avg-ro-apicalls-latency AND labels.scope.keyword: resource') + + elasticsearch.withTimeField('timestamp'), + }, + + MaxReadOnlyAPIrequestP99ResourceScoped: { + query(): + elasticsearch.withAlias('Memory') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('2') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-ro-apicalls-latency AND labels.scope.keyword: resource') + + elasticsearch.withTimeField('timestamp'), + }, + + ReadonlyAPIrequestP99LatencyNamespaceScoped: { + query(): + elasticsearch.withAlias('Memory') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('2') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: avg-ro-apicalls-latency AND labels.scope.keyword: namespace') + + elasticsearch.withTimeField('timestamp'), + }, + + MaxReadOnlyAPIrequestP99LatencyNamespaceScoped: { + query(): + elasticsearch.withAlias('Memory') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('2') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-ro-apicalls-latency AND labels.scope.keyword: namespace') + + elasticsearch.withTimeField('timestamp'), + }, + + ReadOnlyAPIrequestP99LatencyClusterScoped: { + query(): + elasticsearch.withAlias('Memory') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('2') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: avg-ro-apicalls-latency AND labels.scope.keyword: cluster') + + elasticsearch.withTimeField('timestamp'), + }, + + MaxReadonlyAPIrequestP99LatencyClusterScoped: { + query(): + elasticsearch.withAlias('Memory') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('2') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-ro-apicalls-latency AND labels.scope.keyword: cluster') + + elasticsearch.withTimeField('timestamp'), + }, + + MutatingAPIrequestP99Latency: { + query(): + elasticsearch.withAlias('Memory') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('2') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: avg-mutating-apicalls-latency') + + elasticsearch.withTimeField('timestamp'), + }, + + MaxMutatingAPIrequestP99Latency: { + query(): + elasticsearch.withAlias('Memory') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('2') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-mutating-apicalls-latency') + + elasticsearch.withTimeField('timestamp'), + }, + + etcd99thWALfsync: { + query(): + elasticsearch.withAlias('{{labels.pod.keyword}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('5') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: 99thEtcdDiskWalFsync') + + elasticsearch.withTimeField('timestamp'), + }, + + Max99thWALfsync: { + query(): + elasticsearch.withAlias('{{labels.pod.keyword}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('5') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-99thEtcdDiskWalFsync') + + elasticsearch.withTimeField('timestamp'), + }, + + etcd99Roundtrip: { + query(): + elasticsearch.withAlias('{{labels.pod.keyword}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('5') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: 99thEtcdRoundTripTime') + + elasticsearch.withTimeField('timestamp'), + }, + + Max99Roundtrip: { + query(): + elasticsearch.withAlias('{{labels.pod.keyword}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('5') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-99thEtcdRoundTripTime') + + elasticsearch.withTimeField('timestamp'), + }, + + etcd99BackendIandO: { + query(): + elasticsearch.withAlias('{{labels.pod.keyword}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('5') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: 99thEtcdDiskBackendCommit') + + elasticsearch.withTimeField('timestamp'), + }, + + Max99thBackendIandO: { + query(): + elasticsearch.withAlias('{{labels.pod.keyword}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('5') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-99thEtcdDiskBackendCommit') + + elasticsearch.withTimeField('timestamp'), + }, + + etcdCPUusage: { + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('2') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('3') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: cpu-etcd') + + elasticsearch.withTimeField('timestamp'), + }, + + MaxetcdCPUusage: { + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('5') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('3') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('0') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-cpu-etcd') + + elasticsearch.withTimeField('timestamp'), + }, + + etcdRSSusage: { + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('5') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('3') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('0') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: memory-etcd') + + elasticsearch.withTimeField('timestamp'), + }, + + etcdMaxRSSusage: { + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('5') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('3') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('0') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: memory-etcd') + + elasticsearch.withTimeField('timestamp'), + }, + + AvgRSSUsageComponet: { + query(): + elasticsearch.withAlias('RSS') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('2') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: memory-${component:raw}') + + elasticsearch.withTimeField('timestamp'), + }, + + MaxAggregatedRSSUsageComponent: { + query(): + elasticsearch.withAlias('RSS') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('2') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-memory-sum-${component:raw}') + + elasticsearch.withTimeField('timestamp'), + }, + + MaxRSSUsageComponent: { + query(): + elasticsearch.withAlias('RSS') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('2') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-memory-${component:raw}') + + elasticsearch.withTimeField('timestamp'), + }, + AvgCPUUsageComponent: { + query(): + elasticsearch.withAlias('RSS') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('2') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: cpu-${component:raw}') + + elasticsearch.withTimeField('timestamp'), + }, + + MaxCPUUsageComponent: { + query(): + elasticsearch.withAlias('RSS') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('$compare_by.keyword') + + elasticsearch.bucketAggs.Terms.withId('2') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: max-cpu-${component:raw}') + + elasticsearch.withTimeField('timestamp'), + }, +} diff --git a/assets/kube-burner-report-mode/variables.libsonnet b/assets/kube-burner-report-mode/variables.libsonnet index d3f2163..910ad07 100644 --- a/assets/kube-burner-report-mode/variables.libsonnet +++ b/assets/kube-burner-report-mode/variables.libsonnet @@ -1,85 +1,85 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; -local var = g.dashboard.variable; +local var = g.dashboard.variable; { - Datasource: - var.datasource.new('Datasource','elasticsearch') - + var.datasource.withRegex('/.*kube-burner.*/') - + var.query.withRefresh(1) - + var.query.selectionOptions.withIncludeAll(false) - + var.query.selectionOptions.withMulti(false), - - platform: - var.query.new('platform', '{"find": "terms", "field": "platform.keyword"}') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.withRefresh(2) - + var.query.selectionOptions.withMulti(true) - + var.query.selectionOptions.withIncludeAll(false) - + var.query.generalOptions.withLabel('Platform'), + Datasource: + var.datasource.new('Datasource', 'elasticsearch') + + var.datasource.withRegex('/.*kube-burner.*/') + + var.query.withRefresh(1) + + var.query.selectionOptions.withIncludeAll(false) + + var.query.selectionOptions.withMulti(false), - sdn: - var.query.new('sdn', '{"find": "terms", "field": "sdnType.keyword", "query": "platform.keyword: $platform"}') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.withRefresh(1) - + var.query.selectionOptions.withMulti(true) - + var.query.selectionOptions.withIncludeAll(false) - + var.query.generalOptions.withLabel('SDN type'), + platform: + var.query.new('platform', '{"find": "terms", "field": "platform.keyword"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.withRefresh(2) + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(false) + + var.query.generalOptions.withLabel('Platform'), - clusterType: - var.query.new('clusterType', '{"find": "terms", "field": "clusterType.keyword", "query": "platform.keyword: $platform"}') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.withRefresh(1) - + var.query.selectionOptions.withMulti(true) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.generalOptions.withLabel('Cluster Type'), + sdn: + var.query.new('sdn', '{"find": "terms", "field": "sdnType.keyword", "query": "platform.keyword: $platform"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.withRefresh(1) + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(false) + + var.query.generalOptions.withLabel('SDN type'), - benchmark: - var.query.new('benchmark', '{"find": "terms", "field": "benchmark.keyword", "query": "platform.keyword: $platform AND sdnType.keyword: $sdn AND clusterType.keyword: $clusterType"}') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.withRefresh(1) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(false) - + var.query.generalOptions.withLabel('Benchmark'), + clusterType: + var.query.new('clusterType', '{"find": "terms", "field": "clusterType.keyword", "query": "platform.keyword: $platform"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.withRefresh(1) + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.generalOptions.withLabel('Cluster Type'), - workerNodesCount: - var.query.new('workerNodesCount', '{"find": "terms", "field": "workerNodesCount", "query": "platform.keyword: $platform AND sdnType.keyword: $sdn AND benchmark.keyword: $benchmark AND clusterType.keyword: $clusterType"}') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.withRefresh(1) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(false) - + var.query.generalOptions.withLabel('Workers'), + benchmark: + var.query.new('benchmark', '{"find": "terms", "field": "benchmark.keyword", "query": "platform.keyword: $platform AND sdnType.keyword: $sdn AND clusterType.keyword: $clusterType"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.withRefresh(1) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(false) + + var.query.generalOptions.withLabel('Benchmark'), - ocpMajorVersion: - var.query.new('ocpMajorVersion', '{"find": "terms", "field": "ocpMajorVersion.keyword", "query": "platform.keyword: $platform AND sdnType.keyword: $sdn AND benchmark.keyword: $benchmark AND workerNodesCount: $workerNodesCount AND clusterType.keyword: $clusterType"}') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.withRefresh(1) - + var.query.selectionOptions.withMulti(true) - + var.query.selectionOptions.withIncludeAll(false) - + var.query.generalOptions.withLabel('OCP Major'), + workerNodesCount: + var.query.new('workerNodesCount', '{"find": "terms", "field": "workerNodesCount", "query": "platform.keyword: $platform AND sdnType.keyword: $sdn AND benchmark.keyword: $benchmark AND clusterType.keyword: $clusterType"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.withRefresh(1) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(false) + + var.query.generalOptions.withLabel('Workers'), - uuid: - var.query.new('uuid', '{"find": "terms", "field": "uuid.keyword", "query": "platform.keyword: $platform AND sdnType.keyword: $sdn AND benchmark.keyword: $benchmark AND workerNodesCount: $workerNodesCount AND ocpMajorVersion.keyword: $ocpMajorVersion AND clusterType.keyword: $clusterType"}') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.withRefresh(1) - + var.query.selectionOptions.withMulti(true) - + var.query.selectionOptions.withIncludeAll(false) - + var.query.generalOptions.withLabel('UUID'), + ocpMajorVersion: + var.query.new('ocpMajorVersion', '{"find": "terms", "field": "ocpMajorVersion.keyword", "query": "platform.keyword: $platform AND sdnType.keyword: $sdn AND benchmark.keyword: $benchmark AND workerNodesCount: $workerNodesCount AND clusterType.keyword: $clusterType"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.withRefresh(1) + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(false) + + var.query.generalOptions.withLabel('OCP Major'), - compare_by: - var.custom.new('compare_by', ['uuid', 'metadata.ocpVersion', 'metadata.ocpMajorVersion']) - + var.custom.generalOptions.withLabel('Compare by') - + var.custom.selectionOptions.withIncludeAll(false) - + var.custom.selectionOptions.withMulti(false), + uuid: + var.query.new('uuid', '{"find": "terms", "field": "uuid.keyword", "query": "platform.keyword: $platform AND sdnType.keyword: $sdn AND benchmark.keyword: $benchmark AND workerNodesCount: $workerNodesCount AND ocpMajorVersion.keyword: $ocpMajorVersion AND clusterType.keyword: $clusterType"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.withRefresh(1) + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(false) + + var.query.generalOptions.withLabel('UUID'), - component: - var.custom.new('component', ['crio', 'kube-apiserver', 'kube-controller-manager','kubelet','multus','openshift-apiserver','openshift-controller-manager','ovn-control-plane','ovnkube-node','prometheus','router']) - + var.custom.generalOptions.withLabel('Component') - + var.custom.selectionOptions.withIncludeAll(true) - + var.custom.selectionOptions.withMulti(true), + compare_by: + var.custom.new('compare_by', ['uuid', 'metadata.ocpVersion', 'metadata.ocpMajorVersion']) + + var.custom.generalOptions.withLabel('Compare by') + + var.custom.selectionOptions.withIncludeAll(false) + + var.custom.selectionOptions.withMulti(false), - node_roles: - var.custom.new('node_roles', ['masters', 'workers', 'infra']) - + var.custom.generalOptions.withLabel('Node roles') - + var.custom.selectionOptions.withIncludeAll(false) - + var.custom.selectionOptions.withMulti(true), -} \ No newline at end of file + component: + var.custom.new('component', ['crio', 'kube-apiserver', 'kube-controller-manager', 'kubelet', 'multus', 'openshift-apiserver', 'openshift-controller-manager', 'ovn-control-plane', 'ovnkube-node', 'prometheus', 'router']) + + var.custom.generalOptions.withLabel('Component') + + var.custom.selectionOptions.withIncludeAll(true) + + var.custom.selectionOptions.withMulti(true), + + node_roles: + var.custom.new('node_roles', ['masters', 'workers', 'infra']) + + var.custom.generalOptions.withLabel('Node roles') + + var.custom.selectionOptions.withIncludeAll(false) + + var.custom.selectionOptions.withMulti(true), +} diff --git a/assets/kube-burner-report-ocp-wrapper/panels.libsonnet b/assets/kube-burner-report-ocp-wrapper/panels.libsonnet index b240e9c..c10e8e7 100644 --- a/assets/kube-burner-report-ocp-wrapper/panels.libsonnet +++ b/assets/kube-burner-report-ocp-wrapper/panels.libsonnet @@ -24,26 +24,26 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn + options.legend.withShowLegend(true) + options.legend.withPlacement('bottom') + options.legend.withDisplayMode('table'), - + withCommonAggregations(title, unit, targets, gridPos, maxPoints): self.base(title, unit, targets, gridPos, maxPoints) + options.legend.withCalcs([ 'mean', 'max', - 'min' + 'min', ]), withCommonAggregationsRightPlacement(title, unit, targets, gridPos, maxPoints): self.withCommonAggregations(title, unit, targets, gridPos, maxPoints) + options.legend.withPlacement('right'), - + meanWithRightLegend(title, unit, targets, gridPos, maxPoints): self.base(title, unit, targets, gridPos, maxPoints) + options.legend.withCalcs([ - 'mean' + 'mean', ]) + options.legend.withPlacement('right'), - + withMeanMax(title, unit, targets, gridPos, maxPoints): self.withCommonAggregations(title, unit, targets, gridPos, maxPoints) + options.legend.withCalcs([ @@ -62,7 +62,7 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn self.withCommonAggregations(title, unit, targets, gridPos, maxPoints) + options.legend.withSortBy('Mean') + options.legend.withSortDesc(true), - + sortByMaxCommon(title, unit, targets, gridPos, maxPoints): self.withCommonAggregations(title, unit, targets, gridPos, maxPoints) + options.legend.withSortBy('Max') @@ -72,7 +72,7 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn self.withMeanMax(title, unit, targets, gridPos, maxPoints) + options.legend.withSortBy('Mean') + options.legend.withSortDesc(true), - + sortByMax(title, unit, targets, gridPos, maxPoints): self.withCommonAggregations(title, unit, targets, gridPos, maxPoints) + options.legend.withCalcs([ @@ -97,7 +97,7 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn + options.legend.withPlacement('right') + options.legend.withSortBy('Mean') + options.legend.withSortDesc(true), - + maxMeanWithRightLegend(title, unit, targets, gridPos, maxPoints): self.withCommonAggregations(title, unit, targets, gridPos, maxPoints) + options.legend.withCalcs([ @@ -109,7 +109,7 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn minMaxWithRightLegend(title, unit, targets, gridPos, maxPoints): self.withMinMax(title, unit, targets, gridPos, maxPoints) + options.legend.withPlacement('right'), - + sortMaxWithRightLegend(title, unit, targets, gridPos, maxPoints): self.withCommonAggregations(title, unit, targets, gridPos, maxPoints) + options.legend.withCalcs([ @@ -119,7 +119,7 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn + options.legend.withPlacement('right') + options.legend.withSortBy('Max') + options.legend.withSortDesc(true), - + maxWithRightLegend(title, unit, targets, gridPos, maxPoints): self.withCommonAggregations(title, unit, targets, gridPos, maxPoints) + options.legend.withCalcs([ @@ -131,10 +131,10 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn allWithRightLegend(title, unit, targets, gridPos, maxPoints): self.withCommonAggregations(title, unit, targets, gridPos, maxPoints) + options.legend.withCalcs([ - "max", - "min", - "firstNotNull", - "lastNotNull" + 'max', + 'min', + 'firstNotNull', + 'lastNotNull', ]) + options.legend.withPlacement('right'), @@ -146,281 +146,281 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn ]) + options.legend.withSortBy('Max') + options.legend.withSortDesc(true), - + workerCPUCustomOverrides(title, unit, targets, gridPos, maxPoints): self.withMeanMax(title, unit, targets, gridPos, maxPoints) + options.legend.withPlacement('right') + timeSeries.standardOptions.withOverrides([ - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "user", - "system", - "softirq", - "iowait", - "irq" - ], - "prefix": "All except:", - "readOnly": true - } + { + __systemRef: 'hideSeriesFrom', + matcher: { + id: 'byNames', + options: { + mode: 'exclude', + names: [ + 'user', + 'system', + 'softirq', + 'iowait', + 'irq', + ], + prefix: 'All except:', + readOnly: true, + }, + }, + properties: [ + { + id: 'custom.hideFrom', + value: { + legend: false, + tooltip: false, + viz: true, + }, + }, + ], }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": false, - "tooltip": false, - "viz": true - } - } - ] - } - ]), - + ]), + kupeApiCustomOverrides(title, unit, targets, gridPos, maxPoints): self.sortByMax(title, unit, targets, gridPos, maxPoints) + options.tooltip.withMode('multi') + options.legend.withSortDesc(false) + timeSeries.standardOptions.withOverrides([ - { - "matcher": { - "id": "byRegexp", - "options": "/Rss.*/" - }, - "properties": [ - { - "id": "custom.showPoints", - "value": "always" + { + matcher: { + id: 'byRegexp', + options: '/Rss.*/', }, - { - "id": "unit", - "value": "bytes" - } - ] - } - ]), + properties: [ + { + id: 'custom.showPoints', + value: 'always', + }, + { + id: 'unit', + value: 'bytes', + }, + ], + }, + ]), kupeApiAverageCustomOverrides(title, unit, targets, gridPos, maxPoints): self.withMeanMax(title, unit, targets, gridPos, maxPoints) + timeSeries.standardOptions.withOverrides([ - { - "matcher": { - "id": "byRegexp", - "options": "/Rss.*/" + { + matcher: { + id: 'byRegexp', + options: '/Rss.*/', + }, + properties: [ + { + id: 'custom.showPoints', + value: 'auto', + }, + { + id: 'unit', + value: 'bytes', + }, + ], }, - "properties": [ - { - "id": "custom.showPoints", - "value": "auto" + { + __systemRef: 'hideSeriesFrom', + matcher: { + id: 'byNames', + options: { + mode: 'exclude', + names: [ + 'Avg CPU kube-apiserver', + ], + prefix: 'All except:', + readOnly: true, + }, }, - { - "id": "unit", - "value": "bytes" - } - ] - }, - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "Avg CPU kube-apiserver" - ], - "prefix": "All except:", - "readOnly": true - } + properties: [ + { + id: 'custom.hideFrom', + value: { + legend: false, + tooltip: false, + viz: true, + }, + }, + ], }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": false, - "tooltip": false, - "viz": true - } - } - ] - } - ]), + ]), activeKubeControllerManagerOverrides(title, unit, targets, gridPos, maxPoints): self.sortByMax(title, unit, targets, gridPos, maxPoints) + timeSeries.standardOptions.withOverrides([ - { - "matcher": { - "id": "byRegexp", - "options": "/Rss.*/" - }, - "properties": [ - { - "id": "custom.showPoints", - "value": "always" + { + matcher: { + id: 'byRegexp', + options: '/Rss.*/', }, - { - "id": "unit", - "value": "bytes" - } - ] - } - ]), + properties: [ + { + id: 'custom.showPoints', + value: 'always', + }, + { + id: 'unit', + value: 'bytes', + }, + ], + }, + ]), kubeSchedulerUsageOverrides(title, unit, targets, gridPos, maxPoints): self.withMeanMax(title, unit, targets, gridPos, maxPoints) + timeSeries.standardOptions.withOverrides([ - { - "matcher": { - "id": "byRegexp", - "options": "/Rss.*/" - }, - "properties": [ - { - "id": "custom.showPoints", - "value": "always" + { + matcher: { + id: 'byRegexp', + options: '/Rss.*/', }, - { - "id": "unit", - "value": "bytes" - } - ] - } - ]), + properties: [ + { + id: 'custom.showPoints', + value: 'always', + }, + { + id: 'unit', + value: 'bytes', + }, + ], + }, + ]), etcd99thNetworkPeerRTOverrides(title, unit, targets, gridPos, maxPoints): self.withMeanMax(title, unit, targets, gridPos, maxPoints) + timeSeries.standardOptions.withOverrides([ - { - "matcher": { - "id": "byRegexp", - "options": "/.*Logical.*/" - }, - "properties": [ - { - "id": "unit", - "value": "decbytes" + { + matcher: { + id: 'byRegexp', + options: '/.*Logical.*/', }, - { - "id": "custom.axisPlacement", - "value": "hidden" - } - ] - } - ]), + properties: [ + { + id: 'unit', + value: 'decbytes', + }, + { + id: 'custom.axisPlacement', + value: 'hidden', + }, + ], + }, + ]), etcdResouceUtilizationOverrides(title, unit, targets, gridPos, maxPoints): self.sortByMaxCommon(title, unit, targets, gridPos, maxPoints) + timeSeries.standardOptions.withOverrides([ - { - "matcher": { - "id": "byRegexp", - "options": "/Rss.*/" - }, - "properties": [ - { - "id": "custom.showPoints", - "value": "always" + { + matcher: { + id: 'byRegexp', + options: '/Rss.*/', }, - { - "id": "unit", - "value": "bytes" - } - ] - } - ]), + properties: [ + { + id: 'custom.showPoints', + value: 'always', + }, + { + id: 'unit', + value: 'bytes', + }, + ], + }, + ]), etcd99thDiskWalLatencyOverrides(title, unit, targets, gridPos, maxPoints): self.sortByMean(title, unit, targets, gridPos, maxPoints) - + timeSeries.standardOptions.thresholds.withMode("absolute") + + timeSeries.standardOptions.thresholds.withMode('absolute') + custom.withThresholdsStyle({ - "mode": "line+area" - }) + mode: 'line+area', + }) + timeSeries.standardOptions.thresholds.withSteps([ - { - "color": "transparent", - "value": null - }, - { - "color": "red", - "value": 0.01 - } - ]) - + timeSeries.standardOptions.color.withMode("palette-classic"), + { + color: 'transparent', + value: null, + }, + { + color: 'red', + value: 0.01, + }, + ]) + + timeSeries.standardOptions.color.withMode('palette-classic'), etcd99thCommitLatencyOverrides(title, unit, targets, gridPos, maxPoints): self.withMeanMax(title, unit, targets, gridPos, maxPoints) - + timeSeries.standardOptions.thresholds.withMode("absolute") + + timeSeries.standardOptions.thresholds.withMode('absolute') + custom.withThresholdsStyle({ - "mode": "line+area" - }) + mode: 'line+area', + }) + timeSeries.standardOptions.thresholds.withSteps([ - { - "color": "transparent", - "value": null - }, - { - "color": "red", - "value": 0.02 - } - ]) - + timeSeries.standardOptions.color.withMode("palette-classic"), + { + color: 'transparent', + value: null, + }, + { + color: 'red', + value: 0.02, + }, + ]) + + timeSeries.standardOptions.color.withMode('palette-classic'), readOnlyAPIRequestp99ResourceOverrides(title, unit, targets, gridPos, maxPoints): self.sortByMax(title, unit, targets, gridPos, maxPoints) + custom.withThresholdsStyle({ - "mode": "line+area" - }) + mode: 'line+area', + }) + timeSeries.standardOptions.thresholds.withSteps([ - { - "color": "transparent", - "value": null - }, - { - "color": "red", - "value": 1 - } - ]), + { + color: 'transparent', + value: null, + }, + { + color: 'red', + value: 1, + }, + ]), readOnlyAPIRequestp99NamespaceOverrides(title, unit, targets, gridPos, maxPoints): self.withMeanMax(title, unit, targets, gridPos, maxPoints) + custom.withThresholdsStyle({ - "mode": "line+area" - }) + mode: 'line+area', + }) + timeSeries.standardOptions.thresholds.withSteps([ - { - "color": "transparent", - "value": null - }, - { - "color": "red", - "value": 5 - } - ]), + { + color: 'transparent', + value: null, + }, + { + color: 'red', + value: 5, + }, + ]), readOnlyAPIRequestp99ClusterOverrides(title, unit, targets, gridPos, maxPoints): self.withMeanMax(title, unit, targets, gridPos, maxPoints) + custom.withThresholdsStyle({ - "mode": "line+area" - }) + mode: 'line+area', + }) + timeSeries.standardOptions.thresholds.withSteps([ - { - "color": "transparent", - "value": null - }, - { - "color": "red", - "value": 30 - } - ]), + { + color: 'transparent', + value: null, + }, + { + color: 'red', + value: 30, + }, + ]), readOnlyAPIRequestp99MutatingOverrides(title, unit, targets, gridPos, maxPoints): self.sortByMax(title, unit, targets, gridPos, maxPoints) + custom.withThresholdsStyle({ - "mode": "line+area" - }) + mode: 'line+area', + }) + timeSeries.standardOptions.thresholds.withSteps([ - { - "color": "transparent", - "value": null - }, - { - "color": "red", - "value": 1 - } - ]), + { + color: 'transparent', + value: null, + }, + { + color: 'red', + value: 1, + }, + ]), }, stat: { local stat = g.panel.stat, @@ -436,29 +436,29 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn + stat.gridPos.withY(gridPos.y) + stat.gridPos.withH(gridPos.h) + stat.gridPos.withW(gridPos.w) - + options.withJustifyMode("center"), - + + options.withJustifyMode('center'), + withMeanCalcs(title, unit, targets, gridPos): self.base(title, unit, targets, gridPos) + options.reduceOptions.withCalcs([ 'mean', ]), - + withLastNotNullCalcs(title, unit, targets, gridPos): self.base(title, unit, targets, gridPos) + options.reduceOptions.withCalcs([ 'lastNotNull', ]), - + withFieldSummary(title, unit, field, targets, gridPos): self.withLastNotNullCalcs(title, unit, targets, gridPos) + options.reduceOptions.withFields(field), - + withMeanThresholds(title, unit, targets, gridPos): self.withMeanCalcs(title, unit, targets, gridPos) - + stat.standardOptions.thresholds.withMode("absolute") - + stat.standardOptions.thresholds.withSteps([{"value": null,"color": "green"}, {"value": 5000,"color": "red"}]) - + stat.standardOptions.color.withMode("palette-classic"), + + stat.standardOptions.thresholds.withMode('absolute') + + stat.standardOptions.thresholds.withSteps([{ value: null, color: 'green' }, { value: 5000, color: 'red' }]) + + stat.standardOptions.color.withMode('palette-classic'), }, table: { local table = g.panel.table, @@ -474,363 +474,363 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn + table.gridPos.withY(gridPos.y) + table.gridPos.withH(gridPos.h) + table.gridPos.withW(gridPos.w), - + withPagination(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + options.footer.TableFooterOptions.withEnablePagination(true), + self.base(title, unit, targets, gridPos) + + options.footer.TableFooterOptions.withEnablePagination(true), withAlerts(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + table.queryOptions.withTransformations([ - { - "id": "organize", - "options": { - "excludeByName": { - "_id": true, - "_index": true, - "_type": true, - "highlight": true, - "metricName": true, - "sort": true, - "uuid": true + self.base(title, unit, targets, gridPos) + + table.queryOptions.withTransformations([ + { + id: 'organize', + options: { + excludeByName: { + _id: true, + _index: true, + _type: true, + highlight: true, + metricName: true, + sort: true, + uuid: true, + }, + indexByName: {}, + renameByName: { + _type: 'Desciption', + severity: 'Severity', + timestamp: 'Timestamp', + }, + }, }, - "indexByName": {}, - "renameByName": { - "_type": "Desciption", - "severity": "Severity", - "timestamp": "Timestamp" - } - } - } - ]), - + ]), + withLatencyTableOverrides(title, unit, targets, gridPos): - self.withPagination(title, unit, targets, gridPos) - + table.options.withSortBy([ - { - "desc": true, - "displayName": "Initialized" - } - ]) - + table.queryOptions.withTransformations([ - { - "id": "organize", - "options": { - "excludeByName": {}, - "indexByName": {}, - "renameByName": { - "Average containersReadyLatency": "ContainersReady", - "Average initializedLatency": "Initialized", - "Average podReadyLatency": "Ready", - "Average schedulingLatency": "Scheduling", - "namespace.keyword": "Namespace", - "podName.keyword": "Pod" - } - } - } - ]) - + table.standardOptions.withOverrides([ - { - "matcher": { - "id": "byName", - "options": "nodeName.keyword" + self.withPagination(title, unit, targets, gridPos) + + table.options.withSortBy([ + { + desc: true, + displayName: 'Initialized', }, - "properties": [ - { - "id": "custom.width", - "value": 412 - } - ] - } - ]), + ]) + + table.queryOptions.withTransformations([ + { + id: 'organize', + options: { + excludeByName: {}, + indexByName: {}, + renameByName: { + 'Average containersReadyLatency': 'ContainersReady', + 'Average initializedLatency': 'Initialized', + 'Average podReadyLatency': 'Ready', + 'Average schedulingLatency': 'Scheduling', + 'namespace.keyword': 'Namespace', + 'podName.keyword': 'Pod', + }, + }, + }, + ]) + + table.standardOptions.withOverrides([ + { + matcher: { + id: 'byName', + options: 'nodeName.keyword', + }, + properties: [ + { + id: 'custom.width', + value: 412, + }, + ], + }, + ]), withJobSummary(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + table.options.withSortBy([]) - + table.queryOptions.withTransformations([ - { - "id": "organize", - "options": { - "excludeByName": { - "_id": true, - "_index": true, - "_type": true, - "highlight": true, - "jobConfig.churnDelay": true, - "jobConfig.churnDuration": true, - "jobConfig.churnPercent": true, - "jobConfig.cleanup": true, - "jobConfig.errorOnVerify": true, - "jobConfig.jobIterationDelay": true, - "jobConfig.jobIterations": false, - "jobConfig.jobPause": true, - "jobConfig.jobType": true, - "jobConfig.maxWaitTimeout": true, - "jobConfig.name": true, - "jobConfig.namespace": true, - "jobConfig.namespaceLabels.pod-security.kubernetes.io/audit": true, - "jobConfig.namespaceLabels.pod-security.kubernetes.io/enforce": true, - "jobConfig.namespaceLabels.pod-security.kubernetes.io/warn": true, - "jobConfig.namespaceLabels.security.openshift.io/scc.podSecurityLabelSync": true, - "jobConfig.namespaced": true, - "jobConfig.namespacedIterations": true, - "jobConfig.objects": true, - "jobConfig.podWait": true, - "jobConfig.preLoadImages": true, - "jobConfig.preLoadPeriod": true, - "jobConfig.verifyObjects": true, - "jobConfig.waitFor": true, - "jobConfig.waitForDeletion": true, - "jobConfig.waitWhenFinished": true, - "metadata.cloud-bulldozer": true, - "metadata.k8sVersion": true, - "metadata.ocpVersion": true, - "metadata.platform": true, - "metadata.sdnType": true, - "metadata.totalNodes": true, - "metricName": true, - "sort": true, - "timestamp": true, - "uuid": false - }, - "indexByName": { - "_id": 1, - "_index": 2, - "_type": 3, - "elapsedTime": 8, - "jobConfig.burst": 7, - "jobConfig.cleanup": 12, - "jobConfig.errorOnVerify": 13, - "jobConfig.jobIterationDelay": 14, - "jobConfig.jobIterations": 9, - "jobConfig.jobPause": 15, - "jobConfig.jobType": 10, - "jobConfig.maxWaitTimeout": 16, - "jobConfig.name": 5, - "jobConfig.namespace": 17, - "jobConfig.namespacedIterations": 18, - "jobConfig.objects": 19, - "jobConfig.podWait": 11, - "jobConfig.qps": 6, - "jobConfig.verifyObjects": 20, - "jobConfig.waitFor": 21, - "jobConfig.waitForDeletion": 22, - "jobConfig.waitWhenFinished": 23, - "metricName": 24, - "timestamp": 0, - "uuid": 4 + self.base(title, unit, targets, gridPos) + + table.options.withSortBy([]) + + table.queryOptions.withTransformations([ + { + id: 'organize', + options: { + excludeByName: { + _id: true, + _index: true, + _type: true, + highlight: true, + 'jobConfig.churnDelay': true, + 'jobConfig.churnDuration': true, + 'jobConfig.churnPercent': true, + 'jobConfig.cleanup': true, + 'jobConfig.errorOnVerify': true, + 'jobConfig.jobIterationDelay': true, + 'jobConfig.jobIterations': false, + 'jobConfig.jobPause': true, + 'jobConfig.jobType': true, + 'jobConfig.maxWaitTimeout': true, + 'jobConfig.name': true, + 'jobConfig.namespace': true, + 'jobConfig.namespaceLabels.pod-security.kubernetes.io/audit': true, + 'jobConfig.namespaceLabels.pod-security.kubernetes.io/enforce': true, + 'jobConfig.namespaceLabels.pod-security.kubernetes.io/warn': true, + 'jobConfig.namespaceLabels.security.openshift.io/scc.podSecurityLabelSync': true, + 'jobConfig.namespaced': true, + 'jobConfig.namespacedIterations': true, + 'jobConfig.objects': true, + 'jobConfig.podWait': true, + 'jobConfig.preLoadImages': true, + 'jobConfig.preLoadPeriod': true, + 'jobConfig.verifyObjects': true, + 'jobConfig.waitFor': true, + 'jobConfig.waitForDeletion': true, + 'jobConfig.waitWhenFinished': true, + 'metadata.cloud-bulldozer': true, + 'metadata.k8sVersion': true, + 'metadata.ocpVersion': true, + 'metadata.platform': true, + 'metadata.sdnType': true, + 'metadata.totalNodes': true, + metricName: true, + sort: true, + timestamp: true, + uuid: false, + }, + indexByName: { + _id: 1, + _index: 2, + _type: 3, + elapsedTime: 8, + 'jobConfig.burst': 7, + 'jobConfig.cleanup': 12, + 'jobConfig.errorOnVerify': 13, + 'jobConfig.jobIterationDelay': 14, + 'jobConfig.jobIterations': 9, + 'jobConfig.jobPause': 15, + 'jobConfig.jobType': 10, + 'jobConfig.maxWaitTimeout': 16, + 'jobConfig.name': 5, + 'jobConfig.namespace': 17, + 'jobConfig.namespacedIterations': 18, + 'jobConfig.objects': 19, + 'jobConfig.podWait': 11, + 'jobConfig.qps': 6, + 'jobConfig.verifyObjects': 20, + 'jobConfig.waitFor': 21, + 'jobConfig.waitForDeletion': 22, + 'jobConfig.waitWhenFinished': 23, + metricName: 24, + timestamp: 0, + uuid: 4, + }, + renameByName: { + _type: '', + elapsedTime: 'Elapsed time', + elapsedTimeNs: 'Elapsed Time', + highlight: '', + 'jobConfig.burst': 'Burst', + 'jobConfig.churn': 'Churn', + 'jobConfig.churnDelay': '', + 'jobConfig.cleanup': '', + 'jobConfig.errorOnVerify': 'errorOnVerify', + 'jobConfig.iterationsPerNamespace': 'iterationsPerNs', + 'jobConfig.jobIterationDelay': 'jobIterationDelay', + 'jobConfig.jobIterations': 'Iterations', + 'jobConfig.jobPause': 'jobPause', + 'jobConfig.jobType': 'Job Type', + 'jobConfig.maxWaitTimeout': 'maxWaitTImeout', + 'jobConfig.name': 'Name', + 'jobConfig.namespace': 'namespacePrefix', + 'jobConfig.namespaceLabels.pod-security.kubernetes.io/audit': '', + 'jobConfig.namespaced': '', + 'jobConfig.namespacedIterations': 'Namespaced iterations', + 'jobConfig.objects': '', + 'jobConfig.podWait': 'podWait', + 'jobConfig.preLoadImages': 'Preload Images', + 'jobConfig.preLoadPeriod': '', + 'jobConfig.qps': 'QPS', + 'jobConfig.verifyObjects': '', + 'metadata.platform': 'Platform', + metricName: '', + timestamp: '', + uuid: 'UUID', + version: 'Kube-burner version', + }, + }, }, - "renameByName": { - "_type": "", - "elapsedTime": "Elapsed time", - "elapsedTimeNs": "Elapsed Time", - "highlight": "", - "jobConfig.burst": "Burst", - "jobConfig.churn": "Churn", - "jobConfig.churnDelay": "", - "jobConfig.cleanup": "", - "jobConfig.errorOnVerify": "errorOnVerify", - "jobConfig.iterationsPerNamespace": "iterationsPerNs", - "jobConfig.jobIterationDelay": "jobIterationDelay", - "jobConfig.jobIterations": "Iterations", - "jobConfig.jobPause": "jobPause", - "jobConfig.jobType": "Job Type", - "jobConfig.maxWaitTimeout": "maxWaitTImeout", - "jobConfig.name": "Name", - "jobConfig.namespace": "namespacePrefix", - "jobConfig.namespaceLabels.pod-security.kubernetes.io/audit": "", - "jobConfig.namespaced": "", - "jobConfig.namespacedIterations": "Namespaced iterations", - "jobConfig.objects": "", - "jobConfig.podWait": "podWait", - "jobConfig.preLoadImages": "Preload Images", - "jobConfig.preLoadPeriod": "", - "jobConfig.qps": "QPS", - "jobConfig.verifyObjects": "", - "metadata.platform": "Platform", - "metricName": "", - "timestamp": "", - "uuid": "UUID", - "version": "Kube-burner version" - } - } - } - ]) - + table.standardOptions.withOverrides([ - { - "matcher": { - "id": "byName", - "options": "Elapsed time" + ]) + + table.standardOptions.withOverrides([ + { + matcher: { + id: 'byName', + options: 'Elapsed time', + }, + properties: [ + { + id: 'unit', + value: 's', + }, + ], }, - "properties": [ - { - "id": "unit", - "value": "s" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Elapsed Time" + { + matcher: { + id: 'byName', + options: 'Elapsed Time', + }, + properties: [ + { + id: 'unit', + value: 'ns', + }, + ], }, - "properties": [ - { - "id": "unit", - "value": "ns" - } - ] - } - ]), + ]), withClusterMetadata(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + table.options.withSortBy([]) - + table.standardOptions.withMappings([ + self.base(title, unit, targets, gridPos) + + table.options.withSortBy([]) + + table.standardOptions.withMappings([ { - "options": { - "passed": { - "color": "green", - "index": 0 - } + options: { + passed: { + color: 'green', + index: 0, + }, }, - "type": "value" - } - ]) - + table.queryOptions.withTransformations([ - { - "id": "organize", - "options": { - "excludeByName": { - "_id": true, - "_index": true, - "_type": true, - "benchmark": false, - "clustertype": true, - "endDate": true, - "end_date": true, - "highlight": true, - "jobConfig.cleanup": true, - "jobConfig.errorOnVerify": true, - "jobConfig.jobIterationDelay": true, - "jobConfig.jobIterations": false, - "jobConfig.jobPause": true, - "jobConfig.maxWaitTimeout": true, - "jobConfig.namespace": true, - "jobConfig.namespaced": true, - "jobConfig.namespacedIterations": false, - "jobConfig.objects": true, - "jobConfig.preLoadPeriod": true, - "jobConfig.verifyObjects": true, - "jobConfig.waitFor": true, - "jobConfig.waitForDeletion": true, - "jobConfig.waitWhenFinished": true, - "metricName": true, - "ocp_version": true, - "platform": false, - "sdn_type": false, - "sort": true, - "timestamp": true, - "total_nodes": false, - "uuid": true, - "workload": true, - "workload_nodes_count": true, - "workload_nodes_type": true + type: 'value', }, - "indexByName": { - "_id": 1, - "_index": 2, - "_type": 3, - "benchmark": 5, - "clusterName": 8, - "endDate": 9, - "highlight": 6, - "infraNodesCount": 20, - "infraNodesType": 21, - "k8sVersion": 10, - "masterNodesType": 16, - "metricName": 13, - "ocpVersion": 11, - "passed": 15, - "platform": 12, - "sdnType": 14, - "sort": 7, - "timestamp": 0, - "totalNodes": 17, - "uuid": 4, - "workerNodesCount": 18, - "workerNodesType": 19 + ]) + + table.queryOptions.withTransformations([ + { + id: 'organize', + options: { + excludeByName: { + _id: true, + _index: true, + _type: true, + benchmark: false, + clustertype: true, + endDate: true, + end_date: true, + highlight: true, + 'jobConfig.cleanup': true, + 'jobConfig.errorOnVerify': true, + 'jobConfig.jobIterationDelay': true, + 'jobConfig.jobIterations': false, + 'jobConfig.jobPause': true, + 'jobConfig.maxWaitTimeout': true, + 'jobConfig.namespace': true, + 'jobConfig.namespaced': true, + 'jobConfig.namespacedIterations': false, + 'jobConfig.objects': true, + 'jobConfig.preLoadPeriod': true, + 'jobConfig.verifyObjects': true, + 'jobConfig.waitFor': true, + 'jobConfig.waitForDeletion': true, + 'jobConfig.waitWhenFinished': true, + metricName: true, + ocp_version: true, + platform: false, + sdn_type: false, + sort: true, + timestamp: true, + total_nodes: false, + uuid: true, + workload: true, + workload_nodes_count: true, + workload_nodes_type: true, + }, + indexByName: { + _id: 1, + _index: 2, + _type: 3, + benchmark: 5, + clusterName: 8, + endDate: 9, + highlight: 6, + infraNodesCount: 20, + infraNodesType: 21, + k8sVersion: 10, + masterNodesType: 16, + metricName: 13, + ocpVersion: 11, + passed: 15, + platform: 12, + sdnType: 14, + sort: 7, + timestamp: 0, + totalNodes: 17, + uuid: 4, + workerNodesCount: 18, + workerNodesType: 19, + }, + renameByName: { + _type: '', + clusterName: 'Cluster', + elapsedTime: 'Elapsed time', + endDate: '', + infraNodesCount: 'infra count', + infraNodesType: 'infra type', + infra_nodes_count: 'Infra nodes', + infra_nodes_type: 'Infra flavor', + 'jobConfig.burst': 'Burst', + 'jobConfig.cleanup': '', + 'jobConfig.errorOnVerify': 'errorOnVerify', + 'jobConfig.jobIterationDelay': 'jobIterationDelay', + 'jobConfig.jobIterations': 'Iterations', + 'jobConfig.jobPause': 'jobPause', + 'jobConfig.jobType': 'Job Type', + 'jobConfig.maxWaitTimeout': 'maxWaitTImeout', + 'jobConfig.name': 'Name', + 'jobConfig.namespace': 'namespacePrefix', + 'jobConfig.namespaced': '', + 'jobConfig.namespacedIterations': 'Namespaced iterations', + 'jobConfig.objects': '', + 'jobConfig.podWait': 'podWait', + 'jobConfig.preLoadImages': 'Preload Images', + 'jobConfig.preLoadPeriod': '', + 'jobConfig.qps': 'QPS', + 'jobConfig.verifyObjects': '', + k8sVersion: 'k8s version', + k8s_version: 'k8s version', + masterNodesType: 'master type', + master_nodes_count: 'Master nodes', + master_nodes_type: 'Masters flavor', + metricName: '', + ocpVersion: 'OCP version', + passed: 'Passed', + platform: 'Platform', + result: 'Result', + sdnType: 'SDN', + sdn_type: 'SDN', + timestamp: '', + totalNodes: 'total nodes', + total_nodes: 'Total nodes', + uuid: 'UUID', + workerNodesCount: 'worker count', + workerNodesType: 'worker type', + worker_nodes_count: 'Worker nodes', + worker_nodes_type: 'Workers flavor', + workload: '', + workload_nodes_count: 'Workload nodes', + workload_nodes_type: 'Workload flavor', + }, + }, }, - "renameByName": { - "_type": "", - "clusterName": "Cluster", - "elapsedTime": "Elapsed time", - "endDate": "", - "infraNodesCount": "infra count", - "infraNodesType": "infra type", - "infra_nodes_count": "Infra nodes", - "infra_nodes_type": "Infra flavor", - "jobConfig.burst": "Burst", - "jobConfig.cleanup": "", - "jobConfig.errorOnVerify": "errorOnVerify", - "jobConfig.jobIterationDelay": "jobIterationDelay", - "jobConfig.jobIterations": "Iterations", - "jobConfig.jobPause": "jobPause", - "jobConfig.jobType": "Job Type", - "jobConfig.maxWaitTimeout": "maxWaitTImeout", - "jobConfig.name": "Name", - "jobConfig.namespace": "namespacePrefix", - "jobConfig.namespaced": "", - "jobConfig.namespacedIterations": "Namespaced iterations", - "jobConfig.objects": "", - "jobConfig.podWait": "podWait", - "jobConfig.preLoadImages": "Preload Images", - "jobConfig.preLoadPeriod": "", - "jobConfig.qps": "QPS", - "jobConfig.verifyObjects": "", - "k8sVersion": "k8s version", - "k8s_version": "k8s version", - "masterNodesType": "master type", - "master_nodes_count": "Master nodes", - "master_nodes_type": "Masters flavor", - "metricName": "", - "ocpVersion": "OCP version", - "passed": "Passed", - "platform": "Platform", - "result": "Result", - "sdnType": "SDN", - "sdn_type": "SDN", - "timestamp": "", - "totalNodes": "total nodes", - "total_nodes": "Total nodes", - "uuid": "UUID", - "workerNodesCount": "worker count", - "workerNodesType": "worker type", - "worker_nodes_count": "Worker nodes", - "worker_nodes_type": "Workers flavor", - "workload": "", - "workload_nodes_count": "Workload nodes", - "workload_nodes_type": "Workload flavor" - } - } - } - ]) - + table.standardOptions.withOverrides([ - { - "matcher": { - "id": "byName", - "options": "passed" + ]) + + table.standardOptions.withOverrides([ + { + matcher: { + id: 'byName', + options: 'passed', + }, + properties: [ + { + id: 'custom.cellOptions', + value: { + mode: 'basic', + type: 'color-background', + }, + }, + ], }, - "properties": [ - { - "id": "custom.cellOptions", - "value": { - "mode": "basic", - "type": "color-background" - } - } - ] - } - ]), - } -} \ No newline at end of file + ]), + }, +} diff --git a/assets/kube-burner-report-ocp-wrapper/queries.libsonnet b/assets/kube-burner-report-ocp-wrapper/queries.libsonnet index a849153..ae84aad 100644 --- a/assets/kube-burner-report-ocp-wrapper/queries.libsonnet +++ b/assets/kube-burner-report-ocp-wrapper/queries.libsonnet @@ -1,1584 +1,1584 @@ -local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local variables = import './variables.libsonnet'; +local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local elasticsearch = g.query.elasticsearch; { averagePodLatency: { - query(): - elasticsearch.withAlias("{{field}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField('timestamp') - + elasticsearch.bucketAggs.DateHistogram.withId("5") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(1) - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("podReadyLatency") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("4") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("schedulingLatency") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("3") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("initializedLatency") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("2") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("containersReadyLatency") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: podLatencyMeasurement') - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('{{field}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('5') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(1) + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('podReadyLatency') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('4') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('schedulingLatency') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('3') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('initializedLatency') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('2') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('containersReadyLatency') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: podLatencyMeasurement') + + elasticsearch.withTimeField('timestamp'), }, podLatenciesSummary: { - query(): - elasticsearch.withAlias("$latencyPercentile {{term quantileName.keyword}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("quantileName.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Max.withField("$latencyPercentile") - + elasticsearch.metrics.MetricAggregationWithSettings.Max.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Max.withType('max'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: podLatencyQuantilesMeasurement') - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('$latencyPercentile {{term quantileName.keyword}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('quantileName.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Max.withField('$latencyPercentile') + + elasticsearch.metrics.MetricAggregationWithSettings.Max.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Max.withType('max'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: podLatencyQuantilesMeasurement') + + elasticsearch.withTimeField('timestamp'), }, podConditionsLatency: { query(): - elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("namespace.keyword") - + elasticsearch.bucketAggs.Terms.withId("7") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("100"), - elasticsearch.bucketAggs.Terms.withField("nodeName.keyword") - + elasticsearch.bucketAggs.Terms.withId("6") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("100"), - elasticsearch.bucketAggs.Terms.withField("podName.keyword") - + elasticsearch.bucketAggs.Terms.withId("5") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("100"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("schedulingLatency") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("4") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("initializedLatency") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("3") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("containersReadyLatency") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("2") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("podReadyLatency") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: podLatencyMeasurement') - + elasticsearch.withQueryType('randomWalk') - + elasticsearch.withTimeField('timestamp') + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('namespace.keyword') + + elasticsearch.bucketAggs.Terms.withId('7') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('100'), + elasticsearch.bucketAggs.Terms.withField('nodeName.keyword') + + elasticsearch.bucketAggs.Terms.withId('6') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('100'), + elasticsearch.bucketAggs.Terms.withField('podName.keyword') + + elasticsearch.bucketAggs.Terms.withId('5') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('100'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('schedulingLatency') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('4') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('initializedLatency') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('3') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('containersReadyLatency') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('2') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('podReadyLatency') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: podLatencyMeasurement') + + elasticsearch.withQueryType('randomWalk') + + elasticsearch.withTimeField('timestamp'), }, top10ContainerRuntimeNetworkSetupLatency: { - query(): - elasticsearch.withAlias("{{labels.node.keyword}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.node.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: containerNetworkSetupLatency') - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('{{labels.node.keyword}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.node.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: containerNetworkSetupLatency') + + elasticsearch.withTimeField('timestamp'), }, schedulingThroughput: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: schedulingThroughput') - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: schedulingThroughput') + + elasticsearch.withTimeField('timestamp'), }, mastersCPUUtilization: { queries(): [ - elasticsearch.withAlias("{{labels.instance.keyword}}") - + elasticsearch.withHide(false) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.instance.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.settings.withScript("_value * 100") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: \"nodeCPU-Masters\" AND NOT labels.mode.keyword: idle AND NOT labels.mode.keyword: steal") - + elasticsearch.withTimeField('timestamp'), - elasticsearch.withAlias("Aggregated") - + elasticsearch.withHide(false) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.settings.withScript("_value * 100") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: nodeCPU-Masters AND NOT labels.mode.keyword: idle AND NOT labels.mode.keyword: steal") - + elasticsearch.withTimeField('timestamp') - ] + elasticsearch.withAlias('{{labels.instance.keyword}}') + + elasticsearch.withHide(false) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.instance.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.settings.withScript('_value * 100') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: "nodeCPU-Masters" AND NOT labels.mode.keyword: idle AND NOT labels.mode.keyword: steal') + + elasticsearch.withTimeField('timestamp'), + elasticsearch.withAlias('Aggregated') + + elasticsearch.withHide(false) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.settings.withScript('_value * 100') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: nodeCPU-Masters AND NOT labels.mode.keyword: idle AND NOT labels.mode.keyword: steal') + + elasticsearch.withTimeField('timestamp'), + ], }, mastersMemoryUtilization: { base(alias, query): - elasticsearch.withAlias(alias) - + elasticsearch.withHide(false) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.instance.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery(query) - + elasticsearch.withTimeField('timestamp'), + elasticsearch.withAlias(alias) + + elasticsearch.withHide(false) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.instance.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery(query) + + elasticsearch.withTimeField('timestamp'), queries(): [ - self.base("Utilization {{labels.instance.keyword}}", "uuid.keyword: $uuid AND metricName.keyword: nodeMemoryUtilization-Masters"), - self.base("Total {{labels.instance.keyword}}", "uuid.keyword: $uuid AND metricName.keyword: nodeMemoryTotal-Masters"), - elasticsearch.withAlias("Aggregated utilization") - + elasticsearch.withHide(false) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: nodeMemoryUtilization-Masters") - + elasticsearch.withTimeField('timestamp') - ] + self.base('Utilization {{labels.instance.keyword}}', 'uuid.keyword: $uuid AND metricName.keyword: nodeMemoryUtilization-Masters'), + self.base('Total {{labels.instance.keyword}}', 'uuid.keyword: $uuid AND metricName.keyword: nodeMemoryTotal-Masters'), + elasticsearch.withAlias('Aggregated utilization') + + elasticsearch.withHide(false) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: nodeMemoryUtilization-Masters') + + elasticsearch.withTimeField('timestamp'), + ], }, nodeStatusSummary: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.condition.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('30s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: \"nodeStatus\"") - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.condition.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('30s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: "nodeStatus"') + + elasticsearch.withTimeField('timestamp'), }, podStatusSummary: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.phase.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('30s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: \"podStatusCount\"") - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.phase.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('30s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: "podStatusCount"') + + elasticsearch.withTimeField('timestamp'), }, kubeApiServerUsage: { base(alias, query): - elasticsearch.withAlias(alias) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.pod.keyword") - + elasticsearch.bucketAggs.Terms.withId("5") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("labels.container.keyword") - + elasticsearch.bucketAggs.Terms.withId("4") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("labels.namespace.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('30s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery(query) - + elasticsearch.withTimeField('timestamp'), + elasticsearch.withAlias(alias) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.pod.keyword') + + elasticsearch.bucketAggs.Terms.withId('5') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('labels.container.keyword') + + elasticsearch.bucketAggs.Terms.withId('4') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('labels.namespace.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('30s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery(query) + + elasticsearch.withTimeField('timestamp'), queries(): [ - self.base("{{labels.pod.keyword}}", "uuid.keyword: $uuid AND metricName.keyword: \"containerCPU\" AND labels.container.keyword: kube-apiserver"), - self.base("Rss {{labels.pod.keyword}}", "uuid.keyword: $uuid AND metricName.keyword: \"containerMemory\" AND labels.container.keyword: kube-apiserver"), - self.base("Rss {{labels.pod.keyword}}", "uuid.keyword: $uuid AND metricName.keyword: \"containerMemory-Masters\" AND labels.container.keyword: kube-apiserver"), - self.base("{{labels.pod.keyword}}", "uuid.keyword: $uuid AND metricName.keyword: \"containerCPU-Masters\" AND labels.container.keyword: kube-apiserver"), - ] + self.base('{{labels.pod.keyword}}', 'uuid.keyword: $uuid AND metricName.keyword: "containerCPU" AND labels.container.keyword: kube-apiserver'), + self.base('Rss {{labels.pod.keyword}}', 'uuid.keyword: $uuid AND metricName.keyword: "containerMemory" AND labels.container.keyword: kube-apiserver'), + self.base('Rss {{labels.pod.keyword}}', 'uuid.keyword: $uuid AND metricName.keyword: "containerMemory-Masters" AND labels.container.keyword: kube-apiserver'), + self.base('{{labels.pod.keyword}}', 'uuid.keyword: $uuid AND metricName.keyword: "containerCPU-Masters" AND labels.container.keyword: kube-apiserver'), + ], }, averageKubeApiServerUsage: { base(alias, query): - elasticsearch.withAlias(alias) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.container.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto'), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery(query) - + elasticsearch.withTimeField('timestamp'), + elasticsearch.withAlias(alias) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.container.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery(query) + + elasticsearch.withTimeField('timestamp'), queries(): [ - self.base("Avg CPU kube-apiserver", "uuid.keyword: $uuid AND metricName: \"containerCPU\" AND labels.container.keyword: kube-apiserver"), - self.base("Avg Rss kube-apiserver", "uuid.keyword: $uuid AND metricName: \"containerMemory\" AND labels.container.keyword: kube-apiserver"), - ] + self.base('Avg CPU kube-apiserver', 'uuid.keyword: $uuid AND metricName: "containerCPU" AND labels.container.keyword: kube-apiserver'), + self.base('Avg Rss kube-apiserver', 'uuid.keyword: $uuid AND metricName: "containerMemory" AND labels.container.keyword: kube-apiserver'), + ], }, activeKubeControllerManagerUsage: { base(alias, query): - elasticsearch.withAlias(alias) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.pod.keyword") - + elasticsearch.bucketAggs.Terms.withId("5") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("3"), - elasticsearch.bucketAggs.Terms.withField("labels.container.keyword") - + elasticsearch.bucketAggs.Terms.withId("4") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("labels.namespace.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('30s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery(query) - + elasticsearch.withTimeField('timestamp'), + elasticsearch.withAlias(alias) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.pod.keyword') + + elasticsearch.bucketAggs.Terms.withId('5') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('3'), + elasticsearch.bucketAggs.Terms.withField('labels.container.keyword') + + elasticsearch.bucketAggs.Terms.withId('4') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('labels.namespace.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('30s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery(query) + + elasticsearch.withTimeField('timestamp'), queries(): [ - self.base("{{labels.pod.keyword}}", "uuid.keyword: $uuid AND metricName.keyword: \"containerCPU\" AND labels.container.keyword: kube-controller-manager"), - self.base("Rss {{labels.namespace.keyword}}-{{labels.pod.keyword}}", "uuid.keyword: $uuid AND metricName.keyword: \"containerMemory\" AND labels.container.keyword: kube-controller-manager"), - self.base("{{labels.namespace.keyword}}-{{labels.pod.keyword}}", "uuid.keyword: $uuid AND metricName.keyword: \"containerCPU-Masters\" AND labels.container.keyword: kube-controller-manager"), - self.base("Rss {{labels.namespace.keyword}}-{{labels.pod.keyword}}", "uuid.keyword: $uuid AND metricName.keyword: \"containerMemory-Masters\" AND labels.container.keyword: kube-controller-manager"), - ] + self.base('{{labels.pod.keyword}}', 'uuid.keyword: $uuid AND metricName.keyword: "containerCPU" AND labels.container.keyword: kube-controller-manager'), + self.base('Rss {{labels.namespace.keyword}}-{{labels.pod.keyword}}', 'uuid.keyword: $uuid AND metricName.keyword: "containerMemory" AND labels.container.keyword: kube-controller-manager'), + self.base('{{labels.namespace.keyword}}-{{labels.pod.keyword}}', 'uuid.keyword: $uuid AND metricName.keyword: "containerCPU-Masters" AND labels.container.keyword: kube-controller-manager'), + self.base('Rss {{labels.namespace.keyword}}-{{labels.pod.keyword}}', 'uuid.keyword: $uuid AND metricName.keyword: "containerMemory-Masters" AND labels.container.keyword: kube-controller-manager'), + ], }, kubeSchedulerUsage: { base(alias, query): - elasticsearch.withAlias(alias) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.pod.keyword") - + elasticsearch.bucketAggs.Terms.withId("5") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("labels.container.keyword") - + elasticsearch.bucketAggs.Terms.withId("4") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("labels.namespace.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('30s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery(query) - + elasticsearch.withTimeField('timestamp'), + elasticsearch.withAlias(alias) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.pod.keyword') + + elasticsearch.bucketAggs.Terms.withId('5') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('labels.container.keyword') + + elasticsearch.bucketAggs.Terms.withId('4') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('labels.namespace.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('30s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery(query) + + elasticsearch.withTimeField('timestamp'), queries(): [ - self.base("{{labels.pod.keyword}}", "uuid.keyword: $uuid AND metricName: \"containerCPU\" AND labels.container.keyword: kube-scheduler"), - self.base("Rss {{labels.pod.keyword}}", "uuid.keyword: $uuid AND metricName: \"containerMemory\" AND labels.container.keyword: kube-scheduler"), - self.base("{{labels.pod.keyword}}", "uuid.keyword: $uuid AND metricName: \"containerCPU-Masters\" AND labels.container.keyword: kube-scheduler"), - self.base("Rss {{labels.pod.keyword}}", "uuid.keyword: $uuid AND metricName: \"containerMemory-Masters\" AND labels.container.keyword: kube-scheduler"), - ] + self.base('{{labels.pod.keyword}}', 'uuid.keyword: $uuid AND metricName: "containerCPU" AND labels.container.keyword: kube-scheduler'), + self.base('Rss {{labels.pod.keyword}}', 'uuid.keyword: $uuid AND metricName: "containerMemory" AND labels.container.keyword: kube-scheduler'), + self.base('{{labels.pod.keyword}}', 'uuid.keyword: $uuid AND metricName: "containerCPU-Masters" AND labels.container.keyword: kube-scheduler'), + self.base('Rss {{labels.pod.keyword}}', 'uuid.keyword: $uuid AND metricName: "containerMemory-Masters" AND labels.container.keyword: kube-scheduler'), + ], }, nodeCount: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.role.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.Count.withId("1") - + elasticsearch.metrics.Count.withType('count'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: \"nodeRoles\"") - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.role.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.Count.withId('1') + + elasticsearch.metrics.Count.withType('count'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: "nodeRoles"') + + elasticsearch.withTimeField('timestamp'), }, aggregatesCount: { base(alias, query): - elasticsearch.withAlias(alias) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('30s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery(query) - + elasticsearch.withTimeField('timestamp'), + elasticsearch.withAlias(alias) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('30s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery(query) + + elasticsearch.withTimeField('timestamp'), queries(): [ - self.base("Namespaces", "uuid.keyword: $uuid AND metricName.keyword: \"namespaceCount\" AND labels.phase: \"Active\""), - self.base("Services", "uuid.keyword: $uuid AND metricName.keyword: \"serviceCount\""), - self.base("Deployments", "uuid.keyword: $uuid AND metricName.keyword: \"deploymentCount\""), - self.base("Secrets", "uuid.keyword: $uuid AND metricName.keyword: \"secretCount\""), - self.base("ConfigMaps", "uuid.keyword: $uuid AND metricName.keyword: \"configmapCount\""), - ] + self.base('Namespaces', 'uuid.keyword: $uuid AND metricName.keyword: "namespaceCount" AND labels.phase: "Active"'), + self.base('Services', 'uuid.keyword: $uuid AND metricName.keyword: "serviceCount"'), + self.base('Deployments', 'uuid.keyword: $uuid AND metricName.keyword: "deploymentCount"'), + self.base('Secrets', 'uuid.keyword: $uuid AND metricName.keyword: "secretCount"'), + self.base('ConfigMaps', 'uuid.keyword: $uuid AND metricName.keyword: "configmapCount"'), + ], }, openshiftVersion: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.RawData.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.RawData.settings.withSize("500") - + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withType('raw_data'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: \"etcdVersion\"") - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.RawData.settings.withSize('500') + + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withType('raw_data'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: "etcdVersion"') + + elasticsearch.withTimeField('timestamp'), }, jobSummary: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withHide(false) - + elasticsearch.withBucketAggs([]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.RawData.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.RawData.settings.withSize("500") - + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withType('raw_data'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: jobSummary") - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('') + + elasticsearch.withHide(false) + + elasticsearch.withBucketAggs([]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.RawData.settings.withSize('500') + + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withType('raw_data'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: jobSummary') + + elasticsearch.withTimeField('timestamp'), }, clusterMetadata: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withHide(false) - + elasticsearch.withBucketAggs([]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.RawData.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.RawData.settings.withSize("500") - + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withType('raw_data'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: clusterMetadata") - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('') + + elasticsearch.withHide(false) + + elasticsearch.withBucketAggs([]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.RawData.settings.withSize('500') + + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withType('raw_data'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: clusterMetadata') + + elasticsearch.withTimeField('timestamp'), }, alerts: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.RawData.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.RawData.settings.withSize("500") - + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withType('raw_data'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: alert") - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.RawData.settings.withSize('500') + + elasticsearch.metrics.MetricAggregationWithSettings.RawData.withType('raw_data'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: alert') + + elasticsearch.withTimeField('timestamp'), }, ovnKubeMasterPodStats: { - base(alias, query): - elasticsearch.withAlias(alias) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.pod.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), - ]) - + elasticsearch.withQuery(query) - + elasticsearch.withTimeField('timestamp'), + base(alias, query): + elasticsearch.withAlias(alias) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.pod.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), + ]) + + elasticsearch.withQuery(query) + + elasticsearch.withTimeField('timestamp'), queries(metric): [ - self.base("{{labels.pod.keyword}}", "uuid.keyword: $uuid AND metricName: \""+ metric +"\" AND labels.pod.keyword: /ovnkube-master.*/"), - self.base("{{labels.pod.keyword}}", "uuid.keyword: $uuid AND metricName: \""+ metric +"\" AND labels.pod.keyword: /ovnkube-control-plane.*/"), - ] + self.base('{{labels.pod.keyword}}', 'uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.pod.keyword: /ovnkube-master.*/'), + self.base('{{labels.pod.keyword}}', 'uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.pod.keyword: /ovnkube-control-plane.*/'), + ], }, ovnKubeMasterStats: { - base(alias, query): - elasticsearch.withAlias(alias) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.pod.keyword") - + elasticsearch.bucketAggs.Terms.withId("4") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("labels.container.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges("0"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery(query) - + elasticsearch.withTimeField('timestamp'), + base(alias, query): + elasticsearch.withAlias(alias) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.pod.keyword') + + elasticsearch.bucketAggs.Terms.withId('4') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('labels.container.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges('0'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery(query) + + elasticsearch.withTimeField('timestamp'), queries(metric): [ - self.base("{{labels.pod.keyword}}-{{labels.container.keyword}}", "uuid.keyword: $uuid AND metricName: \""+ metric +"\" AND labels.pod.keyword: /ovnkube-master.*/"), - self.base("{{labels.pod.keyword}}-{{labels.container.keyword}}", "uuid.keyword: $uuid AND metricName: \""+ metric +"\" AND labels.pod.keyword: /ovnkube-control-plane.*/"), - ] + self.base('{{labels.pod.keyword}}-{{labels.container.keyword}}', 'uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.pod.keyword: /ovnkube-master.*/'), + self.base('{{labels.pod.keyword}}-{{labels.container.keyword}}', 'uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.pod.keyword: /ovnkube-control-plane.*/'), + ], }, ovnKubeNodePodStats: { - base(alias, query): - elasticsearch.withAlias(alias) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.pod.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("5"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges("0"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), - ]) - + elasticsearch.withQuery(query) - + elasticsearch.withTimeField('timestamp'), + base(alias, query): + elasticsearch.withAlias(alias) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.pod.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('5'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges('0'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), + ]) + + elasticsearch.withQuery(query) + + elasticsearch.withTimeField('timestamp'), queries(metric): [ - self.base("{{labels.pod.keyword}}", "uuid.keyword: $uuid AND metricName: \""+ metric +"\" AND labels.namespace.keyword: \"openshift-ovn-kubernetes\" AND labels.pod.keyword: /ovnkube-node.*/"), - elasticsearch.withAlias('Aggregated') - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges("0"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName: \""+ metric +"\" AND labels.namespace.keyword: \"openshift-ovn-kubernetes\" AND labels.pod.keyword: /ovnkube-node.*/") - + elasticsearch.withTimeField('timestamp'), - ] + self.base('{{labels.pod.keyword}}', 'uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.namespace.keyword: "openshift-ovn-kubernetes" AND labels.pod.keyword: /ovnkube-node.*/'), + elasticsearch.withAlias('Aggregated') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges('0'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.namespace.keyword: "openshift-ovn-kubernetes" AND labels.pod.keyword: /ovnkube-node.*/') + + elasticsearch.withTimeField('timestamp'), + ], }, ovnControllerStats: { - query(metric): - elasticsearch.withAlias("{{labels.pod.keyword}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.pod.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("5"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges("0"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName: \""+ metric +"\" AND labels.namespace.keyword: \"openshift-ovn-kubernetes\" AND labels.pod.keyword: /ovnkube-node.*/ AND labels.container.keyword: \"ovn-controller\"") - + elasticsearch.withTimeField('timestamp') + query(metric): + elasticsearch.withAlias('{{labels.pod.keyword}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.pod.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('5'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges('0'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.namespace.keyword: "openshift-ovn-kubernetes" AND labels.pod.keyword: /ovnkube-node.*/ AND labels.container.keyword: "ovn-controller"') + + elasticsearch.withTimeField('timestamp'), }, aggregatedOVNKubeMasterStats: { - base(alias, query): - elasticsearch.withAlias(alias) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.container.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges("0"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), - ]) - + elasticsearch.withQuery(query) - + elasticsearch.withTimeField('timestamp'), + base(alias, query): + elasticsearch.withAlias(alias) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.container.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges('0'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), + ]) + + elasticsearch.withQuery(query) + + elasticsearch.withTimeField('timestamp'), queries(metric): [ - self.base("", "uuid.keyword: $uuid AND metricName: \""+ metric +"\" AND labels.pod.keyword: /ovnkube-master.*/"), - self.base("","uuid.keyword: $uuid AND metricName: \""+ metric +"\" AND labels.pod.keyword: /ovnkube-control-plane.*/"), + self.base('', 'uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.pod.keyword: /ovnkube-master.*/'), + self.base('', 'uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.pod.keyword: /ovnkube-control-plane.*/'), ], }, aggregatedOVNKubeNodeStats: { - query(metric): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.container.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges("0"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName: \""+ metric +"\" AND labels.namespace.keyword: \"openshift-ovn-kubernetes\" AND labels.pod.keyword: /ovnkube-node.*/") - + elasticsearch.withTimeField('timestamp') + query(metric): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.container.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges('0'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.namespace.keyword: "openshift-ovn-kubernetes" AND labels.pod.keyword: /ovnkube-node.*/') + + elasticsearch.withTimeField('timestamp'), }, etcd99thLatencies: { - query(metric): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.pod.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges("0"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: \""+ metric +"\"") - + elasticsearch.withTimeField('timestamp') + query(metric): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.pod.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges('0'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: "' + metric + '"') + + elasticsearch.withTimeField('timestamp'), }, etcdLeaderChanges: { - query(): - elasticsearch.withAlias("Etcd leader changes") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: etcdLeaderChangesRate") - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('Etcd leader changes') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: etcdLeaderChangesRate') + + elasticsearch.withTimeField('timestamp'), }, etcd99thNetworkPeerRT: { - query(): - elasticsearch.withAlias("{{labels.pod.keyword}} to {{labels.To.keyword}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.pod.keyword") - + elasticsearch.bucketAggs.Terms.withId("4") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("labels.To.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: 99thEtcdRoundTripTimeSeconds") - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('{{labels.pod.keyword}} to {{labels.To.keyword}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.pod.keyword') + + elasticsearch.bucketAggs.Terms.withId('4') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('labels.To.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: 99thEtcdRoundTripTimeSeconds') + + elasticsearch.withTimeField('timestamp'), }, etcdResourceUtilization: { - base(alias, query): - elasticsearch.withAlias(alias) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.pod.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges("0"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery(query) - + elasticsearch.withTimeField('timestamp'), + base(alias, query): + elasticsearch.withAlias(alias) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.pod.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges('0'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery(query) + + elasticsearch.withTimeField('timestamp'), queries(): [ - self.base("Rss {{labels.pod.keyword}}", "uuid.keyword: $uuid AND metricName.keyword: containerMemory* AND labels.container.keyword: etcd"), - self.base("{{labels.pod.keyword}}", "uuid.keyword: $uuid AND metricName.keyword: containerCPU* AND labels.container.keyword: etcd"), + self.base('Rss {{labels.pod.keyword}}', 'uuid.keyword: $uuid AND metricName.keyword: containerMemory* AND labels.container.keyword: etcd'), + self.base('{{labels.pod.keyword}}', 'uuid.keyword: $uuid AND metricName.keyword: containerCPU* AND labels.container.keyword: etcd'), ], }, readOnlyAPILatencyResource: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.verb.keyword") - + elasticsearch.bucketAggs.Terms.withId("4") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(0) - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("labels.resource.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: readOnlyAPICallsLatency AND labels.scope.keyword: resource") - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.verb.keyword') + + elasticsearch.bucketAggs.Terms.withId('4') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(0) + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('labels.resource.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: readOnlyAPICallsLatency AND labels.scope.keyword: resource') + + elasticsearch.withTimeField('timestamp'), }, readOnlyAPILatencyNamespace: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.verb.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(0) - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: readOnlyAPICallsLatency AND labels.scope.keyword: namespace") - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.verb.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(0) + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: readOnlyAPICallsLatency AND labels.scope.keyword: namespace') + + elasticsearch.withTimeField('timestamp'), }, readOnlyAPILatencyCluster: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.verb.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(0) - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: readOnlyAPICallsLatency AND labels.scope.keyword: cluster") - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.verb.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(0) + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: readOnlyAPICallsLatency AND labels.scope.keyword: cluster') + + elasticsearch.withTimeField('timestamp'), }, readOnlyAPILatencyMutating: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.verb.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(0) - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: mutatingAPICallsLatency") - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.verb.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(0) + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: mutatingAPICallsLatency') + + elasticsearch.withTimeField('timestamp'), }, serviceSyncLatency: { - query(): - elasticsearch.withAlias("Latency") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: serviceSyncLatency") - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('Latency') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: serviceSyncLatency') + + elasticsearch.withTimeField('timestamp'), }, apiRequestRate: { - query(): - elasticsearch.withAlias("{{labels.verb.keyword}} {{labels.resource.keyword}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.resource.keyword") - + elasticsearch.bucketAggs.Terms.withId("4") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("labels.verb.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: APIRequestRate") - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('{{labels.verb.keyword}} {{labels.resource.keyword}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.resource.keyword') + + elasticsearch.bucketAggs.Terms.withId('4') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('labels.verb.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: APIRequestRate') + + elasticsearch.withTimeField('timestamp'), }, top5KubeletProcessByCpuUsage: { queries(): [ - elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.node.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.Terms.settings.withSize("5"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: kubeletCPU") - + elasticsearch.withTimeField('timestamp'), - elasticsearch.withAlias("Average across workers") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: kubeletCPU") - + elasticsearch.withTimeField('timestamp'), + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.node.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('5'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: kubeletCPU') + + elasticsearch.withTimeField('timestamp'), + elasticsearch.withAlias('Average across workers') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: kubeletCPU') + + elasticsearch.withTimeField('timestamp'), ], }, top5CrioProcessByCpuUsage: { queries(): [ - elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.node.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.Terms.settings.withSize("5"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: crioCPU") - + elasticsearch.withTimeField('timestamp'), - elasticsearch.withAlias("Average across workers") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: crioCPU") - + elasticsearch.withTimeField('timestamp'), + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.node.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('5'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: crioCPU') + + elasticsearch.withTimeField('timestamp'), + elasticsearch.withAlias('Average across workers') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: crioCPU') + + elasticsearch.withTimeField('timestamp'), ], }, top5KubeletRSSByMemoryUsage: { queries(): [ - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.node.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.Terms.settings.withSize("5"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: kubeletMemory") - + elasticsearch.withTimeField('timestamp'), - elasticsearch.withAlias("Average across workers") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: kubeletMemory") - + elasticsearch.withTimeField('timestamp'), + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.node.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('5'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: kubeletMemory') + + elasticsearch.withTimeField('timestamp'), + elasticsearch.withAlias('Average across workers') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: kubeletMemory') + + elasticsearch.withTimeField('timestamp'), ], }, top5CrioRSSByMemoryUsage: { queries(): [ - elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.node.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.Terms.settings.withSize("5"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: crioMemory") - + elasticsearch.withTimeField('timestamp'), - elasticsearch.withAlias("Average across workers") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: crioMemory") - + elasticsearch.withTimeField('timestamp'), + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.node.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('5'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: crioMemory') + + elasticsearch.withTimeField('timestamp'), + elasticsearch.withAlias('Average across workers') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: crioMemory') + + elasticsearch.withTimeField('timestamp'), ], }, mastersContainerStats: { - query(metric): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.pod.keyword") - + elasticsearch.bucketAggs.Terms.withId("4") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("labels.container.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s'), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName: \""+ metric +"\" AND labels.node.keyword: $master") - + elasticsearch.withTimeField('timestamp') + query(metric): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.pod.keyword') + + elasticsearch.bucketAggs.Terms.withId('4') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('labels.container.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.node.keyword: $master') + + elasticsearch.withTimeField('timestamp'), }, masterCPU: { - query(): - elasticsearch.withAlias("{{labels.mode.keyword}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.mode.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withSettings({ - "script": { - "inline": "_value*100" - } - }) - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: \"nodeCPU-Masters\" AND labels.instance.keyword: $master") - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('{{labels.mode.keyword}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.mode.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withSettings({ + script: { + inline: '_value*100', + }, + }) + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: "nodeCPU-Masters" AND labels.instance.keyword: $master') + + elasticsearch.withTimeField('timestamp'), }, masterMemory: { base(alias, query): - elasticsearch.withAlias(alias) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery(query) - + elasticsearch.withTimeField('timestamp'), + elasticsearch.withAlias(alias) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery(query) + + elasticsearch.withTimeField('timestamp'), queries(): [ - self.base("Utilization", "uuid.keyword: $uuid AND metricName.keyword: \"nodeMemoryUtilization-Masters\" AND labels.instance.keyword: $master"), + self.base('Utilization', 'uuid.keyword: $uuid AND metricName.keyword: "nodeMemoryUtilization-Masters" AND labels.instance.keyword: $master'), ], }, workersContainerStats: { - query(metric): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.pod.keyword") - + elasticsearch.bucketAggs.Terms.withId("4") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("labels.container.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s'), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: "+ metric +" AND labels.node.keyword: $worker") - + elasticsearch.withTimeField('timestamp') + query(metric): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.pod.keyword') + + elasticsearch.bucketAggs.Terms.withId('4') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('labels.container.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: ' + metric + ' AND labels.node.keyword: $worker') + + elasticsearch.withTimeField('timestamp'), }, workerCPU: { - query(): - elasticsearch.withAlias("{{labels.mode.keyword}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.mode.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withSettings({ - "script": { - "inline": "_value*100" - } - }) - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: \"nodeCPU-Workers\" AND labels.instance.keyword: \"$worker\"") - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('{{labels.mode.keyword}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.mode.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withSettings({ + script: { + inline: '_value*100', + }, + }) + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: "nodeCPU-Workers" AND labels.instance.keyword: "$worker"') + + elasticsearch.withTimeField('timestamp'), }, workerMemory: { base(alias, query): - elasticsearch.withAlias(alias) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery(query) - + elasticsearch.withTimeField('timestamp'), + elasticsearch.withAlias(alias) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery(query) + + elasticsearch.withTimeField('timestamp'), queries(): [ - self.base("Utilization", "uuid.keyword: $uuid AND metricName.keyword: \"nodeMemoryUtilization-Workers\" AND labels.instance.keyword: $worker"), + self.base('Utilization', 'uuid.keyword: $uuid AND metricName.keyword: "nodeMemoryUtilization-Workers" AND labels.instance.keyword: $worker'), ], }, infraContainerStats: { queries(metric): [ - elasticsearch.withAlias("{{labels.pod.keyword}}: {{labels.container.keyword}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.pod.keyword") - + elasticsearch.bucketAggs.Terms.withId("4") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("labels.container.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName: \""+ metric +"\" AND labels.node.keyword: \"$infra\" AND labels.namespace.keyword: $namespace") - + elasticsearch.withTimeField('timestamp'), - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.pod.keyword") - + elasticsearch.bucketAggs.Terms.withId("4") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.Terms.withField("labels.container.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s'), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: "+ metric +"-Infra AND labels.node.keyword: $infra") - + elasticsearch.withTimeField('timestamp'), + elasticsearch.withAlias('{{labels.pod.keyword}}: {{labels.container.keyword}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.pod.keyword') + + elasticsearch.bucketAggs.Terms.withId('4') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('labels.container.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName: "' + metric + '" AND labels.node.keyword: "$infra" AND labels.namespace.keyword: $namespace') + + elasticsearch.withTimeField('timestamp'), + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.pod.keyword') + + elasticsearch.bucketAggs.Terms.withId('4') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.Terms.withField('labels.container.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: ' + metric + '-Infra AND labels.node.keyword: $infra') + + elasticsearch.withTimeField('timestamp'), ], }, infraCPU: { - query(): - elasticsearch.withAlias("{{labels.mode.keyword}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.mode.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withSettings({ - "script": { - "inline": "_value*100" - } - }) - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: \"nodeCPU-Infra\" AND labels.instance.keyword: $infra") - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('{{labels.mode.keyword}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.mode.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withSettings({ + script: { + inline: '_value*100', + }, + }) + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: "nodeCPU-Infra" AND labels.instance.keyword: $infra') + + elasticsearch.withTimeField('timestamp'), }, infraMemory: { base(alias, query): - elasticsearch.withAlias(alias) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery(query) - + elasticsearch.withTimeField('timestamp'), + elasticsearch.withAlias(alias) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery(query) + + elasticsearch.withTimeField('timestamp'), queries(): [ - self.base("available", "uuid.keyword: $uuid AND metricName.keyword: \"nodeMemoryAvailable-Infra\" AND labels.instance.keyword: $infra"), - self.base("Total", "uuid.keyword: $uuid AND metricName.keyword: \"nodeMemoryTotal-Infra\" AND labels.instance.keyword: $infra"), + self.base('available', 'uuid.keyword: $uuid AND metricName.keyword: "nodeMemoryAvailable-Infra" AND labels.instance.keyword: $infra'), + self.base('Total', 'uuid.keyword: $uuid AND metricName.keyword: "nodeMemoryTotal-Infra" AND labels.instance.keyword: $infra'), ], }, aggWorkerNodeCpuUsage: { - query(): - elasticsearch.withAlias("{{labels.mode.keyword}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.mode.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withSettings({ - "script": { - "inline": "_value*100" - } - }) - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: \"nodeCPU-AggregatedWorkers\"") - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('{{labels.mode.keyword}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.mode.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withSettings({ + script: { + inline: '_value*100', + }, + }) + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: "nodeCPU-AggregatedWorkers"') + + elasticsearch.withTimeField('timestamp'), }, aggWorkerNodeMemory: { base(alias, query): - elasticsearch.withAlias(alias) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery(query) - + elasticsearch.withTimeField('timestamp'), + elasticsearch.withAlias(alias) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery(query) + + elasticsearch.withTimeField('timestamp'), queries(): [ - self.base("Available", "uuid.keyword: $uuid AND metricName.keyword: \"nodeMemoryAvailable-AggregatedWorkers\""), + self.base('Available', 'uuid.keyword: $uuid AND metricName.keyword: "nodeMemoryAvailable-AggregatedWorkers"'), ], }, aggWorkerNodeContainerCpuUsage: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.pod.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1'), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: containerCPU-AggregatedWorkers") - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.pod.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount('1'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: containerCPU-AggregatedWorkers') + + elasticsearch.withTimeField('timestamp'), }, aggWorkerNodeContainerMemoryUsage: { - query(): - elasticsearch.withAlias("") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("labels.pod.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount("1") - + elasticsearch.bucketAggs.Terms.settings.withSize("0"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s'), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("value") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery("uuid.keyword: $uuid AND metricName.keyword: containerMemory-AggregatedWorkers") - + elasticsearch.withTimeField('timestamp') + query(): + elasticsearch.withAlias('') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('labels.pod.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + + elasticsearch.bucketAggs.Terms.settings.withSize('0'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('10s'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('value') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid.keyword: $uuid AND metricName.keyword: containerMemory-AggregatedWorkers') + + elasticsearch.withTimeField('timestamp'), }, } diff --git a/assets/kube-burner-report-ocp-wrapper/variables.libsonnet b/assets/kube-burner-report-ocp-wrapper/variables.libsonnet index 2e5ba14..9d3d9a6 100644 --- a/assets/kube-burner-report-ocp-wrapper/variables.libsonnet +++ b/assets/kube-burner-report-ocp-wrapper/variables.libsonnet @@ -8,70 +8,70 @@ local var = g.dashboard.variable; + var.query.generalOptions.withLabel('Datasource'), platform: - var.query.new('platform', "{\"find\": \"terms\", \"field\": \"metadata.platform.keyword\"}") + var.query.new('platform', '{"find": "terms", "field": "metadata.platform.keyword"}') + var.query.withDatasourceFromVariable(self.Datasource) + var.query.withRefresh(2) + var.query.selectionOptions.withMulti() + var.query.selectionOptions.withIncludeAll(false) + var.query.generalOptions.withLabel('Platform'), - + sdn: - var.query.new('sdn', "{\"find\": \"terms\", \"field\": \"metadata.sdnType.keyword\", \"query\": \"metadata.platform.keyword: $platform\"}") + var.query.new('sdn', '{"find": "terms", "field": "metadata.sdnType.keyword", "query": "metadata.platform.keyword: $platform"}') + var.query.withDatasourceFromVariable(self.Datasource) + var.query.withRefresh(1) + var.query.selectionOptions.withMulti() + var.query.selectionOptions.withIncludeAll(false) + var.query.generalOptions.withLabel('SDN type'), - + workload: - var.query.new('workload', "{\"find\": \"terms\", \"field\": \"jobConfig.name.keyword\", \"query\": \"metadata.platform.keyword: $platform AND metadata.sdnType.keyword: $sdn\"}") + var.query.new('workload', '{"find": "terms", "field": "jobConfig.name.keyword", "query": "metadata.platform.keyword: $platform AND metadata.sdnType.keyword: $sdn"}') + var.query.withDatasourceFromVariable(self.Datasource) + var.query.withRefresh(1) + var.query.selectionOptions.withMulti(false) + var.query.selectionOptions.withIncludeAll(false) + var.query.generalOptions.withLabel('Workload'), - + nodes: - var.query.new('nodes', "{\"find\": \"terms\", \"field\": \"metadata.totalNodes\", \"query\": \"metadata.platform.keyword: $platform AND metadata.sdnType.keyword: $sdn AND jobConfig.name.keyword: $workload\"}") + var.query.new('nodes', '{"find": "terms", "field": "metadata.totalNodes", "query": "metadata.platform.keyword: $platform AND metadata.sdnType.keyword: $sdn AND jobConfig.name.keyword: $workload"}') + var.query.withDatasourceFromVariable(self.Datasource) + var.query.withRefresh(1) + var.query.selectionOptions.withMulti(false) + var.query.selectionOptions.withIncludeAll(false) + var.query.generalOptions.withLabel('nodes'), - + uuid: - var.query.new('uuid', "{\"find\": \"terms\", \"field\": \"uuid.keyword\", \"query\": \"metadata.platform.keyword: $platform AND metadata.sdnType.keyword: $sdn AND jobConfig.name.keyword: $workload AND metadata.totalNodes: $nodes\"}") + var.query.new('uuid', '{"find": "terms", "field": "uuid.keyword", "query": "metadata.platform.keyword: $platform AND metadata.sdnType.keyword: $sdn AND jobConfig.name.keyword: $workload AND metadata.totalNodes: $nodes"}') + var.query.withDatasourceFromVariable(self.Datasource) + var.query.withRefresh(2) + var.query.selectionOptions.withMulti(false) + var.query.selectionOptions.withIncludeAll(false) + var.query.generalOptions.withLabel('UUID'), - + master: - var.query.new('master', "{ \"find\" : \"terms\", \"field\": \"labels.node.keyword\", \"query\": \"metricName.keyword: nodeRoles AND labels.role.keyword: master AND uuid.keyword: $uuid\"}") + var.query.new('master', '{ "find" : "terms", "field": "labels.node.keyword", "query": "metricName.keyword: nodeRoles AND labels.role.keyword: master AND uuid.keyword: $uuid"}') + var.query.withDatasourceFromVariable(self.Datasource) + var.query.withRefresh(2) + var.query.selectionOptions.withMulti(true) + var.query.selectionOptions.withIncludeAll(false) + var.query.generalOptions.withLabel('Master nodes'), - + worker: - var.query.new('worker', "{ \"find\" : \"terms\", \"field\": \"labels.node.keyword\", \"query\": \"metricName.keyword: nodeRoles AND labels.role.keyword: worker AND uuid.keyword: $uuid\"}") + var.query.new('worker', '{ "find" : "terms", "field": "labels.node.keyword", "query": "metricName.keyword: nodeRoles AND labels.role.keyword: worker AND uuid.keyword: $uuid"}') + var.query.withDatasourceFromVariable(self.Datasource) + var.query.withRefresh(2) + var.query.selectionOptions.withMulti(true) + var.query.selectionOptions.withIncludeAll(false) + var.query.generalOptions.withLabel('Worker nodes'), - + infra: - var.query.new('infra', "{ \"find\" : \"terms\", \"field\": \"labels.node.keyword\", \"query\": \"metricName.keyword: nodeRoles AND labels.role.keyword: infra AND uuid.keyword: $uuid\"}") + var.query.new('infra', '{ "find" : "terms", "field": "labels.node.keyword", "query": "metricName.keyword: nodeRoles AND labels.role.keyword: infra AND uuid.keyword: $uuid"}') + var.query.withDatasourceFromVariable(self.Datasource) + var.query.withRefresh(2) + var.query.selectionOptions.withMulti(true) + var.query.selectionOptions.withIncludeAll(false) + var.query.generalOptions.withLabel('Infra nodes'), - + latencyPercentile: var.custom.new('latencyPercentile', ['P99', 'P95', 'P50'],) + var.custom.generalOptions.withLabel('Latency percentile'), -} \ No newline at end of file +} diff --git a/assets/ocp-performance/panels.libsonnet b/assets/ocp-performance/panels.libsonnet index 01aedbd..3baee2f 100644 --- a/assets/ocp-performance/panels.libsonnet +++ b/assets/ocp-performance/panels.libsonnet @@ -49,4 +49,4 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn 'last', ]), }, -} \ No newline at end of file +} diff --git a/assets/ocp-performance/queries.libsonnet b/assets/ocp-performance/queries.libsonnet index a8f9b71..f7170bf 100644 --- a/assets/ocp-performance/queries.libsonnet +++ b/assets/ocp-performance/queries.libsonnet @@ -1,230 +1,230 @@ -local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local variables = import './variables.libsonnet'; +local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local generateTimeSeriesQuery(query, legend) = [ - local prometheusQuery = g.query.prometheus; - prometheusQuery.new( + local prometheusQuery = g.query.prometheus; + prometheusQuery.new( '$' + variables.datasource.name, query - ) - + prometheusQuery.withFormat('time_series') - + prometheusQuery.withIntervalFactor(2) - + prometheusQuery.withLegendFormat(legend), + ) + + prometheusQuery.withFormat('time_series') + + prometheusQuery.withIntervalFactor(2) + + prometheusQuery.withLegendFormat(legend), ]; { nodeMemory: { - query(nodeName): - generateTimeSeriesQuery('node_memory_Active_bytes{instance=~"' + nodeName + '"}', 'Active') - + generateTimeSeriesQuery('node_memory_MemTotal_bytes{instance=~"' + nodeName + '"}', 'Total') - + generateTimeSeriesQuery('node_memory_Cached_bytes{instance=~"' + nodeName + '"} + node_memory_Buffers_bytes{instance=~"' + nodeName + '"}', 'Cached + Buffers') - + generateTimeSeriesQuery('node_memory_MemAvailable_bytes{instance=~"' + nodeName + '"}', 'Available') - + generateTimeSeriesQuery('(node_memory_MemTotal_bytes{instance=~"' + nodeName + '"} - (node_memory_MemFree_bytes{instance=~"' + nodeName + '"} + node_memory_Buffers_bytes{instance=~"' + nodeName + '"} + node_memory_Cached_bytes{instance=~"' + nodeName + '"}))', 'Used') + query(nodeName): + generateTimeSeriesQuery('node_memory_Active_bytes{instance=~"' + nodeName + '"}', 'Active') + + generateTimeSeriesQuery('node_memory_MemTotal_bytes{instance=~"' + nodeName + '"}', 'Total') + + generateTimeSeriesQuery('node_memory_Cached_bytes{instance=~"' + nodeName + '"} + node_memory_Buffers_bytes{instance=~"' + nodeName + '"}', 'Cached + Buffers') + + generateTimeSeriesQuery('node_memory_MemAvailable_bytes{instance=~"' + nodeName + '"}', 'Available') + + generateTimeSeriesQuery('(node_memory_MemTotal_bytes{instance=~"' + nodeName + '"} - (node_memory_MemFree_bytes{instance=~"' + nodeName + '"} + node_memory_Buffers_bytes{instance=~"' + nodeName + '"} + node_memory_Cached_bytes{instance=~"' + nodeName + '"}))', 'Used'), }, nodeCPU: { query(nodeName): - generateTimeSeriesQuery('sum by (instance, mode)(irate(node_cpu_seconds_total{instance=~"' + nodeName + '",job=~".*"}[$interval])) * 100', 'Busy {{mode}}') + generateTimeSeriesQuery('sum by (instance, mode)(irate(node_cpu_seconds_total{instance=~"' + nodeName + '",job=~".*"}[$interval])) * 100', 'Busy {{mode}}'), }, diskThroughput: { query(nodeName): - generateTimeSeriesQuery('rate(node_disk_read_bytes_total{device=~"$block_device",instance=~"' + nodeName + '"}[$interval])', '{{ device }} - read') - + generateTimeSeriesQuery('rate(node_disk_written_bytes_total{device=~"$block_device",instance=~"' + nodeName + '"}[$interval])', '{{ device }} - write') + generateTimeSeriesQuery('rate(node_disk_read_bytes_total{device=~"$block_device",instance=~"' + nodeName + '"}[$interval])', '{{ device }} - read') + + generateTimeSeriesQuery('rate(node_disk_written_bytes_total{device=~"$block_device",instance=~"' + nodeName + '"}[$interval])', '{{ device }} - write'), }, diskIOPS: { query(nodeName): - generateTimeSeriesQuery('rate(node_disk_reads_completed_total{device=~"$block_device",instance=~"' + nodeName + '"}[$interval])', '{{ device }} - read') - + generateTimeSeriesQuery('rate(node_disk_writes_completed_total{device=~"$block_device",instance=~"' + nodeName + '"}[$interval])', '{{ device }} - write') + generateTimeSeriesQuery('rate(node_disk_reads_completed_total{device=~"$block_device",instance=~"' + nodeName + '"}[$interval])', '{{ device }} - read') + + generateTimeSeriesQuery('rate(node_disk_writes_completed_total{device=~"$block_device",instance=~"' + nodeName + '"}[$interval])', '{{ device }} - write'), }, networkUtilization: { query(nodeName): - generateTimeSeriesQuery('rate(node_network_receive_bytes_total{instance=~"' + nodeName + '",device=~"$net_device"}[$interval]) * 8', '{{instance}} - {{device}} - RX') - + generateTimeSeriesQuery('rate(node_network_transmit_bytes_total{instance=~"' + nodeName + '",device=~"$net_device"}[$interval]) * 8', '{{instance}} - {{device}} - TX') + generateTimeSeriesQuery('rate(node_network_receive_bytes_total{instance=~"' + nodeName + '",device=~"$net_device"}[$interval]) * 8', '{{instance}} - {{device}} - RX') + + generateTimeSeriesQuery('rate(node_network_transmit_bytes_total{instance=~"' + nodeName + '",device=~"$net_device"}[$interval]) * 8', '{{instance}} - {{device}} - TX'), }, networkPackets: { query(nodeName): - generateTimeSeriesQuery('rate(node_network_receive_packets_total{instance=~"' + nodeName + '",device=~"$net_device"}[$interval])', '{{instance}} - {{device}} - RX') - + generateTimeSeriesQuery('rate(node_network_transmit_packets_total{instance=~"' + nodeName + '",device=~"$net_device"}[$interval])', '{{instance}} - {{device}} - TX') + generateTimeSeriesQuery('rate(node_network_receive_packets_total{instance=~"' + nodeName + '",device=~"$net_device"}[$interval])', '{{instance}} - {{device}} - RX') + + generateTimeSeriesQuery('rate(node_network_transmit_packets_total{instance=~"' + nodeName + '",device=~"$net_device"}[$interval])', '{{instance}} - {{device}} - TX'), }, networkDrop: { query(nodeName): - generateTimeSeriesQuery('topk(10, rate(node_network_receive_drop_total{instance=~"' + nodeName + '"}[$interval]))', 'rx-drop-{{ device }}') - + generateTimeSeriesQuery('topk(10,rate(node_network_transmit_drop_total{instance=~"' + nodeName + '"}[$interval]))', 'tx-drop-{{ device }}') + generateTimeSeriesQuery('topk(10, rate(node_network_receive_drop_total{instance=~"' + nodeName + '"}[$interval]))', 'rx-drop-{{ device }}') + + generateTimeSeriesQuery('topk(10,rate(node_network_transmit_drop_total{instance=~"' + nodeName + '"}[$interval]))', 'tx-drop-{{ device }}'), }, conntrackStats: { query(nodeName): - generateTimeSeriesQuery('node_nf_conntrack_entries{instance=~"' + nodeName + '"}', 'conntrack_entries') - + generateTimeSeriesQuery('node_nf_conntrack_entries_limit{instance=~"' + nodeName + '"}', 'conntrack_limit') + generateTimeSeriesQuery('node_nf_conntrack_entries{instance=~"' + nodeName + '"}', 'conntrack_entries') + + generateTimeSeriesQuery('node_nf_conntrack_entries_limit{instance=~"' + nodeName + '"}', 'conntrack_limit'), }, top10ContainerCPU: { query(nodeName): - generateTimeSeriesQuery('topk(10, sum(irate(container_cpu_usage_seconds_total{container!="POD",name!="",node=~"' + nodeName + '",namespace!="",namespace=~"$namespace"}[$interval])) by (pod,container,namespace,name,service) * 100)', '{{ pod }}: {{ container }}') + generateTimeSeriesQuery('topk(10, sum(irate(container_cpu_usage_seconds_total{container!="POD",name!="",node=~"' + nodeName + '",namespace!="",namespace=~"$namespace"}[$interval])) by (pod,container,namespace,name,service) * 100)', '{{ pod }}: {{ container }}'), }, top10ContainerRSS: { query(nodeName): - generateTimeSeriesQuery('topk(10, container_memory_rss{container!="POD",name!="",node=~"' + nodeName + '",namespace!="",namespace=~"$namespace"})', '{{ pod }}: {{ container }}') + generateTimeSeriesQuery('topk(10, container_memory_rss{container!="POD",name!="",node=~"' + nodeName + '",namespace!="",namespace=~"$namespace"})', '{{ pod }}: {{ container }}'), }, containerWriteBytes: { query(nodeName): - generateTimeSeriesQuery('sum(rate(container_fs_writes_bytes_total{device!~".+dm.+", node=~"' + nodeName + '", container!=""}[$interval])) by (device, container)', '{{ container }}: {{ device }}') + generateTimeSeriesQuery('sum(rate(container_fs_writes_bytes_total{device!~".+dm.+", node=~"' + nodeName + '", container!=""}[$interval])) by (device, container)', '{{ container }}: {{ device }}'), }, stackroxCPU: { query(): - generateTimeSeriesQuery('topk(25, sum(irate(container_cpu_usage_seconds_total{container!="POD",name!="",namespace!="",namespace=~"stackrox"}[$interval])) by (pod,container,namespace,name,service) * 100)', '{{ pod }}: {{ container }}') + generateTimeSeriesQuery('topk(25, sum(irate(container_cpu_usage_seconds_total{container!="POD",name!="",namespace!="",namespace=~"stackrox"}[$interval])) by (pod,container,namespace,name,service) * 100)', '{{ pod }}: {{ container }}'), }, stackroxMem: { query(): - generateTimeSeriesQuery('topk(25, container_memory_rss{container!="POD",name!="",namespace!="",namespace=~"stackrox"})', '{{ pod }}: {{ container }}') + generateTimeSeriesQuery('topk(25, container_memory_rss{container!="POD",name!="",namespace!="",namespace=~"stackrox"})', '{{ pod }}: {{ container }}'), }, OVSCPU: { query(nodeName): - generateTimeSeriesQuery('irate(container_cpu_usage_seconds_total{id=~"/system.slice/ovs-vswitchd.service", node=~"' + nodeName + '"}[$interval])*100', 'OVS CPU - {{ node }}') - + generateTimeSeriesQuery('irate(container_cpu_usage_seconds_total{id=~"/system.slice/ovsdb-server.service", node=~"' + nodeName + '"}[$interval])*100', 'OVS DB CPU - {{ node }}') + generateTimeSeriesQuery('irate(container_cpu_usage_seconds_total{id=~"/system.slice/ovs-vswitchd.service", node=~"' + nodeName + '"}[$interval])*100', 'OVS CPU - {{ node }}') + + generateTimeSeriesQuery('irate(container_cpu_usage_seconds_total{id=~"/system.slice/ovsdb-server.service", node=~"' + nodeName + '"}[$interval])*100', 'OVS DB CPU - {{ node }}'), }, OVSMemory: { query(nodeName): - generateTimeSeriesQuery('container_memory_rss{id=~"/system.slice/ovs-vswitchd.service", node=~"' + nodeName + '"}', 'OVS Memory - {{ node }}') - + generateTimeSeriesQuery('container_memory_rss{id=~"/system.slice/ovsdb-server.service", node=~"' + nodeName + '"}', 'OVS DB Memory - {{ node }}') + generateTimeSeriesQuery('container_memory_rss{id=~"/system.slice/ovs-vswitchd.service", node=~"' + nodeName + '"}', 'OVS Memory - {{ node }}') + + generateTimeSeriesQuery('container_memory_rss{id=~"/system.slice/ovsdb-server.service", node=~"' + nodeName + '"}', 'OVS DB Memory - {{ node }}'), }, ovnAnnotationLatency: { query(): - generateTimeSeriesQuery('histogram_quantile(0.99, sum by (pod, le) (rate(ovnkube_controller_pod_creation_latency_seconds_bucket[$interval]))) > 0', '{{ pod }}') + generateTimeSeriesQuery('histogram_quantile(0.99, sum by (pod, le) (rate(ovnkube_controller_pod_creation_latency_seconds_bucket[$interval]))) > 0', '{{ pod }}'), }, ovnCNIAdd: { query(): - generateTimeSeriesQuery('histogram_quantile(0.99, sum(rate(ovnkube_node_cni_request_duration_seconds_bucket{command="ADD"}[$interval])) by (pod,le)) > 0', '{{ pod }}') + generateTimeSeriesQuery('histogram_quantile(0.99, sum(rate(ovnkube_node_cni_request_duration_seconds_bucket{command="ADD"}[$interval])) by (pod,le)) > 0', '{{ pod }}'), }, ovnCNIDel: { query(): - generateTimeSeriesQuery('histogram_quantile(0.99, sum(rate(ovnkube_node_cni_request_duration_seconds_bucket{command="DEL"}[$interval])) by (pod,le)) > 0', '{{ pod }}') + generateTimeSeriesQuery('histogram_quantile(0.99, sum(rate(ovnkube_node_cni_request_duration_seconds_bucket{command="DEL"}[$interval])) by (pod,le)) > 0', '{{ pod }}'), }, ovnKubeMasterCPU: { query(): - generateTimeSeriesQuery('irate(container_cpu_usage_seconds_total{pod=~"ovnkube-master.*",namespace="openshift-ovn-kubernetes",container!~"POD|"}[$interval])*100', '{{container}}-{{pod}}-{{node}}') + generateTimeSeriesQuery('irate(container_cpu_usage_seconds_total{pod=~"ovnkube-master.*",namespace="openshift-ovn-kubernetes",container!~"POD|"}[$interval])*100', '{{container}}-{{pod}}-{{node}}'), }, ovnKubeMasterMem: { query(): - generateTimeSeriesQuery('container_memory_rss{pod=~"ovnkube-master-.*",namespace="openshift-ovn-kubernetes",container!~"POD|"}', '{{container}}-{{pod}}-{{node}}') + generateTimeSeriesQuery('container_memory_rss{pod=~"ovnkube-master-.*",namespace="openshift-ovn-kubernetes",container!~"POD|"}', '{{container}}-{{pod}}-{{node}}'), }, topOvnControllerCPU: { query(): - generateTimeSeriesQuery('topk(10, irate(container_cpu_usage_seconds_total{pod=~"ovnkube-.*",namespace="openshift-ovn-kubernetes",container="ovn-controller"}[$interval])*100)', '{{node}}') + generateTimeSeriesQuery('topk(10, irate(container_cpu_usage_seconds_total{pod=~"ovnkube-.*",namespace="openshift-ovn-kubernetes",container="ovn-controller"}[$interval])*100)', '{{node}}'), }, topOvnControllerMem: { query(): - generateTimeSeriesQuery('topk(10, sum(container_memory_rss{pod=~"ovnkube-node-.*",namespace="openshift-ovn-kubernetes",container="ovn-controller"}) by (node))', '{{node}}') + generateTimeSeriesQuery('topk(10, sum(container_memory_rss{pod=~"ovnkube-node-.*",namespace="openshift-ovn-kubernetes",container="ovn-controller"}) by (node))', '{{node}}'), }, promReplCpuUsage: { query(): - generateTimeSeriesQuery('sum(irate(container_cpu_usage_seconds_total{pod=~"prometheus-k8s-0",namespace!="",name!="",container="prometheus"}[$interval])) by (pod,container) * 100', '{{pod}}') - + generateTimeSeriesQuery('sum(irate(container_cpu_usage_seconds_total{pod=~"prometheus-k8s-1",namespace!="",name!="",container="prometheus"}[$interval])) by (pod,container) * 100', '{{pod}}') + generateTimeSeriesQuery('sum(irate(container_cpu_usage_seconds_total{pod=~"prometheus-k8s-0",namespace!="",name!="",container="prometheus"}[$interval])) by (pod,container) * 100', '{{pod}}') + + generateTimeSeriesQuery('sum(irate(container_cpu_usage_seconds_total{pod=~"prometheus-k8s-1",namespace!="",name!="",container="prometheus"}[$interval])) by (pod,container) * 100', '{{pod}}'), }, promReplMemUsage: { query(): - generateTimeSeriesQuery('sum(container_memory_rss{pod="prometheus-k8s-1",namespace!="",name!="",container="prometheus"}) by (pod)', '{{pod}}') - + generateTimeSeriesQuery('sum(container_memory_rss{pod="prometheus-k8s-0",namespace!="",name!="",container="prometheus"}) by (pod)', '{{pod}}') + generateTimeSeriesQuery('sum(container_memory_rss{pod="prometheus-k8s-1",namespace!="",name!="",container="prometheus"}) by (pod)', '{{pod}}') + + generateTimeSeriesQuery('sum(container_memory_rss{pod="prometheus-k8s-0",namespace!="",name!="",container="prometheus"}) by (pod)', '{{pod}}'), }, metricsServerCpuUsage: { query(): - generateTimeSeriesQuery('sum(irate(container_cpu_usage_seconds_total{pod=~"metrics-server-.*",namespace!="",name!=""}[$interval])) by (pod,container) * 100', '{{pod}}') - + generateTimeSeriesQuery('sum(irate(container_cpu_usage_seconds_total{pod=~"prometheus-adapter-.*",namespace="openshift-monitoring",name!=""}[$interval])) by (pod,container) * 100', '{{pod}}') + generateTimeSeriesQuery('sum(irate(container_cpu_usage_seconds_total{pod=~"metrics-server-.*",namespace!="",name!=""}[$interval])) by (pod,container) * 100', '{{pod}}') + + generateTimeSeriesQuery('sum(irate(container_cpu_usage_seconds_total{pod=~"prometheus-adapter-.*",namespace="openshift-monitoring",name!=""}[$interval])) by (pod,container) * 100', '{{pod}}'), }, metricsServerMemUsage: { query(): - generateTimeSeriesQuery('sum(container_memory_rss{pod=~"metrics-server-.*",namespace!="",name!=""}) by (pod)', '{{pod}}') - + generateTimeSeriesQuery('sum(container_memory_rss{pod=~"prometheus-adapter-.*",namespace="openshift-monitoring",name!=""}) by (pod)', '{{pod}}') + generateTimeSeriesQuery('sum(container_memory_rss{pod=~"metrics-server-.*",namespace!="",name!=""}) by (pod)', '{{pod}}') + + generateTimeSeriesQuery('sum(container_memory_rss{pod=~"prometheus-adapter-.*",namespace="openshift-monitoring",name!=""}) by (pod)', '{{pod}}'), }, kubeletCPU: { query(): - generateTimeSeriesQuery('topk(10,irate(process_cpu_seconds_total{service="kubelet",job="kubelet"}[$interval])*100)', 'kubelet - {{node}}') + generateTimeSeriesQuery('topk(10,irate(process_cpu_seconds_total{service="kubelet",job="kubelet"}[$interval])*100)', 'kubelet - {{node}}'), }, crioCPU: { query(): - generateTimeSeriesQuery('topk(10,irate(process_cpu_seconds_total{service="kubelet",job="crio"}[$interval])*100)', 'crio - {{node}}') + generateTimeSeriesQuery('topk(10,irate(process_cpu_seconds_total{service="kubelet",job="crio"}[$interval])*100)', 'crio - {{node}}'), }, kubeletMemory: { query(): - generateTimeSeriesQuery('topk(10,process_resident_memory_bytes{service="kubelet",job="kubelet"})', 'kubelet - {{node}}') + generateTimeSeriesQuery('topk(10,process_resident_memory_bytes{service="kubelet",job="kubelet"})', 'kubelet - {{node}}'), }, crioMemory: { query(): - generateTimeSeriesQuery('topk(10,process_resident_memory_bytes{service="kubelet",job="crio"})', 'crio - {{node}}') + generateTimeSeriesQuery('topk(10,process_resident_memory_bytes{service="kubelet",job="crio"})', 'crio - {{node}}'), }, crioINodes: { query(): - generateTimeSeriesQuery('(1 - node_filesystem_files_free{fstype!="",mountpoint="/run"} / node_filesystem_files{fstype!="",mountpoint="/run"}) * 100', '/var/run - {{instance}}') + generateTimeSeriesQuery('(1 - node_filesystem_files_free{fstype!="",mountpoint="/run"} / node_filesystem_files{fstype!="",mountpoint="/run"}) * 100', '/var/run - {{instance}}'), }, currentNodeCount: { query(): - generateTimeSeriesQuery('sum(kube_node_info{})', 'Number of nodes') - + generateTimeSeriesQuery('sum(kube_node_status_condition{status="true"}) by (condition) > 0', 'Node: {{ condition }}') + generateTimeSeriesQuery('sum(kube_node_info{})', 'Number of nodes') + + generateTimeSeriesQuery('sum(kube_node_status_condition{status="true"}) by (condition) > 0', 'Node: {{ condition }}'), }, currentNamespaceCount: { query(): - generateTimeSeriesQuery('sum(kube_namespace_status_phase) by (phase)', '{{ phase }}') + generateTimeSeriesQuery('sum(kube_namespace_status_phase) by (phase)', '{{ phase }}'), }, currentPodCount: { query(): - generateTimeSeriesQuery('sum(kube_pod_status_phase{}) by (phase) > 0', '{{ phase}} Pods') + generateTimeSeriesQuery('sum(kube_pod_status_phase{}) by (phase) > 0', '{{ phase}} Pods'), }, nsCount: { query(): - generateTimeSeriesQuery('sum(kube_namespace_status_phase) by (phase) > 0', '{{ phase }} namespaces') + generateTimeSeriesQuery('sum(kube_namespace_status_phase) by (phase) > 0', '{{ phase }} namespaces'), }, podCount: { query(): - generateTimeSeriesQuery('sum(kube_pod_status_phase{}) by (phase)', '{{phase}} pods') + generateTimeSeriesQuery('sum(kube_pod_status_phase{}) by (phase)', '{{phase}} pods'), }, secretCmCount: { query(): - generateTimeSeriesQuery('count(kube_secret_info{})', 'secrets') - + generateTimeSeriesQuery('count(kube_configmap_info{})', 'Configmaps') + generateTimeSeriesQuery('count(kube_secret_info{})', 'secrets') + + generateTimeSeriesQuery('count(kube_configmap_info{})', 'Configmaps'), }, deployCount: { query(): - generateTimeSeriesQuery('count(kube_deployment_labels{})', 'Deployments') + generateTimeSeriesQuery('count(kube_deployment_labels{})', 'Deployments'), }, servicesCount: { query(): - generateTimeSeriesQuery('count(kube_service_info{})', 'Services') + generateTimeSeriesQuery('count(kube_service_info{})', 'Services'), }, routesCount: { query(): - generateTimeSeriesQuery('count(openshift_route_info{})', 'Routes') + generateTimeSeriesQuery('count(openshift_route_info{})', 'Routes'), }, alerts: { query(): - generateTimeSeriesQuery('topk(10,sum(ALERTS{severity!="none"}) by (alertname, severity))', '{{severity}}: {{alertname}}') + generateTimeSeriesQuery('topk(10,sum(ALERTS{severity!="none"}) by (alertname, severity))', '{{severity}}: {{alertname}}'), }, podDistribution: { query(): - generateTimeSeriesQuery('count(kube_pod_info{}) by (node)', '{{ node }}') + generateTimeSeriesQuery('count(kube_pod_info{}) by (node)', '{{ node }}'), }, top10ContMem: { query(): - generateTimeSeriesQuery('topk(10, container_memory_rss{namespace!="",container!="POD",name!=""})', '{{ namespace }} - {{ name }}') + generateTimeSeriesQuery('topk(10, container_memory_rss{namespace!="",container!="POD",name!=""})', '{{ namespace }} - {{ name }}'), }, contMemRSSSystemSlice: { query(): - generateTimeSeriesQuery('sum by (node)(container_memory_rss{id="/system.slice"})', 'system.slice - {{ node }}') + generateTimeSeriesQuery('sum by (node)(container_memory_rss{id="/system.slice"})', 'system.slice - {{ node }}'), }, top10ContCPU: { query(): - generateTimeSeriesQuery('topk(10,irate(container_cpu_usage_seconds_total{namespace!="",container!="POD",name!=""}[$interval])*100)', '{{ namespace }} - {{ name }}') + generateTimeSeriesQuery('topk(10,irate(container_cpu_usage_seconds_total{namespace!="",container!="POD",name!=""}[$interval])*100)', '{{ namespace }} - {{ name }}'), }, goroutinesCount: { query(): - generateTimeSeriesQuery('topk(10, sum(go_goroutines{}) by (job,instance))', '{{ job }} - {{ instance }}') + generateTimeSeriesQuery('topk(10, sum(go_goroutines{}) by (job,instance))', '{{ job }} - {{ instance }}'), }, clusterOperatorsOverview: { query(): - generateTimeSeriesQuery('sum by (condition)(cluster_operator_conditions{condition!=""})', '{{ condition }}') + generateTimeSeriesQuery('sum by (condition)(cluster_operator_conditions{condition!=""})', '{{ condition }}'), }, clusterOperatorsInformation: { query(): - generateTimeSeriesQuery('cluster_operator_conditions{name!="",reason!=""}', '{{name}} - {{reason}}') + generateTimeSeriesQuery('cluster_operator_conditions{name!="",reason!=""}', '{{name}} - {{reason}}'), }, clusterOperatorsDegraded: { query(): - generateTimeSeriesQuery('cluster_operator_conditions{condition="Degraded",name!="",reason!=""}', '{{name}} - {{reason}}') + generateTimeSeriesQuery('cluster_operator_conditions{condition="Degraded",name!="",reason!=""}', '{{name}} - {{reason}}'), }, } diff --git a/assets/ocp-performance/variables.libsonnet b/assets/ocp-performance/variables.libsonnet index e067d67..64ae056 100644 --- a/assets/ocp-performance/variables.libsonnet +++ b/assets/ocp-performance/variables.libsonnet @@ -80,8 +80,8 @@ local var = g.dashboard.variable; + var.query.selectionOptions.withMulti(true) + var.query.selectionOptions.withIncludeAll(true) + var.query.generalOptions.withLabel('Network device'), - + interval: - var.interval.new('interval', ['2m','3m','4m','5m'],) + var.interval.new('interval', ['2m', '3m', '4m', '5m'],) + var.interval.generalOptions.withLabel('interval'), -} \ No newline at end of file +} diff --git a/assets/ovn-monitoring/panels.libsonnet b/assets/ovn-monitoring/panels.libsonnet index 975a5ad..40c19b2 100644 --- a/assets/ovn-monitoring/panels.libsonnet +++ b/assets/ovn-monitoring/panels.libsonnet @@ -1,100 +1,100 @@ -local g = import "github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet"; +local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; { - stat: { - local stat = g.panel.stat, - local options = stat.options, + stat: { + local stat = g.panel.stat, + local options = stat.options, - base(title, unit, targets, gridPos): - stat.new(title) - + stat.datasource.withType('prometheus') - + stat.datasource.withUid('$Datasource') - + stat.standardOptions.withUnit(unit) - + stat.queryOptions.withTargets(targets) - + stat.gridPos.withX(gridPos.x) - + stat.gridPos.withY(gridPos.y) - + stat.gridPos.withH(gridPos.h) - + stat.gridPos.withW(gridPos.w) - + options.withJustifyMode("auto") - + options.withGraphMode("area") - + options.text.withTitleSize(12) - + stat.standardOptions.color.withMode('thresholds') - + options.withColorMode('none') - + options.withColorMode('value'), + base(title, unit, targets, gridPos): + stat.new(title) + + stat.datasource.withType('prometheus') + + stat.datasource.withUid('$Datasource') + + stat.standardOptions.withUnit(unit) + + stat.queryOptions.withTargets(targets) + + stat.gridPos.withX(gridPos.x) + + stat.gridPos.withY(gridPos.y) + + stat.gridPos.withH(gridPos.h) + + stat.gridPos.withW(gridPos.w) + + options.withJustifyMode('auto') + + options.withGraphMode('area') + + options.text.withTitleSize(12) + + stat.standardOptions.color.withMode('thresholds') + + options.withColorMode('none') + + options.withColorMode('value'), - genericstatLegendPanel(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + stat.options.reduceOptions.withCalcs([ - 'last' - ]), - - genericstatThresoldPanel(title, unit, targets, gridPos): - self.genericstatLegendPanel(title, unit, targets, gridPos) - + stat.standardOptions.thresholds.withSteps([ - { - "color": "green", - "value": null - }, - { - "color": "orange", - "value": 0 - }, - { - "color": "green", - "value": 1 - } - ]) - + options.withTextMode('name'), - - genericstatThresoldOVNControllerPanel(title, unit, targets, gridPos): - self.genericstatLegendPanel(title, unit, targets, gridPos) - + stat.standardOptions.thresholds.withSteps([ - { - 'color': 'green', - 'value': null - } - ]) - + options.withTextMode('auto'), - }, + genericstatLegendPanel(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + stat.options.reduceOptions.withCalcs([ + 'last', + ]), - timeSeries: { - local timeSeries = g.panel.timeSeries, - local custom = timeSeries.fieldConfig.defaults.custom, - local options = timeSeries.options, + genericstatThresoldPanel(title, unit, targets, gridPos): + self.genericstatLegendPanel(title, unit, targets, gridPos) + + stat.standardOptions.thresholds.withSteps([ + { + color: 'green', + value: null, + }, + { + color: 'orange', + value: 0, + }, + { + color: 'green', + value: 1, + }, + ]) + + options.withTextMode('name'), - base(title, unit, targets, gridPos): - timeSeries.new(title) - + timeSeries.queryOptions.withTargets(targets) - + timeSeries.datasource.withType('prometheus') - + timeSeries.datasource.withUid('$Datasource') - + timeSeries.standardOptions.withUnit(unit) - + timeSeries.gridPos.withX(gridPos.x) - + timeSeries.gridPos.withY(gridPos.y) - + timeSeries.gridPos.withH(gridPos.h) - + timeSeries.gridPos.withW(gridPos.w) - + custom.withDrawStyle("line") - + custom.withLineInterpolation("linear") - + custom.withBarAlignment(0) - + custom.withLineWidth(1) - + custom.withFillOpacity(10) - + custom.withGradientMode("none") - + custom.withSpanNulls(false) - + custom.withPointSize(5) - + custom.withSpanNulls(false) - + custom.stacking.withMode("none") - + custom.withShowPoints('never') - + options.tooltip.withMode('multi') - + options.tooltip.withSort('desc') - + options.legend.withShowLegend(true) - + options.legend.withPlacement('bottom'), + genericstatThresoldOVNControllerPanel(title, unit, targets, gridPos): + self.genericstatLegendPanel(title, unit, targets, gridPos) + + stat.standardOptions.thresholds.withSteps([ + { + color: 'green', + value: null, + }, + ]) + + options.withTextMode('auto'), + }, - genericTimeSeriesLegendPanel(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + options.legend.withCalcs([ - "mean", - "max" - ]) - + options.legend.withDisplayMode('table'), + timeSeries: { + local timeSeries = g.panel.timeSeries, + local custom = timeSeries.fieldConfig.defaults.custom, + local options = timeSeries.options, + base(title, unit, targets, gridPos): + timeSeries.new(title) + + timeSeries.queryOptions.withTargets(targets) + + timeSeries.datasource.withType('prometheus') + + timeSeries.datasource.withUid('$Datasource') + + timeSeries.standardOptions.withUnit(unit) + + timeSeries.gridPos.withX(gridPos.x) + + timeSeries.gridPos.withY(gridPos.y) + + timeSeries.gridPos.withH(gridPos.h) + + timeSeries.gridPos.withW(gridPos.w) + + custom.withDrawStyle('line') + + custom.withLineInterpolation('linear') + + custom.withBarAlignment(0) + + custom.withLineWidth(1) + + custom.withFillOpacity(10) + + custom.withGradientMode('none') + + custom.withSpanNulls(false) + + custom.withPointSize(5) + + custom.withSpanNulls(false) + + custom.stacking.withMode('none') + + custom.withShowPoints('never') + + options.tooltip.withMode('multi') + + options.tooltip.withSort('desc') + + options.legend.withShowLegend(true) + + options.legend.withPlacement('bottom'), - } -} \ No newline at end of file + genericTimeSeriesLegendPanel(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + options.legend.withCalcs([ + 'mean', + 'max', + ]) + + options.legend.withDisplayMode('table'), + + + }, +} diff --git a/assets/ovn-monitoring/queries.libsonnet b/assets/ovn-monitoring/queries.libsonnet index 0f7aece..d2e7f76 100644 --- a/assets/ovn-monitoring/queries.libsonnet +++ b/assets/ovn-monitoring/queries.libsonnet @@ -1,111 +1,111 @@ -local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local variables = import './variables.libsonnet'; +local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local generateTimeSeriesQuery(query, legend) = [ - local prometheusQuery = g.query.prometheus; - prometheusQuery.new('$'+variables.Datasource.name, query) - + prometheusQuery.withFormat('time_series') - + prometheusQuery.withIntervalFactor(2) - + prometheusQuery.withLegendFormat(legend), + local prometheusQuery = g.query.prometheus; + prometheusQuery.new('$' + variables.Datasource.name, query) + + prometheusQuery.withFormat('time_series') + + prometheusQuery.withIntervalFactor(2) + + prometheusQuery.withLegendFormat(legend), ]; { - ovnMasterLeader: { - query(): - generateTimeSeriesQuery('ovnkube_master_leader','{{pod}}') - }, - - ovnNorthd: { - query(): - generateTimeSeriesQuery('ovn_northd_status','{{pod}}') - }, - - ovnNbdbLeader: { - query(): - generateTimeSeriesQuery('ovn_db_cluster_server_role{server_role="leader",db_name="OVN_Northbound"}','{{pod}}') - }, - - ovnSbdbLeader: { - query(): - generateTimeSeriesQuery('ovn_db_cluster_server_role{server_role="leader",db_name="OVN_Southbound"}','{{pod}}') - }, - - numOnvController: { - query(): - generateTimeSeriesQuery('count(ovn_controller_monitor_all) by (namespace)','') - }, - - ovnKubeMasterCPU: { - query(): - generateTimeSeriesQuery('irate(container_cpu_usage_seconds_total{pod=~"ovnkube-master.*",namespace="openshift-ovn-kubernetes",container!~"POD|"}[2m])*100','{{container}}-{{pod}}-{{node}}') - }, - - ovnKubeMasterMem: { - query(): - generateTimeSeriesQuery('container_memory_rss{pod=~"ovnkube-master-.*",namespace="openshift-ovn-kubernetes",container!~"POD|"}','{{container}}-{{pod}}-{{node}}') - }, - - topOvnControllerCPU: { - query(): - generateTimeSeriesQuery('topk(10, irate(container_cpu_usage_seconds_total{pod=~"ovnkube-.*",namespace="openshift-ovn-kubernetes",container="ovn-controller"}[2m])*100)','{{node}}') - }, - - topOvnControllerMem: { - query(): - generateTimeSeriesQuery('topk(10, sum(container_memory_rss{pod=~"ovnkube-node-.*",namespace="openshift-ovn-kubernetes",container="ovn-controller"}) by (node))','{{node}}') - }, - - ovnAnnotationLatency: { - query(): - generateTimeSeriesQuery('histogram_quantile(0.99, sum by (pod, le) (rate(ovnkube_controller_pod_creation_latency_seconds_bucket[2m]))) > 0','{{pod}} - Pod Annotation latency') - }, - - ovnCNIAdd: { - query(): - generateTimeSeriesQuery('histogram_quantile(0.99, sum(rate(ovnkube_node_cni_request_duration_seconds_bucket{command="ADD"}[2m])) by (pod,le)) > 0','{{pod}}') - }, - - podLatency: { - query(): - generateTimeSeriesQuery('histogram_quantile(0.99, sum(rate(ovnkube_master_pod_lsp_created_port_binding_duration_seconds_bucket[2m])) by (pod,le))','{{pod}} - LSP created') - + generateTimeSeriesQuery('histogram_quantile(0.99, sum(rate(ovnkube_master_pod_port_binding_port_binding_chassis_duration_seconds_bucket[2m])) by (pod,le))','{{pod}} - Port Binding') - + generateTimeSeriesQuery('histogram_quantile(0.99, sum(rate(ovnkube_master_pod_port_binding_chassis_port_binding_up_duration_seconds_bucket[2m])) by (pod,le))','{{pod}} - Port Binding Up') - + generateTimeSeriesQuery('histogram_quantile(0.99, sum(rate(ovnkube_master_pod_first_seen_lsp_created_duration_seconds_bucket[2m])) by (pod,le))','{{pod}} - Pod First seen') - }, - - synclatency: { - query(): - generateTimeSeriesQuery('rate(ovnkube_master_sync_service_latency_seconds_sum[2m])','{{pod}} - Sync service latency') - }, - - ovnLatencyCalculate: { - query(): - generateTimeSeriesQuery('histogram_quantile(0.99, sum(rate(ovnkube_master_network_programming_duration_seconds_bucket[2m])) by (pod, le))','{{pod}} - Kind Pod') - + generateTimeSeriesQuery('histogram_quantile(0.99, sum(rate(ovnkube_master_network_programming_duration_seconds_bucket[2m])) by (service, le))','{{service}} - Kind Service') - }, - - ovnkubeNodeReadyLatency: { - query(): - generateTimeSeriesQuery('ovnkube_node_ready_duration_seconds{pod=~"ovnkube-node-.*",namespace="openshift-ovn-kubernetes",container!~"POD|"}','{{pod}}') - }, - - workQueue: { - query(): - generateTimeSeriesQuery('rate(ovnkube_master_workqueue_adds_total[2m])','{{pod}} - Rate of handled adds') - }, - - workQueueDepth: { - query(): - generateTimeSeriesQuery('ovnkube_master_workqueue_depth','{{pod}} - Depth of workqueue') - }, - - workQueueLatency: { - query(): - generateTimeSeriesQuery('ovnkube_master_workqueue_longest_running_processor_seconds','{{pod}} - Longest processor duration') - }, - - workQueueUnfinishedLatency: { - query(): - generateTimeSeriesQuery('ovnkube_master_workqueue_unfinished_work_seconds','{{pod}} - Unfinished work duration') - } -} \ No newline at end of file + ovnMasterLeader: { + query(): + generateTimeSeriesQuery('ovnkube_master_leader', '{{pod}}'), + }, + + ovnNorthd: { + query(): + generateTimeSeriesQuery('ovn_northd_status', '{{pod}}'), + }, + + ovnNbdbLeader: { + query(): + generateTimeSeriesQuery('ovn_db_cluster_server_role{server_role="leader",db_name="OVN_Northbound"}', '{{pod}}'), + }, + + ovnSbdbLeader: { + query(): + generateTimeSeriesQuery('ovn_db_cluster_server_role{server_role="leader",db_name="OVN_Southbound"}', '{{pod}}'), + }, + + numOnvController: { + query(): + generateTimeSeriesQuery('count(ovn_controller_monitor_all) by (namespace)', ''), + }, + + ovnKubeMasterCPU: { + query(): + generateTimeSeriesQuery('irate(container_cpu_usage_seconds_total{pod=~"ovnkube-master.*",namespace="openshift-ovn-kubernetes",container!~"POD|"}[2m])*100', '{{container}}-{{pod}}-{{node}}'), + }, + + ovnKubeMasterMem: { + query(): + generateTimeSeriesQuery('container_memory_rss{pod=~"ovnkube-master-.*",namespace="openshift-ovn-kubernetes",container!~"POD|"}', '{{container}}-{{pod}}-{{node}}'), + }, + + topOvnControllerCPU: { + query(): + generateTimeSeriesQuery('topk(10, irate(container_cpu_usage_seconds_total{pod=~"ovnkube-.*",namespace="openshift-ovn-kubernetes",container="ovn-controller"}[2m])*100)', '{{node}}'), + }, + + topOvnControllerMem: { + query(): + generateTimeSeriesQuery('topk(10, sum(container_memory_rss{pod=~"ovnkube-node-.*",namespace="openshift-ovn-kubernetes",container="ovn-controller"}) by (node))', '{{node}}'), + }, + + ovnAnnotationLatency: { + query(): + generateTimeSeriesQuery('histogram_quantile(0.99, sum by (pod, le) (rate(ovnkube_controller_pod_creation_latency_seconds_bucket[2m]))) > 0', '{{pod}} - Pod Annotation latency'), + }, + + ovnCNIAdd: { + query(): + generateTimeSeriesQuery('histogram_quantile(0.99, sum(rate(ovnkube_node_cni_request_duration_seconds_bucket{command="ADD"}[2m])) by (pod,le)) > 0', '{{pod}}'), + }, + + podLatency: { + query(): + generateTimeSeriesQuery('histogram_quantile(0.99, sum(rate(ovnkube_master_pod_lsp_created_port_binding_duration_seconds_bucket[2m])) by (pod,le))', '{{pod}} - LSP created') + + generateTimeSeriesQuery('histogram_quantile(0.99, sum(rate(ovnkube_master_pod_port_binding_port_binding_chassis_duration_seconds_bucket[2m])) by (pod,le))', '{{pod}} - Port Binding') + + generateTimeSeriesQuery('histogram_quantile(0.99, sum(rate(ovnkube_master_pod_port_binding_chassis_port_binding_up_duration_seconds_bucket[2m])) by (pod,le))', '{{pod}} - Port Binding Up') + + generateTimeSeriesQuery('histogram_quantile(0.99, sum(rate(ovnkube_master_pod_first_seen_lsp_created_duration_seconds_bucket[2m])) by (pod,le))', '{{pod}} - Pod First seen'), + }, + + synclatency: { + query(): + generateTimeSeriesQuery('rate(ovnkube_master_sync_service_latency_seconds_sum[2m])', '{{pod}} - Sync service latency'), + }, + + ovnLatencyCalculate: { + query(): + generateTimeSeriesQuery('histogram_quantile(0.99, sum(rate(ovnkube_master_network_programming_duration_seconds_bucket[2m])) by (pod, le))', '{{pod}} - Kind Pod') + + generateTimeSeriesQuery('histogram_quantile(0.99, sum(rate(ovnkube_master_network_programming_duration_seconds_bucket[2m])) by (service, le))', '{{service}} - Kind Service'), + }, + + ovnkubeNodeReadyLatency: { + query(): + generateTimeSeriesQuery('ovnkube_node_ready_duration_seconds{pod=~"ovnkube-node-.*",namespace="openshift-ovn-kubernetes",container!~"POD|"}', '{{pod}}'), + }, + + workQueue: { + query(): + generateTimeSeriesQuery('rate(ovnkube_master_workqueue_adds_total[2m])', '{{pod}} - Rate of handled adds'), + }, + + workQueueDepth: { + query(): + generateTimeSeriesQuery('ovnkube_master_workqueue_depth', '{{pod}} - Depth of workqueue'), + }, + + workQueueLatency: { + query(): + generateTimeSeriesQuery('ovnkube_master_workqueue_longest_running_processor_seconds', '{{pod}} - Longest processor duration'), + }, + + workQueueUnfinishedLatency: { + query(): + generateTimeSeriesQuery('ovnkube_master_workqueue_unfinished_work_seconds', '{{pod}} - Unfinished work duration'), + }, +} diff --git a/assets/ovn-monitoring/variables.libsonnet b/assets/ovn-monitoring/variables.libsonnet index cdef581..026908e 100644 --- a/assets/ovn-monitoring/variables.libsonnet +++ b/assets/ovn-monitoring/variables.libsonnet @@ -1,44 +1,44 @@ -local g = import "github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet"; +local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local var = g.dashboard.variable; { - Datasource: - var.datasource.new('Datasource','prometheus') - + var.datasource.withRegex('') - + var.query.generalOptions.withLabel('Datasource') - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(false) - + var.query.withRefresh(1), - - _master_node: - var.query.new('_master_node','label_values(kube_node_role{role="master"}, node)') - + var.datasource.withRegex('') - + var.query.generalOptions.withLabel('Master') - + var.query.selectionOptions.withMulti(true) - + var.query.selectionOptions.withIncludeAll(false) - + var.query.withRefresh(2), + Datasource: + var.datasource.new('Datasource', 'prometheus') + + var.datasource.withRegex('') + + var.query.generalOptions.withLabel('Datasource') + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(false) + + var.query.withRefresh(1), - _worker_node: - var.query.new('_worker_node','label_values(kube_node_role{role=~"work.*"}, node)') - + var.datasource.withRegex('') - + var.query.generalOptions.withLabel('Worker') - + var.query.selectionOptions.withMulti(true) - + var.query.selectionOptions.withIncludeAll(false) - + var.query.withRefresh(2), + _master_node: + var.query.new('_master_node', 'label_values(kube_node_role{role="master"}, node)') + + var.datasource.withRegex('') + + var.query.generalOptions.withLabel('Master') + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(false) + + var.query.withRefresh(2), - master_pod: - var.query.new('master_pod','label_values({pod=~"ovnkube-master.*", namespace=~"openshift-ovn-kubernetes"}, pod)') - + var.datasource.withRegex('') - + var.query.generalOptions.withLabel('OVNKube-Master') - + var.query.selectionOptions.withMulti(true) - + var.query.selectionOptions.withIncludeAll(false) - + var.query.withRefresh(1), - - kubenode_pod: - var.query.new('kubenode_pod','label_values({pod=~"ovnkube-node.*", namespace=~"openshift-ovn-kubernetes"}, pod)') - + var.datasource.withRegex('') - + var.query.generalOptions.withLabel('OVNKube-Node') - + var.query.selectionOptions.withMulti(true) - + var.query.selectionOptions.withIncludeAll(false) - + var.query.withRefresh(1), -} \ No newline at end of file + _worker_node: + var.query.new('_worker_node', 'label_values(kube_node_role{role=~"work.*"}, node)') + + var.datasource.withRegex('') + + var.query.generalOptions.withLabel('Worker') + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(false) + + var.query.withRefresh(2), + + master_pod: + var.query.new('master_pod', 'label_values({pod=~"ovnkube-master.*", namespace=~"openshift-ovn-kubernetes"}, pod)') + + var.datasource.withRegex('') + + var.query.generalOptions.withLabel('OVNKube-Master') + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(false) + + var.query.withRefresh(1), + + kubenode_pod: + var.query.new('kubenode_pod', 'label_values({pod=~"ovnkube-node.*", namespace=~"openshift-ovn-kubernetes"}, pod)') + + var.datasource.withRegex('') + + var.query.generalOptions.withLabel('OVNKube-Node') + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(false) + + var.query.withRefresh(1), +} diff --git a/assets/pgbench-dashboard/annotation.libsonnet b/assets/pgbench-dashboard/annotation.libsonnet index f61abd5..f949c5a 100644 --- a/assets/pgbench-dashboard/annotation.libsonnet +++ b/assets/pgbench-dashboard/annotation.libsonnet @@ -2,21 +2,21 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn local annotation = g.dashboard.annotation; { - run_start_timestamp: - annotation.withName('Run Start Time') - + annotation.withDatasource('$Datasource2') - + annotation.withEnable(true) - + annotation.withIconColor('#5794F2') - + annotation.withHide(false) - + annotation.target.withTags([]) - + annotation.withType('tags'), + run_start_timestamp: + annotation.withName('Run Start Time') + + annotation.withDatasource('$Datasource2') + + annotation.withEnable(true) + + annotation.withIconColor('#5794F2') + + annotation.withHide(false) + + annotation.target.withTags([]) + + annotation.withType('tags'), - sample_start_timestamp: - annotation.withName('Sample Start Time') - + annotation.withDatasource('$Datasource2') - + annotation.withEnable(false) - + annotation.withIconColor('#B877D9') - + annotation.withHide(false) - + annotation.target.withTags([]) - + annotation.withType('tags'), -} \ No newline at end of file + sample_start_timestamp: + annotation.withName('Sample Start Time') + + annotation.withDatasource('$Datasource2') + + annotation.withEnable(false) + + annotation.withIconColor('#B877D9') + + annotation.withHide(false) + + annotation.target.withTags([]) + + annotation.withType('tags'), +} diff --git a/assets/pgbench-dashboard/panels.libsonnet b/assets/pgbench-dashboard/panels.libsonnet index 1175330..6bb4031 100644 --- a/assets/pgbench-dashboard/panels.libsonnet +++ b/assets/pgbench-dashboard/panels.libsonnet @@ -1,173 +1,173 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; { - timeSeries: { - local timeSeries = g.panel.timeSeries, - local custom = timeSeries.fieldConfig.defaults.custom, - local options = timeSeries.options, + timeSeries: { + local timeSeries = g.panel.timeSeries, + local custom = timeSeries.fieldConfig.defaults.custom, + local options = timeSeries.options, - base(title, unit, targets, gridPos): - timeSeries.new(title) - + timeSeries.queryOptions.withTargets(targets) - + timeSeries.datasource.withType('elasticsearch') - + timeSeries.datasource.withUid('$Datasource1') - + timeSeries.standardOptions.withUnit(unit) - + timeSeries.gridPos.withX(gridPos.x) - + timeSeries.gridPos.withY(gridPos.y) - + timeSeries.gridPos.withH(gridPos.h) - + timeSeries.gridPos.withW(gridPos.w) - + custom.withDrawStyle("line") - + custom.withLineInterpolation("linear") - + custom.withBarAlignment(0) - + custom.withFillOpacity(10) - + custom.withGradientMode("none") - + custom.withSpanNulls(false) - + custom.withPointSize(5) - + custom.withSpanNulls(false) - + custom.stacking.withGroup("A") - + custom.stacking.withMode("none") - + custom.withShowPoints('never') - + timeSeries.queryOptions.withTimeFrom(null) - + timeSeries.queryOptions.withTimeShift(null) - + timeSeries.panelOptions.withTransparent(true), + base(title, unit, targets, gridPos): + timeSeries.new(title) + + timeSeries.queryOptions.withTargets(targets) + + timeSeries.datasource.withType('elasticsearch') + + timeSeries.datasource.withUid('$Datasource1') + + timeSeries.standardOptions.withUnit(unit) + + timeSeries.gridPos.withX(gridPos.x) + + timeSeries.gridPos.withY(gridPos.y) + + timeSeries.gridPos.withH(gridPos.h) + + timeSeries.gridPos.withW(gridPos.w) + + custom.withDrawStyle('line') + + custom.withLineInterpolation('linear') + + custom.withBarAlignment(0) + + custom.withFillOpacity(10) + + custom.withGradientMode('none') + + custom.withSpanNulls(false) + + custom.withPointSize(5) + + custom.withSpanNulls(false) + + custom.stacking.withGroup('A') + + custom.stacking.withMode('none') + + custom.withShowPoints('never') + + timeSeries.queryOptions.withTimeFrom(null) + + timeSeries.queryOptions.withTimeShift(null) + + timeSeries.panelOptions.withTransparent(true), - tps_report(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + custom.withLineWidth(2) - + options.tooltip.withMode('multi') - + options.legend.withShowLegend(false) - + options.legend.withDisplayMode('list') - + options.legend.withPlacement('bottom'), + tps_report(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + custom.withLineWidth(2) + + options.tooltip.withMode('multi') + + options.legend.withShowLegend(false) + + options.legend.withDisplayMode('list') + + options.legend.withPlacement('bottom'), - avg_tps(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + options.legend.withShowLegend(true) - + options.legend.withDisplayMode('table') - + options.legend.withCalcs([ - "mean", - "max", - "min" - ]) - + options.legend.withPlacement('bottom') - + custom.withDrawStyle('bars') - + custom.withLineInterpolation('linear') - }, + avg_tps(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + options.legend.withShowLegend(true) + + options.legend.withDisplayMode('table') + + options.legend.withCalcs([ + 'mean', + 'max', + 'min', + ]) + + options.legend.withPlacement('bottom') + + custom.withDrawStyle('bars') + + custom.withLineInterpolation('linear'), + }, - heatmap: { - local heatmap = g.panel.heatmap, - local custom = heatmap.fieldConfig.defaults.custom, - local options = heatmap.options, + heatmap: { + local heatmap = g.panel.heatmap, + local custom = heatmap.fieldConfig.defaults.custom, + local options = heatmap.options, - base(title, unit, targets, gridPos): - heatmap.new(title) - + heatmap.queryOptions.withTargets(targets) - + heatmap.datasource.withType('elasticsearch') - + heatmap.datasource.withUid('$Datasource1') - + heatmap.standardOptions.withUnit(unit) - + heatmap.gridPos.withX(gridPos.x) - + heatmap.gridPos.withY(gridPos.y) - + heatmap.gridPos.withH(gridPos.h) - + heatmap.gridPos.withW(gridPos.w) - + custom.scaleDistribution.withType('linear') - + custom.hideFrom.withLegend(false) - + custom.hideFrom.withTooltip(false) - + custom.hideFrom.withViz(false) - + options.withCalculate(true) - + options.yAxis.withAxisPlacement('left') - + options.yAxis.withReverse(false) - + options.yAxis.withUnit('ms') - + options.rowsFrame.withLayout('auto') - + options.color.HeatmapColorOptions.withMode('scheme') - + options.color.HeatmapColorOptions.withFill('dark-orange') - + options.color.HeatmapColorOptions.withScale('exponential') - + options.color.HeatmapColorOptions.withExponent(0.5) - + options.color.HeatmapColorOptions.withScheme('Oranges') - + options.color.HeatmapColorOptions.withSteps(128) - + options.color.HeatmapColorOptions.withReverse(false) - + options.withCellGap(2) - + options.filterValues.FilterValueRange.withLe(1e-9) - + options.tooltip.withShow(false) - + options.tooltip.withYHistogram(false) - + options.legend.withShow(true) - + options.exemplars.withColor('rgba(255,0,255,0.7)') - + options.withShowValue('never') - + heatmap.panelOptions.withTransparent(true) - }, + base(title, unit, targets, gridPos): + heatmap.new(title) + + heatmap.queryOptions.withTargets(targets) + + heatmap.datasource.withType('elasticsearch') + + heatmap.datasource.withUid('$Datasource1') + + heatmap.standardOptions.withUnit(unit) + + heatmap.gridPos.withX(gridPos.x) + + heatmap.gridPos.withY(gridPos.y) + + heatmap.gridPos.withH(gridPos.h) + + heatmap.gridPos.withW(gridPos.w) + + custom.scaleDistribution.withType('linear') + + custom.hideFrom.withLegend(false) + + custom.hideFrom.withTooltip(false) + + custom.hideFrom.withViz(false) + + options.withCalculate(true) + + options.yAxis.withAxisPlacement('left') + + options.yAxis.withReverse(false) + + options.yAxis.withUnit('ms') + + options.rowsFrame.withLayout('auto') + + options.color.HeatmapColorOptions.withMode('scheme') + + options.color.HeatmapColorOptions.withFill('dark-orange') + + options.color.HeatmapColorOptions.withScale('exponential') + + options.color.HeatmapColorOptions.withExponent(0.5) + + options.color.HeatmapColorOptions.withScheme('Oranges') + + options.color.HeatmapColorOptions.withSteps(128) + + options.color.HeatmapColorOptions.withReverse(false) + + options.withCellGap(2) + + options.filterValues.FilterValueRange.withLe(1e-9) + + options.tooltip.withShow(false) + + options.tooltip.withYHistogram(false) + + options.legend.withShow(true) + + options.exemplars.withColor('rgba(255,0,255,0.7)') + + options.withShowValue('never') + + heatmap.panelOptions.withTransparent(true), + }, - table: { - local table = g.panel.table, - local custom = table.fieldConfig.defaults.custom, - local options = table.options, + table: { + local table = g.panel.table, + local custom = table.fieldConfig.defaults.custom, + local options = table.options, - base(title, targets, gridPos): - table.new(title) - + table.queryOptions.withTargets(targets) - + table.datasource.withType('elasticsearch') - + table.datasource.withUid('$Datasource1') - + table.gridPos.withX(gridPos.x) - + table.gridPos.withY(gridPos.y) - + table.gridPos.withH(gridPos.h) - + table.gridPos.withW(gridPos.w) - + options.withShowHeader(true) - + options.footer.TableFooterOptions.withShow(false) - + options.footer.TableFooterOptions.withReducer('sum') - + options.footer.TableFooterOptions.withCountRows(false) - + custom.withAlign('auto') - + custom.withInspect(false) - + table.panelOptions.withTransparent(true) - + table.queryOptions.withTimeFrom(null) - + table.queryOptions.withTimeShift(null) - + table.standardOptions.color.withMode('thresholds') - + table.queryOptions.withTransformations([ - { - "id": "seriesToColumns", - "options": { - "reducers": [] - } - } - ]) - + table.standardOptions.withOverrides([ - { - "matcher": { - "id": "byName", - "options": "Average latency_ms" - }, - "properties": [ - { - "id": "displayName", - "value": "Avg latency" - }, - { - "id": "decimals", - "value": "2" - }, - { - "id": "custom.align", - "value": null - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Average tps" - }, - "properties": [ - { - "id": "displayName", - "value": "Avg TPS" - }, - { - "id": "decimals", - "value": "2" - }, - { - "id": "custom.align", - "value": null - } - ] - } - ]) - } -} \ No newline at end of file + base(title, targets, gridPos): + table.new(title) + + table.queryOptions.withTargets(targets) + + table.datasource.withType('elasticsearch') + + table.datasource.withUid('$Datasource1') + + table.gridPos.withX(gridPos.x) + + table.gridPos.withY(gridPos.y) + + table.gridPos.withH(gridPos.h) + + table.gridPos.withW(gridPos.w) + + options.withShowHeader(true) + + options.footer.TableFooterOptions.withShow(false) + + options.footer.TableFooterOptions.withReducer('sum') + + options.footer.TableFooterOptions.withCountRows(false) + + custom.withAlign('auto') + + custom.withInspect(false) + + table.panelOptions.withTransparent(true) + + table.queryOptions.withTimeFrom(null) + + table.queryOptions.withTimeShift(null) + + table.standardOptions.color.withMode('thresholds') + + table.queryOptions.withTransformations([ + { + id: 'seriesToColumns', + options: { + reducers: [], + }, + }, + ]) + + table.standardOptions.withOverrides([ + { + matcher: { + id: 'byName', + options: 'Average latency_ms', + }, + properties: [ + { + id: 'displayName', + value: 'Avg latency', + }, + { + id: 'decimals', + value: '2', + }, + { + id: 'custom.align', + value: null, + }, + ], + }, + { + matcher: { + id: 'byName', + options: 'Average tps', + }, + properties: [ + { + id: 'displayName', + value: 'Avg TPS', + }, + { + id: 'decimals', + value: '2', + }, + { + id: 'custom.align', + value: null, + }, + ], + }, + ]), + }, +} diff --git a/assets/pgbench-dashboard/queries.libsonnet b/assets/pgbench-dashboard/queries.libsonnet index aae5f3f..3b694a5 100644 --- a/assets/pgbench-dashboard/queries.libsonnet +++ b/assets/pgbench-dashboard/queries.libsonnet @@ -1,104 +1,104 @@ -local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local variables = import './variables.libsonnet'; +local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local elasticsearch = g.query.elasticsearch; { - tps_report: { - query(): - elasticsearch.withAlias(null) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField("tps") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum') - + elasticsearch.metrics.MetricAggregationWithSettings.CumulativeSum.withPipelineAgg('select metric') - + elasticsearch.metrics.MetricAggregationWithSettings.BucketScript.pipelineVariables.withName('var1') - + elasticsearch.metrics.MetricAggregationWithSettings.BucketScript.pipelineVariables.withPipelineAgg('select metric') - ]) - + elasticsearch.withQuery('(user = $user) AND (uuid = $uuid)') - + elasticsearch.withTimeField('timestamp') - }, + tps_report: { + query(): + elasticsearch.withAlias(null) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField('tps') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum') + + elasticsearch.metrics.MetricAggregationWithSettings.CumulativeSum.withPipelineAgg('select metric') + + elasticsearch.metrics.MetricAggregationWithSettings.BucketScript.pipelineVariables.withName('var1') + + elasticsearch.metrics.MetricAggregationWithSettings.BucketScript.pipelineVariables.withPipelineAgg('select metric'), + ]) + + elasticsearch.withQuery('(user = $user) AND (uuid = $uuid)') + + elasticsearch.withTimeField('timestamp'), + }, - avg_tps: { - query(): - elasticsearch.withAlias(null) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("description.keyword") - + elasticsearch.bucketAggs.Terms.withId("6") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('asc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("4") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0) - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("tps_incl_con_est") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg') - + elasticsearch.metrics.MetricAggregationWithSettings.CumulativeSum.withPipelineAgg('select metric') - ]) - + elasticsearch.withQuery('(uuid.keyword=$uuid) AND (user.keyword=$user)') - + elasticsearch.withTimeField('timestamp'), - }, + avg_tps: { + query(): + elasticsearch.withAlias(null) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('description.keyword') + + elasticsearch.bucketAggs.Terms.withId('6') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('asc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('4') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('tps_incl_con_est') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg') + + elasticsearch.metrics.MetricAggregationWithSettings.CumulativeSum.withPipelineAgg('select metric'), + ]) + + elasticsearch.withQuery('(uuid.keyword=$uuid) AND (user.keyword=$user)') + + elasticsearch.withTimeField('timestamp'), + }, - latency_report: { - query(): - elasticsearch.withAlias(null) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0) - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("latency_ms") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg') - ]) - + elasticsearch.withQuery('(uuid.keyword=$uuid) AND (user.keyword=$user)') - + elasticsearch.withTimeField('timestamp'), - }, + latency_report: { + query(): + elasticsearch.withAlias(null) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('latency_ms') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('(uuid.keyword=$uuid) AND (user.keyword=$user)') + + elasticsearch.withTimeField('timestamp'), + }, - results: { - query(): - elasticsearch.withAlias(null) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("user.keyword") - + elasticsearch.bucketAggs.Terms.withId("1") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("latency_ms") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("4") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("tps") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("20") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg') + results: { + query(): + elasticsearch.withAlias(null) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('user.keyword') + + elasticsearch.bucketAggs.Terms.withId('1') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('latency_ms') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('4') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('tps') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('20') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - ]) - + elasticsearch.withQuery('(uuid.keyword=$uuid) AND (user.keyword=$user)') - + elasticsearch.withTimeField('timestamp'), - } -} \ No newline at end of file + ]) + + elasticsearch.withQuery('(uuid.keyword=$uuid) AND (user.keyword=$user)') + + elasticsearch.withTimeField('timestamp'), + }, +} diff --git a/assets/pgbench-dashboard/variables.libsonnet b/assets/pgbench-dashboard/variables.libsonnet index e92165f..1d5e5f2 100644 --- a/assets/pgbench-dashboard/variables.libsonnet +++ b/assets/pgbench-dashboard/variables.libsonnet @@ -2,29 +2,29 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn local var = g.dashboard.variable; { - Datasource1: - var.datasource.new('Datasource1','elasticsearch') - + var.datasource.withRegex("") - + var.query.generalOptions.withLabel('pgbench-results datasource') - + var.query.withRefresh(1), + Datasource1: + var.datasource.new('Datasource1', 'elasticsearch') + + var.datasource.withRegex('') + + var.query.generalOptions.withLabel('pgbench-results datasource') + + var.query.withRefresh(1), - Datasource2: - var.datasource.new('Datasource2','elasticsearch') - + var.datasource.withRegex("") - + var.query.generalOptions.withLabel('pgbench-summary datasource') - + var.query.withRefresh(1), + Datasource2: + var.datasource.new('Datasource2', 'elasticsearch') + + var.datasource.withRegex('') + + var.query.generalOptions.withLabel('pgbench-summary datasource') + + var.query.withRefresh(1), - uuid: - var.query.new('uuid','{"find": "terms", "field": "uuid.keyword"}') - + var.query.withDatasourceFromVariable(self.Datasource1) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.withRefresh(2), + uuid: + var.query.new('uuid', '{"find": "terms", "field": "uuid.keyword"}') + + var.query.withDatasourceFromVariable(self.Datasource1) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.withRefresh(2), - user: - var.query.new('user','{"find": "terms", "field": "user.keyword"}') - + var.query.withDatasourceFromVariable(self.Datasource1) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.withRefresh(2), -} \ No newline at end of file + user: + var.query.new('user', '{"find": "terms", "field": "user.keyword"}') + + var.query.withDatasourceFromVariable(self.Datasource1) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.withRefresh(2), +} diff --git a/assets/uperf/panels.libsonnet b/assets/uperf/panels.libsonnet index 98de032..90cc149 100644 --- a/assets/uperf/panels.libsonnet +++ b/assets/uperf/panels.libsonnet @@ -1,179 +1,179 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; { - timeSeries: { - local timeSeries = g.panel.timeSeries, - local custom = timeSeries.fieldConfig.defaults.custom, - local options = timeSeries.options, + timeSeries: { + local timeSeries = g.panel.timeSeries, + local custom = timeSeries.fieldConfig.defaults.custom, + local options = timeSeries.options, - base(title, unit, targets, gridPos): - timeSeries.new(title) - + timeSeries.queryOptions.withTargets(targets) - + timeSeries.datasource.withType('elasticsearch') - + timeSeries.datasource.withUid('$Datasource') - + timeSeries.standardOptions.withUnit(unit) - + timeSeries.gridPos.withX(gridPos.x) - + timeSeries.gridPos.withY(gridPos.y) - + timeSeries.gridPos.withH(gridPos.h) - + timeSeries.gridPos.withW(gridPos.w) - + custom.withSpanNulls(false) - + options.tooltip.withMode('multi') - + options.tooltip.withSort('none') - + options.legend.withShowLegend(true) - + timeSeries.queryOptions.withTimeFrom(null) - + timeSeries.queryOptions.withTimeShift(null) - + timeSeries.panelOptions.withTransparent(true), + base(title, unit, targets, gridPos): + timeSeries.new(title) + + timeSeries.queryOptions.withTargets(targets) + + timeSeries.datasource.withType('elasticsearch') + + timeSeries.datasource.withUid('$Datasource') + + timeSeries.standardOptions.withUnit(unit) + + timeSeries.gridPos.withX(gridPos.x) + + timeSeries.gridPos.withY(gridPos.y) + + timeSeries.gridPos.withH(gridPos.h) + + timeSeries.gridPos.withW(gridPos.w) + + custom.withSpanNulls(false) + + options.tooltip.withMode('multi') + + options.tooltip.withSort('none') + + options.legend.withShowLegend(true) + + timeSeries.queryOptions.withTimeFrom(null) + + timeSeries.queryOptions.withTimeShift(null) + + timeSeries.panelOptions.withTransparent(true), - uperfPerformance(title, unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + options.legend.withCalcs([ - 'mean', - 'max', - ]) - + options.legend.withShowLegend(true) - + options.legend.withDisplayMode('table') - + options.legend.withPlacement('bottom') - + custom.withLineWidth(1) - + custom.withFillOpacity(10) - + custom.withPointSize(5) - + custom.withSpanNulls(true) - + custom.withShowPoints('never'), - }, + uperfPerformance(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + options.legend.withCalcs([ + 'mean', + 'max', + ]) + + options.legend.withShowLegend(true) + + options.legend.withDisplayMode('table') + + options.legend.withPlacement('bottom') + + custom.withLineWidth(1) + + custom.withFillOpacity(10) + + custom.withPointSize(5) + + custom.withSpanNulls(true) + + custom.withShowPoints('never'), + }, - table: { - local table = g.panel.table, - local custom = table.fieldConfig.defaults.custom, - local options = table.options, + table: { + local table = g.panel.table, + local custom = table.fieldConfig.defaults.custom, + local options = table.options, - base(title, targets, gridPos): - table.new(title) - + table.queryOptions.withTargets(targets) - + table.datasource.withType('elasticsearch') - + table.datasource.withUid('$Datasource') - + table.gridPos.withX(gridPos.x) - + table.gridPos.withY(gridPos.y) - + table.gridPos.withH(gridPos.h) - + table.gridPos.withW(gridPos.w) - + options.withShowHeader(true) - + options.footer.TableFooterOptions.withShow(false) - + options.footer.TableFooterOptions.withReducer('sum') - + options.footer.TableFooterOptions.withCountRows(false) - + custom.withAlign('auto') - + custom.withInspect(false) - + table.panelOptions.withTransparent(true) - + table.queryOptions.withTimeFrom(null) - + table.queryOptions.withTimeShift(null) - + table.standardOptions.color.withMode('thresholds') - + table.queryOptions.withTransformations([ - { - "id": "seriesToColumns", - "options": { - "reducers": [] - } - } - ]) - + table.standardOptions.withOverrides([ - { - "matcher": { - "id": "byName", - "options": "message_size" - }, - "properties": [ - { - "id": "unit", - "value": "" - }, - { - "id": "custom.align", - "value": null - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Average norm_byte" - }, - "properties": [ - { - "id": "unit", - "value": "bps" - }, - { - "id": "decimals", - "value": "2" - }, - { - "id": "custom.align", - "value": null - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Average norm_ops" - }, - "properties": [ - { - "id": "unit", - "value": "none" - }, - { - "id": "decimals", - "value": "0" - }, - { - "id": "custom.align", - "value": null - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Average norm_ltcy" - }, - "properties": [ - { - "id": "unit", - "value": "µs" - }, - { - "id": "decimals", - "value": "2" - }, - { - "id": "custom.align", - "value": null - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Count" - }, - "properties": [ - { - "id": "displayName", - "value": "Sample count" - }, - { - "id": "unit", - "value": "short" - }, - { - "id": "decimals", - "value": "2" - }, - { - "id": "custom.align", - "value": null - } - ] - } - ]) - } + base(title, targets, gridPos): + table.new(title) + + table.queryOptions.withTargets(targets) + + table.datasource.withType('elasticsearch') + + table.datasource.withUid('$Datasource') + + table.gridPos.withX(gridPos.x) + + table.gridPos.withY(gridPos.y) + + table.gridPos.withH(gridPos.h) + + table.gridPos.withW(gridPos.w) + + options.withShowHeader(true) + + options.footer.TableFooterOptions.withShow(false) + + options.footer.TableFooterOptions.withReducer('sum') + + options.footer.TableFooterOptions.withCountRows(false) + + custom.withAlign('auto') + + custom.withInspect(false) + + table.panelOptions.withTransparent(true) + + table.queryOptions.withTimeFrom(null) + + table.queryOptions.withTimeShift(null) + + table.standardOptions.color.withMode('thresholds') + + table.queryOptions.withTransformations([ + { + id: 'seriesToColumns', + options: { + reducers: [], + }, + }, + ]) + + table.standardOptions.withOverrides([ + { + matcher: { + id: 'byName', + options: 'message_size', + }, + properties: [ + { + id: 'unit', + value: '', + }, + { + id: 'custom.align', + value: null, + }, + ], + }, + { + matcher: { + id: 'byName', + options: 'Average norm_byte', + }, + properties: [ + { + id: 'unit', + value: 'bps', + }, + { + id: 'decimals', + value: '2', + }, + { + id: 'custom.align', + value: null, + }, + ], + }, + { + matcher: { + id: 'byName', + options: 'Average norm_ops', + }, + properties: [ + { + id: 'unit', + value: 'none', + }, + { + id: 'decimals', + value: '0', + }, + { + id: 'custom.align', + value: null, + }, + ], + }, + { + matcher: { + id: 'byName', + options: 'Average norm_ltcy', + }, + properties: [ + { + id: 'unit', + value: 'µs', + }, + { + id: 'decimals', + value: '2', + }, + { + id: 'custom.align', + value: null, + }, + ], + }, + { + matcher: { + id: 'byName', + options: 'Count', + }, + properties: [ + { + id: 'displayName', + value: 'Sample count', + }, + { + id: 'unit', + value: 'short', + }, + { + id: 'decimals', + value: '2', + }, + { + id: 'custom.align', + value: null, + }, + ], + }, + ]), + }, -} \ No newline at end of file +} diff --git a/assets/uperf/queries.libsonnet b/assets/uperf/queries.libsonnet index 8ee6d6f..e838413 100644 --- a/assets/uperf/queries.libsonnet +++ b/assets/uperf/queries.libsonnet @@ -1,104 +1,104 @@ -local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local variables = import './variables.libsonnet'; +local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local elasticsearch = g.query.elasticsearch; { - throughput: { - query(): - elasticsearch.withAlias(null) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField("uperf_ts") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(null), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField("norm_byte") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum') - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.settings.script.withInline('_value * 8') - ]) - + elasticsearch.withQuery('uuid: $uuid AND cluster_name: $cluster_name AND user: $user AND iteration: $iteration AND remote_ip: $server AND message_size: $message_size AND test_type: $test_type AND protocol: $protocol AND num_threads: $threads') - + elasticsearch.withTimeField('uperf_ts') - }, + throughput: { + query(): + elasticsearch.withAlias(null) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('uperf_ts') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(null), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField('norm_byte') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.settings.script.withInline('_value * 8'), + ]) + + elasticsearch.withQuery('uuid: $uuid AND cluster_name: $cluster_name AND user: $user AND iteration: $iteration AND remote_ip: $server AND message_size: $message_size AND test_type: $test_type AND protocol: $protocol AND num_threads: $threads') + + elasticsearch.withTimeField('uperf_ts'), + }, - operations: { - query(): - elasticsearch.withAlias(null) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField("uperf_ts") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(null), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField("norm_ops") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum') - ]) - + elasticsearch.withQuery('uuid: $uuid AND user: $user AND iteration: $iteration AND remote_ip: $server AND message_size: $message_size AND test_type: $test_type AND protocol: $protocol AND num_threads: $threads') - + elasticsearch.withTimeField('uperf_ts') - }, + operations: { + query(): + elasticsearch.withAlias(null) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('uperf_ts') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(null), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField('norm_ops') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), + ]) + + elasticsearch.withQuery('uuid: $uuid AND user: $user AND iteration: $iteration AND remote_ip: $server AND message_size: $message_size AND test_type: $test_type AND protocol: $protocol AND num_threads: $threads') + + elasticsearch.withTimeField('uperf_ts'), + }, - results: { - query(): - elasticsearch.withAlias(null) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("test_type.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.Terms.withField("protocol.keyword") - + elasticsearch.bucketAggs.Terms.withId("4") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.Terms.withField("num_threads") - + elasticsearch.bucketAggs.Terms.withId("5") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.Terms.withField("message_size") - + elasticsearch.bucketAggs.Terms.withId("2") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), + results: { + query(): + elasticsearch.withAlias(null) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('test_type.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.Terms.withField('protocol.keyword') + + elasticsearch.bucketAggs.Terms.withId('4') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.Terms.withField('num_threads') + + elasticsearch.bucketAggs.Terms.withId('5') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.Terms.withField('message_size') + + elasticsearch.bucketAggs.Terms.withId('2') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("norm_byte") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg') - + elasticsearch.metrics.MetricAggregationWithSettings.Average.settings.script.withInline('_value * 8'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('norm_byte') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.settings.script.withInline('_value * 8'), - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("norm_ops") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("6") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('norm_ops') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('6') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("norm_ltcy") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("7") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('norm_ltcy') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('7') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - elasticsearch.metrics.MetricAggregationWithSettings.UniqueCount.withType('count') - + elasticsearch.metrics.MetricAggregationWithSettings.UniqueCount.withId('8') - + elasticsearch.metrics.MetricAggregationWithSettings.UniqueCount.withField('select field') - ]) - + elasticsearch.withQuery('uuid: $uuid AND user: $user AND iteration: $iteration AND remote_ip: $server AND message_size: $message_size AND test_type: $test_type AND protocol: $protocol AND NOT norm_ops:0') - + elasticsearch.withTimeField('uperf_ts') - } -} \ No newline at end of file + elasticsearch.metrics.MetricAggregationWithSettings.UniqueCount.withType('count') + + elasticsearch.metrics.MetricAggregationWithSettings.UniqueCount.withId('8') + + elasticsearch.metrics.MetricAggregationWithSettings.UniqueCount.withField('select field'), + ]) + + elasticsearch.withQuery('uuid: $uuid AND user: $user AND iteration: $iteration AND remote_ip: $server AND message_size: $message_size AND test_type: $test_type AND protocol: $protocol AND NOT norm_ops:0') + + elasticsearch.withTimeField('uperf_ts'), + }, +} diff --git a/assets/uperf/variables.libsonnet b/assets/uperf/variables.libsonnet index 563be12..bd17fb6 100644 --- a/assets/uperf/variables.libsonnet +++ b/assets/uperf/variables.libsonnet @@ -2,72 +2,72 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn local var = g.dashboard.variable; { - Datasource: - var.datasource.new('Datasource','elasticsearch') - + var.datasource.withRegex("/(.*uperf.*)/") - + var.query.generalOptions.withLabel('uperf-results datasource') - + var.query.withRefresh(1), + Datasource: + var.datasource.new('Datasource', 'elasticsearch') + + var.datasource.withRegex('/(.*uperf.*)/') + + var.query.generalOptions.withLabel('uperf-results datasource') + + var.query.withRefresh(1), - uuid: - var.query.new('uuid','{"find": "terms", "field": "uuid.keyword"}') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.withRefresh(2), + uuid: + var.query.new('uuid', '{"find": "terms", "field": "uuid.keyword"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.withRefresh(2), - cluster_name: - var.query.new('cluster_name','{"find": "terms", "field": "cluster_name.keyword"}') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.withRefresh(2), + cluster_name: + var.query.new('cluster_name', '{"find": "terms", "field": "cluster_name.keyword"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.withRefresh(2), - user: - var.query.new('user','{"find": "terms", "field": "user.keyword"}') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.withRefresh(2), - - iteration: - var.query.new('iteration','{"find": "terms", "field": "iteration"}') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.withRefresh(2), + user: + var.query.new('user', '{"find": "terms", "field": "user.keyword"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.withRefresh(2), - server: - var.query.new('server','{"find": "terms", "field": "remote_ip.keyword"}') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.withRefresh(2), + iteration: + var.query.new('iteration', '{"find": "terms", "field": "iteration"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.withRefresh(2), - test_type: - var.query.new('test_type','{"find": "terms", "field": "test_type.keyword"}') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.withRefresh(2), - - protocol: - var.query.new('protocol','{"find": "terms", "field": "protocol.keyword"}') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.withRefresh(2), + server: + var.query.new('server', '{"find": "terms", "field": "remote_ip.keyword"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.withRefresh(2), - message_size: - var.query.new('message_size','{"find": "terms", "field": "message_size"}') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.withRefresh(2), + test_type: + var.query.new('test_type', '{"find": "terms", "field": "test_type.keyword"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.withRefresh(2), - threads: - var.query.new('threads','{"find": "terms", "field": "num_threads"}') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.withRefresh(2), -} \ No newline at end of file + protocol: + var.query.new('protocol', '{"find": "terms", "field": "protocol.keyword"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.withRefresh(2), + + message_size: + var.query.new('message_size', '{"find": "terms", "field": "message_size"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.withRefresh(2), + + threads: + var.query.new('threads', '{"find": "terms", "field": "num_threads"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.withRefresh(2), +} diff --git a/assets/vegeta-wrapper/panels.libsonnet b/assets/vegeta-wrapper/panels.libsonnet index 3abfa63..97535f8 100644 --- a/assets/vegeta-wrapper/panels.libsonnet +++ b/assets/vegeta-wrapper/panels.libsonnet @@ -1,198 +1,198 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; { - timeSeries: { - local timeSeries = g.panel.timeSeries, - local custom = timeSeries.fieldConfig.defaults.custom, - local options = timeSeries.options, + timeSeries: { + local timeSeries = g.panel.timeSeries, + local custom = timeSeries.fieldConfig.defaults.custom, + local options = timeSeries.options, - base(title, unit, targets, gridPos): - timeSeries.new(title) - + timeSeries.queryOptions.withTargets(targets) - + timeSeries.datasource.withType('elasticsearch') - + timeSeries.datasource.withUid('$Datasource') - + timeSeries.standardOptions.withUnit(unit) - + timeSeries.gridPos.withX(gridPos.x) - + timeSeries.gridPos.withY(gridPos.y) - + timeSeries.gridPos.withH(gridPos.h) - + timeSeries.gridPos.withW(gridPos.w) - + custom.withSpanNulls(false) - + options.tooltip.withMode('multi') - + options.tooltip.withSort('none') - + options.legend.withShowLegend(true) - + timeSeries.queryOptions.withTimeFrom(null) - + timeSeries.queryOptions.withTimeShift(null) - + timeSeries.panelOptions.withTransparent(true), + base(title, unit, targets, gridPos): + timeSeries.new(title) + + timeSeries.queryOptions.withTargets(targets) + + timeSeries.datasource.withType('elasticsearch') + + timeSeries.datasource.withUid('$Datasource') + + timeSeries.standardOptions.withUnit(unit) + + timeSeries.gridPos.withX(gridPos.x) + + timeSeries.gridPos.withY(gridPos.y) + + timeSeries.gridPos.withH(gridPos.h) + + timeSeries.gridPos.withW(gridPos.w) + + custom.withSpanNulls(false) + + options.tooltip.withMode('multi') + + options.tooltip.withSort('none') + + options.legend.withShowLegend(true) + + timeSeries.queryOptions.withTimeFrom(null) + + timeSeries.queryOptions.withTimeShift(null) + + timeSeries.panelOptions.withTransparent(true), - legendDisplayModeTable(title,unit, targets, gridPos): - self.base(title, unit, targets, gridPos) - + options.legend.withCalcs([ - 'mean', - 'max', - ]) - + options.legend.withShowLegend(true) - + options.legend.withDisplayMode('table') - + options.legend.withPlacement('bottom') - + custom.withLineWidth(1) - + custom.withFillOpacity(20) - + custom.withPointSize(5) - + custom.withSpanNulls(true) - + custom.withShowPoints('never'), - }, + legendDisplayModeTable(title, unit, targets, gridPos): + self.base(title, unit, targets, gridPos) + + options.legend.withCalcs([ + 'mean', + 'max', + ]) + + options.legend.withShowLegend(true) + + options.legend.withDisplayMode('table') + + options.legend.withPlacement('bottom') + + custom.withLineWidth(1) + + custom.withFillOpacity(20) + + custom.withPointSize(5) + + custom.withSpanNulls(true) + + custom.withShowPoints('never'), + }, - table: { - local table = g.panel.table, - local custom = table.fieldConfig.defaults.custom, - local options = table.options, + table: { + local table = g.panel.table, + local custom = table.fieldConfig.defaults.custom, + local options = table.options, - base(title, targets, gridPos): - table.new(title) - + table.queryOptions.withTargets(targets) - + table.datasource.withType('elasticsearch') - + table.datasource.withUid('$Datasource') - + table.gridPos.withX(gridPos.x) - + table.gridPos.withY(gridPos.y) - + table.gridPos.withH(gridPos.h) - + table.gridPos.withW(gridPos.w) - + options.withShowHeader(true) - + options.footer.TableFooterOptions.withShow(false) - + options.footer.TableFooterOptions.withReducer('sum') - + options.footer.TableFooterOptions.withCountRows(false) - + custom.withAlign('auto') - + custom.withInspect(false) - + table.panelOptions.withTransparent(true) - + table.queryOptions.withTimeFrom(null) - + table.queryOptions.withTimeShift(null) - + table.standardOptions.color.withMode('thresholds') - + table.queryOptions.withTransformations([ - { - "id": "seriesToColumns", - "options": { - "reducers": [] - } - } - ]) - + table.standardOptions.withOverrides([ - { - "matcher": { - "id": "byName", - "options": "Average rps" - }, - "properties": [ - { - "id": "unit", - "value": "reqps" - }, - { - "id": "decimals", - "value": "2" - }, - { - "id": "custom.align", - "value": null - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Average throughput" - }, - "properties": [ - { - "id": "unit", - "value": "reqps" - }, - { - "id": "decimals", - "value": "2" - }, - { - "id": "custom.align", - "value": null - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Average p99_latency" - }, - "properties": [ - { - "id": "unit", - "value": "µs" - }, - { - "id": "decimals", - "value": "2" - }, - { - "id": "custom.align", - "value": null - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Average req_latency" - }, - "properties": [ - { - "id": "unit", - "value": "µs" - }, - { - "id": "decimals", - "value": "2" - }, - { - "id": "custom.align", - "value": null - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Average bytes_in" - }, - "properties": [ - { - "id": "unit", - "value": "bps" - }, - { - "id": "decimals", - "value": "2" - }, - { - "id": "custom.align", - "value": null - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Average bytes_out" - }, - "properties": [ - { - "id": "unit", - "value": "bps" - }, - { - "id": "decimals", - "value": "2" - }, - { - "id": "custom.align", - "value": null - } - ] - } - ]), - } + base(title, targets, gridPos): + table.new(title) + + table.queryOptions.withTargets(targets) + + table.datasource.withType('elasticsearch') + + table.datasource.withUid('$Datasource') + + table.gridPos.withX(gridPos.x) + + table.gridPos.withY(gridPos.y) + + table.gridPos.withH(gridPos.h) + + table.gridPos.withW(gridPos.w) + + options.withShowHeader(true) + + options.footer.TableFooterOptions.withShow(false) + + options.footer.TableFooterOptions.withReducer('sum') + + options.footer.TableFooterOptions.withCountRows(false) + + custom.withAlign('auto') + + custom.withInspect(false) + + table.panelOptions.withTransparent(true) + + table.queryOptions.withTimeFrom(null) + + table.queryOptions.withTimeShift(null) + + table.standardOptions.color.withMode('thresholds') + + table.queryOptions.withTransformations([ + { + id: 'seriesToColumns', + options: { + reducers: [], + }, + }, + ]) + + table.standardOptions.withOverrides([ + { + matcher: { + id: 'byName', + options: 'Average rps', + }, + properties: [ + { + id: 'unit', + value: 'reqps', + }, + { + id: 'decimals', + value: '2', + }, + { + id: 'custom.align', + value: null, + }, + ], + }, + { + matcher: { + id: 'byName', + options: 'Average throughput', + }, + properties: [ + { + id: 'unit', + value: 'reqps', + }, + { + id: 'decimals', + value: '2', + }, + { + id: 'custom.align', + value: null, + }, + ], + }, + { + matcher: { + id: 'byName', + options: 'Average p99_latency', + }, + properties: [ + { + id: 'unit', + value: 'µs', + }, + { + id: 'decimals', + value: '2', + }, + { + id: 'custom.align', + value: null, + }, + ], + }, + { + matcher: { + id: 'byName', + options: 'Average req_latency', + }, + properties: [ + { + id: 'unit', + value: 'µs', + }, + { + id: 'decimals', + value: '2', + }, + { + id: 'custom.align', + value: null, + }, + ], + }, + { + matcher: { + id: 'byName', + options: 'Average bytes_in', + }, + properties: [ + { + id: 'unit', + value: 'bps', + }, + { + id: 'decimals', + value: '2', + }, + { + id: 'custom.align', + value: null, + }, + ], + }, + { + matcher: { + id: 'byName', + options: 'Average bytes_out', + }, + properties: [ + { + id: 'unit', + value: 'bps', + }, + { + id: 'decimals', + value: '2', + }, + { + id: 'custom.align', + value: null, + }, + ], + }, + ]), + }, } diff --git a/assets/vegeta-wrapper/queries.libsonnet b/assets/vegeta-wrapper/queries.libsonnet index c508319..6b70e20 100644 --- a/assets/vegeta-wrapper/queries.libsonnet +++ b/assets/vegeta-wrapper/queries.libsonnet @@ -1,137 +1,137 @@ -local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local variables = import './variables.libsonnet'; +local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local elasticsearch = g.query.elasticsearch; { - rps: { - query(): - elasticsearch.withAlias(null) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(null), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("rps") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg') - ]) - + elasticsearch.withQuery('uuid: $uuid AND hostname: $hostname AND iteration: $iteration AND targets: "$targets"') - + elasticsearch.withTimeField('timestamp') - }, + rps: { + query(): + elasticsearch.withAlias(null) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(null), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('rps') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid: $uuid AND hostname: $hostname AND iteration: $iteration AND targets: "$targets"') + + elasticsearch.withTimeField('timestamp'), + }, - throughput: { - query(): - elasticsearch.withAlias(null) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(null), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("throughput") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg') - ]) - + elasticsearch.withQuery('uuid: $uuid AND hostname: $hostname AND iteration: $iteration AND targets: "$targets"') - + elasticsearch.withTimeField('timestamp') - }, + throughput: { + query(): + elasticsearch.withAlias(null) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(null), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('throughput') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid: $uuid AND hostname: $hostname AND iteration: $iteration AND targets: "$targets"') + + elasticsearch.withTimeField('timestamp'), + }, - latency: { - query(): - [ - elasticsearch.withAlias(null) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(null), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("req_latency") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg') - ]) - + elasticsearch.withQuery('uuid: $uuid AND hostname: $hostname AND iteration: $iteration AND targets: "$targets"') - + elasticsearch.withTimeField('timestamp'), + latency: { + query(): + [ + elasticsearch.withAlias(null) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(null), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('req_latency') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid: $uuid AND hostname: $hostname AND iteration: $iteration AND targets: "$targets"') + + elasticsearch.withTimeField('timestamp'), - elasticsearch.withAlias(null) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(null), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("p99_latency") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg') - ]) - + elasticsearch.withQuery('uuid: $uuid AND hostname: $hostname AND iteration: $iteration AND targets: "$targets"') - + elasticsearch.withTimeField('timestamp') + elasticsearch.withAlias(null) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(null), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('p99_latency') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid: $uuid AND hostname: $hostname AND iteration: $iteration AND targets: "$targets"') + + elasticsearch.withTimeField('timestamp'), - ] - }, + ], + }, - results: { - query(): - elasticsearch.withAlias(null) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("uuid.keyword") - + elasticsearch.bucketAggs.Terms.withId("2") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.Terms.withField("targets.keyword") - + elasticsearch.bucketAggs.Terms.withId("1") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) - + elasticsearch.bucketAggs.Terms.settings.withSize("10") - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("rps") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("3") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + results: { + query(): + elasticsearch.withAlias(null) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('uuid.keyword') + + elasticsearch.bucketAggs.Terms.withId('2') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.Terms.withField('targets.keyword') + + elasticsearch.bucketAggs.Terms.withId('1') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('rps') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('3') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("throughput") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("4") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('throughput') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('4') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("p99_latency") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("5") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('p99_latency') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('5') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("req_latency") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("6") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('req_latency') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('6') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("bytes_in") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("7") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('bytes_in') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('7') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("bytes_out") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("8") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg') - ]) - + elasticsearch.withQuery('uuid: $uuid AND hostname: $hostname AND iteration: $iteration AND targets: "$targets"') - + elasticsearch.withTimeField('timestamp') - } -} \ No newline at end of file + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('bytes_out') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('8') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('uuid: $uuid AND hostname: $hostname AND iteration: $iteration AND targets: "$targets"') + + elasticsearch.withTimeField('timestamp'), + }, +} diff --git a/assets/vegeta-wrapper/variables.libsonnet b/assets/vegeta-wrapper/variables.libsonnet index 91e824d..16b04e1 100644 --- a/assets/vegeta-wrapper/variables.libsonnet +++ b/assets/vegeta-wrapper/variables.libsonnet @@ -2,37 +2,37 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn local var = g.dashboard.variable; { - Datasource: - var.datasource.new('Datasource','elasticsearch') - + var.datasource.withRegex('/(.*vegeta.*)/') - + var.query.generalOptions.withLabel('vegeta-results datasource'), + Datasource: + var.datasource.new('Datasource', 'elasticsearch') + + var.datasource.withRegex('/(.*vegeta.*)/') + + var.query.generalOptions.withLabel('vegeta-results datasource'), - uuid: - var.query.new('uuid','{"find": "terms", "field": "uuid.keyword"}') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.withRefresh(2) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true) - + var.query.generalOptions.withLabel('UUID'), + uuid: + var.query.new('uuid', '{"find": "terms", "field": "uuid.keyword"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.withRefresh(2) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.generalOptions.withLabel('UUID'), - hostname: - var.query.new('hostname','{"find": "terms", "field": "hostname.keyword"}') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.withRefresh(2) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true), + hostname: + var.query.new('hostname', '{"find": "terms", "field": "hostname.keyword"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.withRefresh(2) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true), - targets: - var.query.new('targets','{"find": "terms", "field": "targets.keyword"}') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.withRefresh(2) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true), + targets: + var.query.new('targets', '{"find": "terms", "field": "targets.keyword"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.withRefresh(2) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true), - iteration: - var.query.new('iteration','{"find": "terms", "field": "iteration"}') - + var.query.withDatasourceFromVariable(self.Datasource) - + var.query.withRefresh(2) - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true), -} \ No newline at end of file + iteration: + var.query.new('iteration', '{"find": "terms", "field": "iteration"}') + + var.query.withDatasourceFromVariable(self.Datasource) + + var.query.withRefresh(2) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true), +} diff --git a/assets/ycsb/panels.libsonnet b/assets/ycsb/panels.libsonnet index 73afc4a..e9414bc 100644 --- a/assets/ycsb/panels.libsonnet +++ b/assets/ycsb/panels.libsonnet @@ -1,86 +1,86 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; { - timeSeries: { - local timeSeries = g.panel.timeSeries, - local custom = timeSeries.fieldConfig.defaults.custom, - local options = timeSeries.options, + timeSeries: { + local timeSeries = g.panel.timeSeries, + local custom = timeSeries.fieldConfig.defaults.custom, + local options = timeSeries.options, - base(title, datasource,unit, targets, gridPos): - timeSeries.new(title) - + timeSeries.queryOptions.withTargets(targets) - + timeSeries.datasource.withType('elasticsearch') - + timeSeries.datasource.withUid(datasource) - + timeSeries.standardOptions.withUnit(unit) - + timeSeries.gridPos.withX(gridPos.x) - + timeSeries.gridPos.withY(gridPos.y) - + timeSeries.gridPos.withH(gridPos.h) - + timeSeries.gridPos.withW(gridPos.w) - + custom.withSpanNulls(false) - + custom.withFillOpacity(25) - + options.tooltip.withMode('multi') - + options.tooltip.withSort('none') - + options.legend.withShowLegend(true) - + custom.withLineWidth(2), + base(title, datasource, unit, targets, gridPos): + timeSeries.new(title) + + timeSeries.queryOptions.withTargets(targets) + + timeSeries.datasource.withType('elasticsearch') + + timeSeries.datasource.withUid(datasource) + + timeSeries.standardOptions.withUnit(unit) + + timeSeries.gridPos.withX(gridPos.x) + + timeSeries.gridPos.withY(gridPos.y) + + timeSeries.gridPos.withH(gridPos.h) + + timeSeries.gridPos.withW(gridPos.w) + + custom.withSpanNulls(false) + + custom.withFillOpacity(25) + + options.tooltip.withMode('multi') + + options.tooltip.withSort('none') + + options.legend.withShowLegend(true) + + custom.withLineWidth(2), - overallThroughputPerYCSB(title, datasource, unit, targets, gridPos): - self.base(title, datasource, unit, targets, gridPos) - + options.legend.withDisplayMode('table') - + options.legend.withPlacement('right') - + custom.withDrawStyle('bars') - + custom.withFillOpacity(100) - + custom.withPointSize(4) - + custom.withShowPoints('never') - + options.legend.withCalcs([ - 'sum' - ]), + overallThroughputPerYCSB(title, datasource, unit, targets, gridPos): + self.base(title, datasource, unit, targets, gridPos) + + options.legend.withDisplayMode('table') + + options.legend.withPlacement('right') + + custom.withDrawStyle('bars') + + custom.withFillOpacity(100) + + custom.withPointSize(4) + + custom.withShowPoints('never') + + options.legend.withCalcs([ + 'sum', + ]), - LatancyofEachWorkloadPerYCSBOperation(title, datasource, unit, targets, gridPos): - self.base(title, datasource, unit, targets, gridPos) - + options.legend.withDisplayMode('list') - + options.legend.withPlacement('bottom') - + custom.withFillOpacity(100) - + custom.withPointSize(4) - + custom.withDrawStyle('bars') - + custom.withShowPoints('never'), + LatancyofEachWorkloadPerYCSBOperation(title, datasource, unit, targets, gridPos): + self.base(title, datasource, unit, targets, gridPos) + + options.legend.withDisplayMode('list') + + options.legend.withPlacement('bottom') + + custom.withFillOpacity(100) + + custom.withPointSize(4) + + custom.withDrawStyle('bars') + + custom.withShowPoints('never'), - latency90percReportedFromYCSB(title, datasource, unit, targets, gridPos): - self.base(title, datasource, unit, targets, gridPos) - + custom.withDrawStyle('points') - + custom.withFillOpacity(20) - + options.legend.withDisplayMode('list') - + options.legend.withPlacement('bottom') - + options.legend.withCalcs([]) - + custom.withPointSize(4) - + custom.withShowPoints('always'), + latency90percReportedFromYCSB(title, datasource, unit, targets, gridPos): + self.base(title, datasource, unit, targets, gridPos) + + custom.withDrawStyle('points') + + custom.withFillOpacity(20) + + options.legend.withDisplayMode('list') + + options.legend.withPlacement('bottom') + + options.legend.withCalcs([]) + + custom.withPointSize(4) + + custom.withShowPoints('always'), - throughputOvertimePhase(title, datasource, unit, targets, gridPos): - self.base(title, datasource, unit, targets, gridPos) - + custom.withDrawStyle('line') - + custom.withFillOpacity(20) - + custom.withPointSize(5) - + options.legend.withDisplayMode('list') - + options.legend.withPlacement('bottom') - + options.legend.withCalcs([]) - + custom.withShowPoints('never'), - }, + throughputOvertimePhase(title, datasource, unit, targets, gridPos): + self.base(title, datasource, unit, targets, gridPos) + + custom.withDrawStyle('line') + + custom.withFillOpacity(20) + + custom.withPointSize(5) + + options.legend.withDisplayMode('list') + + options.legend.withPlacement('bottom') + + options.legend.withCalcs([]) + + custom.withShowPoints('never'), + }, - table: { - local table = g.panel.table, - local custom = table.fieldConfig.defaults.custom, - local options = table.options, + table: { + local table = g.panel.table, + local custom = table.fieldConfig.defaults.custom, + local options = table.options, - base(title, datasource, targets, gridPos): - table.new(title) - + table.queryOptions.withTargets(targets) - + table.datasource.withType('elasticsearch') - + table.datasource.withUid(datasource) - + table.gridPos.withX(gridPos.x) - + table.gridPos.withY(gridPos.y) - + table.gridPos.withH(gridPos.h) - + table.gridPos.withW(gridPos.w) - + custom.cellOptions.TableSparklineCellOptions.withTransform('timeseries_to_columns') - + options.withShowHeader(true) - + options.sortBy.withDesc(true), - }, -} \ No newline at end of file + base(title, datasource, targets, gridPos): + table.new(title) + + table.queryOptions.withTargets(targets) + + table.datasource.withType('elasticsearch') + + table.datasource.withUid(datasource) + + table.gridPos.withX(gridPos.x) + + table.gridPos.withY(gridPos.y) + + table.gridPos.withH(gridPos.h) + + table.gridPos.withW(gridPos.w) + + custom.cellOptions.TableSparklineCellOptions.withTransform('timeseries_to_columns') + + options.withShowHeader(true) + + options.sortBy.withDesc(true), + }, +} diff --git a/assets/ycsb/queries.libsonnet b/assets/ycsb/queries.libsonnet index 7e948d7..c491377 100644 --- a/assets/ycsb/queries.libsonnet +++ b/assets/ycsb/queries.libsonnet @@ -1,138 +1,138 @@ -local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local variables = import './variables.libsonnet'; +local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; local elasticsearch = g.query.elasticsearch; { - throughput_overtime: { - query(): - elasticsearch.withAlias(null) - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("action.keyword") - + elasticsearch.bucketAggs.Terms.withId("4") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("3") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("overall_rate") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg') - ]) - + elasticsearch.withQuery('(uuid.keyword = $uuid) AND (phase.keyword = $phase) AND (user.keyword=$user) AND (action.keyword=$operation)') - + elasticsearch.withTimeField('timestamp') - }, + throughput_overtime: { + query(): + elasticsearch.withAlias(null) + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('action.keyword') + + elasticsearch.bucketAggs.Terms.withId('4') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('3') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('overall_rate') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('(uuid.keyword = $uuid) AND (phase.keyword = $phase) AND (user.keyword=$user) AND (action.keyword=$operation)') + + elasticsearch.withTimeField('timestamp'), + }, - phase_average_latency: { - query(): - elasticsearch.withAlias("{{ocpMajorVersion.keyword}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("action.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("2") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("latency_90") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg') - ]) - + elasticsearch.withQuery('(uuid.keyword = $uuid) AND (phase.keyword = $phase) AND (user.keyword=$user) AND (action.keyword=$operation)') - + elasticsearch.withTimeField('timestamp') - }, + phase_average_latency: { + query(): + elasticsearch.withAlias('{{ocpMajorVersion.keyword}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('action.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('2') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('latency_90') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('(uuid.keyword = $uuid) AND (phase.keyword = $phase) AND (user.keyword=$user) AND (action.keyword=$operation)') + + elasticsearch.withTimeField('timestamp'), + }, - latency_95: { - query(): - elasticsearch.withAlias("{{ocpMajorVersion.keyword}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("workload_type.keyword") - + elasticsearch.bucketAggs.Terms.withId("5") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("3") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Average.withField("data.$operation.95thPercentileLatency(us)") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg') - ]) - + elasticsearch.withQuery('(uuid.keyword = $uuid) AND (phase.keyword = $phase) AND (user.keyword=$user)') - + elasticsearch.withTimeField('timestamp') - }, + latency_95: { + query(): + elasticsearch.withAlias('{{ocpMajorVersion.keyword}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('workload_type.keyword') + + elasticsearch.bucketAggs.Terms.withId('5') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('3') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Average.withField('data.$operation.95thPercentileLatency(us)') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Average.withType('avg'), + ]) + + elasticsearch.withQuery('(uuid.keyword = $uuid) AND (phase.keyword = $phase) AND (user.keyword=$user)') + + elasticsearch.withTimeField('timestamp'), + }, - overall_workload_throughput: { - query(): - elasticsearch.withAlias("{{ocpMajorVersion.keyword}}") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("workload_type.keyword") - + elasticsearch.bucketAggs.Terms.withId("5") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - elasticsearch.bucketAggs.DateHistogram.withField("timestamp") - + elasticsearch.bucketAggs.DateHistogram.withId("3") - + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') - + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') - + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) - + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone("utc") - + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField("data.OVERALL.Throughput(ops/sec)") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum') - ]) - + elasticsearch.withQuery('(uuid.keyword = $uuid) AND (phase.keyword = $phase) AND (user.keyword=$user)') - + elasticsearch.withTimeField('timestamp') - }, + overall_workload_throughput: { + query(): + elasticsearch.withAlias('{{ocpMajorVersion.keyword}}') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('workload_type.keyword') + + elasticsearch.bucketAggs.Terms.withId('5') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + elasticsearch.bucketAggs.DateHistogram.withField('timestamp') + + elasticsearch.bucketAggs.DateHistogram.withId('3') + + elasticsearch.bucketAggs.DateHistogram.withType('date_histogram') + + elasticsearch.bucketAggs.DateHistogram.settings.withInterval('auto') + + elasticsearch.bucketAggs.DateHistogram.settings.withMinDocCount(0) + + elasticsearch.bucketAggs.DateHistogram.settings.withTimeZone('utc') + + elasticsearch.bucketAggs.DateHistogram.settings.withTrimEdges(0), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField('data.OVERALL.Throughput(ops/sec)') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), + ]) + + elasticsearch.withQuery('(uuid.keyword = $uuid) AND (phase.keyword = $phase) AND (user.keyword=$user)') + + elasticsearch.withTimeField('timestamp'), + }, - aggregate_operation_sum: { - query(): - elasticsearch.withAlias("$operation - Operations") - + elasticsearch.withBucketAggs([ - elasticsearch.bucketAggs.Terms.withField("workload_type.keyword") - + elasticsearch.bucketAggs.Terms.withId("3") - + elasticsearch.bucketAggs.Terms.withType('terms') - + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') - + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) - + elasticsearch.bucketAggs.Terms.settings.withSize("10"), - ]) - + elasticsearch.withMetrics([ - elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField("data.$operation.Operations") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId("1") - + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum') - ]) - + elasticsearch.withQuery('(uuid.keyword = $uuid) AND (phase.keyword = $phase) AND (user.keyword=$user)') - + elasticsearch.withTimeField('timestamp') - } -} \ No newline at end of file + aggregate_operation_sum: { + query(): + elasticsearch.withAlias('$operation - Operations') + + elasticsearch.withBucketAggs([ + elasticsearch.bucketAggs.Terms.withField('workload_type.keyword') + + elasticsearch.bucketAggs.Terms.withId('3') + + elasticsearch.bucketAggs.Terms.withType('terms') + + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withMinDocCount(1) + + elasticsearch.bucketAggs.Terms.settings.withSize('10'), + ]) + + elasticsearch.withMetrics([ + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withField('data.$operation.Operations') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withId('1') + + elasticsearch.metrics.MetricAggregationWithSettings.Sum.withType('sum'), + ]) + + elasticsearch.withQuery('(uuid.keyword = $uuid) AND (phase.keyword = $phase) AND (user.keyword=$user)') + + elasticsearch.withTimeField('timestamp'), + }, +} diff --git a/assets/ycsb/variables.libsonnet b/assets/ycsb/variables.libsonnet index 8dfedd1..ed6a868 100644 --- a/assets/ycsb/variables.libsonnet +++ b/assets/ycsb/variables.libsonnet @@ -2,49 +2,49 @@ local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonn local var = g.dashboard.variable; { - Datasource1: - var.datasource.new('Datasource1','elasticsearch') - + var.datasource.withRegex('') - + var.query.withRefresh(1) - + var.query.generalOptions.withLabel('ycsb-results datasource'), + Datasource1: + var.datasource.new('Datasource1', 'elasticsearch') + + var.datasource.withRegex('') + + var.query.withRefresh(1) + + var.query.generalOptions.withLabel('ycsb-results datasource'), - Datasource2: - var.datasource.new('Datasource2','elasticsearch') - + var.datasource.withRegex('') - + var.query.withRefresh(1) - + var.query.generalOptions.withLabel('ycsb-summary datasource'), + Datasource2: + var.datasource.new('Datasource2', 'elasticsearch') + + var.datasource.withRegex('') + + var.query.withRefresh(1) + + var.query.generalOptions.withLabel('ycsb-summary datasource'), - uuid: - var.query.new('uuid','{"find": "terms", "field": "uuid.keyword"}') - + var.query.withDatasourceFromVariable(self.Datasource2) - + var.query.withRefresh(2) - + var.datasource.withRegex('') - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true), - - user: - var.query.new('user','{"find": "terms", "field": "user.keyword"}') - + var.query.withDatasourceFromVariable(self.Datasource2) - + var.query.withRefresh(2) - + var.datasource.withRegex('') - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true), - - phase: - var.query.new('phase','{"find": "terms", "field": "phase.keyword"}') - + var.query.withDatasourceFromVariable(self.Datasource2) - + var.query.withRefresh(2) - + var.datasource.withRegex('') - + var.query.generalOptions.withCurrent('run','run') - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true), + uuid: + var.query.new('uuid', '{"find": "terms", "field": "uuid.keyword"}') + + var.query.withDatasourceFromVariable(self.Datasource2) + + var.query.withRefresh(2) + + var.datasource.withRegex('') + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true), - operation: - var.query.new('operation','{"find": "fields", "field": "data.*.Operations"}') - + var.query.withDatasourceFromVariable(self.Datasource2) - + var.query.withRefresh(2) - + var.query.generalOptions.withCurrent('READ','READ') - + var.datasource.withRegex('/data.(.*).Operations/') - + var.query.selectionOptions.withMulti(false) - + var.query.selectionOptions.withIncludeAll(true), -} \ No newline at end of file + user: + var.query.new('user', '{"find": "terms", "field": "user.keyword"}') + + var.query.withDatasourceFromVariable(self.Datasource2) + + var.query.withRefresh(2) + + var.datasource.withRegex('') + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true), + + phase: + var.query.new('phase', '{"find": "terms", "field": "phase.keyword"}') + + var.query.withDatasourceFromVariable(self.Datasource2) + + var.query.withRefresh(2) + + var.datasource.withRegex('') + + var.query.generalOptions.withCurrent('run', 'run') + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true), + + operation: + var.query.new('operation', '{"find": "fields", "field": "data.*.Operations"}') + + var.query.withDatasourceFromVariable(self.Datasource2) + + var.query.withRefresh(2) + + var.query.generalOptions.withCurrent('READ', 'READ') + + var.datasource.withRegex('/data.(.*).Operations/') + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true), +}