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

k8sobjects receiver observed timestamp is missing #18700

Closed
nicolastakashi opened this issue Feb 16, 2023 · 1 comment
Closed

k8sobjects receiver observed timestamp is missing #18700

nicolastakashi opened this issue Feb 16, 2023 · 1 comment
Labels
bug Something isn't working receiver/k8sobjects

Comments

@nicolastakashi
Copy link
Contributor

Component(s)

receiver/k8sobjects

What happened?

Description

Currently, the k8sobjects receiver is not setting the observed timestamp to the produced logs, and some platforms may not ingest data since the timestamp and observed timestamp are not present.

Steps to Reproduce

Configure the collector with the k8sobjects receiver.

Expected Result

Have the observed timestamp present on the log entry.

Actual Result

Log entry doesn't have value on the observed timestamp field.

Collector version

v0.71.0

Environment information

Environment

OS: Ubuntu 20.04
Kubernetes: 1.23
Compiler(if manually compiled): N/A

OpenTelemetry Collector configuration

receivers:
  k8sobjects:
    objects:
      - name: events
        mode: watch

processors:
  batch:

exporters:
  logging:
    verbosity: detailed

service:
  pipelines:
    logs:
      receivers:
      - k8sobjects
      processors: 
      - batch
      exporters:
      - logging

Log output

ObservedTimestamp: 1970-01-01 00:00:00 +0000 UTC
Timestamp: 1970-01-01 00:00:00 +0000 UTC
SeverityText:
SeverityNumber: Unspecified(0)
Body: Map({"object":{"apiVersion":"v1","count":25,"eventTime":null,"firstTimestamp":"2023-02-15T16:40:46Z","involvedObject":{"apiVersion":"v1","fieldPath":"spec.containers{container-name}","kind":"Pod","name":"container-container-name-7785f7966-5f2l9","namespace":"default","resourceVersion":"405467798","uid":"a663352f-a300-4c9c-a5da-67b2c196894f"},"kind":"Event","lastTimestamp":"2023-02-15T16:45:36Z","message":"Back-off restarting failed container","metadata":{"creationTimestamp":"2023-02-15T16:40:46Z","managedFields":[{"apiVersion":"v1","fieldsType":"FieldsV1","fieldsV1":{"f:count":{},"f:firstTimestamp":{},"f:involvedObject":{},"f:lastTimestamp":{},"f:message":{},"f:reason":{},"f:source":{"f:component":{},"f:host":{}},"f:type":{}},"manager":"kubelet","operation":"Update","time":"2023-02-15T16:40:46Z"}],"name":"container-container-name-7785f7966-5f2l9.17440cfe2470cf14","namespace":"default","resourceVersion":"66079426","uid":"541a75a2-a3c3-4e17-b1c0-04bf6a05a92c"},"reason":"BackOff","reportingComponent":"","reportingInstance":"","source":{"component":"kubelet","host":"ip.eu-west-1.compute.internal"},"type":"Warning"},"type":"MODIFIED"})
Attributes:
     -> k8s.resource.name: Str(events)
     -> event.domain: Str(k8s)
     -> event.name: Str(container-container-name-7785f7966-5f2l9.17440cfe2470cf14)
Trace ID:
Span ID:
Flags: 0
	{"kind": "exporter", "data_type": "logs", "name": "logging"}


### Additional context

Given the [Otel specification](https://opentelemetry.io/docs/reference/specification/logs/data-model) the `ObservedTimestamp` field SHOULD be set once the event is observed by OpenTelemetry, in case of external events collected by the collector this is the time when OpenTelemetry’s code observed the event measured by the clock of the OpenTelemetry code.
@nicolastakashi nicolastakashi added bug Something isn't working needs triage New item requiring triage labels Feb 16, 2023
@github-actions
Copy link
Contributor

Pinging code owners:

  • receiver/k8sobjects: @dmitryax @harshit-splunk

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

codeboten pushed a commit that referenced this issue Feb 16, 2023
Currently, the k8sobjects receiver is not setting the observed timestamp to the produced logs, and some platforms may not ingest data since the timestamp and observed timestamp are not present.

Some exporters may reject the logs without an associated timestamp.

Link to tracking Issue: #18700
@atoulme atoulme removed the needs triage New item requiring triage label Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working receiver/k8sobjects
Projects
None yet
Development

No branches or pull requests

2 participants