Skip to content

Comments

add basic openlineage metrics to stats collector#31223

Closed
harels wants to merge 1 commit intoapache:mainfrom
harels:openlineage-metrics
Closed

add basic openlineage metrics to stats collector#31223
harels wants to merge 1 commit intoapache:mainfrom
harels:openlineage-metrics

Conversation

@harels
Copy link

@harels harels commented May 11, 2023

We currently don't have a good way to understand the latency of emitting openlineage events from the openlineage provider.
Beyond logging, there also isn't an easy way to aggregate failed attempts of sending the events.

This PR uses the statsd collector and wraps the section that emits to event with a timer, as well as emit a counter for exceptions in sending the event.

@boring-cyborg
Copy link

boring-cyborg bot commented May 11, 2023

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@harels harels changed the title add basic metrics to stats collector add basic openlinage metrics to stats collector May 11, 2023
@harels harels changed the title add basic openlinage metrics to stats collector add basic openlineage metrics to stats collector May 11, 2023
event = self._redacter.redact(event, max_depth=20)
try:
return self._client.emit(event)
with Stats.timer("ol.emit.attempts"):
Copy link
Contributor

Choose a reason for hiding this comment

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

@harels, this is great. It will help with the telemetry open lineage events.
Would it make sense for us to add or modify an existing test to assert we're sending these to Statsd?

Copy link
Member

Choose a reason for hiding this comment

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

+1, yes a test would help here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1. Test should also include scenario for exception

Copy link
Member

@pankajkoti pankajkoti left a comment

Choose a reason for hiding this comment

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

event = self._redacter.redact(event, max_depth=20)
try:
return self._client.emit(event)
with Stats.timer("ol.emit.attempts"):
Copy link
Member

Choose a reason for hiding this comment

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

+1, yes a test would help here.

@pankajkoti pankajkoti removed their request for review July 12, 2023 12:22
@eladkal eladkal requested a review from mobuchowski July 21, 2023 10:53
@mobuchowski
Copy link
Contributor

@harels AFAIK you wanted to add something here?

@github-actions
Copy link

github-actions bot commented Sep 5, 2023

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Sep 5, 2023
@github-actions github-actions bot closed this Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:openlineage AIP-53 stale Stale PRs per the .github/workflows/stale.yml policy file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants