How to add json data in ConfigMap creation in ArgoCD - kubernetes
I'm trying to create a ConfigMap with ArgoCD.
I've created a volumes.yaml file as such
---
apiVersion: v1
kind: ConfigMap
metadata:
name: persistent-volumes-argo
labels:
grafana_dashboard: "1"
project: "foo"
data:
kubernetes.json: |
{{ .Files.Get "dashboards/persistent-volumes.json" | indent 4 }}
But ArgoCD doesn't seem to be able to read the data, the way a standard Helm deployment would.
I've tried adding the data directly into the ConfigMap as such
(Data omitted for brevity)
---
apiVersion: v1
kind: ConfigMap
metadata:
name: persistent-volumes-argo
labels:
grafana_dashboard: "1"
project: "foo"
data:
kubernetes.json: |
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"limit": 100,
"name": "Annotations & Alerts",
"showIn": 0,
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": 13646,
"graphTooltip": 0,
"iteration": 1659421503107,
"links": [],
"panels": [
{
"collapsed": false,
"datasource": null,
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 26,
"panels": [],
"title": "Alerts",
"type": "row"
},
{
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"noValue": "--",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "semi-dark-red",
"value": null
},
{
"color": "light-green",
"value": -0.0001
},
{
"color": "semi-dark-red",
"value": 0.0001
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 8,
"x": 0,
"y": 1
},
"id": 21,
"options": {
"colorMode": "background",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.0.3",
"targets": [
{
"expr": "count (max by (persistentvolumeclaim,namespace) (kubelet_volume_stats_used_bytes{namespace=~\"${k8s_namespace}\"} ) and (max by (persistentvolumeclaim,namespace) (kubelet_volume_stats_used_bytes{namespace=~\"${k8s_namespace}\"} )) / (max by (persistentvolumeclaim,namespace) (kubelet_volume_stats_capacity_bytes{namespace=~\"${k8s_namespace}\"} )) >= (${warning_threshold} / 100)) or vector (0)",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"timeFrom": null,
"timeShift": null,
"title": "PVCs Above Warning Threshold",
"type": "stat"
},
{
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"decimals": 0,
"mappings": [],
"noValue": "--",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "semi-dark-red",
"value": null
},
{
"color": "light-green",
"value": -0.0001
},
{
"color": "semi-dark-red",
"value": 0.0001
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 8,
"x": 8,
"y": 1
},
"id": 24,
"options": {
"colorMode": "background",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.0.3",
"targets": [
{
"expr": "count((kube_persistentvolumeclaim_status_phase{namespace=~\"${k8s_namespace}\",phase=\"Pending\"}==1)) or vector(0)",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"timeFrom": null,
"timeShift": null,
"title": "PVCs in Pending State",
"transformations": [
{
"id": "organize",
"options": {}
}
],
"type": "stat"
},
{
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"decimals": 0,
"mappings": [],
"noValue": "--",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "semi-dark-red",
"value": null
},
{
"color": "light-green",
"value": -0.0001
},
{
"color": "semi-dark-red",
"value": 0.0001
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 8,
"x": 16,
"y": 1
},
"id": 23,
"options": {
"colorMode": "background",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.0.3",
"targets": [
{
"expr": "count((kube_persistentvolumeclaim_status_phase{namespace=~\"${k8s_namespace}\",phase=\"Lost\"}==1)) or vector(0)",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"timeFrom": null,
"timeShift": null,
"title": "PVCs in Lost State",
"transformations": [
{
"id": "organize",
"options": {}
}
],
"type": "stat"
},
{
"collapsed": false,
"datasource": null,
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 5
},
"id": 17,
"panels": [],
"title": "Usage statistics",
"type": "row"
},
{
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": null,
"displayMode": "auto",
"filterable": false
},
"mappings": [],
"noValue": "--",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "light-green",
"value": null
}
]
},
"unit": "none"
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Used (%)"
},
"properties": [
{
"id": "custom.displayMode",
"value": "gradient-gauge"
},
{
"id": "thresholds",
"value": {
"mode": "absolute",
"steps": [
{
"color": "light-green",
"value": null
},
{
"color": "semi-dark-yellow",
"value": 70
},
{
"color": "dark-red",
"value": 80
}
]
}
},
{
"id": "decimals",
"value": 1
}
]
},
{
"matcher": {
"id": "byName",
"options": "Status"
},
"properties": [
{
"id": "custom.displayMode",
"value": "color-background"
},
{
"id": "mappings",
"value": [
{
"options": {
"0": {
"text": "Bound"
},
"1": {
"text": "Pending"
},
"2": {
"text": "Lost"
}
},
"type": "value"
}
]
},
{
"id": "thresholds",
"value": {
"mode": "absolute",
"steps": [
{
"color": "light-green",
"value": null
},
{
"color": "light-green",
"value": 0
},
{
"color": "semi-dark-orange",
"value": 1
},
{
"color": "semi-dark-red",
"value": 2
}
]
}
},
{
"id": "noValue",
"value": "--"
},
{
"id": "custom.align",
"value": "center"
}
]
},
{
"matcher": {
"id": "byName",
"options": "Namespace"
},
"properties": [
{
"id": "custom.width",
"value": 120
}
]
},
{
"matcher": {
"id": "byName",
"options": "Status"
},
"properties": [
{
"id": "custom.width",
"value": 80
}
]
},
{
"matcher": {
"id": "byName",
"options": "Capacity (GiB)"
},
"properties": [
{
"id": "custom.width",
"value": 120
}
]
},
{
"matcher": {
"id": "byName",
"options": "Used (GiB)"
},
"properties": [
{
"id": "custom.width",
"value": 120
}
]
},
{
"matcher": {
"id": "byName",
"options": "Available (GiB)"
},
"properties": [
{
"id": "custom.width",
"value": 120
}
]
},
{
"matcher": {
"id": "byName",
"options": "StorageClass"
},
"properties": [
{
"id": "custom.width",
"value": 150
}
]
},
{
"matcher": {
"id": "byName",
"options": "PersistentVolumeClaim"
},
"properties": [
{
"id": "custom.width",
"value": 370
}
]
}
]
},
"gridPos": {
"h": 12,
"w": 24,
"x": 0,
"y": 6
},
"id": 29,
"interval": "",
"options": {
"frameIndex": 2,
"showHeader": true,
"sortBy": [
{
"desc": false,
"displayName": "PersistentVolumeClaim"
}
]
},
"pluginVersion": "8.0.3",
"targets": [
{
"expr": " sum by (persistentvolumeclaim,namespace,storageclass,volumename) (kube_persistentvolumeclaim_info{namespace=~\"${k8s_namespace}\"})",
"format": "table",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "A"
},
{
"expr": "sum by (persistentvolumeclaim) (kubelet_volume_stats_capacity_bytes{namespace=~\"${k8s_namespace}\"}/1024/1024/1024)",
"format": "table",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "B"
},
{
"expr": "sum by (persistentvolumeclaim) (kubelet_volume_stats_used_bytes{namespace=~\"${k8s_namespace}\"}/1024/1024/1024)",
"format": "table",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "C"
},
{
"expr": "sum by (persistentvolumeclaim) (kubelet_volume_stats_available_bytes{namespace=~\"${k8s_namespace}\"}/1024/1024/1024)",
"format": "table",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "D"
},
{
"expr": "sum(kube_persistentvolumeclaim_status_phase{namespace=~\"${k8s_namespace}\",phase=~\"(Pending|Lost)\"}) by (persistentvolumeclaim) + sum(kube_persistentvolumeclaim_status_phase{namespace=~\"${k8s_namespace}\",phase=~\"(Lost)\"}) by (persistentvolumeclaim)",
"format": "table",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "E"
},
{
"expr": "sum by (persistentvolumeclaim) (kubelet_volume_stats_used_bytes{namespace=~\"${k8s_namespace}\"}/kubelet_volume_stats_capacity_bytes{namespace=~\"${k8s_namespace}\"} * 100)",
"format": "table",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "F"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Persistent Volume Claim",
"transformations": [
{
"id": "seriesToColumns",
"options": {
"byField": "persistentvolumeclaim"
}
},
{
"id": "organize",
"options": {
"excludeByName": {
"Time": true,
"Time 1": true,
"Time 2": true,
"Time 3": true,
"Time 4": true,
"Time 5": true,
"Time 6": true,
"Value #A": true
},
"indexByName": {},
"renameByName": {
"Time 1": "",
"Time 2": "",
"Time 3": "",
"Time 4": "",
"Time 5": "",
"Time 6": "",
"Value #A": "",
"Value #B": "Capacity (GiB)",
"Value #C": "Used (GiB)",
"Value #D": "Available (GiB)",
"Value #E": "Status",
"Value #F": "Used (%)",
"namespace": "Namespace",
"persistentvolumeclaim": "PersistentVolumeClaim",
"storageclass": "StorageClass",
"volumename": "PhysicalVolume"
}
}
}
],
"type": "table"
},
{
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"custom": {
"align": null,
"displayMode": "auto",
"filterable": false
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 24,
"x": 0,
"y": 18
},
"id": 7,
"options": {
"showHeader": true,
"sortBy": [
{
"desc": true,
"displayName": "Status"
}
]
},
"pluginVersion": "8.0.3",
"targets": [
{
"expr": "kube_storageclass_info",
"format": "table",
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Storage Class",
"transformations": [
{
"id": "organize",
"options": {
"excludeByName": {
"Time": true,
"Value": true,
"__name__": true,
"app_kubernetes_io_instance": true,
"app_kubernetes_io_name": true,
"instance": true,
"job": true,
"kubernetes_namespace": true,
"kubernetes_pod_name": true,
"pod_template_hash": true
},
"indexByName": {
"Time": 1,
"Value": 13,
"__name__": 2,
"app_kubernetes_io_instance": 3,
"app_kubernetes_io_name": 4,
"instance": 5,
"job": 6,
"kubernetes_namespace": 7,
"kubernetes_pod_name": 8,
"pod_template_hash": 9,
"provisioner": 10,
"reclaimPolicy": 11,
"storageclass": 0,
"volumeBindingMode": 12
},
"renameByName": {
"provisioner": "Provisioner",
"reclaimPolicy": "ReclaimPolicy",
"storageclass": "StorageClass",
"volumeBindingMode": "VolumeBindingMode"
}
}
},
{
"id": "groupBy",
"options": {
"fields": {
"Provisioner": {
"aggregations": [],
"operation": "groupby"
},
"ReclaimPolicy": {
"aggregations": [],
"operation": "groupby"
},
"StorageClass": {
"aggregations": [],
"operation": "groupby"
},
"VolumeBindingMode": {
"aggregations": [],
"operation": "groupby"
}
}
}
}
],
"type": "table"
},
{
"collapsed": false,
"datasource": null,
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 23
},
"id": 15,
"panels": [],
"title": "Graphical usage data ",
"type": "row"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "$datasource",
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 12,
"w": 24,
"x": 0,
"y": 24
},
"hiddenSeries": false,
"id": 9,
"legend": {
"alignAsTable": true,
"avg": true,
"current": true,
"max": true,
"min": true,
"rightSide": true,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "8.0.3",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "(max by (persistentvolumeclaim,namespace) (kubelet_volume_stats_used_bytes{namespace=~\"${k8s_namespace}\"}))",
"interval": "",
"legendFormat": "{{namespace}} ({{persistentvolumeclaim}})",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "All Running PVCs Used Bytes",
"tooltip": {
"shared": true,
"sort": 2,
"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": null,
"show": true
},
{
"format": "Date & time",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"collapsed": true,
"datasource": null,
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 36
},
"id": 19,
"panels": [
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 41
},
"hiddenSeries": false,
"id": 11,
"legend": {
"alignAsTable": true,
"avg": true,
"current": false,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.2.1",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "rate(kubelet_volume_stats_used_bytes{namespace=~\"${k8s_namespace}\"}[1h])",
"instant": false,
"interval": "",
"legendFormat": "{{namespace}} ({{persistentvolumeclaim}})",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Hourly Volume Usage Rate",
"tooltip": {
"shared": true,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "binBps",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "Date & time",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 48
},
"hiddenSeries": false,
"id": 12,
"legend": {
"alignAsTable": true,
"avg": true,
"current": false,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.2.1",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "rate(kubelet_volume_stats_used_bytes{namespace=~\"${k8s_namespace}\"}[1d])",
"interval": "",
"legendFormat": "{{namespace}} ({{persistentvolumeclaim}})",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Daily Volume Usage Rate",
"tooltip": {
"shared": true,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "binBps",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "Date & time",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 55
},
"hiddenSeries": false,
"id": 13,
"legend": {
"alignAsTable": true,
"avg": true,
"current": false,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"alertThreshold": true
}
}
But this errors with rpc error: code = FailedPrecondition desc = Failed to unmarshal "volumes.yaml": <nil>
Is there a way to pass in json data when creating a ConfigMap with ArgoCD, either as a template or by dumping the data in the file?
To create configmap with argocd and helm
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "helm-chart.fullname" . }}-configmap
data:
config.json : |
{{ toJson .Values.configmap | indent 4 }}
and the value file should be like this, which is our JSON but converted to YAML
configmap:
json:
- rigid
- better for data interchange
yaml:
- slim and flexible
- better for configuration
object:
key: value
array:
- null_value:
- boolean: true
- integer: 1
- alias: &example aliases are like variables
- alias: *example
paragraph: >
Blank lines denote
paragraph breaks
content: |-
Or we
can auto
convert line breaks
to save space
alias: &foo
bar: baz
alias_reuse: *foo
json2yaml
A complete demo app can be found here
A very quick way to create app with the above configmap and demo app
argocd app create demo-app --repo https://github.com/Adiii717/argocd-demo-app.git --path helm-chart --dest-namespace default --dest-server https://kubernetes.default.svc --helm-set replicaCount=2
Make sure you also set
export ARGOCD_AUTH_TOKEN="tokeh
export ARGOCD_OPTS="--grpc-web"
export ARGOCD_SERVER="argocd.example.com"
added section for the configmap
Related
Grafana 8 | Notifications Alert
We did an upgrade to our Loki-stack from version:2.1.0 to version 2.4.1, After the upgrade Grafana Alert Rules are not working previously we were running version: 6.7 of Grafana, and now we running version:8.0. In the dashboard am getting the below error. Error: Checking the logs on Grafana pod am getting the below error. t=2022-05-11T13:16:12+0000 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=user1 method=GET path=/api/prometheus/grafana/api/v1/rules status=404 remote_addr=159.12.0.4 time_ms=2 size=29 referer="https://digisc.dev.company.com/internal/grafana/d/k8s_views_global/kubernetes-views-global-version-8-grafana?orgId=1&refresh=30s" t=2022-05-11T13:30:57+0000 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=user1 method=GET path=/api/alertmanager/grafana/config/api/v1/alerts status=404 remote_addr=159.12.0.4 time_ms=9 size=29 referer=https://digisc.dev.campany.com/internal/grafana/alerting/notifications In the browser console am getting below error. https://digisc.dev.company.com/internal/grafana/api/ruler/1/api/v1/rules 500 We used helm to release our infrastructure changes. Below is one of the alerts we used:: { "alert": { "alertRuleTags": {}, "conditions": [ { "evaluator": { "params": [ 15 ], "type": "gt" }, "operator": { "type": "and" }, "query": { "params": [ "C", "5m", "now" ] }, "reducer": { "params": [], "type": "last" }, "type": "query" } ], "executionErrorState": "alerting", "for": "5m", "frequency": "1m", "handler": 1, "name": "Cluster CPU Capacity alert", "noDataState": "ok", "notifications": [] }, "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "Prometheus", "fill": 1, "fillGradient": 0, "gridPos": { "h": 5, "w": 6, "x": 6, "y": 9 }, "hiddenSeries": false, "id": 10, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 5, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "sum(kube_node_status_capacity_cpu_cores)", "format": "time_series", "intervalFactor": 1, "legendFormat": "allocatable", "refId": "A" }, { "expr": "sum(kube_node_status_allocatable_cpu_cores)", "format": "time_series", "intervalFactor": 1, "legendFormat": "capacity", "refId": "B" }, { "expr": "sum(kube_pod_container_resource_requests_cpu_cores)", "format": "time_series", "intervalFactor": 1, "legendFormat": "requested", "refId": "C" } ], "thresholds": [ { "colorMode": "critical", "fill": true, "line": true, "op": "gt", "value": 15 } ], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Cluster CPU Capacity", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "decimals": null, "format": "none", "label": "cores", "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } } Can you please assist if you are familiar with this error maybe we missed a configuration during the upgrade? We used below helm chart for Loki:: https://github.com/grafana/helm-charts/tree/main/charts/loki-stack
deploy web apps /create Stages by api to run new deployments
It’ possible to create a deploment stage by Azure DevOps API? We want to create a new stage and want to deploy a web app on the webserver. What is the best approach to release a new web app including the configuration of iis by azure devops API? Kind Regards, Dominik
If you mean creating release definition with stages and specific tasks, then you can call the Definitions - Create REST API. For example to add a stage with the IIS Web App Deploy task: POST : https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/definitions?api-version=6.0 Request Body: (Of course, you need to replace the parameters accordingly. You can also capture the Request Body(Payload) by pressing F12 when creating a release definition from the UI) { "id": 0, "name": "RESTAPI-WEB", "source": 2, "comment": "", "createdOn": "2022-04-20T08:36:03.598Z", "createdBy": null, "modifiedBy": null, "modifiedOn": "2022-04-20T08:36:03.598Z", "environments": [ { "id": -3, "name": "Stage 1", "rank": 1, "variables": {}, "variableGroups": [], "preDeployApprovals": { "approvals": [ { "rank": 1, "isAutomated": true, "isNotificationOn": false, "id": 0 } ], "approvalOptions": { "executionOrder": 1 } }, "deployStep": { "tasks": [], "id": 0 }, "postDeployApprovals": { "approvals": [ { "rank": 1, "isAutomated": true, "isNotificationOn": false, "id": 0 } ], "approvalOptions": { "executionOrder": 2 } }, "deployPhases": [ { "deploymentInput": { "parallelExecution": { "parallelExecutionType": 0 }, "agentSpecification": null, "skipArtifactsDownload": false, "artifactsDownloadInput": {}, "queueId": 158, "demands": [], "enableAccessToken": false, "timeoutInMinutes": 0, "jobCancelTimeoutInMinutes": 1, "condition": "succeeded()", "overrideInputs": {}, "dependencies": [] }, "rank": 1, "phaseType": 1, "name": "Agent job", "refName": null, "workflowTasks": [ { "name": "Deploy IIS Website/App: ", "refName": null, "enabled": true, "timeoutInMinutes": 0, "inputs": { "WebSiteName": "TestSite", "VirtualApplication": "", "Package": "$(System.DefaultWorkingDirectory)\\**\\*.zip", "SetParametersFile": "", "RemoveAdditionalFilesFlag": "true", "ExcludeFilesFromAppDataFlag": "true", "TakeAppOfflineFlag": "false", "AdditionalArguments": "", "XmlTransformation": "false", "XmlVariableSubstitution": "false", "JSONFiles": "" }, "taskId": "1b467810-6725-4b6d-accd-886174c09bba", "version": "0.*", "definitionType": "task", "alwaysRun": false, "continueOnError": false, "overrideInputs": {}, "condition": "succeeded()", "environment": {}, "retryCountOnTaskFailure": 0 } ], "phaseInputs": {} } ], "runOptions": {}, "environmentOptions": { "emailNotificationType": "OnlyOnFailure", "emailRecipients": "release.environment.owner;release.creator", "skipArtifactsDownload": false, "timeoutInMinutes": 0, "enableAccessToken": false, "publishDeploymentStatus": true, "badgeEnabled": false, "autoLinkWorkItems": false, "pullRequestDeploymentEnabled": false }, "demands": [], "conditions": [ { "conditionType": 1, "name": "ReleaseStarted", "value": "" } ], "executionPolicy": { "concurrencyCount": 1, "queueDepthCount": 0 }, "schedules": [], "properties": { "LinkBoardsWorkItems": false, "BoardsEnvironmentType": "unmapped" }, "preDeploymentGates": { "id": 0, "gatesOptions": null, "gates": [] }, "postDeploymentGates": { "id": 0, "gatesOptions": null, "gates": [] }, "retentionPolicy": { "daysToKeep": 30, "releasesToKeep": 3, "retainBuild": true }, "processParameters": {} } ], "artifacts": [ { "type": "Build", "definitionReference": { "IsMultiDefinitionType": { "name": "False", "id": "False" }, "project": { "name": "AzureFunction", "id": "4da2f07a-ac7b-43a0-b764-459af8a4d9df" }, "repository": { "name": "", "id": "" }, "definitions": { "name": "", "id": "" }, "definition": { "name": "AzureFunctions_CI", "id": "172" }, "defaultVersionType": { "name": "Latest", "id": "latestType" }, "defaultVersionBranch": { "name": "", "id": "" }, "defaultVersionTags": { "name": "", "id": "" }, "defaultVersionSpecific": { "name": "", "id": "" } }, "alias": "_AzureFunctions_CI", "isPrimary": true, "sourceId": "", "isRetained": false } ], "variables": {}, "variableGroups": [], "triggers": [], "lastRelease": null, "tags": [], "path": "\\", "properties": { "DefinitionCreationSource": "ReleaseNew", "IntegrateJiraWorkItems": "false", "IntegrateBoardsWorkItems": false }, "releaseNameFormat": "Release-$(rev:r)", "description": "" } To deploy the webapp, please refer to Deploy your Web Deploy package to IIS servers using WinRM and Deploy an Azure Web App for details.
Commit Status not working with Continuous Deployment Trigger in Azure Release via API
We have an Azure Repository which triggers a Release-Pipeline every time something is pushed to the main branch. When a Release is triggered it shows its status (succeeded) on the right side in the commits in Azure Repos like on the following Picture: It even shows which stage is already promoted etc. which is awesome. This all works fine when configuring the Release Pipeline Manually with the following CD-Trigger Configuration: Even when exporting the Pipeline JSON file and reimporting it everything works as expected. However, when creating the Release with the exact same Settings via API i don't see the Status of the Release. The trigger itself works as expected but the status in the commits is simply not there: Does someone know which exact Setting in the Release-Pipeline.json is responsible for this status? Here are some parts of the json body I send via API which might be missing something? Edit: A few more information needed i guess. I use a cli-tool to create the body and send the api request. The values are templated. The template gets its values either from previous api calls or from user inputs. Here is the complete template. I created it based on the manually configured relase-pipeline JSON (Which works fine and shows the status i want). { "name": "{{.BuildProjectName}}/{{.BuildServiceName}}", "path": "\\", "isDeleted": false, "source": "restApi", "releaseNameFormat": "{{.BuildServiceName}}-$(rev:r)", "properties": { "DefinitionCreationSource": { "$type": "System.String", "$value": "ReleaseNew" }, "IntegrateBoardsWorkItems": { "$type": "System.String", "$value": "False" }, "IntegrateJiraWorkItems": { "$type": "System.String", "$value": "false" } }, "artifacts": [ { "sourceId": "{{.BuildProjectID}}:{{.BuildRepoID}}", "type": "Git", "alias": "BuildRepo", "definitionReference": { "branches": { "id": "{{.BuildRepoDefaultBranch}}", "name": "{{.BuildRepoDefaultBranch}}" }, "checkoutNestedSubmodules": { "id": "True", "name": "Any nested submodules within" }, "defaultVersionType": { "id": "latestFromBranchType", "name": "Latest from the default branch" }, "definition": { "id": "{{.BuildRepoID}}", "name": "{{.BuildServiceName}}" }, "project": { "id": "{{.BuildProjectID}}", "name": "{{.BuildProjectName}}" } }, "isPrimary": true, "isRetained": false }, { "type": "Git", "alias": "FluxDeployScript", "definitionReference": { "branches": { "id": "master", "name": "master" }, "checkoutNestedSubmodules": { "id": "True", "name": "Any nested submodules within" }, "defaultVersionType": { "id": "latestFromBranchType", "name": "Latest from the default branch" }, "definition": { "id": "black-washed", "name": "azure-pipeline-templates" }, "project": { "id": "black-washed", "name": "Operations" } }, "isRetained": false }, { "type": "Build", "alias": "BuildPipeline", "definitionReference": { "defaultVersionType": { "id": "latestType", "name": "Latest" }, "definition": { "id": "{{.BuildPipelineID}}", "name": "{{.BuildServiceName}}" }, "IsMultiDefinitionType": { "id": "False", "name": "False" }, "project": { "id": "{{.BuildProjectID}}", "name": "{{.BuildProjectName}}" } }, "isRetained": false } ], "environments": [ { "name": "dev", "rank": 1, "conditions": [ { "name": "ReleaseStarted", "conditionType": 1, "value": "" } ], "deployPhases": [ { "rank": 1, "phaseType": 1, "name": "Agent job", "refName": null, "deploymentInput": { "queueId": "{{.QueueID}}", "agentSpecification": { "identifier": "ubuntu-20.04" } }, "workflowTasks": [ { "environment": {}, "taskId": "2a6ca863-f2ce-4f4d-8bcb-15e64608ec4b", "version": "1.*", "name": "Download flux creds", "refName": "fluxCreds", "enabled": true, "alwaysRun": false, "continueOnError": false, "timeoutInMinutes": 0, "definitionType": "task", "overrideInputs": {}, "condition": "succeeded()", "inputs": { "secureFile": "black-washed", "retryCount": "8", "socketTimeout": "" } }, { "environment": { "USER_EMAIL": "{{.ApproverMail}}", "ENVIRONMENT": "$(Release.EnvironmentName)", "DESCRIPTION": "$(Release.ReleaseDescription)", "URL": "$(Release.ReleaseWebURL)", "PROJECT": "{{.BuildProjectName}}", "CONTAINER": "{{.BuildServiceName}}", "TAG": "$(Release.Artifacts.BuildPipeline.BuildNumber)", "REPOSITORY": "finodigital.azurecr.io", "WORKLOAD_TYPE": "deployment", "NAMESPACE": "{{.BuildProjectName}}", "WORKLOAD_NAME": "{{.BuildProjectName}}-{{.BuildServiceName}}", "USER_NAME": "{{.ApproverName}}", "FLUX_CREDS": "$(fluxCreds.secureFilePath)" }, "taskId": "6c731c3c-3c68-459a-a5c9-bde6e6595b5b", "version": "3.*", "name": "Bash Script", "refName": "", "enabled": true, "alwaysRun": false, "continueOnError": false, "timeoutInMinutes": 0, "definitionType": "task", "overrideInputs": {}, "condition": "succeeded()", "inputs": { "targetType": "filePath", "filePath": "$(System.DefaultWorkingDirectory)/FluxDeployScript/flux-release.sh", "arguments": "", "workingDirectory": "", "failOnStderr": "false", "noProfile": "true", "noRc": "true" } } ] } ], "retentionPolicy": { "daysToKeep": 30, "releasesToKeep": 3, "retainBuild": true }, "preDeployApprovals": { "approvals": [ { "rank": 1, "isAutomated": true, "isNotificationOn": false } ], "approvalOptions": { "requiredApproverCount": null, "releaseCreatorCanBeApprover": false, "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, "enforceIdentityRevalidation": false, "timeoutInMinutes": 0, "executionOrder": 1 } }, "postDeployApprovals": { "approvals": [ { "rank": 1, "isAutomated": true, "isNotificationOn": false } ], "approvalOptions": { "requiredApproverCount": null, "releaseCreatorCanBeApprover": false, "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, "enforceIdentityRevalidation": false, "timeoutInMinutes": 0, "executionOrder": 2 } } }, { "name": "test", "rank": 2, "conditions": [ { "name": "dev", "conditionType": 2, "value": "4" } ], "deployPhases": [ { "rank": 1, "phaseType": 1, "name": "Agent job", "refName": null, "deploymentInput": { "queueId": "{{.QueueID}}", "agentSpecification": { "identifier": "ubuntu-20.04" } }, "workflowTasks": [ { "environment": {}, "taskId": "2a6ca863-f2ce-4f4d-8bcb-15e64608ec4b", "version": "1.*", "name": "Download flux creds", "refName": "fluxCreds", "enabled": true, "alwaysRun": false, "continueOnError": false, "timeoutInMinutes": 0, "definitionType": "task", "overrideInputs": {}, "condition": "succeeded()", "inputs": { "secureFile": "black-washed", "retryCount": "8", "socketTimeout": "" } }, { "environment": { "USER_EMAIL": "{{.ApproverMail}}", "ENVIRONMENT": "$(Release.EnvironmentName)", "DESCRIPTION": "$(Release.ReleaseDescription)", "URL": "$(Release.ReleaseWebURL)", "PROJECT": "{{.BuildProjectName}}", "CONTAINER": "{{.BuildServiceName}}", "TAG": "$(Release.Artifacts.BuildPipeline.BuildNumber)", "REPOSITORY": "finodigital.azurecr.io", "WORKLOAD_TYPE": "deployment", "NAMESPACE": "{{.BuildProjectName}}", "WORKLOAD_NAME": "{{.BuildProjectName}}-{{.BuildServiceName}}", "USER_NAME": "{{.ApproverName}}", "FLUX_CREDS": "$(fluxCreds.secureFilePath)" }, "taskId": "6c731c3c-3c68-459a-a5c9-bde6e6595b5b", "version": "3.*", "name": "Bash Script", "refName": "", "enabled": true, "alwaysRun": false, "continueOnError": false, "timeoutInMinutes": 0, "definitionType": "task", "overrideInputs": {}, "condition": "succeeded()", "inputs": { "targetType": "filePath", "filePath": "$(System.DefaultWorkingDirectory)/FluxDeployScript/flux-release.sh", "arguments": "", "workingDirectory": "", "failOnStderr": "false", "noProfile": "true", "noRc": "true" } } ] } ], "retentionPolicy": { "daysToKeep": 30, "releasesToKeep": 3, "retainBuild": true }, "preDeployApprovals": { "approvals": [ { "rank": 1, "isAutomated": false, "isNotificationOn": false, "approver": { "displayName": null, "id": "{{.ApproverID}}" } } ], "approvalOptions": { "requiredApproverCount": null, "releaseCreatorCanBeApprover": false, "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, "enforceIdentityRevalidation": false, "timeoutInMinutes": 0, "executionOrder": 1 } }, "postDeployApprovals": { "approvals": [ { "rank": 1, "isAutomated": true, "isNotificationOn": false } ], "approvalOptions": { "requiredApproverCount": null, "releaseCreatorCanBeApprover": false, "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, "enforceIdentityRevalidation": false, "timeoutInMinutes": 0, "executionOrder": 2 } } }, { "name": "prod", "rank": 3, "conditions": [ { "name": "test", "conditionType": 2, "value": "4" } ], "deployPhases": [ { "rank": 1, "phaseType": 1, "name": "Agent job", "refName": null, "deploymentInput": { "queueId": "{{.QueueID}}", "agentSpecification": { "identifier": "ubuntu-20.04" } }, "workflowTasks": [ { "environment": {}, "taskId": "2a6ca863-f2ce-4f4d-8bcb-15e64608ec4b", "version": "1.*", "name": "Download flux creds", "refName": "fluxCreds", "enabled": true, "alwaysRun": false, "continueOnError": false, "timeoutInMinutes": 0, "definitionType": "task", "overrideInputs": {}, "condition": "succeeded()", "inputs": { "secureFile": "black-wahsed", "retryCount": "8", "socketTimeout": "" } }, { "environment": { "USER_EMAIL": "{{.ApproverMail}}", "ENVIRONMENT": "$(Release.EnvironmentName)", "DESCRIPTION": "$(Release.ReleaseDescription)", "URL": "$(Release.ReleaseWebURL)", "PROJECT": "{{.BuildProjectName}}", "CONTAINER": "{{.BuildServiceName}}", "TAG": "$(Release.Artifacts.BuildPipeline.BuildNumber)", "REPOSITORY": "finodigital.azurecr.io", "WORKLOAD_TYPE": "deployment", "NAMESPACE": "{{.BuildProjectName}}", "WORKLOAD_NAME": "{{.BuildProjectName}}-{{.BuildServiceName}}", "USER_NAME": "{{.ApproverName}}", "FLUX_CREDS": "$(fluxCreds.secureFilePath)" }, "taskId": "6c731c3c-3c68-459a-a5c9-bde6e6595b5b", "version": "3.*", "name": "Bash Script", "refName": "", "enabled": true, "alwaysRun": false, "continueOnError": false, "timeoutInMinutes": 0, "definitionType": "task", "overrideInputs": {}, "condition": "succeeded()", "inputs": { "targetType": "filePath", "filePath": "$(System.DefaultWorkingDirectory)/FluxDeployScript/flux-release.sh", "arguments": "", "workingDirectory": "", "failOnStderr": "false", "noProfile": "true", "noRc": "true" } } ] } ], "retentionPolicy": { "daysToKeep": 30, "releasesToKeep": 3, "retainBuild": true }, "preDeployApprovals": { "approvals": [ { "rank": 1, "isAutomated": false, "isNotificationOn": false, "approver": { "displayName": null, "id": "{{.ApproverID}}" } } ], "approvalOptions": { "requiredApproverCount": null, "releaseCreatorCanBeApprover": false, "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, "enforceIdentityRevalidation": false, "timeoutInMinutes": 0, "executionOrder": 1 } }, "postDeployApprovals": { "approvals": [ { "rank": 1, "isAutomated": true, "isNotificationOn": false } ], "approvalOptions": { "requiredApproverCount": null, "releaseCreatorCanBeApprover": false, "autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false, "enforceIdentityRevalidation": false, "timeoutInMinutes": 0, "executionOrder": 2 } } } ], "triggers": [ { "branchFilters": [ "{{.BuildRepoDefaultBranch}}" ], "alias": "BuildRepo", "triggerType": 3 } ]
According to your description, I tested it and everything works as expected. Steps: Get the release definition via the REST API Definitions - Get and copy the response body. GET https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/definitions/{definitionId}?api-version=6.1-preview.4 Create the new release pipeline via the REST API Definitions - Create POST https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/definitions?api-version=6.1-preview.4 Copy the response body and rename the field name to New release pipeline2, then mark it as request body. I am using PostMan. Result: Update1 It seems that you are missing the field environmentOptions field in the request body, which contains publishDeploymentStatus, which controls the feature you are missing. If you do not configure it or set the value to false, you will not see the Status of the Release in the commit page. "environmentOptions": { "emailNotificationType": "OnlyOnFailure", "emailRecipients": "release.environment.owner;release.creator", "skipArtifactsDownload": false, "timeoutInMinutes": 0, "enableAccessToken": false, "publishDeploymentStatus": false, "badgeEnabled": false, "autoLinkWorkItems": false, "pullRequestDeploymentEnabled": false }, Result:
Post grafana dashboard to particular folder
I am trying to use the grafana API to post dashboards to a specific folder. Using the following command, I can see the folder ID's for all folders in my grafana: curl -X GET http://<username>:<password>#localhost:3000/api/folders?limit=200 [{"id":9,"uid":"6m0M3AZZk","title":"Apps"},{"id":38,"uid":"jEJ5aSVZz","title":"Cluster_Health"},{"id":31,"uid":"vsmJ2dGZz","title":"CPU by App"},{"id":51,"uid":"Fx9ajQXWz","title":"Data Pipeline"},{"id":6,"uid":"dYFMMhZWz","title":"home"},{"id":19,"uid":"qDwG6yWZz","title":"Node_Health"},{"id":18,"uid":"37pWeyWZk","title":"Pending_Data"},{"id":44,"uid":"nreWbxfWz","title":"Prod"},{"id":13,"uid":"PYzEBYZWk","title":"Services"},{"id":27,"uid":"byVe4IMWk","title":"API"}] Now, I would like to post a dashboard to my Services folder (id 13). However, when I make my request, this dashboard is always going to the General folder. I am using a python script to make my request: def post_dashboard(filepath): with open(filepath, "r") as fin: data = json.loads(fin.read()) data = json.dumps(data) response = requests.post("http://localhost:3000/api/dashboards/db", headers=headers_raw, data=data) print(response.json()) print(response.status_code) My JSON file looks like this: {"dashboard": { "annotations": { "list": [ { "builtIn": 1, "datasource": "-- Grafana --", "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "type": "dashboard" } ] }, "editable": true, "gnetId": null, "graphTooltip": 0, "id": null, "iteration": 1593098750052, "links": [], "panels": [ { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "Prometheus-1", "description": "The amount of CPU taken up by redis from top command", "fill": 0, "gridPos": { "h": 8, "w": 24, "x": 0, "y": 0 }, "id": 10, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "app_cpu{node_type=\"process\", cluster_id=~\"$cluster\", app_name=~\".*redisserver.*\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{ host_name }}", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "CPU Used", "tooltip": { "shared": true, "sort": 2, "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": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "Prometheus-1", "description": "The current amount of memory redis is consuming", "fill": 0, "gridPos": { "h": 9, "w": 12, "x": 0, "y": 8 }, "id": 2, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "redis_mem_used{cluster_id=~\"$cluster\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{ node }}", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Redis Memory Used", "tooltip": { "shared": true, "sort": 2, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "decbytes", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "Prometheus-1", "description": "The maximum amount of memory that redis has used", "fill": 0, "gridPos": { "h": 9, "w": 12, "x": 12, "y": 8 }, "id": 4, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "redis_mem_peak{cluster_id=~\"$cluster\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{ node }}", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Redis Peak Memory", "tooltip": { "shared": true, "sort": 2, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "decbytes", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "Prometheus-1", "description": "The amount of memory used by the LUA engine inside of redis", "fill": 0, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 17 }, "id": 6, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "redis_mem_lua{cluster_id=~\"$cluster\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{ node }}", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "LUA Mem Used", "tooltip": { "shared": true, "sort": 2, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "decbytes", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": "Prometheus-1", "description": "The amount of memory used as observed by top", "fill": 0, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 17 }, "id": 8, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "redis_mem_rss{cluster_id=~\"$cluster\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{ node }}", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "RSS Mem Used", "tooltip": { "shared": true, "sort": 2, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "decbytes", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } } ], "schemaVersion": 18, "style": "dark", "tags": [], "templating": { "list": [ { "allValue": null, "current": {}, "datasource": "Prometheus-1", "definition": "label_values(redis_mem_used, cluster_id)", "hide": 0, "includeAll": true, "label": null, "multi": true, "name": "cluster", "options": [], "query": "label_values(redis_mem_used, cluster_id)", "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "tagValuesQuery": "", "tags": [], "tagsQuery": "", "type": "query", "useTags": false } ] }, "time": { "from": "now-6h", "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": "", "title": "Redis", "uid": "rfdsk32", "folder": "Services", "folderTitle": "Services", "folderId": 13, "overwrite": true } } My grafana version is 6.2.0. I have used several references that say that folderId should be the controlling keyword for which folder a dashboard goes to. https://grafana.com/docs/grafana/latest/http_api/dashboard/#create-update-dashboard
You have used wrong payload structure: { "dashboard": { ... "folderId": 13, "overwrite": true } } Correct structure is: { "dashboard": { ... }, "folderId": 13, "overwrite": true }
while consuming from kafka in druid, roll up merges two rows to 1 instead of adding them
I trying to use druid to consume events from kafka, however when I'm using roll-up to consume the data, the number of events seem to coming in wrong. without roll-up the numbers are accurate. I am using Druid 0.17.1. i have observed that while roll up is happening instead of aggregating the events to n it aggregates to 1. here is my ingestion spec { "dataSchema": { "dataSource": "notificationstatus", "timestampSpec": { "column": "date", "format": "yyyy-MM-dd-HH:mm:ss Z", "missingValue": null }, "dimensionsSpec": { "dimensions": [{ "type": "string", "name": "Process", "multiValueHandling": "SORTED_ARRAY", "createBitmapIndex": true }, { "type": "string", "name": "Channel", "multiValueHandling": "SORTED_ARRAY", "createBitmapIndex": true }, { "type": "string", "name": "Status", "multiValueHandling": "SORTED_ARRAY", "createBitmapIndex": true }, { "type": "string", "name": "Message", "multiValueHandling": "SORTED_ARRAY", "createBitmapIndex": true }, { "type": "string", "name": "CampaignID", "multiValueHandling": "SORTED_ARRAY", "createBitmapIndex": true }, { "type": "string", "name": "BannerID", "multiValueHandling": "SORTED_ARRAY", "createBitmapIndex": true } ], "dimensionExclusions": [ "date", "count" ] }, "metricsSpec": [{ "type": "count", "name": "count" }], "granularitySpec": { "type": "uniform", "segmentGranularity": "HOUR", "queryGranularity": "MINUTE", "rollup": true, "intervals": null }, "transformSpec": { "filter": { "type": "not", "field": { "type": "like", "dimension": "Status", "pattern": "INFO", "escape": null, "extractionFn": null } }, "transforms": [] } }, "ioConfig": { "topic": "notificationstatus", "inputFormat": { "type": "tsv", "columns": [ "source", "ymd", "date", "Process", "deviceID", "Channel", "CampaignID", "BannerID", "Status", "Message", "11", "12" ], "listDelimiter": null, "delimiter": "\t", "findColumnsFromHeader": false, "skipHeaderRows": 0 }, "replicas": 1, "taskCount": 1, "taskDuration": "PT3600S", "consumerProperties": {}, "pollTimeout": 100, "startDelay": "PT5S", "period": "PT30S", "useEarliestOffset": false, "completionTimeout": "PT1800S", "lateMessageRejectionPeriod": null, "earlyMessageRejectionPeriod": null, "lateMessageRejectionStartDateTime": null, "stream": "notificationstatus", "useEarliestSequenceNumber": false, "type": "kafka" }, "tuningConfig": { "type": "kafka", "maxRowsInMemory": 1000000, "maxBytesInMemory": 0, "maxRowsPerSegment": 5000000, "maxTotalRows": null, "intermediatePersistPeriod": "PT10M", "basePersistDirectory": "/home/akash/Downloads/druidVer/apache-druid-0.17.1/var/tmp/druid-realtime-persist622909873559398926", "maxPendingPersists": 0, "indexSpec": { "bitmap": { "type": "concise" }, "dimensionCompression": "lz4", "metricCompression": "lz4", "longEncoding": "longs" }, "indexSpecForIntermediatePersists": { "bitmap": { "type": "concise" }, "dimensionCompression": "lz4", "metricCompression": "lz4", "longEncoding": "longs" }, "buildV9Directly": true, "reportParseExceptions": false, "handoffConditionTimeout": 0, "resetOffsetAutomatically": false, "segmentWriteOutMediumFactory": null, "workerThreads": null, "chatThreads": null, "chatRetries": 8, "httpTimeout": "PT10S", "shutdownTimeout": "PT80S", "offsetFetchPeriod": "PT30S", "intermediateHandoffPeriod": "P2147483647D", "logParseExceptions": false, "maxParseExceptions": 2147483647, "maxSavedParseExceptions": 0, "skipSequenceNumberAvailabilityCheck": false, "repartitionTransitionDuration": "PT120S" }, "type": "kafka" }