private void ProcessZookeeperLine(LogLine logLine)
        {
            var javaLineMatchResult = logLine.LineContents.MatchJavaLine(_zookeeperRegex);

            if (!javaLineMatchResult.SuccessfulMatch)
            {
                _processingNotificationsCollector.ReportError("Failed to process line as Zookeeper event", logLine, nameof(ClusterControllerPlugin));
                return;
            }

            // ./2018.2 linux/node1/appzookeeper_1.20182.18.0627.22308155521326766729002/logs/appzookeeper_node1-0.log:13:2018-08-08 11:01:48.490 +1000 14754 main : ERROR org.apache.zookeeper.server.quorum.QuorumPeerConfig - Invalid configuration, only one server specified(ignoring)
            if (javaLineMatchResult.IsErrorPriorityOrHigher())
            {
                var entry = new ZookeeperError(logLine, javaLineMatchResult);
                _zkErrorWriter.AddLine(entry);
            }

            // ./node1/appzookeeper_0.20182.18.1001.21158905666349186534552/logs/appzookeeper_node1-0.log.2018-10-02:1725:2018-10-02 22:09:01.927 +0000  SyncThread:0 : WARN  org.apache.zookeeper.server.persistence.FileTxnLog - fsync-ing the write ahead log in SyncThread:0 took 1013ms which will adversely effect operation latency. See the ZooKeeper troubleshooting guide
            if (javaLineMatchResult.Class == "org.apache.zookeeper.server.persistence.FileTxnLog" &&
                javaLineMatchResult.Message.StartsWith("fsync-ing", StringComparison.Ordinal))
            {
                var fsyncLatencyMatch = _zkFsyncLatencyRegex.Match(javaLineMatchResult.Message);
                if (fsyncLatencyMatch.Success)
                {
                    var entry = new ZookeeperFsyncLatency(logLine, javaLineMatchResult.Timestamp)
                    {
                        FsyncLatencyMs = fsyncLatencyMatch.GetNullableInt("fsync_latency"),
                    };

                    _zkFsyncLatencyWriter.AddLine(entry);
                }
            }
        }
Пример #2
0
        private void ProcessZookeeperLine(LogLine logLine)
        {
            var match = logLine.LineContents.CastToStringAndRegexMatch(_zookeeperRegex);

            if (match == null || match == Match.Empty)
            {
                _processingNotificationsCollector.ReportError("Failed to process line as Zookeeper event", logLine, nameof(ClusterControllerPlugin));
                return;
            }

            var groups  = match.Groups;
            var ts      = groups["ts"].Value;
            var sev     = groups["sev"].Value;
            var @class  = groups["class"].Value;
            var message = groups["message"].Value;

            // ./2018.2 linux/node1/appzookeeper_1.20182.18.0627.22308155521326766729002/logs/appzookeeper_node1-0.log:13:2018-08-08 11:01:48.490 +1000 14754 main : ERROR org.apache.zookeeper.server.quorum.QuorumPeerConfig - Invalid configuration, only one server specified(ignoring)
            if (sev == "ERROR" || sev == "FATAL")
            {
                var entry = new ZookeeperError(logLine, ts)
                {
                    Severity = sev,
                    Message  = message,
                    Class    = @class,
                };

                _zkErrorWriter.AddLine(entry);
            }

            // ./node1/appzookeeper_0.20182.18.1001.21158905666349186534552/logs/appzookeeper_node1-0.log.2018-10-02:1725:2018-10-02 22:09:01.927 +0000  SyncThread:0 : WARN  org.apache.zookeeper.server.persistence.FileTxnLog - fsync-ing the write ahead log in SyncThread:0 took 1013ms which will adversely effect operation latency. See the ZooKeeper troubleshooting guide
            if (@class == "org.apache.zookeeper.server.persistence.FileTxnLog" &&
                message.StartsWith("fsync-ing", StringComparison.Ordinal))
            {
                var fsyncLatencyMatch = _zkFsyncLatencyRegex.Match(message);
                if (fsyncLatencyMatch.Success)
                {
                    var entry = new ZookeeperFsyncLatency(logLine, ts)
                    {
                        FsyncLatencyMs = fsyncLatencyMatch.GetNullableInt("fsync_latency"),
                    };

                    _zkFsyncLatencyWriter.AddLine(entry);
                }
            }
        }