Skip to content

cloud_run_alerts: add flexible json-based log indicators and policies #79

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

andriipetruk
Copy link

@andriipetruk andriipetruk commented Mar 31, 2025

This PR enhances the cloud_run_service_alerts module by adding support for flexible JSON-based log indicators and alert policies:

  • JSON Payload Labels: Easily extract custom labels from JSON logs.
  • Flexible Alert Policies: Now supports defining multiple metrics within a single alert policy.

@andriipetruk andriipetruk requested review from a team as code owners March 31, 2025 22:59
@andriipetruk andriipetruk requested review from dcreey and lock14 March 31, 2025 22:59
Copy link

google-cla bot commented Mar 31, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@andriipetruk
Copy link
Author

This PR enhances the cloud_run_service_alerts module by adding support for flexible JSON-based log indicators and alert policies:

  • JSON Payload Labels: Easily extract custom labels from JSON logs.
  • Flexible Alert Policies: Now supports defining multiple metrics within a single alert policy.

@andriipetruk andriipetruk force-pushed the json_payload_custom_labels branch from 6fa61af to 69df9b3 Compare April 1, 2025 01:28
Copy link
Contributor

@pjh pjh left a comment

Choose a reason for hiding this comment

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

I've never looked at this code before today but on the whole this change looks good to me. I reviewed it to try to understand if / how it would affect existing users of the module and for the most part it seems to preserve the existing behavior, though I did have questions in one or two parts.

I know that @shankiyani has started to review this and is perhaps testing it out in his environment, I'll defer approval to him.

@pjh pjh requested a review from shankiyani April 1, 2025 23:46
@andriipetruk andriipetruk force-pushed the json_payload_custom_labels branch from 69df9b3 to 4e92aff Compare April 2, 2025 19:16
@andriipetruk andriipetruk force-pushed the json_payload_custom_labels branch from 4e92aff to 03898be Compare April 2, 2025 19:49
@andriipetruk
Copy link
Author

@shankiyani @pjh PR was updated

@pjh
Copy link
Contributor

pjh commented Apr 3, 2025

@shankiyani please re-review, I'm deferring approval to you.

@pjh pjh requested a review from shankiyani April 3, 2025 20:45
@shankiyani
Copy link
Contributor

@shankiyani @pjh PR was updated

Thanks @andriipetruk setting up a local test will take some time and I want to think through if this pattern should be adopted for the text payload variant as well.

In general multi-condition alert policy hinders the ability to use Cloud Monitoring Dashboards with no indicator that the feature will be supported anytime soon. I've been wanting to create a more "flattened" approach at the cost of increased number of APs but the draw being that dashboards can be used for centralized on-call viewing. Its not blocking for this PR but I wanted to share my intentions for this module going forward.

@andriipetruk andriipetruk force-pushed the json_payload_custom_labels branch from 03898be to d7a562e Compare April 7, 2025 22:26
@andriipetruk andriipetruk force-pushed the json_payload_custom_labels branch 2 times, most recently from 91276da to 1487cb3 Compare April 12, 2025 02:52
@andriipetruk andriipetruk force-pushed the json_payload_custom_labels branch from 1487cb3 to 94e3d9b Compare April 17, 2025 19:48
@andriipetruk andriipetruk force-pushed the json_payload_custom_labels branch from 94e3d9b to eec5337 Compare April 22, 2025 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants