-
Notifications
You must be signed in to change notification settings - Fork 178
chore: Redis Enterprise modern library usage #1538
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
Open
schmikei
wants to merge
5
commits into
grafana:master
Choose a base branch
from
schmikei:chore/redis-enterprise-modernization
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
488c847
modernize the redis-enterprise mixin to use modern libraries
schmikei 0a8f29c
fix lint
schmikei 4caf4be
audit signals for gauges
schmikei f522be4
pr feedback
schmikei f664523
Merge branch 'master' into chore/redis-enterprise-modernization
schmikei File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -1,17 +1,33 @@ | ||
| { | ||
| _config+:: { | ||
| dashboardTags: ['redis-enterprise-mixin'], | ||
| dashboardPeriod: 'now-1h', | ||
| dashboardTimezone: 'default', | ||
| dashboardRefresh: '1m', | ||
| local this = self, | ||
| filteringSelector: 'job="integrations/redis-enterprise"', | ||
| groupLabels: ['job', 'redis_cluster'], | ||
| instanceLabels: ['instance'], | ||
| nodeLabels: ['node'], | ||
| databaseLabels: ['bdb'], | ||
| uid: 'redis-enterprise', | ||
| dashboardNamePrefix: 'Redis Enterprise', | ||
| dashboardTags: [self.uid + '-mixin'], | ||
| dashboardPeriod: 'now-1h', | ||
| dashboardTimezone: 'default', | ||
| dashboardRefresh: '1m', | ||
|
|
||
| //alert thresholds | ||
| alertsClusterOutOfMemoryThreshold: 80, // % | ||
| alertsNodeCPUHighUtilizationThreshold: 80, // % | ||
| alertsDatabaseHighMemoryUtiliation: 80, // % | ||
| alertsDatabaseHighLatencyMs: 1000, // ms | ||
| alertsEvictedObjectsThreshold: 1, | ||
| // Alert thresholds | ||
| alertsClusterOutOfMemoryThreshold: 80, // % | ||
| alertsNodeCPUHighUtilizationThreshold: 80, // % | ||
| alertsDatabaseHighMemoryUtilization: 80, // % | ||
| alertsDatabaseHighLatencyMs: 1000, // ms | ||
| alertsEvictedObjectsThreshold: 1, | ||
|
|
||
| enableLokiLogs: true, | ||
| enableLokiLogs: true, | ||
| extraLogLabels: [], | ||
| showLogsVolume: true, | ||
|
|
||
| // Metrics source for signals | ||
| metricsSource: 'prometheus', | ||
| signals: { | ||
| overview: (import './signals/overview.libsonnet')(this), | ||
| nodes: (import './signals/nodes.libsonnet')(this), | ||
| databases: (import './signals/databases.libsonnet')(this), | ||
| }, | ||
| } |
This file contains hidden or 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,148 @@ | ||
| local g = import './g.libsonnet'; | ||
| local commonlib = import 'common-lib/common/main.libsonnet'; | ||
| local util = import 'common-lib/common/util.libsonnet'; | ||
| local logslib = import 'logs-lib/logs/main.libsonnet'; | ||
|
|
||
|
|
||
| { | ||
| local root = self, | ||
| new(this):: | ||
| local prefix = this.config.dashboardNamePrefix; | ||
| local links = this.grafana.links; | ||
| local tags = this.config.dashboardTags; | ||
| local uid = g.util.string.slugify(this.config.uid); | ||
| local vars = this.grafana.variables; | ||
| local annotations = this.grafana.annotations; | ||
| local refresh = this.config.dashboardRefresh; | ||
| local period = this.config.dashboardPeriod; | ||
| local timezone = this.config.dashboardTimezone; | ||
|
|
||
| local nodeVars = std.map( | ||
| function(label) | ||
| g.dashboard.variable.query.new(label) | ||
| + g.dashboard.variable.custom.selectionOptions.withMulti(true) | ||
| + g.dashboard.variable.query.queryTypes.withLabelValues(label, metric='node_up') | ||
| + g.dashboard.variable.query.withDatasourceFromVariable(vars.datasources.prometheus) | ||
| + g.dashboard.variable.query.selectionOptions.withIncludeAll(true), | ||
| this.config.nodeLabels | ||
| ); | ||
|
|
||
| local databaseVars = std.map( | ||
| function(label) | ||
| g.dashboard.variable.query.new(label) | ||
| + g.dashboard.variable.custom.selectionOptions.withMulti(true) | ||
| + g.dashboard.variable.custom.selectionOptions.withIncludeAll(true) | ||
| + g.dashboard.variable.query.queryTypes.withLabelValues(label, metric='bdb_up') | ||
| + g.dashboard.variable.query.withDatasourceFromVariable(vars.datasources.prometheus), this.config.databaseLabels | ||
| ); | ||
|
|
||
|
|
||
| { | ||
| 'redis-enterprise-overview.json': | ||
| g.dashboard.new(prefix + ' overview') | ||
| + g.dashboard.withPanels( | ||
| g.util.panel.resolveCollapsedFlagOnRows( | ||
| g.util.grid.wrapPanels( | ||
| [ | ||
| this.grafana.rows.overviewRow, | ||
| this.grafana.rows.overviewNodesKPIsRow, | ||
| this.grafana.rows.overviewDatabaseKPIsRow, | ||
| ] | ||
| ) | ||
| ) | ||
| ) + root.applyCommon( | ||
| vars.multiInstance, | ||
| uid + '_overview', | ||
| tags, | ||
| links { redisEnterpriseOverview:: {} }, | ||
| annotations, | ||
| timezone, | ||
| refresh, | ||
| period, | ||
| ), | ||
| 'redis-enterprise-node-overview.json': | ||
| g.dashboard.new(prefix + ' nodes') | ||
| + g.dashboard.withPanels( | ||
| g.util.panel.resolveCollapsedFlagOnRows( | ||
| g.util.grid.wrapPanels( | ||
| [ | ||
| this.grafana.rows.nodesOverviewRow, | ||
| this.grafana.rows.nodesMetricsRow, | ||
| ] | ||
| ) | ||
| ) | ||
| ) + root.applyCommon( | ||
| vars.multiInstance + nodeVars, | ||
| uid + '_nodes', | ||
| tags, | ||
| links { redisEnterpriseNodes:: {} }, | ||
| annotations, | ||
| timezone, | ||
| refresh, | ||
| period, | ||
| ), | ||
| 'redis-enterprise-database-overview.jsonn': | ||
|
||
| g.dashboard.new(prefix + ' databases') | ||
| + g.dashboard.withPanels( | ||
| g.util.panel.resolveCollapsedFlagOnRows( | ||
| g.util.grid.wrapPanels( | ||
| [ | ||
| this.grafana.rows.databasesOverviewRow, | ||
| this.grafana.rows.databasesMetricsRow, | ||
| this.grafana.rows.databasesCRDBRow, | ||
| ] | ||
| ), | ||
| ) | ||
| ) + root.applyCommon( | ||
| vars.multiInstance + nodeVars + databaseVars, | ||
| uid + '_databases', | ||
| tags, | ||
| links { redisEnterpriseDatabases:: {} }, | ||
| annotations, | ||
| timezone, | ||
| refresh, | ||
| period, | ||
| ), | ||
| } + if this.config.enableLokiLogs then { | ||
| 'redis-enterprise-logs.json': | ||
| logslib.new( | ||
| prefix + ' logs', | ||
| datasourceName=this.grafana.variables.datasources.loki.name, | ||
| datasourceRegex=this.grafana.variables.datasources.loki.regex, | ||
| filterSelector=this.config.filteringSelector, | ||
| labels=this.config.groupLabels + this.config.extraLogLabels, | ||
| formatParser=null, | ||
| showLogsVolume=this.config.showLogsVolume, | ||
| ) | ||
| { | ||
| dashboards+: | ||
| { | ||
| logs+: | ||
| root.applyCommon(super.logs.templating.list, uid=uid + '-logs', tags=tags, links=links { redisEnterpriseLogs+:: {} }, annotations=annotations, timezone=timezone, refresh=refresh, period=period), | ||
| }, | ||
| panels+: | ||
| { | ||
| logs+: | ||
| g.panel.logs.options.withEnableLogDetails(true) | ||
| + g.panel.logs.options.withShowTime(false) | ||
| + g.panel.logs.options.withWrapLogMessage(false), | ||
| }, | ||
| variables+: { | ||
| toArray+: [ | ||
| this.grafana.variables.datasources.prometheus { hide: 2 }, | ||
| ], | ||
| }, | ||
| }.dashboards.logs, | ||
| } | ||
| else {}, | ||
|
|
||
| applyCommon(vars, uid, tags, links, annotations, timezone, refresh, period): | ||
| g.dashboard.withTags(tags) | ||
| + g.dashboard.withUid(uid) | ||
| + g.dashboard.withLinks(std.objectValues(links)) | ||
| + g.dashboard.withTimezone(timezone) | ||
| + g.dashboard.withRefresh(refresh) | ||
| + g.dashboard.time.withFrom(period) | ||
| + g.dashboard.withVariables(vars) | ||
| + g.dashboard.withAnnotations(std.objectValues(annotations)), | ||
| } | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we divide by 1000 that would convert the value to seconds, but the alert threshold is in milliseconds -
alertsDatabaseHighLatencyMs.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah this seems like a bug with the original implementation. Think it should be
bdb_avg_latency* 1000 based off the context.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thank you!