grafana / jsonnet-libs Goto Github PK
View Code? Open in Web Editor NEWGrafana Labs' Jsonnet libraries
License: Other
Grafana Labs' Jsonnet libraries
License: Other
We should also include a default overrides configuration and it should probably use the new -runtime-config.file
flag.
A concrete example of this behavior:
mixins.libsonnet
in this project includes prometheus-mixin
, using a grafanaDashboardFolder
of Prometheus
(relevant code). prometheus-mixin
also includes a dashboard called prometheus.json
.
This dashboard doesn't appear in Grafana under the "Prometheus" folder, as I'd expect.
If I tweak slightly by modifying the folder name:
mixins+:: {
prometheus+: { grafanaDashboardFolder: 'Prom' },
},
Now the "Prometheus" dashboard does appear under the "Prom" folder. This happens with other mix-ins as well (eg, an "Etcd" folder with an "etcd.json" dashboard), which is how I originally discovered the issue.
Currently the link to Grafana lands on the home page for Grafana:
99% of the time I will have to click on the dashboards dropdown or the search magnifier to get to the list of dashboards/folders to navigate to the dashboard I want.
I'm suggesting we add ?search=open
to the Grafana URL to automatically bring up the list of dashboards.
My only concern here is people outside of Grafana with different workflows being handed this change and breaking their workflow.
One alternative to this would be a variable you could set in the config to append this query parameter which is not set by default.
Thoughts/opinions anyone?
The instances variable in the PosrgreSQL dashboard is I think incorrect.
The current variable is label_values(up{job=~"postgres.*"},instance)
However, this does not match the job names from the agent.
I think it should possibly be something like this
label_values(up{job="integrations/postgres_exporter"}, instance)
The etcd operator jsonnet needs a readme
Refer
Root cause
passing to super is to the main library however in the code implies to old ksonnet-util
As is shown here:
t=2020-07-31T12:10:18+0000 lvl=eror msg="Cannot read directory" logger=provisioning.dashboard type=file name=dashboards error="stat /grafana/dashboards: no such file or directory"
t=2020-07-31T12:10:18+0000 lvl=eror msg="Failed to read content of symlinked path" logger=provisioning.dashboard type=file name=dashboards path=/grafana/dashboards
This was generated from a default run of the TNS demo.
From @tomwilkie on November 17, 2017 11:12
If when typing a query I put my own quotes in then use autocomplete, I get a double set of quotes:
Copied from original issue: kausalco/private#89
Currently it's quite difficult to alter the command line flags of a prometheus container. This could be made much easier if the flags were embedded in an object and passed to the mapToFlags function.
Linting in grafana/jsonnet-libs was broken for a long time due to a bug in evaluating exit codes when doing the lint. TL;DR, make lint
fails with a non-zero error code only if the last checked jsonnet file check failed. Similar issue seems to have been already fixed in deployment_tools
repo.
Moreover, the linting docker image uses an image from kausal, despite of jsonnet-libs/build/Makefile referring to a grafana-hosted image.
In #201 we switched from v1beta1
to v1
, but missed that we need explicit selectors for that version.
Those need to be added ASAP, the some libs are totally unusable without.
From @tomwilkie on August 31, 2017 10:30
If I have:
rate(request_duration_seconds_sum[5m]) / rate(request_duration_seconds_count[5m])
And I put a sum(
at the beginning, I get:
sum(rate(request_duration_seconds_sum[5m]) / rate(request_duration_seconds_count[5m]))
Whereas what I wanted was:
sum(rate(request_duration_seconds_sum[5m])) / rate(request_duration_seconds_count[5m])
Copied from original issue: kausalco/private#35
I was following the instructions in prometheus-ksonnet/README.md
and I encountred with the following issue:
~/tmp/k8s-config 17:04:30
$ tk init
GET https://github.com/ksonnet/ksonnet-lib/archive/0d2f82676817bbf9e4acf6495b2090205f323b9f.tar.gz 200
GET https://github.com/grafana/jsonnet-libs/archive/fd1d2f7e962560e3a20abfed161c70f91c991964.tar.gz 200
Directory structure set up! Remember to configure the API endpoint:
`tk env set environments/default --server=https://127.0.0.1:6443`
~/tmp/k8s-config 17:04:50
$ export CONTEXT=$(kubectl config current-context)
~/tmp/k8s-config 17:04:53
$ tk env set environments/default --server-from-context=$CONTEXT
updated spec.apiServer (`https:// -> `https://kubernetes.docker.internal:6443`)
~/tmp/k8s-config 17:04:58
$ jb install github.com/grafana/jsonnet-libs/prometheus-ksonnet
GET https://github.com/grafana/jsonnet-libs/archive/fd1d2f7e962560e3a20abfed161c70f91c991964.tar.gz 200
GET https://github.com/grafana/grafana/archive/21ae4802ceba6a8f1de908fba17d2e3c5a220e42.tar.gz 200
GET https://github.com/grafana/jsonnet-libs/archive/fd1d2f7e962560e3a20abfed161c70f91c991964.tar.gz 200
GET https://github.com/kubernetes-monitoring/kubernetes-mixin/archive/4a8e078147dbca51067521e6ac59c7b54d44d3bd.tar.gz 200
GET https://github.com/prometheus/alertmanager/archive/ce108378d4c8d580804452dcc3a31222067793b2.tar.gz 200
GET https://github.com/prometheus/node_exporter/archive/0ce1f39c64a0a37d5aa81da8006661920b097e82.tar.gz 200
GET https://github.com/grafana/jsonnet-libs/archive/fd1d2f7e962560e3a20abfed161c70f91c991964.tar.gz 200
GET https://github.com/grafana/jsonnet-libs/archive/fd1d2f7e962560e3a20abfed161c70f91c991964.tar.gz 200
GET https://github.com/prometheus/prometheus/archive/b82d76faecec0f366df7ca816f5677863e72fc3b.tar.gz 200
GET https://github.com/grafana/jsonnet-libs/archive/fd1d2f7e962560e3a20abfed161c70f91c991964.tar.gz 200
GET https://github.com/grafana/grafonnet-lib/archive/aa3a5412cdecc48f18082e8de7ddd6cc25dab745.tar.gz 200
GET https://github.com/grafana/jsonnet-libs/archive/fd1d2f7e962560e3a20abfed161c70f91c991964.tar.gz 200
GET https://github.com/kubernetes-monitoring/kubernetes-mixin/archive/4a8e078147dbca51067521e6ac59c7b54d44d3bd.tar.gz 200
~/tmp/k8s-config 17:07:32
$ cat <<EOF > environments/default/main.jsonnet
local prometheus = import "prometheus-ksonnet/prometheus-ksonnet.libsonnet";
prometheus {
_config+:: {
cluster_name: "cluster1",
namespace: "default",
},
}
EOF
~/tmp/k8s-config 17:07:37
$ tk diff environments/default
evaluating jsonnet: RUNTIME ERROR: function expected 0 positional argument(s), but got 1
/Users/oleg/tmp/k8s-config/vendor/ksonnet-util/kausal.libsonnet:69:18-33 function <anonymous>
/Users/oleg/tmp/k8s-config/vendor/alertmanager/alertmanager.libsonnet:92:5-33 object <anonymous>
/Users/oleg/tmp/k8s-config/vendor/alertmanager/alertmanager.libsonnet:106:7-28 thunk from <object <anonymous>>
/Users/oleg/tmp/k8s-config/vendor/ksonnet-util/kausal.libsonnet:185:47-59 thunk from <function <anonymous>>
/Users/oleg/tmp/k8s-config/vendor/github.com/ksonnet/ksonnet-lib/ksonnet.beta.4/k8s.libsonnet:1763:216-228 thunk from <function <anonymous>>
/Users/oleg/tmp/k8s-config/vendor/github.com/ksonnet/ksonnet-lib/ksonnet.beta.4/k8s.libsonnet:2139:81-101 thunk from <function <anonymous>>
/Users/oleg/tmp/k8s-config/vendor/github.com/ksonnet/ksonnet-lib/ksonnet.beta.4/k8s.libsonnet:2139:72-102 function <anonymous>
/Users/oleg/tmp/k8s-config/vendor/github.com/ksonnet/ksonnet-lib/ksonnet.beta.4/k8s.libsonnet:1763:152-229 function <anonymous>
/Users/oleg/tmp/k8s-config/vendor/ksonnet-util/kausal.libsonnet:185:9-68 function <anonymous>
/Users/oleg/tmp/k8s-config/vendor/alertmanager/alertmanager.libsonnet:(99:5)-(107:6) object <anonymous>
...
/Users/oleg/tmp/k8s-config/vendor/ksonnet-util/kausal.libsonnet:249:9-14 thunk from <function <anonymous>>
/Users/oleg/tmp/k8s-config/vendor/github.com/ksonnet/ksonnet-lib/ksonnet.beta.4/k8s.libsonnet:9734:130-135
/Users/oleg/tmp/k8s-config/vendor/github.com/ksonnet/ksonnet-lib/ksonnet.beta.4/k8s.libsonnet:9820:51-56 thunk from <function <anonymous>>
/Users/oleg/tmp/k8s-config/vendor/github.com/ksonnet/ksonnet-lib/ksonnet.beta.4/k8s.libsonnet:9820:42-57 function <anonymous>
/Users/oleg/tmp/k8s-config/vendor/github.com/ksonnet/ksonnet-lib/ksonnet.beta.4/k8s.libsonnet:9734:104-136
/Users/oleg/tmp/k8s-config/vendor/ksonnet-util/kausal.libsonnet:(246:7)-(250:8) function <anonymous>
/Users/oleg/tmp/k8s-config/vendor/alertmanager/alertmanager.libsonnet:123:5-53 object <anonymous>
/Users/oleg/tmp/k8s-config/vendor/prometheus-ksonnet/lib/alertmanager.libsonnet:49:10-15 object <anonymous>
During manifestation
I'm pasting the full context of the process to have the trace of the versions that tk init
and jb install
download. Same thing happens with both tk diff
and tk apply
.
I have Tanka 0.13.0 fresh install on Mac using brew.
I'm not sure if the issue is related to something broken in this repo or to a different dependency, but as the process documented here doesn't work I think it's worth tracking it.
What would you think about ustreaming this mixin in the memcached_exporter repository? thanks!
Probably just inherit Cortex PDBs for now
Alertmanager configures its peer addresses when the replica count is > 1. It follows the pod discovery convention used by Statefulsets. The processes themselves use this convention to gossip to their peers.
However, without a Headless Service named alertmanager
, they can't reach one another.
By default, the existing service is already named alertmanager
. It also exposes ports 9094 and 9093, which it probably doesn't need to. It should probably only expose 80.
Maybe we could name the new service alertmanager-gossip
which has ClusterIp
set to None
, and only expose 9094 and 9093 on it, when replicas is > 1.
All module arguments inherit and override $._config.commonArgs
. In order to benefit from the cortex-jsonnet best practices, Cortex modules (modules that aren't specific to GEM) inherit their arguments from the vendored library. Since the inheritance is $._config.commonArgs + cortex.<module>_args
, configuration made in $_config.commonArgs
may not appear in the manifestation of Cortex modules.
As a user I would expect the inheritance to behave more like:
cortex.module_args + $._config.commonArgs + $.<module>.args
I see that promeditor was removed from this repo. Did the code get moved to a different repo somewhere?
Why is the deployment
adding a name
label by default ?
jsonnet-libs/ksonnet-util/kausal.libsonnet
Line 146 in 054e937
From my point of view it could be app
like most deployments use, but the best would be to add nothing. Maybe just add if labels are empty ? ( but I still prefer app
over name
).
I could submit a PR ?
Any comment welcome.
Thanks
There are many dashboards mixins in this repo. However, it just provides a dashboards.jsonnet
file, but not everyone has jsonnet experience. Maybe it is better to add a dashboards auto gen in circle CI so that users can use the dashboard file directly.
From @tomwilkie on August 25, 2017 8:3
We used to allow enter to select an autocompletion, but this meant clicking into the middle of a metric and pressing enter would replace the metric and not submit the query.
Now, we use tab to select an autocompletion, but this means using the arrow keys to select an autocompletion requires you to also use a tab to 'submit' the autocompletion, which seems counter intuitive.
Proposal (for discussion): consider "keyboard focus" - when the focus is in the query box, tab is required to select autocompletion. When you use the arrow keys, the focus moves to the autocompletion dropdown, and enter is allow to select an autocompletion. WDYT?
Copied from original issue: kausalco/private#27
Consider adding a (configurable) sample_limit to scrape jobs as a way of protecting the Prometheus, and and any upstream remote_write endpoints, from abusive jobs.
Specifically, it's setting of zero here. The comment alludes that using zero disables sharding, but this check doesn't seem implemented and instead causes dashboards to not be emitted at all. I think 1 is meant instead? That would make it equivalent with the behavior in dashboard_folders_config_map
if the mixin doesn't specify grafanaDashboardShards
.
FYI this config field is also set to 8 in dashboards.libsonnet
, but that gets overridden (deployment.libsonnet
is ordered after dashboards.libsonnet
on import).
I'd suggest a reconsideration of the naming of dashboard_config_maps
if possible, to better match grafanaDashboardShards
in the folders case.
It appears that the new (old?) ksonnet at https://github.com/kube-jsonnet/k is officially deprecated in favor of k8s-alpha.
However, it appears that all *sonnet deployments under the Grafana umbrella are still using the above ksonnet libs.
Also, the k8s-alpha README states that it is still experimental.
I am embarking on beginning to unify and port deployments for a few k8s clusters to a single, unified config management system and I'd really like to use Tanka. I'm still learning jsonnet, so I'm still not completely clear on how to design the repository.
Should I:
Are there experimental */jsonnet-libs branches which use k8s-alpha? What is the intended roadmap for migrating towards it?
For example in kubernetes-pods
. The service account file and Kubernetes server certificate is configured for the scrape config. Presumably this was actually meant for authentication to the Kubernetes API server for service discovery (or it exists as an artifact of copy-paste).
The service discovery still works as we don't specify and API server in the kubernetes_sd_config
block and Prometheus automatically loads the certificate and service account token.
https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config
# The API server addresses. If left empty, Prometheus is assumed to run inside
# of the cluster and will discover API servers automatically and use the pod's
# CA certificate and bearer token file at /var/run/secrets/kubernetes.io/serviceaccount/.
It'd be nice if the various README's referenced and gave instructions for tanka instead of ks (since that's now a dead project, right?).
I'm using tanka and wanted to create PVCs for using them as a shared filesystem for different Deployments.
This is not possible because of an overwritten new()-method which drops the apiVersion/kind properties during creation.
For StatefulSets there should be another type which should be used PersistentVolumeClaimTemplates
. See #77 for details.
The resulting manifests from the etcd-operator
jsonnet library are missing the definition of EtcdCluster
, causing any libraries that depend on them to fail to tk diff
or tk apply
if the target cluster isn't already configured with that CRD.
We are stuck with the v0.1.0 of the kubernetes-mixin because later versions require the new-style metrics of K8s 1.14+.
Once we are on a current kubernetes-mixin version, the overrides in prometheus-ksonnet/prometheus-ksonnet.libsonnet can be removed.
Here is the JS error that accompanies this:
Uncaught TypeError: Cannot read property 'contains' of null at Portal.handleOutsideMouseClick .
This used to work until React changed some unstable behaviour that react-portal
relied on (unstable_renderSubtreeIntoContainer()
).
It's a bit of dead end. The way forward should be
but Grafana doesn't allow this.
This was generated from a default run of the TNS demo:
t=2020-07-31T12:22:22+0000 lvl=eror msg="failed to save dashboard" logger=provisioning.dashboard type=file name=dashboards-prometheus error="Dashboard name cannot be the same as folder"
At the moment, ksonnet-util
is using the naked k.libsonnet
import Ksonnet used to promote:
This however is not really possible with Tanka anymore, because of two reasons:
jb
does not support installing naked files (it did by accident), so you cannot jb install github.com/ksonnet/ksonnet-lib/ksonnet.beta.3/k.libsonnet
Our best solution yet is to use the actual package of this library, which is ksonnet.beta.3
, located at github.com/ksonnet/ksonnet-lib/ksonnet.beta.3
.
Doing this would involve adding the package prefix to the above mentioned import. Furthermore, it would be cool to add a jsonnetfile.json
(no .lock.json
though) to the ksonnet-util
folder, so that jb
automatically takes care of providing the library when ksonnet-util
is installed :D
Opinions?
We're currently putting alerts.rules
, prometheus.yml
, and recording.rules
into a single ConfigMap. We've gotten to the point where the combined size of those files have become too long. We're getting the error:
Name: "prometheus-...-config", Namespace: "default"
for: "STDIN": ConfigMap "prometheus-...-config" is invalid: metadata.annotations: Too long: must have at most 262144 characters
I understand this is due to exceeding the max annotation size while attempting to set the kubectl.kubernetes.io/last-applied-configuration
annotation. Violating the annotation size constraint makes the apply fail.
As a solution, I'd like to propose we break up this single ConfigMap into three, one for each file.
The following constructors are called from ksonnet-util/utils.libsonnet#namespacedRBAC
and ksonnet-util/utils.libsonnet#rbac
:
and they all miss the mandatory name
argument leading to the following error:
RUNTIME ERROR: Missing argument: name
vendor/jsonnet-libs/ksonnet-util/util.libsonnet:88:7-24 object <anonymous>
When using the prometheus statefulset, the following ks diff is always present when running ks diff --diff-strategy=subset
. This diff still exists after a ks apply
.
---
- live statefulsets prometheus
+ config statefulsets prometheus
{
"apiVersion": "apps/v1beta1",
"kind": "StatefulSet",
"metadata": {
"name": "prometheus"
},
"spec": {
"replicas": 1,
"serviceName": "prometheus",
"template": {
"metadata": {
"annotations": {
"prometheus.io.path": "/prometheus/metrics"
},
"labels": {
"name": "prometheus"
}
},
"spec": {
"containers": [
{
"args": [
"--config.file=/etc/prometheus/prometheus.yml",
"--web.listen-address=:80",
"--web.external-url=https://uswest-cluster.grapeshot.com/prometheus/",
"--web.enable-lifecycle",
"--web.route-prefix=/prometheus/"
],
"image": "prom/prometheus:v2.2.1",
"imagePullPolicy": "IfNotPresent",
"name": "prometheus",
"ports": [
{
"containerPort": 80,
"name": "http-metrics"
}
],
"resources": {
"limits": {
"cpu": "1",
"memory": "1Gi"
},
"requests": { [118/2921]
"cpu": "1",
"memory": "1Gi"
}
},
"volumeMounts": [
{
"mountPath": "/prometheus",
"name": "prometheus-data"
},
{
"mountPath": "/etc/prometheus",
"name": "prometheus-config"
}
]
},
{
"args": [
"-v",
"-t",
"-p=/etc/prometheus",
"curl",
"-X",
"POST",
"--fail",
"-o",
"-",
"-sS",
"http://localhost:80/prometheus/-/reload"
],
"image": "weaveworks/watch:master-5b2a6e5",
"imagePullPolicy": "IfNotPresent",
"name": "watch",
"resources": {
"limits": {
"cpu": "50m",
"memory": "100Mi"
},
"requests": {
"cpu": "50m",
"memory": "100Mi"
}
},
"volumeMounts": [
{
"mountPath": "/etc/prometheus",
"name": "prometheus-config"
}
]
}
],
"securityContext": {
"runAsUser": 0
},
"serviceAccount": "prometheus",
"volumes": [
{
"configMap": {
"name": "prometheus-config"
},
"name": "prometheus-config"
}
]
}
},
"volumeClaimTemplates": [
{
"metadata": {
"name": "prometheus-data"
},
"spec": {
"accessModes": [
"ReadWriteOnce"
],
"resources": {
"requests": {
"storage": "300Gi"
}
}
}
+ "apiVersion": "v1"
+ "kind": "PersistentVolumeClaim"
}
]
}
}
---
grafana_dashboards
vs grafanaDashboards
) #234I want to use memcached-mixin to generate a dashboard. The dashboard generated successfully, but when I import it to Grafana, I cannot see anything.
jb version
โ memcached-mixin jb --version
v0.3.1
grafana version
grafana/grafana:6.6.2
main.jsonnet
local memcached_mixin = (import "memcached-mixin/mixin.libsonnet");
memcached_mixin {}
After importing the dashboard, I cannot see anything in my grafana
Steps:
# install mixin
jb install github.com/grafana/jsonnet-libs/memcached-mixin
# generate dashboard
jsonnet -J vendor -m . environments/memcached-mixin/main.jsonnet
Generated dashboard
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": [ ]
},
"yaxes": [
{
"format": "percentunit",
"label": null,
"logBase": 1,
"max": null,
"min": 0,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
]
}
],
"repeat": null,
"repeatIteration": null,
"repeatRowId": null,
"showTitle": true,
"title": "Hits",
"titleSize": "h6"
},
{
"collapse": false,
"height": "250px",
"panels": [
{
"aliasColors": { },
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "$datasource",
"fill": 1,
"id": 2,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [ ],
"nullPointMode": "null as zero",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [ ],
"spaceLength": 10,
"span": 4,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "sum without (job, instance) (rate(memcached_commands_total{cluster=~\"$cluster\", job=~\"$job\", instance=~\"$instance\"}[1m]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{command}} {{status}}",
"legendLink": null,
"step": 10
}
],
"thresholds": [ ],
"timeFrom": null,
"timeShift": null,
"title": "Commands",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": [ ]
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": 0,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
]
},
{
"aliasColors": { },
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "$datasource",
"fill": 1,
"id": 3,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [ ],
"nullPointMode": "null as zero",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [ ],
"spaceLength": 10,
"span": 4,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "sum without (job) (rate(memcached_items_evicted_total{cluster=~\"$cluster\", job=~\"$job\", instance=~\"$instance\"}[1m]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{instance}}",
"legendLink": null,
"step": 10
}
],
"thresholds": [ ],
"timeFrom": null,
"timeShift": null,
"title": "Evictions",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": [ ]
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": 0,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
]
},
{
"aliasColors": { },
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "$datasource",
"fill": 1,
"id": 4,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [ ],
"nullPointMode": "null as zero",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [ ],
"spaceLength": 10,
"span": 4,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "sum without (job) (rate(memcached_items_total{cluster=~\"$cluster\", job=~\"$job\", instance=~\"$instance\"}[1m]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{instance}}",
"legendLink": null,
"step": 10
}
],
"thresholds": [ ],
"timeFrom": null,
"timeShift": null,
"title": "Stored",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": [ ]
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": 0,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
]
}
],
"repeat": null,
"repeatIteration": null,
"repeatRowId": null,
"showTitle": true,
"title": "Ops",
"titleSize": "h6"
},
{
"collapse": false,
"height": "250px",
"panels": [
{
"aliasColors": { },
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "$datasource",
"fill": 10,
"id": 5,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 0,
"links": [ ],
"nullPointMode": "null as zero",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [ ],
"spaceLength": 10,
"span": 6,
"stack": true,
"steppedLine": false,
"targets": [
{
"expr": "sum without (job) (memcached_current_bytes{cluster=~\"$cluster\", job=~\"$job\", instance=~\"$instance\"})",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{instance}}",
"legendLink": null,
"step": 10
}
],
"thresholds": [ ],
"timeFrom": null,
"timeShift": null,
"title": "Memory",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": [ ]
},
"yaxes": [
{
"format": "bytes",
"label": null,
"logBase": 1,
"max": null,
"min": 0,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
]
},
{
"aliasColors": { },
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "$datasource",
"fill": 10,
"id": 6,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 0,
"links": [ ],
"nullPointMode": "null as zero",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [ ],
"spaceLength": 10,
"span": 6,
"stack": true,
"steppedLine": false,
"targets": [
{
"expr": "sum without (job) (memcached_current_items{cluster=~\"$cluster\", job=~\"$job\", instance=~\"$instance\"})",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{instance}}",
"legendLink": null,
"step": 10
}
],
"thresholds": [ ],
"timeFrom": null,
"timeShift": null,
"title": "Items",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": [ ]
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": 0,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
]
}
],
"repeat": null,
"repeatIteration": null,
"repeatRowId": null,
"showTitle": true,
"title": "Memory",
"titleSize": "h6"
},
{
"collapse": false,
"height": "250px",
"panels": [
{
"aliasColors": { },
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "$datasource",
"fill": 1,
"id": 7,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [ ],
"nullPointMode": "null as zero",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [ ],
"spaceLength": 10,
"span": 4,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "sum without (job) (rate(memcached_connections_total{cluster=~\"$cluster\", job=~\"$job\", instance=~\"$instance\"}[1m]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{instance}} - Connection Rate",
"legendLink": null,
"step": 10
},
{
"expr": "sum without (job) (memcached_current_connections{cluster=~\"$cluster\", job=~\"$job\", instance=~\"$instance\"})",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{instance}} - Current Connrections",
"legendLink": null,
"step": 10
},
{
"expr": "sum without (job) (memcached_max_connections{cluster=~\"$cluster\", job=~\"$job\", instance=~\"$instance\"})",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{instance}} - Max Connections",
"legendLink": null,
"step": 10
}
],
"thresholds": [ ],
"timeFrom": null,
"timeShift": null,
"title": "Connections",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": [ ]
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": 0,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
]
},
{
"aliasColors": { },
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "$datasource",
"fill": 1,
"id": 8,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [ ],
"nullPointMode": "null as zero",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [ ],
"spaceLength": 10,
"span": 4,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "sum without (job) (rate(memcached_read_bytes_total{cluster=~\"$cluster\", job=~\"$job\", instance=~\"$instance\"}[1m]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{instance}}",
"legendLink": null,
"step": 10
}
],
"thresholds": [ ],
"timeFrom": null,
"timeShift": null,
"title": "Reads",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": [ ]
},
"yaxes": [
{
"format": "bps",
"label": null,
"logBase": 1,
"max": null,
"min": 0,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
]
},
{
"aliasColors": { },
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "$datasource",
"fill": 1,
"id": 9,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [ ],
"nullPointMode": "null as zero",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [ ],
"spaceLength": 10,
"span": 4,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "sum without (job) (rate(memcached_written_bytes_total{cluster=~\"$cluster\", job=~\"$job\", instance=~\"$instance\"}[1m]))",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{instance}}",
"legendLink": null,
"step": 10
}
],
"thresholds": [ ],
"timeFrom": null,
"timeShift": null,
"title": "Writes",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": [ ]
},
"yaxes": [
{
"format": "bps",
"label": null,
"logBase": 1,
"max": null,
"min": 0,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
]
}
],
"repeat": null,
"repeatIteration": null,
"repeatRowId": null,
"showTitle": true,
"title": "Network",
"titleSize": "h6"
},
{
"collapse": false,
"height": "250px",
"panels": [
{
"aliasColors": { },
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "$datasource",
"fill": 1,
"id": 10,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [ ],
"nullPointMode": "null as zero",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [ ],
"spaceLength": 10,
"span": 12,
"stack": false,
"steppedLine": false,
"styles": [
{
"alias": "Time",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"pattern": "Time",
"type": "hidden"
},
{
"alias": "Count",
"colorMode": null,
"colors": [ ],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"link": false,
"linkTooltip": "Drill down",
"linkUrl": "",
"pattern": "Value #A",
"thresholds": [ ],
"type": "hidden",
"unit": "short"
},
{
"alias": "Uptime",
"colorMode": null,
"colors": [ ],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"link": false,
"linkTooltip": "Drill down",
"linkUrl": "",
"pattern": "Value #B",
"thresholds": [ ],
"type": "number",
"unit": "dtdurations"
},
{
"alias": "Instance",
"colorMode": null,
"colors": [ ],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"link": false,
"linkTooltip": "Drill down",
"linkUrl": "",
"pattern": "instance",
"thresholds": [ ],
"type": "number",
"unit": "short"
},
{
"alias": "Job",
"colorMode": null,
"colors": [ ],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"link": false,
"linkTooltip": "Drill down",
"linkUrl": "",
"pattern": "job",
"thresholds": [ ],
"type": "number",
"unit": "short"
},
{
"alias": "Version",
"colorMode": null,
"colors": [ ],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"link": false,
"linkTooltip": "Drill down",
"linkUrl": "",
"pattern": "version",
"thresholds": [ ],
"type": "number",
"unit": "short"
},
{
"alias": "",
"colorMode": null,
"colors": [ ],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"pattern": "/.*/",
"thresholds": [ ],
"type": "string",
"unit": "short"
}
],
"targets": [
{
"expr": "count by (job, instance, version) (memcached_version{cluster=~\"$cluster\", job=~\"$job\", instance=~\"$instance\"})",
"format": "table",
"instant": true,
"intervalFactor": 2,
"legendFormat": "",
"refId": "A",
"step": 10
},
{
"expr": "max by (job, instance) (memcached_uptime_seconds{cluster=~\"$cluster\", job=~\"$job\", instance=~\"$instance\"})",
"format": "table",
"instant": true,
"intervalFactor": 2,
"legendFormat": "",
"refId": "B",
"step": 10
}
],
"thresholds": [ ],
"timeFrom": null,
"timeShift": null,
"title": "Memcached Info",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"transform": "table",
"type": "table",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": [ ]
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": 0,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
]
}
],
"repeat": null,
"repeatIteration": null,
"repeatRowId": null,
"showTitle": true,
"title": "Memcached Info",
"titleSize": "h6"
}
],
"schemaVersion": 14,
"style": "dark",
"tags": [ ],
"templating": {
"list": [
{
"current": {
"text": "default",
"value": "default"
},
"hide": 0,
"label": null,
"name": "datasource",
"options": [ ],
"query": "prometheus",
"refresh": 1,
"regex": "",
"type": "datasource"
},
{
"allValue": null,
"current": {
"selected": true,
"text": "All",
"value": "$__all"
},
"datasource": "$datasource",
"hide": 0,
"includeAll": true,
"label": "cluster",
"multi": true,
"name": "cluster",
"options": [ ],
"query": "label_values(memcached_commands_total, cluster)",
"refresh": 1,
"regex": "",
"sort": 2,
"tagValuesQuery": "",
"tags": [ ],
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"allValue": null,
"current": {
"selected": true,
"text": "All",
"value": "$__all"
},
"datasource": "$datasource",
"hide": 0,
"includeAll": true,
"label": "job",
"multi": true,
"name": "job",
"options": [ ],
"query": "label_values(memcached_commands_total{cluster=~\"$cluster\"}, job)",
"refresh": 1,
"regex": "",
"sort": 2,
"tagValuesQuery": "",
"tags": [ ],
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"allValue": null,
"current": {
"selected": true,
"text": "All",
"value": "$__all"
},
"datasource": "$datasource",
"hide": 0,
"includeAll": true,
"label": "instance",
"multi": true,
"name": "instance",
"options": [ ],
"query": "label_values(memcached_commands_total{cluster=~\"$cluster\",job=~\"$job\"}, instance)",
"refresh": 1,
"regex": "",
"sort": 2,
"tagValuesQuery": "",
"tags": [ ],
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
},
"time": {
"from": "now-1h",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"timezone": "utc",
"title": "Memcached",
"uid": "",
"version": 0
}
}
Having given some talks recently demonstrating Tanka, at the start, I needed to add: (import 'ksonnet-util/kausal.libsonnet')
. This makes no sense - what is "ksonnet" and what is "kausal"? (Other than a cool company that has now merged with Grafana Labs!!).
I suggest we make some adjustments to ksonnet-util
to make it cleaner for newcomers. These suggestions currently include:
jaeger.libsonnet
somewhere more sensible - it is not relevant where it is #291ksonnet-util/kausal.libsonnet
to tanka-util/util.libsonnet
k8s-mixin/defaults.libsonnet
#293prometheus-ksonnet
use the defaulted config value for label nameFrom @tomwilkie on August 2, 2017 9:5
Copied from original issue: kausalco/private#7
hi @sh0rez namespace option not work as expected
and see this issue grafana/tanka#418
From @tomwilkie on November 17, 2017 11:3
What I expect:
Copied from original issue: kausalco/private#88
The field of the returned object for the role binding is called cluster_role_binding
(as for the rbac()
method), while I guess it should really be just role_binding
.
For Istio to work, port name in Services need to be formed with <protocol>[-<suffix>]
https://istio.io/docs/ops/configuration/traffic-management/protocol-selection/
When using util.serviceFor()
, the ports are named with the container name first :
servicePort.newNamed(c.name + '-' + port.name, port.containerPort, port.containerPort) +
I propose to change the naming to the other way around:
servicePort.newNamed(port.name + '-' + c.name, port.containerPort, port.containerPort) +
As far as I know, nothing else is dependent on this naming beside Istio...
Given ksonnet is deprecated, calling this lib prometheus-ksonnet
doesn't make sense. Therefore, I propose we rename it prometheus-mixin
. We can leave behind a prometheus-ksonnet
that will allow for previous installations to still work.
I also propose:
grafana-mixin
, and have prometheus-mixin
import it via jb
.$.grafana_add_datasource...
less Prometheus focused. Allow it to be used for non Prometheus datasources, without making prometheus related code more verbose.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.