Skip to content

Enhance Cron Job Attributes #39456

Open
Open
@naman-jain-15

Description

@naman-jain-15

Component(s)

receiver/k8scluster

Is your feature request related to a problem? Please describe.

The current implementation of the OpenTelemetry Collector provides very limited resource attributes for cronjobs

Describe the solution you'd like

Enhance the resource attributes for cronjobs to include:

k8s.cronjob.concurrency_policy
k8s.cronjob.schedule
k8s.cronjob.suspend

Describe alternatives you've considered

There is this function also that we can extend


func GetMetadata(cj *batchv1.CronJob) map[experimentalmetricmetadata.ResourceID]*metadata.KubernetesMetadata {
	rm := metadata.GetGenericMetadata(&cj.ObjectMeta, constants.K8sKindCronJob)
	rm.Metadata[cronJobKeySchedule] = cj.Spec.Schedule
	rm.Metadata[cronJobKeyConcurrencyPolicy] = string(cj.Spec.ConcurrencyPolicy)
	return map[experimentalmetricmetadata.ResourceID]*metadata.KubernetesMetadata{experimentalmetricmetadata.ResourceID(cj.UID): rm}
}

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestnever staleIssues marked with this label will be never staled and automatically removedreceiver/k8sclusterwaiting-for:semantic-conventionsWaiting on something on semantic-conventions to be stabilized

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions