-
Notifications
You must be signed in to change notification settings - Fork 178
chore: IIS Modernization #1542
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
base: master
Are you sure you want to change the base?
chore: IIS Modernization #1542
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,87 +1,87 @@ | ||
| { | ||
| prometheusAlerts+:: { | ||
| groups+: [ | ||
| new(this): { | ||
| groups: [ | ||
| { | ||
| name: 'microsoft-iis', | ||
| name: 'MicrosoftIISAlerts', | ||
| rules: [ | ||
| { | ||
| alert: 'MicrosoftIISHighNumberOfRejectedAsyncIORequests', | ||
| alert: 'MicrosoftIISRejectedAsyncIORequests', | ||
| expr: ||| | ||
| increase(windows_iis_rejected_async_io_requests_total[5m]) > %(alertsWarningHighRejectedAsyncIORequests)s | ||
| ||| % $._config, | ||
| ||| % this.config, | ||
| 'for': '5m', | ||
| labels: { | ||
| severity: 'warning', | ||
| }, | ||
| annotations: { | ||
| summary: 'There are a high number of rejected async I/O requests for a site.', | ||
| description: ||| | ||
| The number of rejected async IO requests is {{ printf "%%.0f" $value }} over the last 5m on {{ $labels.instance }} - {{ $labels.site }} which is above the threshold of %(alertsWarningHighRejectedAsyncIORequests)s. | ||
| ||| % $._config, | ||
| description: | ||
| ('The number of rejected async IO requests is {{ printf "%%.0f" $value }} over the last 5m on {{ $labels.instance }} - {{ $labels.site }}, ' + | ||
| 'which is above the threshold of %(alertsWarningHighRejectedAsyncIORequests)s.') % this.config, | ||
| }, | ||
| }, | ||
| { | ||
| alert: 'MicrosoftIISHighNumberOf5xxRequestErrors', | ||
| alert: 'MicrosoftIIS5xxRequestErrors', | ||
| expr: ||| | ||
| sum without (pid, status_code)(increase(windows_iis_worker_request_errors_total{status_code=~"5.*"}[5m])) > %(alertsCriticalHigh5xxRequests)s | ||
| ||| % $._config, | ||
| sum without (pid, status_code)(increase(windows_iis_worker_request_errors_total{status_code=~"5.."}[5m])) > %(alertsCriticalHigh5xxRequests)s | ||
| ||| % this.config, | ||
| 'for': '5m', | ||
| labels: { | ||
| severity: 'critical', | ||
| }, | ||
| annotations: { | ||
| summary: 'There are a high number of 5xx request errors for an application.', | ||
| description: ||| | ||
| The number of 5xx request errors is {{ printf "%%.0f" $value }} over the last 5m on {{ $labels.instance }} - {{ $labels.app }} which is above the threshold of %(alertsCriticalHigh5xxRequests)s. | ||
| ||| % $._config, | ||
| description: | ||
| ('The number of 5xx request errors is {{ printf "%%.0f" $value }} over the last 5m on {{ $labels.instance }} - {{ $labels.app }}, ' + | ||
| 'which is above the threshold of %(alertsCriticalHigh5xxRequests)s.') % this.config, | ||
| }, | ||
| }, | ||
| { | ||
| alert: 'MicrosoftIISLowSuccessRateForWebsocketConnections', | ||
| alert: 'MicrosoftIISSuccessRateForWebsocket', | ||
| expr: ||| | ||
| sum without (pid) (increase(windows_iis_worker_websocket_connection_accepted_total[5m]) / clamp_min(increase(windows_iis_worker_websocket_connection_attempts_total[5m]),1)) * 100 > %(alertsCriticalLowWebsocketConnectionSuccessRate)s | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know you didn't change this line but I think it has a bug:
I keep finding these bugs in the existing code and I am going to add this as an example to https://github.com/grafana/cloud-onboarding/issues/9972. |
||
| ||| % $._config, | ||
| ||| % this.config, | ||
| 'for': '5m', | ||
| labels: { | ||
| severity: 'critical', | ||
| }, | ||
| annotations: { | ||
| summary: 'There is a low success rate for websocket connections for an application.', | ||
| description: ||| | ||
| The success rate for websocket connections is {{ printf "%%.0f" $value }} over the last 5m on {{ $labels.instance }} - {{ $labels.app }} which is above the threshold of %(alertsCriticalLowWebsocketConnectionSuccessRate)s. | ||
| ||| % $._config, | ||
| description: | ||
| ('The success rate for websocket connections is {{ printf "%%.0f" $value }} over the last 5m on {{ $labels.instance }} - {{ $labels.app }}, ' + | ||
| 'which is above the threshold of %(alertsCriticalLowWebsocketConnectionSuccessRate)s.') % this.config, | ||
| }, | ||
| }, | ||
| { | ||
| alert: 'MicrosoftIISThreadpoolUtilizationNearingMax', | ||
| alert: 'MicrosoftIISThreadpoolUtilization', | ||
| expr: ||| | ||
| sum without (pid, state)(windows_iis_worker_threads / windows_iis_worker_max_threads) * 100 > %(alertsCriticalHighThreadPoolUtilization)s | ||
| ||| % $._config, | ||
| ||| % this.config, | ||
| 'for': '5m', | ||
| labels: { | ||
| severity: 'critical', | ||
| }, | ||
| annotations: { | ||
| summary: 'The thread pool utilization is nearing max capacity.', | ||
| description: ||| | ||
| The threadpool utilization is at {{ printf "%%.0f" $value }} over the last 5m on {{ $labels.instance }} - {{ $labels.app }} which is above the threshold of %(alertsCriticalHighThreadPoolUtilization)s. | ||
| ||| % $._config, | ||
| description: | ||
| ('The threadpool utilization is at {{ printf "%%.0f" $value }} over the last 5m on {{ $labels.instance }} - {{ $labels.app }}, ' + | ||
| 'which is above the threshold of %(alertsCriticalHighThreadPoolUtilization)s.') % this.config, | ||
| }, | ||
| }, | ||
| { | ||
| alert: 'MicrosoftIISHighNumberOfWorkerProcessFailures', | ||
| alert: 'MicrosoftIISWorkerProcessFailures', | ||
| expr: ||| | ||
| increase(windows_iis_total_worker_process_failures[5m]) > %(alertsWarningHighWorkerProcessFailures)s | ||
| ||| % $._config, | ||
| ||| % this.config, | ||
| 'for': '5m', | ||
| labels: { | ||
| severity: 'warning', | ||
| }, | ||
| annotations: { | ||
| summary: 'There are a high number of worker process failures for an application.', | ||
| description: ||| | ||
| The number of worker process failures is at {{ printf "%%.0f" $value }} over the last 5m on {{ $labels.instance }} - {{ $labels.app }} which is above the threshold of %(alertsWarningHighWorkerProcessFailures)s. | ||
| ||| % $._config, | ||
| description: | ||
| ('The number of worker process failures is at {{ printf "%%.0f" $value }} over the last 5m on {{ $labels.instance }} - {{ $labels.app }}, ' + | ||
| 'which is above the threshold of %(alertsWarningHighWorkerProcessFailures)s.') % this.config, | ||
| }, | ||
| }, | ||
| ], | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,17 +1,39 @@ | ||||||
| { | ||||||
| _config+:: { | ||||||
| dashboardTags: ['microsoft-iis-mixin'], | ||||||
| dashboardPeriod: 'now-1h', | ||||||
| dashboardTimezone: 'default', | ||||||
| dashboardRefresh: '1m', | ||||||
| local this = self, | ||||||
|
|
||||||
| // alerts thresholds | ||||||
| alertsWarningHighRejectedAsyncIORequests: 20, | ||||||
| alertsCriticalHigh5xxRequests: 5, | ||||||
| alertsCriticalLowWebsocketConnectionSuccessRate: 80, | ||||||
| alertsCriticalHighThreadPoolUtilization: 90, | ||||||
| alertsWarningHighWorkerProcessFailures: 10, | ||||||
| filteringSelector: 'job="integrations/iis"', | ||||||
| groupLabels: ['job'], | ||||||
| instanceLabels: ['instance'], | ||||||
| logLabels: ['job', 'instance'], | ||||||
|
|
||||||
| enableLokiLogs: true, | ||||||
|
|
||||||
| // Dashboard settings | ||||||
| dashboardTags: [this.uid + '-mixin'], | ||||||
| uid: 'microsoft-iis', | ||||||
| dashboardNamePrefix: 'Microsoft IIS', | ||||||
| dashboardPeriod: 'now-30m', | ||||||
| dashboardTimezone: 'default', | ||||||
| dashboardRefresh: '1m', | ||||||
|
|
||||||
| // Logs configuration | ||||||
| enableLokiLogs: true, | ||||||
| extraLogLabels: ['level'], // Required by logs-lib | ||||||
| logsVolumeGroupBy: 'level', | ||||||
| showLogsVolume: true, | ||||||
|
|
||||||
| // Alert thresholds | ||||||
| alertsWarningHighRejectedAsyncIORequests: 20, // count | ||||||
| alertsCriticalHigh5xxRequests: 5, // % | ||||||
| alertsCriticalLowWebsocketConnectionSuccessRate: 80, // % | ||||||
| alertsCriticalHighThreadPoolUtilization: 90, // % | ||||||
| alertsWarningHighWorkerProcessFailures: 10, // count | ||||||
|
|
||||||
| // Metrics source | ||||||
| metricsSource: 'prometheus', | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be an array instead?
Suggested change
|
||||||
|
|
||||||
| // Signal definitions grouped by dashboard | ||||||
| signals+: { | ||||||
| overview: (import './signals/overview.libsonnet')(this), | ||||||
| applications: (import './signals/applications.libsonnet')(this), | ||||||
| }, | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| local g = import './g.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; | ||
|
|
||
| { | ||
| // Microsoft IIS overview dashboard | ||
| 'microsoft-iis-overview.json': | ||
| g.dashboard.new(prefix + ' overview') | ||
| + g.dashboard.withDescription('Dashboard providing an overview of Microsoft IIS performance.') | ||
| + g.dashboard.withPanels( | ||
| g.util.panel.resolveCollapsedFlagOnRows( | ||
| g.util.grid.wrapPanels( | ||
| [ | ||
| this.grafana.rows.overviewRequests, | ||
| this.grafana.rows.overviewAsyncIO, | ||
| this.grafana.rows.overviewTraffic, | ||
| this.grafana.rows.overviewConnections, | ||
| ] | ||
| ) | ||
| ) | ||
| ) | ||
| + root.applyCommon( | ||
| vars.multiInstance + [ | ||
| g.dashboard.variable.query.new('site') | ||
| + g.dashboard.variable.query.withDatasourceFromVariable(vars.datasources.prometheus) | ||
| + g.dashboard.variable.query.queryTypes.withLabelValues('site', 'windows_iis_requests_total{job=~"$job", instance=~"$instance"}') | ||
| + g.dashboard.variable.query.generalOptions.withLabel('Site') | ||
| + g.dashboard.variable.query.selectionOptions.withMulti(true) | ||
| + g.dashboard.variable.query.selectionOptions.withIncludeAll(true, '.+') | ||
| + g.dashboard.variable.query.refresh.onTime(), | ||
| ], | ||
| uid + '_overview', | ||
| tags, | ||
| links { microsoftIISOverview+:: {} }, | ||
| annotations, | ||
| timezone, | ||
| refresh, | ||
| period | ||
| ), | ||
|
|
||
| // Microsoft IIS applications dashboard | ||
| 'microsoft-iis-applications.json': | ||
| g.dashboard.new(prefix + ' applications') | ||
| + g.dashboard.withDescription('Dashboard providing detailed application performance metrics for Microsoft IIS.') | ||
| + g.dashboard.withPanels( | ||
| g.util.panel.resolveCollapsedFlagOnRows( | ||
| g.util.grid.wrapPanels( | ||
| [ | ||
| this.grafana.rows.applicationsRequests, | ||
| this.grafana.rows.applicationsWebsocket, | ||
| this.grafana.rows.applicationsWorkerProcesses, | ||
| this.grafana.rows.applicationsCache, | ||
| ] | ||
| ) | ||
| ) | ||
| ) | ||
| + root.applyCommon( | ||
| vars.multiInstance + [ | ||
| g.dashboard.variable.query.new('application') | ||
| + g.dashboard.variable.query.withDatasourceFromVariable(vars.datasources.prometheus) | ||
| + g.dashboard.variable.query.queryTypes.withLabelValues('app', 'windows_iis_current_application_pool_state{job=~"$job", instance=~"$instance"}') | ||
| + g.dashboard.variable.query.generalOptions.withLabel('Application') | ||
| + g.dashboard.variable.query.selectionOptions.withMulti(true) | ||
| + g.dashboard.variable.query.selectionOptions.withIncludeAll(true, '.+') | ||
| + g.dashboard.variable.query.refresh.onLoad() | ||
| + g.dashboard.variable.query.refresh.onTime(), | ||
| ], | ||
| uid + '_applications', | ||
| tags, | ||
| links { microsoftIISApplications+:: {} }, | ||
| annotations, | ||
| timezone, | ||
| refresh, | ||
| period | ||
| ), | ||
| } | ||
| + | ||
| if this.config.enableLokiLogs then | ||
| { | ||
| 'microsoft-iis-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 { microsoftIISLogs+:: {} }, 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.
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.
Do all or some of the alerts need to use the
{%(filteringSelector)s}? It's not present in any of them.