Skip to content

ENG-2835 websocket monitoring daemon (endpoint-monitor)#3581

Merged
mslipper merged 1 commit intodevelopfrom
zhwrd/edge-proxyd-exporter
Oct 1, 2022
Merged

ENG-2835 websocket monitoring daemon (endpoint-monitor)#3581
mslipper merged 1 commit intodevelopfrom
zhwrd/edge-proxyd-exporter

Conversation

@zhwrd
Copy link
Contributor

@zhwrd zhwrd commented Sep 27, 2022

Description

Adds websocket monitoring daemon for edge-proxyd and downstream infra providers. This first iteration is pretty specific to one method: eth_subscribe. I opted to re-use the eth client instead of rolling my own websocket client since I understand we mainly only allow the subscribe method... Also in general, think we'd be better off using a vendor for most synthetic testing on our edge proxies since it will let us ping the endpoint from several regions without having to deploy there...

In a loop, runs eth_subscribe over websocket for each configured provider and reports metrics to prometheus on any errors encountered.

Metadata

@changeset-bot
Copy link

changeset-bot bot commented Sep 27, 2022

⚠️ No Changeset found

Latest commit: c77b42e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mergify
Copy link
Contributor

mergify bot commented Sep 27, 2022

This PR changes implementation code, but doesn't include a changeset. Did you forget to add one?

@zhwrd zhwrd force-pushed the zhwrd/edge-proxyd-exporter branch 2 times, most recently from 5baf272 to 6f7c316 Compare September 29, 2022 20:28
@zhwrd zhwrd changed the title ENG-2835 websocket monitoring daemon (edge-proxyd-exporter) ENG-2835 websocket monitoring daemon (endpoint-monitor) Sep 29, 2022
@zhwrd zhwrd force-pushed the zhwrd/edge-proxyd-exporter branch 5 times, most recently from 7709411 to 569b5d2 Compare September 29, 2022 21:35
Copy link
Contributor

@mslipper mslipper left a comment

Choose a reason for hiding this comment

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

Looks good. A couple nits:

  • We generally use urfave/cli elsewhere in the codebase to do env var parsing/CLI management. It's nice because it lets you specify command line args as well. It also integrates with the op-service package, which contains generalized utilities for passing in metric configs and serving them.
  • We also use op-service to create instances of the Prometheus metrics collector rather than serving a global. See https://github.com/ethereum-optimism/optimism/tree/develop/op-service/metrics for the package in question.
  • We usually do manual signal handling so we can gracefully shut things down on SIGINT.

These aren't blocking, though, given the scope + goals of this project.

Lastly, this PR is under the size SLA when you discount the go.sum file.

@zhwrd zhwrd closed this Sep 30, 2022
@zhwrd zhwrd reopened this Sep 30, 2022
@zhwrd
Copy link
Contributor Author

zhwrd commented Sep 30, 2022

Looks good. A couple nits:

  • We generally use urfave/cli elsewhere in the codebase to do env var parsing/CLI management. It's nice because it lets you specify command line args as well. It also integrates with the op-service package, which contains generalized utilities for passing in metric configs and serving them.
  • We also use op-service to create instances of the Prometheus metrics collector rather than serving a global. See https://github.com/ethereum-optimism/optimism/tree/develop/op-service/metrics for the package in question.
  • We usually do manual signal handling so we can gracefully shut things down on SIGINT.

These aren't blocking, though, given the scope + goals of this project.

Lastly, this PR is under the size SLA when you discount the go.sum file.

cool, will go ahead and adopt the op-service standard stuff, looks useful!

@zhwrd zhwrd force-pushed the zhwrd/edge-proxyd-exporter branch 5 times, most recently from f5f4407 to fe1ae0a Compare September 30, 2022 19:04
@zhwrd zhwrd force-pushed the zhwrd/edge-proxyd-exporter branch from fe1ae0a to c77b42e Compare September 30, 2022 19:05
@zhwrd zhwrd marked this pull request as ready for review September 30, 2022 19:14
@zhwrd
Copy link
Contributor Author

zhwrd commented Sep 30, 2022

Think this looks good now... Don't think i can gracefully shutdown the metrics server in this case because don't have access to the underlying Server from the op-server/metrics package but correct me if i'm wrong? Anyways it's not really important here so all good.

}

type Config struct {
Providers []string `envconfig:"PROVIDERS" required:"true"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Do these envconfig tags carry meaning anymore?

@mslipper mslipper merged commit 48aa3d1 into develop Oct 1, 2022
@mslipper mslipper deleted the zhwrd/edge-proxyd-exporter branch October 1, 2022 08:54
This was referenced Oct 13, 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.

2 participants