Skip to content

Commit

Permalink
fix: parse event timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
rogercoll committed Oct 14, 2024
1 parent 20421fc commit 56d2ad0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ processors:
- set(attributes["data_stream.dataset"], "nginx_ingress_controller.access")
# LogRecord event: https://github.com/open-telemetry/semantic-conventions/pull/982
- set(attributes["event.name"], "nginx.ingress.controller.access")
- set(attributes["event.timestamp"], attributes["nginx_ingress_controller.access.time"])
- set(attributes["event.timestamp"], String(Time(attributes["nginx_ingress_controller.access.time"], "%d/%b/%Y:%H:%M:%S %z")))
- delete_key(attributes, "nginx_ingress_controller.access.time")
- context: log
conditions:
Expand Down
4 changes: 2 additions & 2 deletions packages/nginx_ingress_controller_otel/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extensions:
receivers:
filelog:
include_file_path: true
include: [/var/log/pods/*/*/*.log]
include: [/var/log/pods/*nginx-ingress-nginx-controller*/controller/*.log]
operators:
- id: container-parser
type: container
Expand Down Expand Up @@ -81,7 +81,7 @@ processors:

# LogRecord event: https://github.com/open-telemetry/semantic-conventions/pull/982
- set(attributes["event.name"], "nginx.ingress.controller.access")
- set(attributes["event.timestamp"], attributes["nginx_ingress_controller.access.time"])
- set(attributes["event.timestamp"], String(Time(attributes["nginx_ingress_controller.access.time"], "%d/%b/%Y:%H:%M:%S %z")))
- delete_key(attributes, "nginx_ingress_controller.access.time")

- context: log
Expand Down

0 comments on commit 56d2ad0

Please sign in to comment.