Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

event.name field of the kubernetes events does not reflect events definition #35857

Open
tetianakravchenko opened this issue Oct 17, 2024 · 3 comments

Comments

@tetianakravchenko
Copy link

Component(s)

receiver/k8sobjects

Describe the issue you're reporting

receiver/k8sobjects seems to be a recommended way to collect kubernetes events, as there is an open discussion regarding the k8sevents deprecation - #24242:

receivers:
  k8sobjects:
    objects:
      - name: events
        mode: "watch"
        group: "events.k8s.io"
        exclude_watch_type:
          - "DELETED"

In this PR #16543 - event.name was set as a name of the kubernetes event.
For example, for the event:

- apiVersion: v1
  count: 1
  eventTime: null
  firstTimestamp: "2024-10-17T17:13:07Z"
  involvedObject:
    apiVersion: apps/v1
    kind: StatefulSet
    name: web
    namespace: opentelemetry-operator-system
    resourceVersion: "26119"
    uid: 664abece-c04c-484e-93c1-394d19dd200b
  kind: Event
  lastTimestamp: "2024-10-17T17:13:07Z"
  message: create Pod web-0 in StatefulSet web successful
  metadata:
    creationTimestamp: "2024-10-17T17:13:07Z"
    name: web.17ff4cc43c2c72a0
    namespace: opentelemetry-operator-system
    resourceVersion: "26122"
    uid: 7d7c3ea4-59f6-422e-be44-a489a0c058d8
  reason: SuccessfulCreate
  reportingComponent: statefulset-controller
  reportingInstance: ""
  source:
    component: statefulset-controller
  type: Normal

event.name is web.17ff4cc43c2c72a0, that is unique for each event.

as defined in https://opentelemetry.io/docs/specs/semconv/general/events/#event-definition:

The event name uniquely identifies event structure / type of the payload (body) and the set of attributes.

that contradicts with the current event.name

I found related issues, but for the k8sevents - #14474, that was closed. As was mentioned in #14474 (comment):

Looking at the examples you've shown there, I'd say an appropriate event.name might be something like involvedObject.kind + reason

should event.name be changed to involvedObject.kind + reason ?

@tetianakravchenko tetianakravchenko added the needs triage New item requiring triage label Oct 17, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@TylerHelmuth
Copy link
Member

@tetianakravchenko you are correct that we are currently not using the OTel Event definition for event.name correctly. We are also setting and event.domain (I think) which isn't spec-ed anymore.

This happened because k8sojects receiver was an early adopter of the Event concept as one of its prototypes for the spec. But now we are holding off on fixing it until Otel Events are stable so that we can do a single breaking change.

@TylerHelmuth TylerHelmuth added priority:p2 Medium and removed needs triage New item requiring triage labels Oct 17, 2024
@tetianakravchenko
Copy link
Author

@TylerHelmuth thank you for the reply!

But now we are holding off on fixing it until Otel Events are stable so that we can do a single breaking change.

is there any related issue/s regarding the work on otel events that I can follow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants