-
Notifications
You must be signed in to change notification settings - Fork 160
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
Extend csplib to add Azure SQL Database #1278
Conversation
075775a
to
8a6e346
Compare
8a6e346
to
720fc62
Compare
asql_dtutbl: | ||
this.signals.azuresqldb.dtuUsed.common | ||
+ commonlib.panels.generic.table.base.new( | ||
'DTU utilization and limits by database', | ||
[ | ||
this.signals.azuresqldb.dtuUsed.asTarget() | ||
+ g.query.prometheus.withFormat('table') | ||
+ g.query.prometheus.withInstant(true), | ||
|
||
this.signals.azuresqldb.dtuPercent.asTarget() | ||
+ g.query.prometheus.withFormat('table') | ||
+ g.query.prometheus.withInstant(true), | ||
|
||
this.signals.azuresqldb.dtuLimit.asTarget() | ||
+ g.query.prometheus.withFormat('table') | ||
+ g.query.prometheus.withInstant(true), | ||
], | ||
'DTU utilization and limits by database' | ||
) + self._asql_tableCommon(), |
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.
nit: you could also try to define tables with using asTable() and asTableColumn() now:
#1290
vCoreCpuPercent: { | ||
name: 'vCore utilization by database', | ||
description: 'Percent of CPU utilization by database. If database uses vCores, the vCore percent utilization is shown', | ||
type: 'gauge', | ||
unit: 'percent', | ||
sources: { | ||
azuremonitor: { | ||
expr: '100 * (label_replace(azure_microsoft_sql_servers_databases_cpu_used_average_count{%(queriesSelector)s}, "database", "$1", "resourceID", ".+/(.*)") / label_replace(azure_microsoft_sql_servers_databases_cpu_limit_average_count{%(queriesSelector)s}, "database", "$1", "resourceID", ".+/(.*)"))', | ||
legendCustomTemplate: '{{database}} vCore', | ||
}, | ||
}, | ||
}, |
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.
type=gauge and aggLevel=none is equivalent of type=raw. Right now it would be just fine, however, changing aggLevel to instance/group later on would break this signal, as 100 * would be applied in the wrong place.
Best to change type to raw, or move 100 *
to exprWrappers
:
https://github.com/grafana/jsonnet-libs/tree/master/common-lib/common/signal#configuration-options
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.
Ahh excellent. Thank you for this, I'll add it to the exprWrappers.
Adds an azure sql database dashboard to csp-mixin.