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

Added logging decorator for CuratorFramework to Audit ZK Endpoints #2172

Merged
merged 15 commits into from
Feb 2, 2021

Conversation

rosalind210
Copy link
Contributor

@rosalind210 rosalind210 commented Jan 27, 2021

Created a decorator for the CuratorFramework to handle logging calls to ZooKeeper. It holds a maps that connects the thread ID, classname, and method nameto the number of zookeeper calls it has made over certain interval of time.

The most important updates:

  • LoggingCuratorFramework created that keeps track of call counts and logs when that amount
  • New framework is set as CuratorFramework in the SingularityCuratorProvider, if a boolean useLoggingCuratorFramework is true in the SingularityConfiguration
  • logging curator's clear() performed by a timer, clears every 30 milliseconds.

[1/28 Update] Added timer to LoggingCuratorFramework that performs a clear (logs and empties everything in the map) every 3 minutes.

[1/29] Logs tested in iad03-test, output:

INFO  [2021-01-29 21:22:58,168] com.hubspot.singularity.data.LoggingCuratorFramework: 49: TaskManager's getTasks called ZK 1 times in 180000 milliseconds
INFO  [2021-01-29 21:22:58,168] com.hubspot.singularity.data.LoggingCuratorFramework: 45: TaskManager's getTaskIdsForRequest called ZK 6 times in 180000 milliseconds
INFO  [2021-01-29 21:22:58,168] com.hubspot.singularity.data.LoggingCuratorFramework: 49: TaskManager's filterInactiveTaskIds called ZK 12 times in 180000 milliseconds
INFO  [2021-01-29 21:22:58,168] com.hubspot.singularity.data.LoggingCuratorFramework: 47: TaskManager's getTaskHistoryUpdates called ZK 12 times in 180000 milliseconds
INFO  [2021-01-29 21:22:58,168] com.hubspot.singularity.data.LoggingCuratorFramework: 43: StateManager's getState called ZK 4 times in 180000 milliseconds
INFO  [2021-01-29 21:22:58,168] com.hubspot.singularity.data.LoggingCuratorFramework: 49: TaskManager's getTaskMetadata called ZK 2 times in 180000 milliseconds
INFO  [2021-01-29 21:22:58,168] com.hubspot.singularity.data.LoggingCuratorFramework: 49: TaskManager's getHealthcheckResults called ZK 2 times in 180000 milliseconds
INFO  [2021-01-29 21:22:58,168] com.hubspot.singularity.data.LoggingCuratorFramework: 49: DeployManager's getRequestDeployState called ZK 2 times in 180000 milliseconds

@rosalind210 rosalind210 changed the title WIP: Added logging decorator for CuratorFramework Added logging decorator for CuratorFramework to Audit ZK Endpoints Jan 29, 2021
@pschoenfelder
Copy link
Contributor

Looks solid overall 👍 Couple minor things but the core is all there

I'm curious — will these logs mostly be read by humans or machines (presumably aggregating for further analysis)? If the latter, may want to make the output format more easily parsable, but otherwise looks good.

@pschoenfelder
Copy link
Contributor

🚢

@ssalinas
Copy link
Member

ssalinas commented Feb 2, 2021

🚢

@rosalind210 rosalind210 merged commit 1c455b4 into master Feb 2, 2021
@ssalinas ssalinas deleted the audit_endpoints_zk_call_counts branch February 2, 2021 16:56
@ssalinas ssalinas added this to the 1.5.0 milestone May 4, 2022
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.

None yet

3 participants