Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@EugeneYushin
Copy link
Contributor

@EugeneYushin EugeneYushin commented Sep 11, 2025

Problem

Events appear in logs as Java objects refs instead of their serialized json representation:

Posting event for start 0: io.openlineage.client.OpenLineage$RunEvent@55cb6d00
vs
Posting event for end 0: {\"eventTime\":\"2025-09-10T12:42:36.745Z\",\"producer\":...

Solution

Wrap logger calls with OpenLineageClientUtils.toJson.

One-line summary:

Checklist

  • You've signed-off your work
  • Your pull request title follows our guidelines
  • Your changes are accompanied by tests (if relevant)
  • Your change contains a small diff and is self-contained
  • You've updated any relevant documentation (if relevant)
  • Your comment includes a one-liner for the changelog about the specific purpose of the change (not required for changes to tests, docs, or CI config)
  • You've versioned the core OpenLineage model or facets according to SchemaVer (if relevant)
  • You've added a header to source files (if relevant)

SPDX-License-Identifier: Apache-2.0
Copyright 2018-2025 contributors to the OpenLineage project

@EugeneYushin EugeneYushin requested a review from a team as a code owner September 11, 2025 08:29
@boring-cyborg boring-cyborg bot added area:integration/spark language:java Uses Java programming language labels Sep 11, 2025
@boring-cyborg
Copy link

boring-cyborg bot commented Sep 11, 2025

Thanks for opening your first OpenLineage pull request! We appreciate your contribution. If you haven't already, please make sure you've reviewed our guide for new contributors (https://github.com/OpenLineage/OpenLineage/blob/main/CONTRIBUTING.md).

Signed-off-by: EugenYushin <[email protected]>
@EugeneYushin
Copy link
Contributor Author

@collado-mike could you please check this tiny "improvement" PR?

.build());

log.debug("Posting event for start {}: {}", executionId, event);
log.debug("Posting event for start {}: {}", executionId, OpenLineageClientUtils.toJson(event));
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd recommend to wrap this with a check for current log level, to avoid spending CPU time if nobody will see this message anyway:
https://docs.oracle.com/javase/8/docs/api/java/util/logging/Logger.html#isLoggable-java.util.logging.Level-

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great call! I've wrapped calls to logger with log.isDebugEnabled(), same way we do in the rest of the codebase

@mobuchowski mobuchowski merged commit 760cd95 into OpenLineage:main Sep 12, 2025
34 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:integration/spark language:java Uses Java programming language

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants