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

feat: add/refactor port 8123 telemetry in zetalient #709

Merged
merged 7 commits into from
Jun 16, 2023

Conversation

brewmaster012
Copy link
Collaborator

@brewmaster012 brewmaster012 commented Jun 15, 2023

move constructor out of NewTSS;
add lastStartTimestamp
add lastScannedBlock on each chain
add lastCoreBlock on zetacore

closes #682 #699

added telemetry items:

# curl localhost:8123/lastcoreblock
175

# curl localhost:8123/lastscannedblock
{"1337":272,"18444":194}

# curl localhost:8123/laststarttamstamp
2023-06-15T06:52:02Z

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.

Closes:

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Include instructions and any relevant details so others can reproduce.

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Checklist:

  • I have added unit tests that prove my fix feature works

move constructor out of NewTSS;
add lastStartTimestamp
add lastScannedBlock on each chain
@brewmaster012 brewmaster012 requested a review from kingpinXD June 15, 2023 05:15
@brewmaster012 brewmaster012 changed the title feat: refactor 8123 telemetry in zetalient feat: refactor port 8123 telemetry in zetalient Jun 15, 2023
@brewmaster012 brewmaster012 changed the title feat: refactor port 8123 telemetry in zetalient feat: add/refactor port 8123 telemetry in zetalient Jun 15, 2023
Copy link
Member

@CharlieMc0 CharlieMc0 left a comment

Choose a reason for hiding this comment

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

A couple questions about the SetCoreBlockNumber function and why /pending was excluded

router.HandleFunc("/debug/pprof/", pprof.Index)
router.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline)

//router.Handle("/pending", http.HandlerFunc(t.pendingHandler)).Methods(http.MethodGet)
Copy link
Member

Choose a reason for hiding this comment

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

Is this for pending CCTXs? Why not include it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Our rpc improved so pending txs can be queried form node rpc efficiently. This is no longer needed.

Comment on lines +79 to +84
func (t *TelemetryServer) SetCoreBlockNumber(blockNumber int64) {
t.mu.Lock()
t.lastCoreBlockNumber = blockNumber
t.mu.Unlock()
}

Copy link
Member

Choose a reason for hiding this comment

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

What is this function for? Does it cause zetaclient to rescan older blocks?

Copy link
Member

@CharlieMc0 CharlieMc0 Jun 15, 2023

Choose a reason for hiding this comment

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

I see now there is no routing. At first I thought this was something you could hit externally via the 8123 endpoint

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is a setter to feed info into telemetry server.

@brewmaster012 brewmaster012 requested a review from CharlieMc0 June 15, 2023 21:51
@brewmaster012 brewmaster012 merged commit ebe5109 into develop Jun 16, 2023
@brewmaster012 brewmaster012 deleted the zetaclient-telemetry branch June 16, 2023 17:42
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.

add: zetaclient telemetry for scanning progresses on external chains
3 participants