Skip to content

[Draft] Update otelopscol to v0.156.0#2388

Open
franciscovalentecastro wants to merge 13 commits into
masterfrom
fcovalente-otelopscol-v0.156.0
Open

[Draft] Update otelopscol to v0.156.0#2388
franciscovalentecastro wants to merge 13 commits into
masterfrom
fcovalente-otelopscol-v0.156.0

Conversation

@franciscovalentecastro

Copy link
Copy Markdown
Contributor

Description

Related issue

How has this been tested?

Checklist:

  • Unit tests
    • Unit tests do not apply.
    • Unit tests have been added/modified and passed for this PR.
  • Integration tests
    • Integration tests do not apply.
    • Integration tests have been added/modified and passed for this PR.
  • Documentation
    • This PR introduces no user visible changes.
    • This PR introduces user visible changes and the corresponding documentation change has been made.
  • Minor version bump
    • This PR introduces no new features.
    • This PR introduces new features, and there is a separate PR to bump the minor version since the last release already.
    • This PR bumps the version.

Comment thread apps/couchbase.go Outdated
Parser: confgenerator.ParserShared{
TimeKey: "timestamp",
TimeFormat: "%Y-%m-%dT%H:%M:%S.%L",
TimeFormat: "%Y-%m-%dT%H:%M:%S.%LZ",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want %z to parse this as UTC, or else it will be parsed as a local time, no?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right.

This also gives me insight that fluent-bit doesn't "fail to parse" a timestamp that has a "suffix" that is not within the described format. Being a bit more lenient that way.

Comment thread apps/postgresql.go
Parser: confgenerator.ParserShared{
TimeKey: "time",
TimeFormat: "%Y-%m-%d %H:%M:%S.%L %z",
TimeFormat: "%Y-%m-%d %H:%M:%S.%L %Z",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fun one. strptime's %z is documented as "An RFC-822/ISO 8601 standard timezone specification. RFC-822 allows "UT" / "GMT" / "EST" / "EDT" / "CST" / "CDT" / "MST" / "MDT" / "PST" / "PDT" / 1ALPHA. ISO 8601 allows only Z or ±nn:nn. Notably absent from this list is UTC.

I added a test using UT, and glibc's strptime actually does not parse UT or GMT as valid %z specifiers.

So I'm convinced that %Z is indeed the correct specifier for these logs, and the fact that %z worked with Fluent Bit was a happy accident.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

Comment thread confgenerator/logging_receivers.go Outdated
Comment on lines +961 to +962
formattedTime := ottl.FormatTime(ottl.ToTime(v, "%Y-%m-%dT%T.%sZ"), "%Y-%m-%d %T.%s")
return v.Set(ottl.Concat([]ottl.Value{formattedTime, ottl.StringLiteral("+0000")}, " "))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, is this guaranteed to actually produce a UTC time? Should we actually just be formatting with %z instead?

@franciscovalentecastro franciscovalentecastro Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were creating timestamps for Windows Event Logs using the output format "%Y-%m-%d %T.%s +0000", which i assume because the fluent-bit windows event logs were always using UTC in the format +0000.

I set %z (which translates to Golang Z0700) which generates Z instead. I think this is better. We could somehow hack the format to %z -> 0700 to get +0000 but it doesn't seem worth it.

The original PR (#1969) i assume was trying to replicate exactly what Windows Event Logs API returns (AFAIU, xml logs are stored always with UTC 1 ) and how fluent-bit event logs timestamps are displayed.

Footnotes

  1. https://superuser.com/questions/1531591/what-time-zone-does-windows-event-logs-show

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants