-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from Manda-supraja26/Vegeta
Adding vegeta-wrapper dashboard to grafonnet
- Loading branch information
Showing
4 changed files
with
404 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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, | ||
|
||
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'), | ||
}, | ||
|
||
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 | ||
} | ||
] | ||
} | ||
]), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'; | ||
local variables = import './variables.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') | ||
}, | ||
|
||
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'), | ||
|
||
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'), | ||
|
||
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("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_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') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
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('/(.*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'), | ||
|
||
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), | ||
|
||
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), | ||
} |
Oops, something went wrong.