Skip to content

K8sattributes: Add automatic RBAC for new service.name resource attribute generator #4131

Open
@ChristianCiach

Description

@ChristianCiach

The k8sattributes processor recently added support for automatic the service.name resource attribute:

According to https://opentelemetry.io/docs/specs/semconv/non-normative/k8s-attributes/#how-servicename-should-be-calculated, the service.name is extract from the first of these attributes:

  • pod.annotation[resource.opentelemetry.io/service.name]
  • pod.label[app.kubernetes.io/instance]
  • pod.label[app.kubernetes.io/name]
  • k8s.deployment.name
  • k8s.replicaset.name
  • k8s.statefulset.name
  • k8s.daemonset.name
  • k8s.cronjob.name
  • k8s.job.name
  • k8s.pod.name
  • k8s.container.name

This means that, if k8sprocessor has been configured with service.name,

func GenerateK8SAttrRbacRules(_ logr.Logger, config K8sAttributeConfig) ([]rbacv1.PolicyRule, error) {
should automatically add RBAC for replicasets (to access k8s.deployment.name).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:collectorIssues for deploying collectorenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions