Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make catalog logging a little quieter where entities are erroring #23022

Merged
merged 5 commits into from Apr 9, 2024

Conversation

punkle
Copy link
Contributor

@punkle punkle commented Feb 16, 2024

Hey, I just made a Pull Request!

When an error is raised by a url reader or any other processor in the catalog, those errors are logged to the application logs with a warning level as well as written to the refresh_state table for retrieval later.

Given that these errors are already visible at the application layer via the refresh state table, I would argue that the log line is superfluous. The log line can be useful in some cases so I have made it possible to re-enable the log line.

In the end this change makes the catalog logging a little quieter where entities are erroring.

I dont feel terribly strongly about this, and am happy to close this if there is any contention.

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

Signed-off-by: Brian Fletcher <brian@roadie.io>
@punkle punkle requested review from a team as code owners February 16, 2024 13:21
@github-actions github-actions bot added the area:catalog Related to the Catalog Project Area label Feb 16, 2024
@backstage-goalie
Copy link
Contributor

backstage-goalie bot commented Feb 16, 2024

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage/plugin-catalog-backend plugins/catalog-backend patch v1.21.0

Copy link
Contributor

github-actions bot commented Feb 16, 2024

Uffizzi Cluster pr-23022 was deleted.

@awanlin
Copy link
Collaborator

awanlin commented Feb 16, 2024

For a long time while I was at Keyloop we had no access to the database, I think this is true for other adopters as well. Also, for early Adopters these are errors they will run into first as they learn. I feel like moving them to debug makes them harder to surface especially as turning on the debug logs creates very verbose output making it harder to catch things like this.

That said, happy to go with what every the Maintainer decide on this 👍

@punkle
Copy link
Contributor Author

punkle commented Feb 16, 2024

@awanlin The errors are shown in the application in a few places:

  • InspectEntityDialog, you can get there from the three dots in the top right of the catalog item.
  • The plugin gives you an overview of the processing errors also: @backstage/plugin-catalog-unprocessed-entities

@mikeyhc
Copy link
Contributor

mikeyhc commented Feb 22, 2024

My concern here is this makes integrating with log based tooling a lot more difficult. We use logs to generate both metrics and alerting, and while this would be possible by enabling debug logging, that would also generate a lot of noise and cost when it comes to storing those logs.

@punkle
Copy link
Contributor Author

punkle commented Feb 23, 2024

Can you elaborate a little? Which metrics and alerts are you triggering from this log line?

@mikeyhc
Copy link
Contributor

mikeyhc commented Feb 23, 2024

Sure! We use this to generate metrics and alert around total number of erroring entities. Seeing a steep uptick in this is often indicative of a new automation generating invalid entities, and has helped us proactively reached out to catalog users. Also as a large number of erroring entities can negatively impact processing times it has allowed us to head off incidents related to that.

@punkle
Copy link
Contributor Author

punkle commented Feb 26, 2024

@mikeyhc I suppose what we could do to satisfy both concerns is to emit an event on the event broker and then make a configurable event subscriber that writes a log line or a produces a metric or something..

Then if you dont want the log line, dont configure the subscriber. If you do want the log line, configure the subscriber. Something like that.

Would that work?

Signed-off-by: Brian Fletcher <brian@roadie.io>
Signed-off-by: Brian Fletcher <brian@roadie.io>
Signed-off-by: Brian Fletcher <brian@roadie.io>
@mikeyhc
Copy link
Contributor

mikeyhc commented Feb 26, 2024

@punkle sounds good to me

@punkle
Copy link
Contributor Author

punkle commented Feb 26, 2024

@mikeyhc Ive implemented that suggestion in the latest version of this pull request. Let me know if you have any feedback on the specifics.

Copy link
Contributor

@mikeyhc mikeyhc left a comment

Choose a reason for hiding this comment

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

LGTM and really appreciate the comprehensive changeset!

Copy link
Contributor

github-actions bot commented Mar 7, 2024

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions bot added the stale label Mar 7, 2024
@punkle
Copy link
Contributor Author

punkle commented Mar 8, 2024

not stale

@github-actions github-actions bot removed the stale label Mar 8, 2024
Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions bot added the stale label Mar 15, 2024
@punkle
Copy link
Contributor Author

punkle commented Mar 15, 2024

not stale

@github-actions github-actions bot removed the stale label Mar 15, 2024
Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions bot added the stale label Mar 22, 2024
@punkle
Copy link
Contributor Author

punkle commented Mar 25, 2024

Not stale

@github-actions github-actions bot removed the stale label Mar 25, 2024
Copy link
Contributor

github-actions bot commented Apr 1, 2024

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions bot added the stale label Apr 1, 2024
@freben freben removed the stale label Apr 1, 2024
Signed-off-by: Brian Fletcher <brian@roadie.io>
@punkle punkle requested a review from Rugvip April 2, 2024 09:01
Copy link
Contributor

github-actions bot commented Apr 9, 2024

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions bot added the stale label Apr 9, 2024
@freben freben merged commit c6635e5 into backstage:master Apr 9, 2024
29 checks passed
Copy link
Contributor

github-actions bot commented Apr 9, 2024

Thank you for contributing to Backstage! The changes in this pull request will be part of the 1.26.0 release, scheduled for Tue, 14 May 2024.

@punkle
Copy link
Contributor Author

punkle commented Apr 9, 2024

yay, thank you!

@freben freben mentioned this pull request Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:catalog Related to the Catalog Project Area stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants