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

Update Zookeeper to gain parity with google #399

Open
wants to merge 4 commits into
base: google-parity
Choose a base branch
from

Conversation

JonathanWamsley
Copy link
Contributor

@JonathanWamsley JonathanWamsley commented Feb 22, 2022

Updated to support multiple files.

The new multi-file Config

pipeline:
- type: zookeeper
  file_log_path:
    - "./zookeeper.log"
    - "./zookeeper2.log"
- type: stdout

2 examples(first single line, second multiline) with ID is sent to zookeeper.log

2022-01-31 17:51:45,451 [myid:1] - INFO  [NIOWorkerThread-3:NIOServerCnxn@514] - Processing mntr command from /0:0:0:0:0:0:0:1:50284


2022-02-01 00:46:33,626 [myid:1] - WARN  [SendWorker:2:QuorumCnxManager$SendWorker@1283] - Interrupted while waiting for message on queue
java.lang.InterruptedException
	at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2056)
	at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2133)
	at org.apache.zookeeper.util.CircularBlockingQueue.poll(CircularBlockingQueue.java:105)
	at org.apache.zookeeper.server.quorum.QuorumCnxManager.pollSendQueue(QuorumCnxManager.java:1448)
	at org.apache.zookeeper.server.quorum.QuorumCnxManager.access$900(QuorumCnxManager.java:99)
	at org.apache.zookeeper.server.quorum.QuorumCnxManager$SendWorker.run(QuorumCnxManager.java:1272)

And results in json

{
    "timestamp": "2022-03-28T13:57:00.535062-04:00",
    "severity": 30,
    "severity_text": "INFO",
    "labels": {
        "file_name": "zookeeper.log",
        "plugin_id": "zookeeper"
    },
    "record": {
        "line": "514",
        "message": "Processing mntr command from /0:0:0:0:0:0:0:1:50284\n\n\n",
        "myid": "1",
        "source": "NIOServerCnxn",
        "thread": "NIOWorkerThread-3",
        "time": "2022-01-31 17:51:45,451"
    }
}
{
    "timestamp": "2022-03-28T13:57:08.135142-04:00",
    "severity": 50,
    "severity_text": "WARN",
    "labels": {
        "file_name": "zookeeper.log",
        "plugin_id": "zookeeper"
    },
    "record": {
        "line": "1283",
        "message": "Interrupted while waiting for message on queue\njava.lang.InterruptedException\n\tat java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2056)\n\tat java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2133)\n\tat org.apache.zookeeper.util.CircularBlockingQueue.poll(CircularBlockingQueue.java:105)\n\tat org.apache.zookeeper.server.quorum.QuorumCnxManager.pollSendQueue(QuorumCnxManager.java:1448)\n\tat org.apache.zookeeper.server.quorum.QuorumCnxManager.access$900(QuorumCnxManager.java:99)\n\tat org.apache.zookeeper.server.quorum.QuorumCnxManager$SendWorker.run(QuorumCnxManager.java:1272)\n",
        "myid": "1",
        "source": "QuorumCnxManager$SendWorker",
        "thread": "SendWorker:2",
        "time": "2022-02-01 00:46:33,626"
    }
}

2 examples(first single line, second multiline) without ID is sent to zookeeper2.log

2022-01-31 17:51:45,451 - INFO  [NIOWorkerThread-3:NIOServerCnxn@514] - Processing mntr command from /0:0:0:0:0:0:0:1:50284
2022-02-01 00:46:33,626 - WARN  [SendWorker:2:QuorumCnxManager$SendWorker@1283] - Interrupted while waiting for message on queue
java.lang.InterruptedException
	at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2056)
	at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2133)
	at org.apache.zookeeper.util.CircularBlockingQueue.poll(CircularBlockingQueue.java:105)
	at org.apache.zookeeper.server.quorum.QuorumCnxManager.pollSendQueue(QuorumCnxManager.java:1448)
	at org.apache.zookeeper.server.quorum.QuorumCnxManager.access$900(QuorumCnxManager.java:99)
	at org.apache.zookeeper.server.quorum.QuorumCnxManager$SendWorker.run(QuorumCnxManager.java:1272)

and results in json

{
    "timestamp": "2022-03-28T13:57:41.33453-04:00",
    "severity": 30,
    "severity_text": "INFO",
    "labels": {
        "file_name": "zookeeper2.log",
        "plugin_id": "zookeeper"
    },
    "record": {
        "line": "514",
        "message": "Processing mntr command from /0:0:0:0:0:0:0:1:50284\n\n",
        "source": "NIOServerCnxn",
        "thread": "NIOWorkerThread-3",
        "time": "2022-01-31 17:51:45,451"
    }
}
{
    "timestamp": "2022-03-28T13:57:54.335323-04:00",
    "severity": 50,
    "severity_text": "WARN",
    "labels": {
        "file_name": "zookeeper2.log",
        "plugin_id": "zookeeper"
    },
    "record": {
        "line": "1283",
        "message": "Interrupted while waiting for message on queue\njava.lang.InterruptedException\n\tat java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2056)\n\tat java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2133)\n\tat org.apache.zookeeper.util.CircularBlockingQueue.poll(CircularBlockingQueue.java:105)\n\tat org.apache.zookeeper.server.quorum.QuorumCnxManager.pollSendQueue(QuorumCnxManager.java:1448)\n\tat org.apache.zookeeper.server.quorum.QuorumCnxManager.access$900(QuorumCnxManager.java:99)\n\tat org.apache.zookeeper.server.quorum.QuorumCnxManager$SendWorker.run(QuorumCnxManager.java:1272)\n",
        "source": "QuorumCnxManager$SendWorker",
        "thread": "SendWorker:2",
        "time": "2022-02-01 00:46:33,626"
    }
}

Copy link
Member

@jsirianni jsirianni left a comment

Choose a reason for hiding this comment

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

I get regex errors with the following

log

2022-01-31 17:51:45,451 - INFO  [NIOWorkerThread-3:NIOServerCnxn@514] - Processing mntr command from /0:0:0:0:0:0:0:1:50284
2022-01-31 17:51:45,451 [myid:1] - INFO  [NIOWorkerThread-3:NIOServerCnxn@514] - Processing mntr command from /0:0:0:0:0:0:0:1:50284
2022-01-31 17:51:45,451 - INFO  [NIOWorkerThread-3:NIOServerCnxn@514] - Processing mntr command from /0:0:0:0:0:0:0:1:50284
2022-01-31 17:51:45,451 [myid:1] - INFO  [NIOWorkerThread-3:NIOServerCnxn@514] - Processing mntr command from /0:0:0:0:0:0:0:1:50284
2022-01-31 17:51:45,451 - INFO  [NIOWorkerThread-3:NIOServerCnxn@514] - Processing mntr command from /0:0:0:0:0:0:0:1:50284
2022-01-31 17:51:45,451 [myid:1] - INFO  [NIOWorkerThread-3:NIOServerCnxn@514] - Processing mntr command from /0:0:0:0:0:0:0:1:50284
2022-02-01 00:46:33,626 - WARN  [SendWorker:2:QuorumCnxManager$SendWorker@1283] - Interrupted while waiting for message on queue
java.lang.InterruptedException
	at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2056)
	at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2133)
	at org.apache.zookeeper.util.CircularBlockingQueue.poll(CircularBlockingQueue.java:105)
	at org.apache.zookeeper.server.quorum.QuorumCnxManager.pollSendQueue(QuorumCnxManager.java:1448)
	at org.apache.zookeeper.server.quorum.QuorumCnxManager.access$900(QuorumCnxManager.java:99)
	at org.apache.zookeeper.server.quorum.QuorumCnxManager$SendWorker.run(QuorumCnxManager.java:1272)
2022-01-31 17:51:45,451 [myid:1] - INFO  [NIOWorkerThread-3:NIOServerCnxn@514] - Processing mntr command from /0:0:0:0:0:0:0:1:50284

Config

pipeline:
- type: zookeeper
  file_path: ./in
  start_at: beginning

- type: stdout

@JonathanWamsley

This comment was marked as outdated.

@JonathanWamsley
Copy link
Contributor Author

JonathanWamsley commented Mar 28, 2022

Updated to support multiple files.

@jsirianni jsirianni changed the base branch from master to google-parity March 29, 2022 14:32
Copy link
Member

@jsirianni jsirianni left a comment

Choose a reason for hiding this comment

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

I updated the target branch to google-parity

Comment on lines +10 to +11
- "/opt/zookeeper/logs/zookeeper-*.out"
- "/var/log/zookeeper/zookeeper.log"
Copy link
Member

Choose a reason for hiding this comment

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

Are these the same default values as ops-agent? Generally, if zookeeper is writing logs to one, it will not be writing to the other.

In my opinion, we keep the default the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, these are the default paths that are looked for in the ops-agent .
When you say keep the default the same, you are talking about "/home/kafka/kafka/logs/zookeeper.log" and then the user would have to specify one ops-agent path or the other?

description: The absolute path to the Zookeeper logs
type: string
default: "/home/kafka/kafka/logs/zookeeper.log"
type: strings
Copy link
Member

Choose a reason for hiding this comment

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

I like the idea of using strings here, but it does break compatibility. I am okay with this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn 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