Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ resources:
- ../crd
- ../rbac
- ../manager
- ../resource-metrics
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
- ../webhook
Expand Down
20 changes: 20 additions & 0 deletions config/resource-metrics/general.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
kind: CustomResourceStateMetrics
spec:
resources:
# Creates a generic metric for all resources
- groupVersionKind:
group: compute.datumapis.com
kind: "*"
version: "*"
metricNamePrefix: "datum_cloud_resource"
labelsFromPath:
namespace: [metadata, namespace]
name: [metadata, name]
metrics:
- name: "info"
help: "Information about the resource"
each:
type: Info
info:
labelsFromPath:
uid: [metadata, uid]
41 changes: 41 additions & 0 deletions config/resource-metrics/instances.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
kind: CustomResourceStateMetrics
spec:
resources:
- groupVersionKind:
group: compute.datumapis.com
kind: Instance
version: v1alpha
metricNamePrefix: "datum_cloud_compute_instance"
labelsFromPath:
namespace: [metadata, namespace]
name: [metadata, name]
metrics:
- name: "info"
help: "Information about instance"
each:
type: Info
info:
labelsFromPath:
uid: [metadata, uid]
compute_datumapis_com_workload_deployment_uid: [metadata, labels, compute_datumapis_com_workload_deployment_uid]
compute_datumapis_com_workload_uid: [metadata, labels, compute_datumapis_com_workload_uid]
- name: "status_condition"
help: "The current status conditions of the instance"
each:
type: Gauge
gauge:
path: [status, conditions]
labelsFromPath:
condition: [type]
reason: [reason]
status: [status]
valueFrom: [status]
- name: "network_interface_info"
help: "Information about instance network interfaces"
each:
type: Info
info:
path: [status, networkInterfaces]
labelsFromPath:
network_ip: [assignments, networkIP]
external_ip: [assignments, externalIP]
14 changes: 14 additions & 0 deletions config/resource-metrics/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

configMapGenerator:
- name: workload-services-metrics
options:
labels:
telemetry.datumapis.com/resource-metrics-config: "true"

files:
- general.yaml
- instances.yaml
- workload-deployments.yaml
- workloads.yaml
31 changes: 31 additions & 0 deletions config/resource-metrics/workload-deployments.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
kind: CustomResourceStateMetrics
spec:
resources:
- groupVersionKind:
group: compute.datumapis.com
kind: WorkloadDeployment
version: v1alpha
metricNamePrefix: "datum_cloud_compute_workload_deployment"
labelsFromPath:
namespace: [metadata, namespace]
name: [metadata, name]
metrics:
- name: "info"
help: "Information about workload deployment"
each:
type: Info
info:
labelsFromPath:
uid: [metadata, uid]
compute_datumapis_com_workload_uid: [metadata, labels, compute_datumapis_com_workload_uid]
- name: "status_condition"
help: "The current status conditions of the workload deployment"
each:
type: Gauge
gauge:
path: [status, conditions]
labelsFromPath:
condition: [type]
reason: [reason]
status: [status]
valueFrom: [status]
30 changes: 30 additions & 0 deletions config/resource-metrics/workloads.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
kind: CustomResourceStateMetrics
spec:
resources:
- groupVersionKind:
group: compute.datumapis.com
kind: Workload
version: v1alpha
metricNamePrefix: "datum_cloud_compute_workload"
labelsFromPath:
namespace: [metadata, namespace]
name: [metadata, name]
metrics:
- name: "info"
help: "Information about workload"
each:
type: Info
info:
labelsFromPath:
uid: [metadata, uid]
- name: "status_condition"
help: "The current status conditions of the workload"
each:
type: Gauge
gauge:
path: [status, conditions]
labelsFromPath:
condition: [type]
reason: [reason]
status: [status]
valueFrom: [status]