-
Notifications
You must be signed in to change notification settings - Fork 178
chore: Modernize wildfly-mixin #1535
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
Draft
postnati
wants to merge
9
commits into
grafana:master
Choose a base branch
from
postnati:chore/wildfly-mixin-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.
Draft
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
626ff57
Modernize wildfly-mixin to grafonnet v11 and signals architecture
postnati ddd178a
Updated links and signals to use Sentence case. Update signals to use…
postnati bc3067a
Refactored signal files to align with the dashboards instead of group…
postnati f9c7f9c
Reworked signals to line up with dashboards and instance labels
postnati 1c13b3b
Tweaked timeseries panels to match best practices
postnati f95c6ae
Ran make fmt
postnati b0c9b60
Fixed linting errors for prometheus datasource.
postnati f9cac8b
Reworked all panels to use commonlib as base.
postnati 59ad446
Updated README to match modernization changes.
postnati 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
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+:: { | ||
| enableMultiCluster: false, | ||
| multiclusterSelector: 'job=~"$job"', | ||
| wildflySelector: if self.enableMultiCluster then 'job=~"$job", cluster=~"$cluster"' else 'job=~"$job"', | ||
| dashboardTags: ['wildfly-mixin'], | ||
| dashboardPeriod: 'now-1h', | ||
| dashboardTimezone: 'default', | ||
| dashboardRefresh: '1m', | ||
| local this = self, | ||
| filteringSelector: 'job="integrations/wildfly"', | ||
| groupLabels: ['job', 'cluster'], | ||
| logLabels: ['job', 'cluster', 'instance'], | ||
| instanceLabels: ['instance'], | ||
|
|
||
| // alerts thresholds | ||
| alertsErrorRequestErrorRate: '30', | ||
| alertsErrorRejectedSessions: '20', | ||
| uid: 'wildfly', | ||
| dashboardTags: [self.uid], | ||
| dashboardNamePrefix: 'Wildfly', | ||
| dashboardPeriod: 'now-1h', | ||
| dashboardTimezone: 'default', | ||
| dashboardRefresh: '1m', | ||
| metricsSource: 'prometheus', // metrics source for signals | ||
|
|
||
| enableLokiLogs: true, | ||
| // Logging configuration | ||
| enableLokiLogs: true, | ||
| extraLogLabels: ['level', 'severity'], // Required by logs-lib | ||
| logsVolumeGroupBy: 'level', | ||
| showLogsVolume: true, | ||
|
|
||
| // alerts thresholds | ||
| alertsErrorRequestErrorRate: '30', | ||
| alertsErrorRejectedSessions: '20', | ||
|
|
||
| // Signals configuration | ||
| signals+: { | ||
| overviewServer: (import './signals/overview-server.libsonnet')(this), | ||
| overviewDeployment: (import './signals/overview-deployment.libsonnet')(this), | ||
| datasource: (import './signals/datasource.libsonnet')(this), | ||
| datasourceTransaction: (import './signals/datasource-transaction.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,115 @@ | ||
| local g = import './g.libsonnet'; | ||
| local commonlib = import 'common-lib/common/main.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 extraLogLabels = this.config.extraLogLabels; | ||
| { | ||
|
|
||
| 'wildfly-overview.json': | ||
| g.dashboard.new(prefix + ' overview') | ||
| + g.dashboard.withPanels( | ||
| g.util.panel.resolveCollapsedFlagOnRows( | ||
| g.util.grid.wrapPanels([ | ||
| this.grafana.rows.requestsRow, | ||
| this.grafana.rows.networkRow, | ||
| this.grafana.rows.sessionsRow, | ||
| ]) | ||
| ) | ||
| ) + root.applyCommon( | ||
| vars.multiInstance + [ | ||
| g.dashboard.variable.query.new('server') | ||
| + g.dashboard.variable.custom.selectionOptions.withMulti(true) | ||
| + g.dashboard.variable.query.queryTypes.withLabelValues(label='server', metric='wildfly_undertow_request_count_total{%(queriesSelectorGroupOnly)s}' % vars) | ||
| + g.dashboard.variable.query.withDatasourceFromVariable(vars.datasources.prometheus), | ||
| g.dashboard.variable.query.new('deployment') | ||
| + g.dashboard.variable.custom.selectionOptions.withMulti(true) | ||
| + g.dashboard.variable.query.queryTypes.withLabelValues(label='deployment', metric='wildfly_undertow_active_sessions{%(queriesSelectorGroupOnly)s}' % vars) | ||
| + g.dashboard.variable.query.withDatasourceFromVariable(vars.datasources.prometheus), | ||
| ], | ||
| uid + '-overview', | ||
| tags, | ||
| links { wildflyOverview+:: {} }, | ||
| annotations, | ||
| timezone, | ||
| refresh, | ||
| period, | ||
| ), | ||
| 'wildfly-datasource.json': | ||
| g.dashboard.new(prefix + ' datasource') | ||
| + g.dashboard.withPanels( | ||
| g.util.panel.resolveCollapsedFlagOnRows( | ||
| g.util.grid.wrapPanels([ | ||
| this.grafana.rows.connectionsRow, | ||
| this.grafana.rows.transactionsRow, | ||
| ]) | ||
| ) | ||
| ) + root.applyCommon( | ||
| vars.multiInstance + [ | ||
| g.dashboard.variable.query.new('data_source') | ||
| + g.dashboard.variable.custom.selectionOptions.withMulti(true) | ||
| + g.dashboard.variable.query.queryTypes.withLabelValues(label='data_source', metric='wildfly_datasources_pool_in_use_count{%(queriesSelectorGroupOnly)s}' % vars) | ||
| + g.dashboard.variable.query.withDatasourceFromVariable(vars.datasources.prometheus), | ||
| ], | ||
| uid + '-datasource', | ||
| tags, | ||
| links { wildflyDatasource+:: {} }, | ||
| annotations, | ||
| timezone, | ||
| refresh, | ||
| period, | ||
| ), | ||
|
|
||
| } + if this.config.enableLokiLogs then { | ||
| 'wildfly-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.logLabels + this.config.extraLogLabels, | ||
| formatParser=null, | ||
| showLogsVolume=this.config.showLogsVolume, | ||
| ) | ||
| { | ||
| dashboards+: | ||
| { | ||
| logs+: | ||
| root.applyCommon(super.logs.templating.list, uid=uid + '-logs', tags=tags, links=links { logs+:: {} }, 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.
This'd be a breaking default otherwise