Skip to content

Commit

Permalink
ENG-947: Added Persistent-Volume-Claim Flow (#44)
Browse files Browse the repository at this point in the history
* ENG-947 & ENG-1241: Removed Persistent-Volume from transformObject flow

* ENG-947: Added Persistent-Volume-Claim flow
  • Loading branch information
sanjoyment authored Feb 20, 2024
1 parent 8574cd5 commit db49257
Show file tree
Hide file tree
Showing 16 changed files with 1,061 additions and 330 deletions.
28 changes: 28 additions & 0 deletions receiver/k8sclusterreceiver/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,22 @@ The capacity of persistent volume.
| ---- | ----------- | ---------- |
| By | Gauge | Int |
### k8s.persistentvolumeclaim.allocated
The allocated capacity of persistent volume.
| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| By | Gauge | Int |
### k8s.persistentvolumeclaim.capacity
The capacity of persistent volume claim.
| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| By | Gauge | Int |
### k8s.pod.phase
Current phase of the pod (1 - Pending, 2 - Running, 3 - Succeeded, 4 - Failed, 5 - Unknown)
Expand Down Expand Up @@ -462,8 +478,20 @@ Current status reason of the pod (1 - Evicted, 2 - NodeAffinity, 3 - NodeLost, 4
| k8s.persistentvolume.type | The type of the Persistent Volume. | Any Str | true |
| k8s.persistentvolume.uid | The UID of the Persistent Volume | Any Str | true |
| k8s.persistentvolume.volume_mode | The volume mode of the Persistent Volume. | Any Str | true |
| k8s.persistentvolumeclaim.access_modes | Access modes of the Persistent Volume Claim. | Any Str | true |
| k8s.persistentvolumeclaim.annotations | The annotations of the Persistent Volume Claim. | Any Str | true |
| k8s.persistentvolumeclaim.finalizers | Finalizers of the Persistent Volume Claim. | Any Str | true |
| k8s.persistentvolumeclaim.labels | Labels of the Persistent Volume Claim. | Any Str | true |
| k8s.persistentvolumeclaim.name | The Name of the Persistent Volume Claim. | Any Str | true |
| k8s.persistentvolumeclaim.namespace | The namespace of the Persistent Volume Claim. | Any Str | true |
| k8s.persistentvolumeclaim.phase | The phase of the Persistent Volume Claim. | Any Str | true |
| k8s.persistentvolumeclaim.selector | The selector of the Persistent Volume Claim. | Any Str | true |
| k8s.persistentvolumeclaim.start_time | The start time of the Persistent Volume Claim. | Any Str | true |
| k8s.persistentvolumeclaim.storage_class | The storage class of the Persistent Volume Claim. | Any Str | true |
| k8s.persistentvolumeclaim.type | The type of the Persistent Volume Claim. | Any Str | true |
| k8s.persistentvolumeclaim.uid | The UID of the Persistent Volume Claim. | Any Str | true |
| k8s.persistentvolumeclaim.volume_mode | The volume mode of the Persistent Volume Claim. | Any Str | true |
| k8s.persistentvolumeclaim.volume_name | The volume name of the Persistent Volume Claim. | Any Str | true |
| k8s.pod.name | The k8s pod name. | Any Str | true |
| k8s.pod.start_time | The start time of the Pod. | Any Str | true |
| k8s.pod.uid | The k8s pod uid. | Any Str | true |
Expand Down
4 changes: 4 additions & 0 deletions receiver/k8sclusterreceiver/internal/collection/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver/internal/namespace"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver/internal/node"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver/internal/persistentvolume"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver/internal/persistentvolumeclaim"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver/internal/pod"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver/internal/replicaset"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver/internal/replicationcontroller"
Expand Down Expand Up @@ -81,6 +82,9 @@ func (dc *DataCollector) CollectMetricData(currentTime time.Time) pmetric.Metric
dc.metadataStore.ForEach(gvk.PersistentVolume, func(o any) {
persistentvolume.RecordMetrics(dc.metricsBuilder, o.(*corev1.PersistentVolume), ts)
})
dc.metadataStore.ForEach(gvk.PersistentVolumeClaim, func(o any) {
persistentvolumeclaim.RecordMetrics(dc.metricsBuilder, o.(*corev1.PersistentVolumeClaim), ts)
})
dc.metadataStore.ForEach(gvk.Namespace, func(o any) {
namespace.RecordMetrics(dc.metricsBuilder, o.(*corev1.Namespace), ts)
})
Expand Down
1 change: 1 addition & 0 deletions receiver/k8sclusterreceiver/internal/gvk/gvk.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var (
Pod = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Pod"}
Node = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Node"}
PersistentVolume = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "PersistentVolume"}
PersistentVolumeClaim = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "PersistentVolumeClaim"}
Namespace = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Namespace"}
ReplicationController = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "ReplicationController"}
ResourceQuota = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "ResourceQuota"}
Expand Down
Loading

0 comments on commit db49257

Please sign in to comment.