Skip to content

Mixin: Change from Phlare to Pyroscope #2342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
_config+:: {
// Tags for dashboards.
tags: ['phlare'],
tags: ['pyroscope'],

// The label used to differentiate between different application instances (i.e. 'pod' in a kubernetes install).
per_instance_label: 'pod',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(import 'config.libsonnet') +
(import 'dashboards/phlare-writes.libsonnet') +
(import 'dashboards/phlare-reads.libsonnet')
(import 'dashboards/pyroscope-writes.libsonnet') +
(import 'dashboards/pyroscope-reads.libsonnet')
Original file line number Diff line number Diff line change
Expand Up @@ -4,63 +4,63 @@ local utils = import 'mixin-utils/utils.libsonnet';
grafanaDashboards+: {
local dashboards = self,
local http_route = '.*merge.*|.*series.*|.*type.*',
'phlare-reads.json': {
local cfg = self,
'pyroscope-reads.json': {
local cfg = self,

showMultiCluster:: $._config.multi_cluster,
clusterLabel:: $._config.per_cluster_label,
clusterMatchers::
if cfg.showMultiCluster then
[utils.selector.re(cfg.clusterLabel, '$cluster')]
else
[],
showMultiCluster:: $._config.multi_cluster,
clusterLabel:: $._config.per_cluster_label,
clusterMatchers::
if cfg.showMultiCluster then
[utils.selector.re(cfg.clusterLabel, '$cluster')]
else
[],

matchers:: {
querier: [utils.selector.re('job', '($namespace)/(phlare|querier)')],
ingester: [utils.selector.re('job', '($namespace)/(phlare|ingester)')],
},
matchers:: {
querier: [utils.selector.re('job', '($namespace)/(pyroscope|querier)')],
ingester: [utils.selector.re('job', '($namespace)/(pyroscope|ingester)')],
},

local selector(matcherId) =
local ms = (cfg.clusterMatchers + cfg.matchers[matcherId]);
if std.length(ms) > 0 then
std.join(',', ['%(label)s%(op)s"%(value)s"' % matcher for matcher in ms]) + ','
else '',
querierSelector:: selector('querier'),
ingesterSelector:: selector('ingester'),
} +
$.dashboard('Phlare / Reads', uid='phlare-reads')
.addCluster()
.addNamespace()
.addTag()
.addRow(
$.row('Querier')
.addPanel(
$.panel('QPS') +
$.qpsPanel('pyroscope_request_duration_seconds_count{%s route=~"%s"}' % [dashboards['phlare-reads.json'].querierSelector, http_route])
)
.addPanel(
$.panel('Latency') +
utils.latencyRecordingRulePanel(
'pyroscope_request_duration_seconds',
dashboards['phlare-reads.json'].matchers.querier + [utils.selector.re('route', http_route)] + dashboards['phlare-reads.json'].clusterMatchers,
sum_by=['route']
)
)
)
.addRow(
$.row('Ingester')
.addPanel(
$.panel('QPS') +
$.qpsPanel('pyroscope_request_duration_seconds_count{%s route=~"%s"}' % [dashboards['phlare-reads.json'].ingesterSelector, http_route])
)
.addPanel(
$.panel('Latency') +
utils.latencyRecordingRulePanel(
'pyroscope_request_duration_seconds',
dashboards['phlare-reads.json'].matchers.ingester + [utils.selector.re('route', http_route)] + dashboards['phlare-reads.json'].clusterMatchers,
sum_by=['route']
)
)
),
local selector(matcherId) =
local ms = (cfg.clusterMatchers + cfg.matchers[matcherId]);
if std.length(ms) > 0 then
std.join(',', ['%(label)s%(op)s"%(value)s"' % matcher for matcher in ms]) + ','
else '',
querierSelector:: selector('querier'),
ingesterSelector:: selector('ingester'),
} +
$.dashboard('Pyroscope / Reads', uid='pyroscope-reads')
.addCluster()
.addNamespace()
.addTag()
.addRow(
$.row('Querier')
.addPanel(
$.panel('QPS') +
$.qpsPanel('pyroscope_request_duration_seconds_count{%s route=~"%s"}' % [dashboards['pyroscope-reads.json'].querierSelector, http_route])
)
.addPanel(
$.panel('Latency') +
utils.latencyRecordingRulePanel(
'pyroscope_request_duration_seconds',
dashboards['pyroscope-reads.json'].matchers.querier + [utils.selector.re('route', http_route)] + dashboards['pyroscope-reads.json'].clusterMatchers,
sum_by=['route']
)
)
)
.addRow(
$.row('Ingester')
.addPanel(
$.panel('QPS') +
$.qpsPanel('pyroscope_request_duration_seconds_count{%s route=~"%s"}' % [dashboards['pyroscope-reads.json'].ingesterSelector, http_route])
)
.addPanel(
$.panel('Latency') +
utils.latencyRecordingRulePanel(
'pyroscope_request_duration_seconds',
dashboards['pyroscope-reads.json'].matchers.ingester + [utils.selector.re('route', http_route)] + dashboards['pyroscope-reads.json'].clusterMatchers,
sum_by=['route']
)
)
),
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,107 +6,107 @@ local utils = import 'mixin-utils/utils.libsonnet';
grafanaDashboards+: {
local dashboards = self,

'phlare-writes.json': {
local cfg = self,
'pyroscope-writes.json': {
local cfg = self,

showMultiCluster:: $._config.multi_cluster,
clusterLabel:: $._config.per_cluster_label,
clusterMatchers::
if cfg.showMultiCluster then
[utils.selector.re(cfg.clusterLabel, '$cluster')]
else
[],
showMultiCluster:: $._config.multi_cluster,
clusterLabel:: $._config.per_cluster_label,
clusterMatchers::
if cfg.showMultiCluster then
[utils.selector.re(cfg.clusterLabel, '$cluster')]
else
[],

matchers:: {
distributor: [utils.selector.re('job', '($namespace)/(phlare|distributor)')],
ingester: [utils.selector.re('job', '($namespace)/(phlare|ingester)')],
},
matchers:: {
distributor: [utils.selector.re('job', '($namespace)/(pyroscope|distributor)')],
ingester: [utils.selector.re('job', '($namespace)/(pyroscope|ingester)')],
},

local selector(matcherId) =
local ms = cfg.clusterMatchers + cfg.matchers[matcherId];
if std.length(ms) > 0 then
std.join(',', ['%(label)s%(op)s"%(value)s"' % matcher for matcher in ms]) + ','
else '',
local selector(matcherId) =
local ms = cfg.clusterMatchers + cfg.matchers[matcherId];
if std.length(ms) > 0 then
std.join(',', ['%(label)s%(op)s"%(value)s"' % matcher for matcher in ms]) + ','
else '',

distributorSelector:: selector('distributor'),
ingesterSelector:: selector('ingester'),
} +
$.dashboard('Phlare / Writes', uid='phlare-writes')
.addCluster()
.addNamespace()
.addTag()
.addRow(
$.row('Distributor Profiles received')
.addPanel(
$.panel('Compressed Size') +
utils.latencyRecordingRulePanel(
'pyroscope_distributor_received_compressed_bytes',
dashboards['phlare-writes.json'].matchers.distributor + [utils.selector.re('type', '.*')] + dashboards['phlare-writes.json'].clusterMatchers,
multiplier='1',
sum_by=['type'],
) + { yaxes: g.yaxes('bytes') },
)
.addPanel(
$.panel('Samples') +
utils.latencyRecordingRulePanel(
'pyroscope_distributor_received_samples',
dashboards['phlare-writes.json'].matchers.distributor + [utils.selector.re('type', '.*')] + dashboards['phlare-writes.json'].clusterMatchers,
multiplier='1',
sum_by=['type'],
) + { yaxes: g.yaxes('count') },
)
)
.addRow(
$.row('Distributor Requests')
.addPanel(
$.panel('QPS') +
$.qpsPanel('pyroscope_request_duration_seconds_count{%s, route=~".*push.*|.*ingest.*"}' % std.rstripChars(dashboards['phlare-writes.json'].distributorSelector, ','))
)
.addPanel(
$.panel('Latency') +
utils.latencyRecordingRulePanel(
'pyroscope_request_duration_seconds',
dashboards['phlare-writes.json'].matchers.distributor + [utils.selector.re('route', '.*push.*')] + dashboards['phlare-writes.json'].clusterMatchers,
)
)
)
.addRow(
$.row('Ingester')
.addPanel(
$.panel('QPS') +
$.qpsPanel('pyroscope_request_duration_seconds_count{%s route=~".*push.*|.*ingest.*"}' % dashboards['phlare-writes.json'].ingesterSelector)
)
.addPanel(
$.panel('Latency') +
utils.latencyRecordingRulePanel(
'pyroscope_request_duration_seconds',
dashboards['phlare-writes.json'].matchers.ingester + [utils.selector.re('route', '.*push.*|.*ingest.*')] + dashboards['phlare-writes.json'].clusterMatchers,
)
)
)
.addRow(
local long_desc = |||
Ingesters maintain a local Head per-tenant. Each
Head maintains the active profiling series; Then
the head gets periodically compacted into a block
on disk. This panel shows the estimated size of
the Head in memory for all ingesters.
|||;
$.row('Ingester - Head')
.addPanel(
local short_desc = 'Head size in bytes per table type';
$.panel(short_desc) +
$.panelDescription(short_desc, long_desc,) +
$.queryPanel('sum(pyroscope_head_size_bytes{%s}) by (type)' % dashboards['phlare-writes.json'].ingesterSelector, '{{type}}') +
{ yaxes: $.yaxes('bytes') },
)
.addPanel(
local short_desc = 'Head size in bytes per pod';
$.panel(short_desc) +
$.panelDescription(short_desc, long_desc,) +
$.queryPanel('sum(pyroscope_head_size_bytes{%s}) by (instance)' % dashboards['phlare-writes.json'].ingesterSelector, '{{instance}}') +
{ yaxes: $.yaxes('bytes') },
)
),
distributorSelector:: selector('distributor'),
ingesterSelector:: selector('ingester'),
} +
$.dashboard('Pyroscope / Writes', uid='pyroscope-writes')
.addCluster()
.addNamespace()
.addTag()
.addRow(
$.row('Distributor Profiles received')
.addPanel(
$.panel('Compressed Size') +
utils.latencyRecordingRulePanel(
'pyroscope_distributor_received_compressed_bytes',
dashboards['pyroscope-writes.json'].matchers.distributor + [utils.selector.re('type', '.*')] + dashboards['pyroscope-writes.json'].clusterMatchers,
multiplier='1',
sum_by=['type'],
) + { yaxes: g.yaxes('bytes') },
)
.addPanel(
$.panel('Samples') +
utils.latencyRecordingRulePanel(
'pyroscope_distributor_received_samples',
dashboards['pyroscope-writes.json'].matchers.distributor + [utils.selector.re('type', '.*')] + dashboards['pyroscope-writes.json'].clusterMatchers,
multiplier='1',
sum_by=['type'],
) + { yaxes: g.yaxes('count') },
)
)
.addRow(
$.row('Distributor Requests')
.addPanel(
$.panel('QPS') +
$.qpsPanel('pyroscope_request_duration_seconds_count{%s, route=~".*push.*|.*ingest.*"}' % std.rstripChars(dashboards['pyroscope-writes.json'].distributorSelector, ','))
)
.addPanel(
$.panel('Latency') +
utils.latencyRecordingRulePanel(
'pyroscope_request_duration_seconds',
dashboards['pyroscope-writes.json'].matchers.distributor + [utils.selector.re('route', '.*push.*')] + dashboards['pyroscope-writes.json'].clusterMatchers,
)
)
)
.addRow(
$.row('Ingester')
.addPanel(
$.panel('QPS') +
$.qpsPanel('pyroscope_request_duration_seconds_count{%s route=~".*push.*|.*ingest.*"}' % dashboards['pyroscope-writes.json'].ingesterSelector)
)
.addPanel(
$.panel('Latency') +
utils.latencyRecordingRulePanel(
'pyroscope_request_duration_seconds',
dashboards['pyroscope-writes.json'].matchers.ingester + [utils.selector.re('route', '.*push.*|.*ingest.*')] + dashboards['pyroscope-writes.json'].clusterMatchers,
)
)
)
.addRow(
local long_desc = |||
Ingesters maintain a local Head per-tenant. Each
Head maintains the active profiling series; Then
the head gets periodically compacted into a block
on disk. This panel shows the estimated size of
the Head in memory for all ingesters.
|||;
$.row('Ingester - Head')
.addPanel(
local short_desc = 'Head size in bytes per table type';
$.panel(short_desc) +
$.panelDescription(short_desc, long_desc,) +
$.queryPanel('sum(pyroscope_head_size_bytes{%s}) by (type)' % dashboards['pyroscope-writes.json'].ingesterSelector, '{{type}}') +
{ yaxes: $.yaxes('bytes') },
)
.addPanel(
local short_desc = 'Head size in bytes per pod';
$.panel(short_desc) +
$.panelDescription(short_desc, long_desc,) +
$.queryPanel('sum(pyroscope_head_size_bytes{%s}) by (instance)' % dashboards['pyroscope-writes.json'].ingesterSelector, '{{instance}}') +
{ yaxes: $.yaxes('bytes') },
)
),
},
}
Loading