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

Add punt hook to drop admin-chosen messages #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dehnert
Copy link
Contributor

@dehnert dehnert commented Apr 20, 2024

Useful if there's a class with some useful messages, but also a high rate of messages that nobody needs to see that unnecessarily load the server.

Useful if there's a class with some useful messages, but also a high
rate of messages that nobody needs to see that unnecessarily load the
server.
@asedeno
Copy link
Contributor

asedeno commented Apr 20, 2024

I'm not convinced I want this to be a function by default, but the idea is good. Do you want to filter on anything more than the class/instance/recipient tuple?

@dehnert
Copy link
Contributor Author

dehnert commented Apr 20, 2024

My current function is:

def ROOST_CHECK_PUNT(notice):
    if (notice.cls == b'MOIRA' and notice.instance == b'incr-runner' and
        notice.sender == b'smstest@ATHENA.MIT.EDU' and
        len(notice.fields) >= 1 and
        b'pipe child exits with signal 0 status 0' in notice.fields[0]):
        return True
    return False

so I'm also matching on the body (on a theory that maybe I'm somewhat interested if there's a different error).

(Something else an arbitrary function allows is dropping some percentage of traffic, which might be appealing in some use-cases.)

@asedeno
Copy link
Contributor

asedeno commented Apr 21, 2024

I understand why you want to do this, but now I've thought about it enough to realize why I don't like it: it can't be configured via config.yml at all, unlike everything else in this file. I'm going to think on this some more.

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.

2 participants