Skip to content

Instantly share code, notes, and snippets.

@corsc
Last active May 20, 2021 04:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corsc/22302a228aa735c3297f5ca013f55b59 to your computer and use it in GitHub Desktop.
Save corsc/22302a228aa735c3297f5ca013f55b59 to your computer and use it in GitHub Desktop.
Companion Code to an article of Dashboarding metrics
{
"viz": "timeseries",
"requests": [
{
"q": "sum:astria.astria.api.count{$commit,$host,$environment,!respcode:200,!respcode:402,!respcode:422,!respcode:403} by {endpoint,respcode}.as_count()",
"type": "bars",
"style": {
"palette": "dog_classic",
"type": "solid",
"width": "normal"
}
},
{
"q": "sum:astria.auth.failed{$commit,$host,$environment} by {endpoint}.as_count()",
"type": "bars",
"style": {
"palette": "dog_classic",
"type": "solid",
"width": "normal"
}
}
],
"yaxis": {
"max": "auto",
"scale": "linear",
"min": "auto",
"label": "",
"includeZero": true
},
"markers": []
}
{
"viz": "timeseries",
"requests": [
{
"q": "sum:astria.astria.api.count{$commit,$host,$environment,!respcode:200,!respcode:402,!respcode:403,!respcode:422}.as_count()/sum:astria.astria.api.count{$commit,$host,$environment}.as_count()*100",
"type": "line",
"style": {
"palette": "dog_classic",
"type": "solid",
"width": "normal"
}
}
],
"yaxis": {
"max": "100",
"min": "0"
},
"markers": [
{
"value": "y = 25",
"type": "info dashed"
},
{
"value": "y = 50",
"type": "warning dashed"
},
{
"value": "y = 75",
"type": "error dashed"
}
]
}
{
"viz": "timeseries",
"requests": [
{
"q": "max:astria.astria.api.95percentile{$commit,$host,$environment} by {endpoint}.fill(zero)/1000000",
"type": "line",
"style": {
"palette": "dog_classic",
"type": "solid",
"width": "normal"
}
},
{
"q": "autosmooth(week_before(max:astria.astria.api.95percentile{$commit,$host,$environment} by {endpoint}))/1000000",
"type": "line",
"style": {
"palette": "grey",
"type": "dotted",
"width": "normal"
}
}
],
"yaxis": {
"max": "auto",
"scale": "linear",
"min": "auto",
"label": "",
"includeZero": true
},
"markers": []
}
{
"viz": "timeseries",
"requests": [
{
"q": "((autosmooth(max:astria.astria.api.count{$commit,$host,$environment}.as_count().fill(zero))-autosmooth(week_before(max:astria.astria.api.count{$commit,$host,$environment}.as_count().fill(zero))))/autosmooth(week_before(max:astria.astria.api.count{$commit,$host,$environment}.as_count().fill(zero))))*100",
"type": "line",
"style": {
"palette": "dog_classic",
"type": "solid",
"width": "normal"
},
"on_right_yaxis": false
}
],
"yaxis": {
"max": "auto",
"scale": "linear",
"min": "auto",
"label": "",
"includeZero": true
},
"markers": [
{
"value": "y = 50",
"type": "info dashed"
},
{
"value": "y = 0",
"type": "info dashed"
},
{
"value": "y = -50",
"type": "error dashed"
},
{
"value": "y = 100",
"type": "info dashed"
},
{
"value": "y = -100",
"type": "info dashed"
}
]
}
{
"viz": "timeseries",
"requests": [
{
"q": "max:astria.astria.api.count{$commit,$host,$environment} by {endpoint}.as_count().fill(zero)",
"type": "line",
"style": {
"palette": "dog_classic",
"type": "solid",
"width": "normal"
},
"on_right_yaxis": false
},
{
"q": "week_before(max:astria.astria.api.count{$commit,$host,$environment} by {endpoint}.as_count().fill(zero))",
"type": "line",
"style": {
"palette": "dog_classic",
"type": "dotted",
"width": "normal"
},
"on_right_yaxis": false
}
],
"yaxis": {
"max": "auto",
"scale": "linear",
"min": "auto",
"label": "",
"includeZero": true
},
"markers": []
}
{
"viz": "timeseries",
"requests": [
{
"q": "sum:astria.astria.api.count{$commit,$environment,$host} by {endpoint}.as_rate()",
"type": "line",
"style": {
"palette": "dog_classic",
"type": "solid",
"width": "normal"
}
},
{
"q": "autosmooth(week_before(sum:astria.astria.api.count{$commit,$environment,$host} by {endpoint}.as_rate()))",
"type": "line",
"style": {
"palette": "dog_classic",
"type": "dotted",
"width": "normal"
},
"on_right_yaxis": false
}
],
"yaxis": {
"max": "auto",
"scale": "linear",
"min": "auto",
"label": "",
"includeZero": true
},
"markers": []
}
{
"viz": "timeseries",
"requests": [
{
"q": "sum:astria.event{$commit,$host,$environment} by {type}.as_count()",
"type": "bars",
"style": {
"palette": "warm",
"type": "solid",
"width": "normal"
},
"on_right_yaxis": false
},
{
"q": "sum:astria.config.err{$commit,$host,$environment}.as_count()",
"type": "bars",
"style": {
"palette": "warm",
"type": "solid",
"width": "normal"
},
"on_right_yaxis": false
},
{
"q": "sum:astria.log.err{$commit,$host,$environment}.as_count()",
"type": "bars",
"style": {
"palette": "warm",
"type": "solid",
"width": "normal"
},
"on_right_yaxis": false
},
{
"q": "sum:astria.log.panic{$commit,$host,$environment}.as_count()",
"type": "bars",
"style": {
"palette": "warm",
"type": "solid",
"width": "normal"
},
"on_right_yaxis": false
},
{
"q": "sum:astria.log.fatal{$commit,$host,$environment}.as_count()",
"type": "bars",
"style": {
"palette": "warm",
"type": "solid",
"width": "normal"
},
"on_right_yaxis": false
}
],
"yaxis": {
"max": "auto",
"scale": "linear",
"min": "auto",
"label": "",
"includeZero": true
},
"markers": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment