diff --git a/Makefile b/Makefile index 25b9444..ec07c17 100644 --- a/Makefile +++ b/Makefile @@ -200,7 +200,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest ## Tool Versions KUSTOMIZE_VERSION ?= v3.8.7 -CONTROLLER_TOOLS_VERSION ?= v0.11.1 +CONTROLLER_TOOLS_VERSION ?= v0.14.0 KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" .PHONY: kustomize diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index f1eea7a..2b8286d 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2023 The Perses Authors. diff --git a/config/crd/bases/perses.dev_perses.yaml b/config/crd/bases/perses.dev_perses.yaml index 69966e3..f1b2bb5 100644 --- a/config/crd/bases/perses.dev_perses.yaml +++ b/config/crd/bases/perses.dev_perses.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.14.0 name: perses.perses.dev spec: group: perses.dev @@ -21,14 +20,19 @@ spec: description: Perses is the Schema for the perses API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -248,9 +252,10 @@ spec: datasources_path: type: string interval: - description: Duration wraps time.Duration. It is used to parse - the custom duration format from YAML. This type should not - propagate beyond the scope of input/output processing. + description: |- + Duration wraps time.Duration. It is used to parse the custom duration format + from YAML. + This type should not propagate beyond the scope of input/output processing. format: int64 type: integer panels_path: @@ -275,9 +280,9 @@ spec: format: int64 type: integer disable_sign_up: - description: DisableSignUp deactivates the Sign-up page - in the UI. It also disables the endpoint that gives - the possibility to create a user. + description: |- + DisableSignUp deactivates the Sign-up page in the UI. + It also disables the endpoint that gives the possibility to create a user. type: boolean providers: description: Providers configure the different authentication @@ -450,10 +455,10 @@ spec: - enable_native type: object refresh_token_ttl: - description: RefreshTokenTTL is the time to live of the - refresh token. The refresh token is used to get a new - access token when it is expired. By default, it is 24 - hours. + description: |- + RefreshTokenTTL is the time to live of the refresh token. + The refresh token is used to get a new access token when it is expired. + By default, it is 24 hours. format: int64 type: integer required: @@ -482,9 +487,9 @@ spec: type: string type: array scopes: - description: 'The list of kind targeted by the permission. - For example: `Datasource`, `Dashboard`, ... With - Role, you can''t target global kinds' + description: |- + The list of kind targeted by the permission. For example: `Datasource`, `Dashboard`, ... + With Role, you can't target global kinds items: type: string type: array @@ -495,17 +500,17 @@ spec: type: array type: object enable_auth: - description: When it is true, the authentication and authorization - config are considered. And you will need a valid JWT token - to contact most of the endpoints exposed by the API + description: |- + When it is true, the authentication and authorization config are considered. + And you will need a valid JWT token to contact most of the endpoints exposed by the API type: boolean encryption_key: - description: EncryptionKey is the secret key used to encrypt - and decrypt sensitive data stored in the database such as - the password of the basic auth for a datasource. Note that - if it is not provided, it will use a default value. On a - production instance, you should set this key. Also note - the key must be at least 32 bytes long. + description: |- + EncryptionKey is the secret key used to encrypt and decrypt sensitive data + stored in the database such as the password of the basic auth for a datasource. + Note that if it is not provided, it will use a default value. + On a production instance, you should set this key. + Also note the key must be at least 32 bytes long. type: string encryption_key_file: description: EncryptionKeyFile is the path to file containing @@ -532,42 +537,42 @@ spec: conditions: items: description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - \n type FooStatus struct{ // Represents the observations of a - foo's current state. // Known .status.conditions.type are: \"Available\", - \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge - // +listType=map // +listMapKey=type Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + state of this API Resource.\n---\nThis struct is intended for + direct use as an array at the field path .status.conditions. For + example,\n\n\n\ttype FooStatus struct{\n\t // Represents the + observations of a foo's current state.\n\t // Known .status.conditions.type + are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // + +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t + \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" + patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t + \ // other fields\n\t}" properties: lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should be when - the underlying condition changed. If that is not known, then - using the time when the API field changed is acceptable. + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. format: date-time type: string message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. maxLength: 32768 type: string observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. format: int64 minimum: 0 type: integer reason: - description: reason contains a programmatic identifier indicating - the reason for the condition's last transition. Producers - of specific condition types may define expected values and - meanings for this field, and whether the values are considered - a guaranteed API. The value should be a CamelCase string. + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. This field may not be empty. maxLength: 1024 minLength: 1 @@ -581,11 +586,12 @@ spec: - Unknown type: string type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + description: |- + type of condition in CamelCase or in foo.example.com/CamelCase. + --- + Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be + useful (see .node.status.conditions), the ability to deconflict is important. + The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string diff --git a/config/crd/bases/perses.dev_persesdashboards.yaml b/config/crd/bases/perses.dev_persesdashboards.yaml index 8801c26..5880d6a 100644 --- a/config/crd/bases/perses.dev_persesdashboards.yaml +++ b/config/crd/bases/perses.dev_persesdashboards.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.14.0 name: persesdashboards.perses.dev spec: group: perses.dev @@ -21,14 +20,19 @@ spec: description: PersesDashboard is the Schema for the persesdashboards API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -47,7 +51,8 @@ spec: type: string type: object plugin: - description: Plugin will contain the datasource configuration. + description: |- + Plugin will contain the datasource configuration. The data typed is available in Cue. properties: kind: @@ -178,42 +183,42 @@ spec: conditions: items: description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - \n type FooStatus struct{ // Represents the observations of a - foo's current state. // Known .status.conditions.type are: \"Available\", - \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge - // +listType=map // +listMapKey=type Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + state of this API Resource.\n---\nThis struct is intended for + direct use as an array at the field path .status.conditions. For + example,\n\n\n\ttype FooStatus struct{\n\t // Represents the + observations of a foo's current state.\n\t // Known .status.conditions.type + are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // + +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t + \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" + patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t + \ // other fields\n\t}" properties: lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should be when - the underlying condition changed. If that is not known, then - using the time when the API field changed is acceptable. + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. format: date-time type: string message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. maxLength: 32768 type: string observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. format: int64 minimum: 0 type: integer reason: - description: reason contains a programmatic identifier indicating - the reason for the condition's last transition. Producers - of specific condition types may define expected values and - meanings for this field, and whether the values are considered - a guaranteed API. The value should be a CamelCase string. + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. This field may not be empty. maxLength: 1024 minLength: 1 @@ -227,11 +232,12 @@ spec: - Unknown type: string type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + description: |- + type of condition in CamelCase or in foo.example.com/CamelCase. + --- + Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be + useful (see .node.status.conditions), the ability to deconflict is important. + The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string diff --git a/config/crd/bases/perses.dev_persesdatasources.yaml b/config/crd/bases/perses.dev_persesdatasources.yaml index 502fd1e..953bb5c 100644 --- a/config/crd/bases/perses.dev_persesdatasources.yaml +++ b/config/crd/bases/perses.dev_persesdatasources.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.14.0 name: persesdatasources.perses.dev spec: group: perses.dev @@ -21,14 +20,19 @@ spec: description: PersesDatasource is the Schema for the PersesDatasources API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -44,8 +48,9 @@ spec: type: string type: object plugin: - description: Plugin will contain the datasource configuration. The - data typed is available in Cue. + description: |- + Plugin will contain the datasource configuration. + The data typed is available in Cue. properties: kind: type: string @@ -65,42 +70,42 @@ spec: conditions: items: description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - \n type FooStatus struct{ // Represents the observations of a - foo's current state. // Known .status.conditions.type are: \"Available\", - \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge - // +listType=map // +listMapKey=type Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + state of this API Resource.\n---\nThis struct is intended for + direct use as an array at the field path .status.conditions. For + example,\n\n\n\ttype FooStatus struct{\n\t // Represents the + observations of a foo's current state.\n\t // Known .status.conditions.type + are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // + +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t + \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" + patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t + \ // other fields\n\t}" properties: lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should be when - the underlying condition changed. If that is not known, then - using the time when the API field changed is acceptable. + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. format: date-time type: string message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. maxLength: 32768 type: string observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. format: int64 minimum: 0 type: integer reason: - description: reason contains a programmatic identifier indicating - the reason for the condition's last transition. Producers - of specific condition types may define expected values and - meanings for this field, and whether the values are considered - a guaranteed API. The value should be a CamelCase string. + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. This field may not be empty. maxLength: 1024 minLength: 1 @@ -114,11 +119,12 @@ spec: - Unknown type: string type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + description: |- + type of condition in CamelCase or in foo.example.com/CamelCase. + --- + Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be + useful (see .node.status.conditions), the ability to deconflict is important. + The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml index 7711b08..e7bba64 100644 --- a/config/samples/kustomization.yaml +++ b/config/samples/kustomization.yaml @@ -1,4 +1,6 @@ ## Append samples you want in your CSV to this file as resources ## resources: - - v1alpha1_perses.yaml + - perses.dev_v1alpha1_perses.yaml + - perses.dev_v1alpha1_persesdashboard.yaml + - perses.dev_v1alpha1_persesdatasource.yaml #+kubebuilder:scaffold:manifestskustomizesamples diff --git a/config/samples/perses.dev_v1alpha1_persesdashboard-2.yaml b/config/samples/perses.dev_v1alpha1_persesdashboard-2.yaml deleted file mode 100644 index 08a39b6..0000000 --- a/config/samples/perses.dev_v1alpha1_persesdashboard-2.yaml +++ /dev/null @@ -1,563 +0,0 @@ -apiVersion: perses.dev/v1alpha1 -kind: PersesDashboard -metadata: - labels: - app.kubernetes.io/name: perses-dashboard-2 - app.kubernetes.io/instance: perses-dashboard-sample-2 - app.kubernetes.io/part-of: perses-operator - app.kubernetes.io/managed-by: kustomize - app.kubernetes.io/created-by: perses-operator - name: perses-dashboard-sample-2 -spec: - kind: Dashboard - metadata: - name: Demo-2 - project: default - createdAt: "2021-11-09T00:00:00Z" - updatedAt: "2021-11-09T00:00:00Z" - version: 0 - spec: - duration: 5m - variables: - - kind: ListVariable - spec: - name: job - allowMultiple: false - allowAllValue: false - plugin: - kind: PrometheusLabelValuesVariable - spec: - labelName: job - - kind: ListVariable - spec: - name: instance - allowMultiple: false - allowAllValue: false - plugin: - kind: PrometheusLabelValuesVariable - spec: - labelName: instance - matchers: - - up{job=~"$job"} - - kind: ListVariable - spec: - name: interval - plugin: - kind: StaticListVariable - spec: - values: - - 1m - - 5m - - kind: TextVariable - spec: - name: text - value: test - constant: true - panels: - defaultTimeSeriesChart: - kind: Panel - spec: - display: - name: Default Time Series Panel - plugin: - kind: TimeSeriesChart - spec: {} - queries: - - kind: TimeSeriesQuery - spec: - plugin: - kind: PrometheusTimeSeriesQuery - spec: - query: up - seriesTest: - kind: Panel - spec: - display: - name: "~130 Series" - description: This is a line chart - plugin: - kind: TimeSeriesChart - spec: - yAxis: - format: - unit: bytes - shortValues: true - queries: - - kind: TimeSeriesQuery - spec: - plugin: - kind: PrometheusTimeSeriesQuery - spec: - query: rate(caddy_http_response_duration_seconds_sum[$interval]) - basicEx: - kind: Panel - spec: - display: - name: Single Query - plugin: - kind: TimeSeriesChart - spec: - yAxis: - format: - unit: decimal - legend: - position: right - queries: - - kind: TimeSeriesQuery - spec: - plugin: - kind: PrometheusTimeSeriesQuery - spec: - seriesNameFormat: Node memory - {{device}} {{instance}} - query: - 1 - node_filesystem_free_bytes{job='$job',instance=~'$instance',fstype!="rootfs",mountpoint!~"/(run|var).*",mountpoint!=""} - / node_filesystem_size_bytes{job='$job',instance=~'$instance'} - legendEx: - kind: Panel - spec: - display: - name: Legend Example - plugin: - kind: TimeSeriesChart - spec: - legend: - position: bottom - yAxis: - show: true - format: - unit: bytes - shortValues: true - queries: - - kind: TimeSeriesQuery - spec: - plugin: - kind: PrometheusTimeSeriesQuery - spec: - seriesNameFormat: Node memory total - query: - node_memory_MemTotal_bytes{job='$job',instance=~'$instance'} - - node_memory_MemFree_bytes{job='$job',instance=~'$instance'} - - node_memory_Buffers_bytes{job='$job',instance=~'$instance'} - node_memory_Cached_bytes{job='$job',instance=~'$instance'} - - kind: TimeSeriesQuery - spec: - plugin: - kind: PrometheusTimeSeriesQuery - spec: - seriesNameFormat: Memory (buffers) - {{instance}} - query: node_memory_Buffers_bytes{job='$job',instance=~'$instance'} - - kind: TimeSeriesQuery - spec: - plugin: - kind: PrometheusTimeSeriesQuery - spec: - seriesNameFormat: Cached Bytes - query: node_memory_Cached_bytes{job='$job',instance=~'$instance'} - - kind: TimeSeriesQuery - spec: - plugin: - kind: PrometheusTimeSeriesQuery - spec: - seriesNameFormat: MemFree Bytes - query: node_memory_MemFree_bytes{job='$job',instance=~'$instance'} - testNodeQuery: - kind: Panel - spec: - display: - name: Test Query - description: Description text - plugin: - kind: TimeSeriesChart - spec: - yAxis: - format: - unit: decimal - decimalPlaces: 2 - legend: - position: right - queries: - - kind: TimeSeriesQuery - spec: - plugin: - kind: PrometheusTimeSeriesQuery - spec: - query: node_load15{instance=~"(demo.do.prometheus.io:9100)",job='$job'} - seriesNameFormat: Test {{job}} {{instance}} - testQueryAlt: - kind: Panel - spec: - display: - name: Test Query Alt - description: Description text - plugin: - kind: TimeSeriesChart - spec: - legend: - position: right - yAxis: - format: - unit: percent-decimal - decimalPlaces: 1 - thresholds: - steps: - - value: 0.4 - name: "Alert: Warning condition example" - - value: 0.75 - name: "Alert: Critical condition example" - queries: - - kind: TimeSeriesQuery - spec: - plugin: - kind: PrometheusTimeSeriesQuery - spec: - query: node_load1{instance=~"(demo.do.prometheus.io:9100)",job='$job'} - cpuLine: - kind: Panel - spec: - display: - name: CPU - Line (Multi Series) - description: This is a line chart test - plugin: - kind: TimeSeriesChart - spec: - yAxis: - show: false - label: CPU Label - format: - unit: percent-decimal - decimalPlaces: 0 - legend: - position: bottom - thresholds: - steps: - - value: 0.2 - - value: 0.35 - queries: - - kind: TimeSeriesQuery - spec: - plugin: - kind: PrometheusTimeSeriesQuery - spec: - seriesNameFormat: "{{mode}} mode - {{job}} {{instance}}" - query: avg without (cpu)(rate(node_cpu_seconds_total{job='$job',instance=~'$instance',mode!="nice",mode!="steal",mode!="irq"}[$interval])) - cpuGauge: - kind: Panel - spec: - display: - name: CPU - Gauge (Multi Series) - description: This is a gauge chart test - plugin: - kind: GaugeChart - spec: - calculation: last-number - format: - unit: percent-decimal - thresholds: - steps: - - value: 0.2 - - value: 0.35 - queries: - - kind: TimeSeriesQuery - spec: - plugin: - kind: PrometheusTimeSeriesQuery - spec: - seriesNameFormat: "{{mode}} mode - {{job}} {{instance}}" - query: avg without (cpu)(rate(node_cpu_seconds_total{job='$job',instance=~'$instance',mode!="nice",mode!="steal",mode!="irq"}[$interval])) - statSm: - kind: Panel - spec: - display: - name: Stat Sm - plugin: - kind: StatChart - spec: - calculation: mean - format: - unit: decimal - decimalPlaces: 1 - shortValues: true - queries: - - kind: TimeSeriesQuery - spec: - plugin: - kind: PrometheusTimeSeriesQuery - spec: - query: node_time_seconds{job='$job',instance=~'$instance'} - node_boot_time_seconds{job='$job',instance=~'$instance'} - gaugeRAM: - kind: Panel - spec: - display: - name: RAM Used - description: This is a stat chart - plugin: - kind: GaugeChart - spec: - calculation: last-number - format: - unit: percent - thresholds: - steps: - - value: 85 - - value: 95 - queries: - - kind: TimeSeriesQuery - spec: - plugin: - kind: PrometheusTimeSeriesQuery - spec: - query: - 100 - ((node_memory_MemAvailable_bytes{job='$job',instance=~'$instance'} - * 100) / node_memory_MemTotal_bytes{job='$job',instance=~'$instance'}) - statRAM: - kind: Panel - spec: - display: - name: RAM Used - description: This is a stat chart - plugin: - kind: StatChart - spec: - calculation: last-number - format: - unit: percent - queries: - - kind: TimeSeriesQuery - spec: - plugin: - kind: PrometheusTimeSeriesQuery - spec: - query: - 100 - ((node_memory_MemAvailable_bytes{job='$job',instance=~'$instance'} - * 100) / node_memory_MemTotal_bytes{job='$job',instance=~'$instance'}) - statTotalRAM: - kind: Panel - spec: - display: - name: RAM Total - description: This is a stat chart - plugin: - kind: StatChart - spec: - calculation: last-number - format: - unit: bytes - decimalPlaces: 1 - queries: - - kind: TimeSeriesQuery - spec: - plugin: - kind: PrometheusTimeSeriesQuery - spec: - query: node_memory_MemTotal_bytes{job='$job',instance=~'$instance'} - statMd: - kind: Panel - spec: - display: - name: Stat Md - plugin: - kind: StatChart - spec: - calculation: sum - format: - unit: decimal - decimalPlaces: 2 - shortValues: true - sparkline: - color: "#e65013" - width: 1.5 - queries: - - kind: TimeSeriesQuery - spec: - plugin: - kind: PrometheusTimeSeriesQuery - spec: - query: - avg(node_load15{job='node',instance=~'$instance'}) / count(count(node_cpu_seconds_total{job='node',instance=~'$instance'}) - by (cpu)) * 100 - statLg: - kind: Panel - spec: - display: - name: Stat Lg - description: This is a stat chart - plugin: - kind: StatChart - spec: - calculation: mean - format: - unit: percent - queries: - - kind: TimeSeriesQuery - spec: - plugin: - kind: PrometheusTimeSeriesQuery - spec: - query: - (((count(count(node_cpu_seconds_total{job='$job',instance=~'$instance'}) - by (cpu))) - avg(sum by (mode)(rate(node_cpu_seconds_total{mode="idle",job='$job',instance=~'$instance'}[$interval])))) - * 100) / count(count(node_cpu_seconds_total{job='$job',instance=~'$instance'}) - by (cpu)) - gaugeEx: - kind: Panel - spec: - display: - name: Gauge Ex - description: This is a gauge chart - plugin: - kind: GaugeChart - spec: - calculation: last-number - format: - unit: percent - thresholds: - steps: - - value: 85 - - value: 95 - queries: - - kind: TimeSeriesQuery - spec: - plugin: - kind: PrometheusTimeSeriesQuery - spec: - query: - (((count(count(node_cpu_seconds_total{job='$job',instance=~'$instance'}) - by (cpu))) - avg(sum by (mode)(rate(node_cpu_seconds_total{mode="idle",job='$job',instance=~'$instance'}[$interval])))) - * 100) / count(count(node_cpu_seconds_total{job='$job',instance=~'$instance'}) - by (cpu)) - gaugeAltEx: - kind: Panel - spec: - display: - name: Gauge Alt Ex - description: GaugeChart description text - plugin: - kind: GaugeChart - spec: - calculation: last-number - format: - unit: percent-decimal - decimalPlaces: 1 - thresholds: - steps: - - value: 0.5 - name: "Alert: Warning condition example" - - value: 0.75 - name: "Alert: Critical condition example" - queries: - - kind: TimeSeriesQuery - spec: - plugin: - kind: PrometheusTimeSeriesQuery - spec: - query: node_load15{instance=~'$instance',job='$job'} - gaugeFormatTest: - kind: Panel - spec: - display: - name: Gauge Format Test - plugin: - kind: GaugeChart - spec: - calculation: last-number - format: - unit: bytes - max: 95000000 - thresholds: - steps: - - value: 71000000 - - value: 82000000 - queries: - - kind: TimeSeriesQuery - spec: - plugin: - kind: PrometheusTimeSeriesQuery - spec: - query: node_time_seconds{job='$job',instance=~'$instance'} - node_boot_time_seconds{job='$job',instance=~'$instance'} - layouts: - - kind: Grid - spec: - display: - title: Row 1 - collapse: - open: true - items: - - x: 0 - "y": 0 - width: 2 - height: 3 - content: - "$ref": "#/spec/panels/statRAM" - - x: 0 - "y": 4 - width: 2 - height: 3 - content: - "$ref": "#/spec/panels/statTotalRAM" - - x: 2 - "y": 0 - width: 4 - height: 6 - content: - "$ref": "#/spec/panels/statMd" - - x: 6 - "y": 0 - width: 10 - height: 6 - content: - "$ref": "#/spec/panels/statLg" - - x: 16 - "y": 0 - width: 4 - height: 6 - content: - "$ref": "#/spec/panels/gaugeFormatTest" - - x: 20 - "y": 0 - width: 4 - height: 6 - content: - "$ref": "#/spec/panels/gaugeRAM" - - kind: Grid - spec: - display: - title: Row 2 - collapse: - open: true - items: - - x: 0 - "y": 0 - width: 12 - height: 6 - content: - "$ref": "#/spec/panels/legendEx" - - x: 12 - "y": 0 - width: 12 - height: 6 - content: - "$ref": "#/spec/panels/basicEx" - - kind: Grid - spec: - display: - title: Row 3 - collapse: - open: false - items: - - x: 0 - "y": 0 - width: 24 - height: 6 - content: - "$ref": "#/spec/panels/cpuGauge" - - x: 0 - "y": 6 - width: 12 - height: 8 - content: - "$ref": "#/spec/panels/cpuLine" - - x: 12 - "y": 0 - width: 12 - height: 8 - content: - "$ref": "#/spec/panels/defaultTimeSeriesChart"