Skip to content

Commit

Permalink
dashboard: use fill(null) in InfluxQL requests
Browse files Browse the repository at this point in the history
This patch replaces fill(none) with fill(null) in dashboards InfluxQL
requests. After this patch, all panels with non-derivative requests
will show the gap in metrics for an interval if there were no metrics
for this interval. Before this patch, they had displayed a straight line
connecting border values in the area. Derivative requests will still
display a straight line [1]. There is a workaround to make derivative
requests result consistent with non-derivative one, but it makes query
more complicated both in terms of readability and performance, so it's
not worth it.

1. influxdata/influxdb#7185

Closes #23
  • Loading branch information
DifferentialOrange committed Aug 1, 2022
1 parent b2a43e3 commit a6c0634
Show file tree
Hide file tree
Showing 25 changed files with 954 additions and 911 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Set default Prometheus job to `tarantool`
- Set default InfluxDB measurement to `tarantool_http`
- Use in-built `$__rate_interval` instead of user-defined `$rate_time_range`
- Use `fill(null)` in InfluxQL requests


## [1.3.0] - 2022-06-29
Expand Down
4 changes: 4 additions & 0 deletions dashboard/panels/cluster.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ local prometheus = grafana.prometheus;
measurement=measurement,
group_tags=['label_pairs_alias'],
alias='$tag_label_pairs_alias',
fill='null',
).where('metric_name', '=', 'tnt_cartridge_issues').where('label_pairs_level', '=', level)
.selectField('value').addConverter('last')
),
Expand Down Expand Up @@ -437,6 +438,7 @@ local prometheus = grafana.prometheus;
measurement=measurement,
group_tags=['label_pairs_alias', 'label_pairs_stream', 'label_pairs_id'],
alias='$tag_label_pairs_alias $tag_label_pairs_stream ($tag_label_pairs_id)',
fill='null',
).where('metric_name', '=', 'tnt_replication_status')
.selectField('value').addConverter('last')
),
Expand Down Expand Up @@ -513,6 +515,7 @@ local prometheus = grafana.prometheus;
measurement=measurement,
group_tags=['label_pairs_alias', 'label_pairs_id'],
alias='$tag_label_pairs_alias ($tag_label_pairs_id)',
fill='null',
).where('metric_name', '=', 'tnt_replication_lag')
.selectField('value').addConverter('mean')
),
Expand Down Expand Up @@ -554,6 +557,7 @@ local prometheus = grafana.prometheus;
measurement=measurement,
group_tags=['label_pairs_alias', 'label_pairs_delta'],
alias='$tag_label_pairs_alias ($tag_label_pairs_delta)',
fill='null',
).where('metric_name', '=', 'tnt_clock_delta')
.selectField('value').addConverter('last')
),
Expand Down
2 changes: 2 additions & 0 deletions dashboard/panels/common.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ local prometheus = grafana.prometheus;
measurement=measurement,
group_tags=['label_pairs_alias'],
alias='$tag_label_pairs_alias',
fill='null',
).where('metric_name', '=', metric_name)
.selectField('value').addConverter(converter),

Expand All @@ -88,6 +89,7 @@ local prometheus = grafana.prometheus;
measurement=measurement,
group_tags=['label_pairs_alias'],
alias='$tag_label_pairs_alias',
fill='null',
).where('metric_name', '=', metric_name)
.selectField('value').addConverter('mean').addConverter('non_negative_derivative', ['1s']),

Expand Down
3 changes: 3 additions & 0 deletions dashboard/panels/crud.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ local operation_rps_template(
measurement=measurement,
group_tags=['label_pairs_alias', 'label_pairs_name'],
alias='$tag_label_pairs_alias — $tag_label_pairs_name',
fill='null',
).where('metric_name', '=', 'tnt_crud_stats_count')
.where('label_pairs_operation', '=', operation)
.where('label_pairs_status', '=', status)
Expand Down Expand Up @@ -115,6 +116,7 @@ local operation_latency_template(
measurement=measurement,
group_tags=['label_pairs_alias', 'label_pairs_name'],
alias='$tag_label_pairs_alias — $tag_label_pairs_name',
fill='null',
).where('metric_name', '=', 'tnt_crud_stats')
.where('label_pairs_operation', '=', operation)
.where('label_pairs_status', '=', status)
Expand Down Expand Up @@ -634,6 +636,7 @@ local module = {
measurement=measurement,
group_tags=['label_pairs_alias', 'label_pairs_name'],
alias='$tag_label_pairs_alias — $tag_label_pairs_name',
fill='null',
).where('metric_name', '=', 'tnt_crud_map_reduces')
.where('label_pairs_operation', '=', 'select')
.selectField('value').addConverter('mean').addConverter('non_negative_derivative', ['1s'])
Expand Down
2 changes: 2 additions & 0 deletions dashboard/panels/expirationd.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ local prometheus = grafana.prometheus;
'label_pairs_name',
],
alias='$tag_label_pairs_name — $tag_label_pairs_alias',
fill='null',
).where('metric_name', '=', metric_name)
.selectField('value').addConverter('mean'),

Expand All @@ -55,6 +56,7 @@ local prometheus = grafana.prometheus;
'label_pairs_name',
],
alias='$tag_label_pairs_name — $tag_label_pairs_alias',
fill='null',
).where('metric_name', '=', metric_name)
.selectField('value').addConverter('mean').addConverter('non_negative_derivative', ['1s']),

Expand Down
2 changes: 2 additions & 0 deletions dashboard/panels/http.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ local prometheus = grafana.prometheus;
measurement=measurement,
group_tags=['label_pairs_alias', 'label_pairs_path', 'label_pairs_method', 'label_pairs_status'],
alias='$tag_label_pairs_alias — $tag_label_pairs_method $tag_label_pairs_path (code $tag_label_pairs_status)',
fill='null',
).where('metric_name', '=', metric_name).where('label_pairs_status', '=~', std.format('/%s/', status_regex))
.selectField('value').addConverter('mean').addConverter('non_negative_derivative', ['1s'])
),
Expand Down Expand Up @@ -144,6 +145,7 @@ local prometheus = grafana.prometheus;
measurement=measurement,
group_tags=['label_pairs_alias', 'label_pairs_path', 'label_pairs_method', 'label_pairs_status'],
alias='$tag_label_pairs_alias — $tag_label_pairs_method $tag_label_pairs_path (code $tag_label_pairs_status)',
fill='null',
).where('metric_name', '=', metric_name).where('label_pairs_quantile', '=', quantile)
.where('label_pairs_status', '=~', std.format('/%s/', status_regex)).selectField('value').addConverter('mean')
),
Expand Down
1 change: 1 addition & 0 deletions dashboard/panels/operations.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ local prometheus = grafana.prometheus;
measurement=measurement,
group_tags=['label_pairs_alias'],
alias='$tag_label_pairs_alias',
fill='null',
).where('metric_name', '=', 'tnt_stats_op_total').where('label_pairs_operation', '=', operation)
.selectField('value').addConverter('mean').addConverter('non_negative_derivative', ['1s'])
),
Expand Down
3 changes: 3 additions & 0 deletions dashboard/panels/space.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ local prometheus = grafana.prometheus;
measurement=measurement,
group_tags=['label_pairs_alias', 'label_pairs_name'],
alias='$tag_label_pairs_alias — $tag_label_pairs_name',
fill='null',
).where('metric_name', '=', metric_name).where('label_pairs_engine', '=', engine)
.selectField('value').addConverter('last')
),
Expand Down Expand Up @@ -125,6 +126,7 @@ local prometheus = grafana.prometheus;
measurement=measurement,
group_tags=['label_pairs_alias', 'label_pairs_name'],
alias='$tag_label_pairs_alias — $tag_label_pairs_name',
fill='null',
).where('metric_name', '=', metric_name).where('label_pairs_engine', '=', 'memtx')
.selectField('value').addConverter('mean')
),
Expand Down Expand Up @@ -194,6 +196,7 @@ local prometheus = grafana.prometheus;
measurement=measurement,
group_tags=['label_pairs_alias', 'label_pairs_name', 'label_pairs_index_name'],
alias='$tag_label_pairs_alias — $tag_label_pairs_name ($tag_label_pairs_index_name)',
fill='null',
).where('metric_name', '=', 'tnt_space_index_bsize')
.selectField('value').addConverter('mean')
),
Expand Down
2 changes: 2 additions & 0 deletions dashboard/panels/tdg/expirationd.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ local prometheus = grafana.prometheus;
'label_pairs_name',
],
alias='$tag_label_pairs_name — $tag_label_pairs_alias',
fill='null',
).where('metric_name', '=', metric_name)
.selectField('value').addConverter('mean'),

Expand All @@ -55,6 +56,7 @@ local prometheus = grafana.prometheus;
'label_pairs_name',
],
alias='$tag_label_pairs_name — $tag_label_pairs_alias',
fill='null',
).where('metric_name', '=', metric_name)
.selectField('value').addConverter('mean').addConverter('non_negative_derivative', ['1s']),

Expand Down
1 change: 1 addition & 0 deletions dashboard/panels/tdg/file_connectors.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ local prometheus = grafana.prometheus;
'label_pairs_connector_name',
],
alias='$tag_label_pairs_connector_name — $tag_label_pairs_alias',
fill='null',
).where('metric_name', '=', metric_name)
.selectField('value').addConverter('mean'),

Expand Down
3 changes: 2 additions & 1 deletion dashboard/panels/tdg/graphql.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ local prometheus = grafana.prometheus;
'label_pairs_entity',
],
alias='$tag_label_pairs_operation_name ($tag_label_pairs_schema, $tag_label_pairs_entity) — $tag_label_pairs_alias',
fill='null',
).where('metric_name', '=', metric_name)
.selectField('value').addConverter('mean').addConverter('non_negative_derivative', ['1s']),

Expand Down Expand Up @@ -69,7 +70,7 @@ local prometheus = grafana.prometheus;
(SELECT "value" as "%(metric_name_count)s" FROM %(policy_prefix)s"%(measurement)s"
WHERE ("metric_name" = '%(metric_name_count)s') AND $timeFilter)
GROUP BY time($__interval), "label_pairs_alias", "label_pairs_operation_name",
"label_pairs_schema", "label_pairs_entity" fill(none)
"label_pairs_schema", "label_pairs_entity" fill(null)
|||, {
metric_name_sum: std.join('_', [metric_name, 'sum']),
metric_name_count: std.join('_', [metric_name, 'count']),
Expand Down
2 changes: 2 additions & 0 deletions dashboard/panels/tdg/iproto.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ local prometheus = grafana.prometheus;
'label_pairs_type',
],
alias='$tag_label_pairs_type — $tag_label_pairs_alias',
fill='null',
).where('metric_name', '=', metric_name)
.where('label_pairs_method', '=', std.format('repository.%s', method_tail))
.selectField('value').addConverter('mean').addConverter('non_negative_derivative', ['1s']),
Expand Down Expand Up @@ -102,6 +103,7 @@ local prometheus = grafana.prometheus;
'label_pairs_type',
],
alias='$tag_label_pairs_type — $tag_label_pairs_alias',
fill='null',
).where('metric_name', '=', metric_name)
.where('label_pairs_method', '=', std.format('repository.%s', method_tail))
.where('label_pairs_quantile', '=', '0.99')
Expand Down
4 changes: 4 additions & 0 deletions dashboard/panels/tdg/kafka/brokers.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ local prometheus = grafana.prometheus;
'label_pairs_broker_name',
],
alias='$tag_label_pairs_name ($tag_label_pairs_broker_name) — $tag_label_pairs_alias ($tag_label_pairs_type, $tag_label_pairs_connector_name)',
fill='null',
).where('metric_name', '=', metric_name)
.selectField('value').addConverter('mean'),

Expand Down Expand Up @@ -61,6 +62,7 @@ local prometheus = grafana.prometheus;
'label_pairs_broker_name',
],
alias='$tag_label_pairs_name ($tag_label_pairs_broker_name) — $tag_label_pairs_alias ($tag_label_pairs_type, $tag_label_pairs_connector_name)',
fill='null',
).where('metric_name', '=', metric_name)
.selectField('value').addConverter('mean').addConverter('non_negative_derivative', ['1s']),

Expand Down Expand Up @@ -89,6 +91,7 @@ local prometheus = grafana.prometheus;
'label_pairs_broker_name',
],
alias='$tag_label_pairs_name ($tag_label_pairs_broker_name) — $tag_label_pairs_alias ($tag_label_pairs_type, $tag_label_pairs_connector_name)',
fill='null',
).where('metric_name', '=', metric_name).where('label_pairs_quantile', '=', '0.99')
.selectField('value').addConverter('last'),

Expand Down Expand Up @@ -620,6 +623,7 @@ local prometheus = grafana.prometheus;
'label_pairs_request',
],
alias='$tag_label_pairs_request — $tag_label_pairs_name ($tag_label_pairs_broker_name) — $tag_label_pairs_alias ($tag_label_pairs_type, $tag_label_pairs_connector_name)',
fill='null',
).where('metric_name', '=', 'tdg_kafka_broker_req')
.selectField('value').addConverter('mean').addConverter('non_negative_derivative', ['1s']),
),
Expand Down
4 changes: 4 additions & 0 deletions dashboard/panels/tdg/kafka/topics.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ local prometheus = grafana.prometheus;
'label_pairs_topic',
],
alias='$tag_label_pairs_name ($tag_label_pairs_topic) — $tag_label_pairs_alias ($tag_label_pairs_type, $tag_label_pairs_connector_name)',
fill='null',
).where('metric_name', '=', metric_name)
.selectField('value').addConverter('mean'),

Expand Down Expand Up @@ -61,6 +62,7 @@ local prometheus = grafana.prometheus;
'label_pairs_partition',
],
alias='$tag_label_pairs_name ($tag_label_pairs_topic, $tag_label_pairs_partition) — $tag_label_pairs_alias ($tag_label_pairs_type, $tag_label_pairs_connector_name)',
fill='null',
).where('metric_name', '=', metric_name)
.selectField('value').addConverter('mean'),

Expand Down Expand Up @@ -90,6 +92,7 @@ local prometheus = grafana.prometheus;
'label_pairs_partition',
],
alias='$tag_label_pairs_name ($tag_label_pairs_topic, $tag_label_pairs_partition) — $tag_label_pairs_alias ($tag_label_pairs_type, $tag_label_pairs_connector_name)',
fill='null',
).where('metric_name', '=', metric_name)
.selectField('value').addConverter('mean').addConverter('non_negative_derivative', ['1s']),

Expand Down Expand Up @@ -118,6 +121,7 @@ local prometheus = grafana.prometheus;
'label_pairs_topic',
],
alias='$tag_label_pairs_name ($tag_label_pairs_topic) — $tag_label_pairs_alias ($tag_label_pairs_type, $tag_label_pairs_connector_name)',
fill='null',
).where('metric_name', '=', metric_name).where('label_pairs_quantile', '=', '0.99')
.selectField('value').addConverter('last'),

Expand Down
2 changes: 2 additions & 0 deletions dashboard/panels/tdg/kafka/utils.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ local prometheus = grafana.prometheus;
measurement=measurement,
group_tags=['label_pairs_alias', 'label_pairs_name', 'label_pairs_type', 'label_pairs_connector_name'],
alias='$tag_label_pairs_name — $tag_label_pairs_alias ($tag_label_pairs_type, $tag_label_pairs_connector_name)',
fill='null',
).where('metric_name', '=', metric_name)
.selectField('value').addConverter('mean'),

Expand All @@ -46,6 +47,7 @@ local prometheus = grafana.prometheus;
measurement=measurement,
group_tags=['label_pairs_alias', 'label_pairs_name', 'label_pairs_type', 'label_pairs_connector_name'],
alias='$tag_label_pairs_name — $tag_label_pairs_alias ($tag_label_pairs_type, $tag_label_pairs_connector_name)',
fill='null',
).where('metric_name', '=', metric_name)
.selectField('value').addConverter('mean').addConverter('non_negative_derivative', ['1s']),
}
2 changes: 2 additions & 0 deletions dashboard/panels/tdg/rest_api.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ local prometheus = grafana.prometheus;
'label_pairs_method',
],
alias='$tag_label_pairs_method $tag_label_pairs_type (code $tag_label_pairs_status_code) — $tag_label_pairs_alias',
fill='null',
).where('metric_name', '=', metric_name)
.where('label_pairs_method', get_condition, 'GET')
.where('label_pairs_status_code', '=~', std.format('/%s/', status_regex))
Expand Down Expand Up @@ -92,6 +93,7 @@ local prometheus = grafana.prometheus;
'label_pairs_method',
],
alias='$tag_label_pairs_method $tag_label_pairs_type (code $tag_label_pairs_status_code) — $tag_label_pairs_alias',
fill='null',
).where('metric_name', '=', metric_name)
.where('label_pairs_method', get_condition, 'GET')
.where('label_pairs_status_code', '=~', std.format('/%s/', status_regex))
Expand Down
8 changes: 6 additions & 2 deletions dashboard/panels/tdg/tasks.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ local prometheus = grafana.prometheus;
'label_pairs_kind',
],
alias='$tag_label_pairs_name — $tag_label_pairs_alias',
fill='null',
).where('metric_name', '=', metric_name)
.selectField('value').addConverter('mean').addConverter('non_negative_derivative', ['1s']),
),
Expand Down Expand Up @@ -78,6 +79,7 @@ local prometheus = grafana.prometheus;
'label_pairs_kind',
],
alias='$tag_label_pairs_name — $tag_label_pairs_alias',
fill='null',
).where('metric_name', '=', metric_name)
.selectField('value').addConverter('mean'),
),
Expand Down Expand Up @@ -124,7 +126,7 @@ local prometheus = grafana.prometheus;
WHERE ("metric_name" = '%(metric_name_sum)s') AND $timeFilter),
(SELECT "value" as "%(metric_name_count)s" FROM %(policy_prefix)s"%(measurement)s"
WHERE ("metric_name" = '%(metric_name_count)s') AND $timeFilter)
GROUP BY time($__interval), "label_pairs_alias", "label_pairs_name" fill(none)
GROUP BY time($__interval), "label_pairs_alias", "label_pairs_name" fill(null)
|||, {
metric_name_sum: std.join('_', [metric_name, 'sum']),
metric_name_count: std.join('_', [metric_name, 'count']),
Expand Down Expand Up @@ -167,6 +169,7 @@ local prometheus = grafana.prometheus;
'label_pairs_kind',
],
alias='$tag_label_pairs_name ($tag_label_pairs_kind) — $tag_label_pairs_alias',
fill='null',
).where('metric_name', '=', metric_name)
.selectField('value').addConverter('mean').addConverter('non_negative_derivative', ['1s']),
),
Expand Down Expand Up @@ -204,6 +207,7 @@ local prometheus = grafana.prometheus;
'label_pairs_kind',
],
alias='$tag_label_pairs_name ($tag_label_pairs_kind) — $tag_label_pairs_alias',
fill='null',
).where('metric_name', '=', metric_name)
.selectField('value').addConverter('mean'),
),
Expand Down Expand Up @@ -251,7 +255,7 @@ local prometheus = grafana.prometheus;
(SELECT "value" as "%(metric_name_count)s" FROM %(policy_prefix)s"%(measurement)s"
WHERE ("metric_name" = '%(metric_name_count)s') AND $timeFilter)
GROUP BY time($__interval), "label_pairs_alias", "label_pairs_name",
"label_pairs_kind" fill(none)
"label_pairs_kind" fill(null)
|||, {
metric_name_sum: std.join('_', [metric_name, 'sum']),
metric_name_count: std.join('_', [metric_name, 'count']),
Expand Down
2 changes: 1 addition & 1 deletion dashboard/panels/tdg/tuples.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ local prometheus = grafana.prometheus;
WHERE ("metric_name" = '%(metric_name_sum)s') AND $timeFilter),
(SELECT "value" as "%(metric_name_count)s" FROM %(policy_prefix)s"%(measurement)s"
WHERE ("metric_name" = '%(metric_name_count)s') AND $timeFilter)
GROUP BY time($__interval), "label_pairs_alias", "label_pairs_type_name" fill(none)
GROUP BY time($__interval), "label_pairs_alias", "label_pairs_type_name" fill(null)
|||, {
metric_name_sum: std.join('_', [metric_name, 'sum']),
metric_name_count: std.join('_', [metric_name, 'count']),
Expand Down
2 changes: 2 additions & 0 deletions dashboard/panels/vinyl.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ local prometheus = grafana.prometheus;
measurement=measurement,
group_tags=['label_pairs_alias'],
alias='$tag_label_pairs_alias',
fill='null',
).where('metric_name', '=', 'tnt_vinyl_scheduler_tasks').where('label_pairs_status', '=', 'inprogress')
.selectField('value').addConverter('last')
),
Expand Down Expand Up @@ -627,6 +628,7 @@ local prometheus = grafana.prometheus;
measurement=measurement,
group_tags=['label_pairs_alias'],
alias='$tag_label_pairs_alias',
fill='null',
).where('metric_name', '=', 'tnt_vinyl_scheduler_tasks').where('label_pairs_status', '=', 'failed')
.selectField('value').addConverter('mean').addConverter('non_negative_derivative', ['1s'])
),
Expand Down
Loading

0 comments on commit a6c0634

Please sign in to comment.