Skip to content

Commit

Permalink
added start_time attributes in k8s workloads
Browse files Browse the repository at this point in the history
  • Loading branch information
bhogayatakb committed Feb 7, 2024
1 parent d9e87fd commit 6556035
Show file tree
Hide file tree
Showing 16 changed files with 293 additions and 4 deletions.
8 changes: 8 additions & 0 deletions receiver/k8sclusterreceiver/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -422,23 +422,30 @@ Current status reason of the pod (1 - Evicted, 2 - NodeAffinity, 3 - NodeLost, 4
| k8s.cluster.name | The k8s cluster name. | Any Str | true |
| k8s.container.name | The k8s container name | Any Str | true |
| k8s.cronjob.name | The k8s CronJob name | Any Str | true |
| k8s.cronjob.start_time | The start time of the Cronjob. | Any Str | true |
| k8s.cronjob.uid | The k8s CronJob uid. | Any Str | true |
| k8s.daemonset.name | The k8s daemonset name. | Any Str | true |
| k8s.daemonset.start_time | The start time of the Daemonset. | Any Str | true |
| k8s.daemonset.uid | The k8s daemonset uid. | Any Str | true |
| k8s.deployment.name | The name of the Deployment. | Any Str | true |
| k8s.deployment.start_time | The start time of the Deployment. | Any Str | true |
| k8s.deployment.uid | The UID of the Deployment. | Any Str | true |
| k8s.hpa.name | The k8s hpa name. | Any Str | true |
| k8s.hpa.uid | The k8s hpa uid. | Any Str | true |
| k8s.job.name | The k8s pod name. | Any Str | true |
| k8s.job.start_time | The start time of the Job. | Any Str | true |
| k8s.job.uid | The k8s job uid. | Any Str | true |
| k8s.namespace.name | The k8s namespace name. | Any Str | true |
| k8s.namespace.start_time | The start time of the Namespace. | Any Str | true |
| k8s.namespace.uid | The k8s namespace uid. | Any Str | true |
| k8s.node.name | The k8s node name. | Any Str | true |
| k8s.node.start_time | The start time of the Node. | Any Str | true |
| k8s.node.uid | The k8s node uid. | 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 |
| k8s.replicaset.name | The k8s replicaset name | Any Str | true |
| k8s.replicaset.start_time | The start time of the Replicaset. | Any Str | true |
| k8s.replicaset.uid | The k8s replicaset uid | Any Str | true |
| k8s.replicationcontroller.name | The k8s replicationcontroller name. | Any Str | true |
| k8s.replicationcontroller.uid | The k8s replicationcontroller uid. | Any Str | true |
Expand All @@ -451,6 +458,7 @@ Current status reason of the pod (1 - Evicted, 2 - NodeAffinity, 3 - NodeLost, 4
| k8s.service.uid | The UID of the service | Any Str | true |
| k8s.service_account.name | The name of the Service-account | Any Str | true |
| k8s.statefulset.name | The k8s statefulset name. | Any Str | true |
| k8s.statefulset.start_time | The start time of the Statefulset. | Any Str | true |
| k8s.statefulset.uid | The k8s statefulset uid. | Any Str | true |
| opencensus.resourcetype | The OpenCensus resource type. | Any Str | true |
| openshift.clusterquota.name | The k8s ClusterResourceQuota name. | Any Str | true |
Expand Down
1 change: 1 addition & 0 deletions receiver/k8sclusterreceiver/internal/cronjob/cronjobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func RecordMetrics(mb *metadata.MetricsBuilder, cj *batchv1.CronJob, ts pcommon.
rb.SetK8sNamespaceName(cj.Namespace)
rb.SetK8sCronjobUID(string(cj.UID))
rb.SetK8sCronjobName(cj.Name)
rb.SetK8sCronjobStartTime(cj.GetCreationTimestamp().String())
rb.SetOpencensusResourcetype("k8s")
mb.EmitForResource(metadata.WithResource(rb.Emit()))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func RecordMetrics(mb *metadata.MetricsBuilder, ds *appsv1.DaemonSet, ts pcommon
rb := mb.NewResourceBuilder()
rb.SetK8sNamespaceName(ds.Namespace)
rb.SetK8sDaemonsetName(ds.Name)
rb.SetK8sDaemonsetStartTime(ds.GetCreationTimestamp().String())
rb.SetK8sDaemonsetUID(string(ds.UID))
rb.SetOpencensusResourcetype("k8s")
mb.EmitForResource(metadata.WithResource(rb.Emit()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func RecordMetrics(mb *imetadata.MetricsBuilder, dep *appsv1.Deployment, ts pcom
rb.SetK8sDeploymentName(dep.Name)
rb.SetK8sDeploymentUID(string(dep.UID))
rb.SetK8sNamespaceName(dep.Namespace)
rb.SetK8sDeploymentStartTime(dep.GetCreationTimestamp().String())
rb.SetOpencensusResourcetype("k8s")
mb.EmitForResource(metadata.WithResource(rb.Emit()))
}
Expand Down
1 change: 1 addition & 0 deletions receiver/k8sclusterreceiver/internal/jobs/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func RecordMetrics(mb *metadata.MetricsBuilder, j *batchv1.Job, ts pcommon.Times
rb.SetK8sNamespaceName(j.Namespace)
rb.SetK8sJobName(j.Name)
rb.SetK8sJobUID(string(j.UID))
rb.SetK8sJobStartTime(j.GetCreationTimestamp().String())
rb.SetOpencensusResourcetype("k8s")
mb.EmitForResource(metadata.WithResource(rb.Emit()))
}
Expand Down
46 changes: 46 additions & 0 deletions receiver/k8sclusterreceiver/internal/metadata/generated_config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6556035

Please sign in to comment.