Page MenuHomePhabricator

logstash_checker should be able to check for error for any php version
Closed, InvalidPublic

Description

When scap calles logstash_checker,py, it only checks for program:php7.2-fpm, while this is ok for now, it will be an issue when we upgrade php to 7.3

Event Timeline

Things seem to have changed a lot since this ticket was filed. In production scap calls /usr/local/bin/logstash_checker.py like so:

/usr/local/bin/logstash_checker.py \
 --service-name mwdeploy \
 --host mw1418 \
 --fail-threshold <something> \
 --delay <something> \
 --logstash-host logstash1023.eqiad.wmnet:9200

That's the end of scap's responsibility for what happens.

/usr/local/bin/logstash_checker.py comes from operations/puppet/modules/service/files/logstash_checker.py which has these bits of relevant code:

def _logstash_query(self):
    if self.service_name == 'mwdeploy':
        return self._mwdeploy_query()

def _mwdeploy_query(self):
    """Return a query that tracks MediaWiki deploy problems."""
    query = ('host:("%(host)s") '
             'AND type:mediawiki '
             'AND channel:(exception OR error)'
             ) % vars(self)

    return {
        "size": 0,
        "aggs": {
            "2": {
                "date_histogram": {
                    "interval": "10s",
                    "field": "@timestamp"
                }
            }
        },
        "query": {
            "bool": {
                "filter": [
                    {
                        "range": {
                            "@timestamp": {
                                "lte": "now",
                                "gte": "now-60m"
                            }
                        }
                    },
                    {
                        "query_string": {
                            "query": query
                        }
                    }
                ],
                "must_not": [
                    {
                        "terms": {
                            "level": [
                                "DEBUG"
                            ]
                        }
                    }
                ]
            }
        }
    }

This query does not have any parameters that would restrict it to logs message from a specific version of PHP so I think we're good to cancel this ticket.