Skip to content

Conversation

@benjaminjb
Copy link
Contributor

Checklist:

  • Have you added an explanation of what your changes do and why you'd like them to be included?
  • Have you updated or added documentation for the change, as applicable?
  • Have you tested your changes on all related environments with successful results, as applicable?
    • Have you added automated tests?

Type of Changes:

  • New feature
  • Bug fix
  • Documentation
  • Testing enhancement
  • Other

What is the current behavior (link to any open issues here)?

As of 0.119.0, the parser collector modifies certain paths of transforms. While this is not an error, the resulting log can look a little alarming, so we rewrote some of our transforms to match.

What is the new behavior (if this is a feature change)?

  • Breaking change (fix or feature that would cause existing functionality to change)

We handle the transforms.

Other Information:
Issues: [PGO-2268]

As of 0.119.0, the parser collector modifies certain
paths of transforms. While this is not an error, the
resulting log can look a little alarming, so we rewrote
some of our transforms to match.

Issues: [PGO-2268]

// https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/-/pkg/ottl/ottlfuncs#parsejson
`set(cache, ParseJSON(body["original"]))`,
`set(log.cache, ParseJSON(log.body["original"]))`,
Copy link
Member

Choose a reason for hiding this comment

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

🤔 Do we still have to set context=log? If so, what a strange change they made.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do not. I'm not sure of the benefit of this change.

That said, is it expected for almost every emission to be LogRecord #0?

Copy link
Member

Choose a reason for hiding this comment

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

That sounds like an index, maybe? The batch time is quite small by default, so one-at-a-time sounds plausible.

Copy link
Member

@cbandy cbandy left a comment

Choose a reason for hiding this comment

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

I couldn't pay attention the whole way through. LGTM

# https://git.postgresql.org/gitweb/?p=postgresql.git;hb=REL_10_0;f=src/backend/utils/error/elog.c#l2246
# https://git.postgresql.org/gitweb/?p=postgresql.git;hb=REL_17_0;f=src/backend/utils/error/elog.c#l2671
- set(time, Time(cache["timestamp"], "%F %T.%L %Z"))
- set(log.time, Time(log.cache["timestamp"], "%F %T.%L %Z")) where IsString(log.cache["timestamp"])
Copy link
Member

Choose a reason for hiding this comment

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

👍🏻 I don't mind being safe here. Did something warn? I expect Postgres always includes a timestamp.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't remember where (pgbouncer, patroni?) but at some point I caused a log to come through that didn't have a timestamp. That might've been when I was trying to reproduce the bug Drew was checking out? But I thought we might want to be safe wherever we're doing a time transform just in case.

@benjaminjb benjaminjb merged commit 7a00601 into main Mar 20, 2025
19 checks passed
@benjaminjb benjaminjb deleted the benjb/ottl-warn-paths branch March 20, 2025 17:41
dsessler7 pushed a commit that referenced this pull request Nov 14, 2025
* Modify context path of OTEL transformers

As of 0.119.0, the parser collector modifies certain
paths of transforms. While this is not an error, the
resulting log can look a little alarming, so we rewrote
some of our transforms to match.

* Handle pgBouncer 1.24.0

During testing, some pgbouncer metrics were seen to cause
errors when accessing PG through pgbouncer; in addition,
we found that 1.24.0 introduced a change to the `show databases`
columns. This PR addresses those errors and that change.

NOTE: Even when not using NULL values, sqlqueryreceiver will
still warn when it finds a NULL value in some row that it scans.

Issue: PGO-2268
See: 7a00601
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.

3 participants