diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db020a7..fdc3f28 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Get dependencies run: make deps @@ -35,7 +35,7 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Compile dashboards run: make build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 40df6c2..47178ee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install dependencies required for multi-arch builds run: sudo apt-get update && sudo apt-get install qemu-user-static podman fuse-overlayfs diff --git a/Makefile b/Makefile index 5a52572..57e0ea9 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,8 @@ -JSONNET := https://github.com/google/go-jsonnet/releases/download/v0.20.0/go-jsonnet_0.20.0_Linux_x86_64.tar.gz -JB = https://github.com/jsonnet-bundler/jsonnet-bundler/releases/latest/download/jb-linux-amd64 +ARCH := $(shell arch) +OS_TYPE := $(shell uname) +JB_OS_TYPE := $(shell uname | tr '[:upper:]' '[:lower:]') +JSONNET := https://github.com/google/go-jsonnet/releases/download/v0.20.0/go-jsonnet_0.20.0_$(OS_TYPE)_$(ARCH).tar.gz +JB = https://github.com/jsonnet-bundler/jsonnet-bundler/releases/latest/download/jb-$(JB_OS_TYPE)-$(ARCH) BINDIR = bin TEMPLATESDIR = templates OUTPUTDIR = rendered diff --git a/README.md b/README.md index 674f57d..c8b2ba0 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ mkdir -p rendered/General/ bin/jsonnet -J ./templates/vendor templates/General/ocp-performance-v2.jsonnet > rendered/General/ocp-performance-v2.json Rendered the v2 dashboards with latest grafonnet library ``` -All other operations remain same as before. +Rest all operations remain same as before. In order to clean up the environment execute `make clean`. diff --git a/assets/k8s-netperf/panels.libsonnet b/assets/k8s-netperf/panels.libsonnet new file mode 100644 index 0000000..0e10a3f --- /dev/null +++ b/assets/k8s-netperf/panels.libsonnet @@ -0,0 +1,249 @@ +local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; + +{ + row: { + local row = g.panel.row, + + base(title, repeat, gridPos): + row.new(title) + + row.withRepeat(repeat) + + row.gridPos.withX(gridPos.x) + + row.gridPos.withY(gridPos.y) + + row.gridPos.withH(gridPos.h) + + row.gridPos.withW(gridPos.w), + }, + + table: { + local table = g.panel.table, + local options = table.options, + + base(title, targets, gridPos): + 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.queryOptions.withTargets(targets) + + table.gridPos.withX(gridPos.x) + + table.gridPos.withY(gridPos.y) + + table.gridPos.withH(gridPos.h) + + table.gridPos.withW(gridPos.w) + + table.queryOptions.withTransformations([ + { + "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 + }, + "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" + }, + "properties": [ + { + "id": "unit", + "value": "Mbits" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "messageSize" + }, + "properties": [ + { + "id": "unit", + "value": "bytes" + } + ] + } + ]) + + options.withCellHeight("sm") + + options.withFooter({ + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }) + + options.withSortBy([ + { + "desc": true, + "displayName": "ea7b29d7-8991-4752-a0d4-e26446d34915 TCP_STREAM 4096 Mb/s AWS" + } + ]), + + 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 + }, + "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" + } + } + } + ]) + + table.standardOptions.withOverrides([ + { + "matcher": { + "id": "byName", + "options": "Average" + }, + "properties": [ + { + "id": "unit", + "value": "µs" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "messageSize" + }, + "properties": [ + { + "id": "unit", + "value": "bytes" + } + ] + } + ]), + }, + + timeSeries: { + local timeSeries = g.panel.timeSeries, + local custom = timeSeries.fieldConfig.defaults.custom, + local options = timeSeries.options, + + base(title, targets, gridPos): + timeSeries.new(title) + + timeSeries.queryOptions.withTargets(targets) + + timeSeries.panelOptions.withRepeat("messageSize") + + timeSeries.panelOptions.withRepeatDirection("h") + + timeSeries.datasource.withType('elasticsearch') + + timeSeries.datasource.withUid('$datasource') + + timeSeries.gridPos.withX(gridPos.x) + + timeSeries.gridPos.withY(gridPos.y) + + timeSeries.gridPos.withH(gridPos.h) + + timeSeries.gridPos.withW(gridPos.w) + + custom.withLineWidth(2) + + custom.withGradientMode("hue") + + custom.withShowPoints("always") + + custom.withPointSize(10) + + custom.withSpanNulls(true) + + custom.withFillOpacity(0) + + custom.withScaleDistribution({ + "type": "log", + "log": 2 + }) + + custom.withAxisCenteredZero(false) + + custom.withHideFrom({ + "tooltip": false, + "viz": false, + "legend": false + }) + + custom.withAxisGridShow(true) + + custom.withLineStyle({ + "fill": "solid" + }) + + options.tooltip.withMode('single') + + options.tooltip.withSort('none') + + options.legend.withShowLegend(true) + + options.legend.withPlacement('bottom') + + options.legend.withDisplayMode('table') + + options.legend.withCalcs(['lastNotNull']) + + timeSeries.standardOptions.withOverrides([ + { + "matcher": { + "id": "byFrameRefID", + "options": "A" + }, + "properties": [ + { + "id": "unit", + "value": "µs" + } + ] + } + ]), + + withThroughputOverrides(title, targets, gridPos): + self.base(title, targets, gridPos) + + options.legend.withSortBy("Last *") + + options.legend.withPlacement('right') + + options.legend.withSortDesc(false) + + timeSeries.standardOptions.withOverrides([ + { + "matcher": { + "id": "byFrameRefID", + "options": "A" + }, + "properties": [ + { + "id": "unit", + "value": "Mbits" + } + ] + } + ]), + }, +} \ No newline at end of file diff --git a/assets/k8s-netperf/queries.libsonnet b/assets/k8s-netperf/queries.libsonnet new file mode 100644 index 0000000..1ef4dee --- /dev/null +++ b/assets/k8s-netperf/queries.libsonnet @@ -0,0 +1,164 @@ +local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; +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') + }, + 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') + }, +} \ No newline at end of file diff --git a/assets/k8s-netperf/variables.libsonnet b/assets/k8s-netperf/variables.libsonnet new file mode 100644 index 0000000..7f8713c --- /dev/null +++ b/assets/k8s-netperf/variables.libsonnet @@ -0,0 +1,90 @@ +local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; +local var = g.dashboard.variable; + +{ + datasource: + var.datasource.new('datasource', 'elasticsearch') + + var.datasource.withRegex('/(.*netperf.*)/') + + var.query.generalOptions.withLabel('datasource') + + var.query.selectionOptions.withMulti(false) + + var.query.withRefresh(1) + + var.query.selectionOptions.withIncludeAll(false), + + platform: + var.query.new('platform', "{\"find\": \"terms\", \"field\": \"metadata.platform.keyword\"}") + + var.query.withDatasourceFromVariable(self.datasource) + + var.query.withRefresh(2) + + var.query.selectionOptions.withMulti(false) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.generalOptions.withLabel('Platform'), + + workers: + 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) + + var.query.selectionOptions.withIncludeAll(true) + + 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.withDatasourceFromVariable(self.datasource) + + var.query.withRefresh(2) + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.generalOptions.withLabel('uuid'), + + hostNetwork: + var.custom.new('hostNetwork', ['true', 'false'],) + + var.custom.selectionOptions.withMulti(true) + + var.custom.selectionOptions.withIncludeAll(false) + + var.custom.generalOptions.withLabel('hostNetwork'), + + service: + var.custom.new('service', ['true', 'false'],) + + var.custom.selectionOptions.withMulti(true) + + var.custom.selectionOptions.withIncludeAll(true) + + var.custom.generalOptions.withLabel('service'), + + streams: + 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) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.generalOptions.withLabel('streams'), + + throughput_profile: + var.query.new('throughput_profile', "{\"find\": \"terms\", \"field\": \"profile.keyword\", \"query\":\"uuid:$uuid\"}") + + var.query.withDatasourceFromVariable(self.datasource) + + 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.withDatasourceFromVariable(self.datasource) + + 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.withDatasourceFromVariable(self.datasource) + + var.query.withRefresh(2) + + var.query.selectionOptions.withMulti(true) + + var.query.selectionOptions.withIncludeAll(true) + + var.query.generalOptions.withLabel('messageSize'), + + driver: + 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) + + var.query.selectionOptions.withIncludeAll(false) + + var.query.generalOptions.withLabel('Driver'), +} \ No newline at end of file diff --git a/dittybopper/syncer/entrypoint.py b/dittybopper/syncer/entrypoint.py index 8142ed3..f2bf23e 100644 --- a/dittybopper/syncer/entrypoint.py +++ b/dittybopper/syncer/entrypoint.py @@ -16,7 +16,7 @@ class GrafanaOperations: def __init__(self, grafana_url: str, input_directory: str, git_commit_hash: str): self.grafana_url = grafana_url self.input_directory = input_directory - self.git_commit_hash = git_commit_hash + self.git_commit_hash = git_commit_hash if git_commit_hash else '' self.dashboards = defaultdict(list) self.folder_map = dict() self.logger = logging.getLogger(__name__) diff --git a/templates/CPT/k8s-netperf-v2.jsonnet b/templates/CPT/k8s-netperf-v2.jsonnet new file mode 100644 index 0000000..34c1b5a --- /dev/null +++ b/templates/CPT/k8s-netperf-v2.jsonnet @@ -0,0 +1,36 @@ +local panels = import '../../assets/k8s-netperf/panels.libsonnet'; +local queries = import '../../assets/k8s-netperf/queries.libsonnet'; +local variables = import '../../assets/k8s-netperf/variables.libsonnet'; +local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; + +g.dashboard.new('k8s-netperf') ++ g.dashboard.time.withFrom('now-6h') ++ g.dashboard.time.withTo('now') ++ g.dashboard.withTimezone('utc') ++ g.dashboard.timepicker.withRefreshIntervals(['5s', '10s', '30s', '1m', '5m', '15m', '30m', '1h', '2h', '1d']) ++ g.dashboard.timepicker.withTimeOptions(['5m', '15m', '1h', '6h', '12h', '24h', '2d', '7d', '30d']) ++ g.dashboard.withRefresh('') ++ g.dashboard.withEditable(true) ++ g.dashboard.graphTooltip.withSharedCrosshair() ++ g.dashboard.withVariables([ + variables.datasource, + variables.platform, + variables.workers, + variables.uuid, + variables.hostNetwork, + variables.service, + variables.streams, + variables.throughput_profile, + variables.latency_profile, + variables.messageSize, + variables.driver, +]) ++ g.dashboard.withPanels([ + panels.row.base('$latency_profile', 'latency_profile', { x: 0, y: 0, w: 24, h: 1 }), + panels.timeSeries.base('$latency_profile - $driver - $messageSize', queries.all.query('$latency_profile', 'latency'), { x: 0, y: 0, w: 24, h: 8 }), + panels.row.base('$throughput_profile', 'throughput_profile', { x: 0, y: 9, w: 24, h: 1 }), + panels.timeSeries.withThroughputOverrides('$throughput_profile - $driver - $messageSize', queries.all.query('$throughput_profile', 'throughput'), { x: 0, y: 10, w: 24, h: 8 }), + panels.row.base('Parallelism $parallelism', 'parallelism', { x: 0, y: 18, w: 24, h: 1 }), + panels.table.base('Throughput - Parallelism: $parallelism', queries.parallelismAll.query('$throughput_profile', 'throughput'), { x: 0, y: 19, w: 24, h: 11 }), + panels.table.withLatencyOverrides('Latency - Parallelism: $parallelism', queries.parallelismAll.query('$latency_profile', 'latency'), { x: 0, y: 19, w: 24, h: 11 }), +]) diff --git a/templates/jsonnetfile.lock.json b/templates/jsonnetfile.lock.json index e7be9c9..6fc272e 100644 --- a/templates/jsonnetfile.lock.json +++ b/templates/jsonnetfile.lock.json @@ -8,18 +8,18 @@ "subdir": "gen/grafonnet-latest" } }, - "version": "9087f21f41936c32967e4e3ae164627ba4055fed", - "sum": "sVzVlSLbxPkAurwO19YERigLMmRfVsViMcWC0gkTTqU=" + "version": "9e217263ac4b922ca2e00bc5cc36ada2311bb5a6", + "sum": "k5S6Nf6VA8Lg9B/qyB5XEoxDmIf5PsW8HTuC/BaNnu4=" }, { "source": { "git": { "remote": "https://github.com/grafana/grafonnet.git", - "subdir": "gen/grafonnet-v10.0.0" + "subdir": "gen/grafonnet-v10.1.0" } }, - "version": "9087f21f41936c32967e4e3ae164627ba4055fed", - "sum": "bWMuE3sTMnEFFwYmmwugyX+gjNsGea6NDwWxgzB19JQ=" + "version": "9e217263ac4b922ca2e00bc5cc36ada2311bb5a6", + "sum": "GpXlwBysu8dnoH9oYmsJj31CCVsL+wXnbWMxq7sl5Gg=" }, { "source": { @@ -28,8 +28,8 @@ "subdir": "doc-util" } }, - "version": "fd8de9039b3c06da77d635a3a8289809a5bfb542", - "sum": "mFebrE9fhyAKW4zbnidcjVFupziN5LPA/Z7ii94uCzs=" + "version": "503e5c8fe96d6b55775037713ac10b184709ad93", + "sum": "BY4u0kLF3Qf/4IB4HnX9S5kEQIpHb4MUrppp6WLDtlU=" }, { "source": { @@ -38,8 +38,8 @@ "subdir": "" } }, - "version": "0256a910ac71f0f842696d7bca0bf01ea77eb654", - "sum": "zBOpb1oTNvXdq9RF6yzTHill5r1YTJLBBoqyx4JYtAg=" + "version": "c1a315a7dbead0335a5e0486acc5583395b22a24", + "sum": "UVdL+uuFI8BSQgLfMJEJk2WDKsQXNT3dRHcr2Ti9rLI=" } ], "legacyImports": false