Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

feat: record prom metrics and ui consumes them #36

Merged
merged 14 commits into from
Mar 15, 2020
Merged

feat: record prom metrics and ui consumes them #36

merged 14 commits into from
Mar 15, 2020

Conversation

alanshaw
Copy link
Member

supersedes #30

Copy link
Member

@daviddias daviddias left a comment

Choose a reason for hiding this comment

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

LGTM so far!

.gitignore Outdated
@@ -1,3 +1,4 @@
hydra-booster
hydra-belly
coverage.txt
data
Copy link
Member

Choose a reason for hiding this comment

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

can prometheus write to prometheus-data?

Copy link
Member Author

Choose a reason for hiding this comment

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

I did not see an option for this I could put in promconfig.yaml but there is a command line option I could add in the docs (I wanted this also 😂).

hydra/periodicmetrics.go Show resolved Hide resolved
fmt.Fprintf(os.Stderr, "Running %d DHT Sybils:\n", options.NSybils)

var hyperLock sync.Mutex
hyperlog := hyperloglog.New()
Copy link
Member Author

Choose a reason for hiding this comment

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

Idea: Instead of storing and calculating unique peers per hydra, we should just log them to a file and use a separate process to tail the logs and calculate it. We want our hydra to do as little extra work as possible since we're going to be running so many sybils on each machine.

@olizilla is using https://github.com/google/mtail to do this in combination with the peerlog plugin to get unique peers seen by the gateways.

If we did this, we could then monitor unique peer IDs across multiple hydras, which may be a reassurring compliment to the unique peers seen by the gateways.

cc @momack2

Copy link

@olizilla olizilla Mar 13, 2020

Choose a reason for hiding this comment

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

clarification, the peerlog plugin logs unique peerIDs as they connect and disconnect, and we use ELK / elastic search to report over unique peerIDs seen across a given time period. If hydra-bootster can log PeerIDs in the same structure as produced by the peerlog plugin, we can send those logs to ELK too, and add them to that report.

mtail is an alternative option, for situations where there is a metric you want to scrape with prometheus that can only be derived from logs, but we dont need both.

Choose a reason for hiding this comment

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

and yes, I support this idea!

Choose a reason for hiding this comment

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

by agreggating over all the logs for all the infra, we can apply the uniquness constraint across all services, which is neat.

Copy link
Member

Choose a reason for hiding this comment

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

I support this idea too! :)

Copy link
Member Author

Choose a reason for hiding this comment

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

#39

@alanshaw alanshaw requested a review from daviddias March 14, 2020 00:43
Copy link
Member

@daviddias daviddias left a comment

Choose a reason for hiding this comment

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

Nothing to point out.

This PR is already a tad big. Time to merge and get a hydra-node deployed? Fixing any bug left in smaller PRs?

@alanshaw alanshaw merged commit 7c3541f into master Mar 15, 2020
@alanshaw alanshaw deleted the feat/prom2 branch March 15, 2020 19:23
@momack2
Copy link

momack2 commented Mar 15, 2020

6B04209B-5278-42D4-BD74-325BE4A3A2B6

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants