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

Export gossip with macro #73

Draft
wants to merge 47 commits into
base: prometheus
Choose a base branch
from
Draft

Commits on Jul 27, 2022

  1. Initial Prometheus support

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    5e080e1 View commit details
    Browse the repository at this point in the history
  2. Add Solana node's version

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    15ded10 View commit details
    Browse the repository at this point in the history
  3. Rename metric

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    8b20faf View commit details
    Browse the repository at this point in the history
  4. Bugfix: balance should be gauge

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    b0f40a1 View commit details
    Browse the repository at this point in the history
  5. delete dependabot from our fork

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    a728409 View commit details
    Browse the repository at this point in the history
  6. Remove at parameter

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    5332470 View commit details
    Browse the repository at this point in the history
  7. Change path from prometheus to metrics

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    906f67c View commit details
    Browse the repository at this point in the history
  8. Change cluster -> node

    When referring to our node, we use simply `node` as opposed to
    `cluster`.
    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    3a958c3 View commit details
    Browse the repository at this point in the history
  9. Rename metrics

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    ba68332 View commit details
    Browse the repository at this point in the history
  10. Simplify Lamports struct

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    d734527 View commit details
    Browse the repository at this point in the history
  11. Change license to Apache 2.0

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    f528d3e View commit details
    Browse the repository at this point in the history
  12. Add block's timestamp

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    253ac1c View commit details
    Browse the repository at this point in the history
  13. Rename metrics

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    ecd70c1 View commit details
    Browse the repository at this point in the history
  14. Turn i64 to u64 timestamp

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    2d09704 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    bfc1328 View commit details
    Browse the repository at this point in the history
  16. Add label about commitment level

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    ad78d65 View commit details
    Browse the repository at this point in the history
  17. Change help msg for block's timestamp

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    aedcbe4 View commit details
    Browse the repository at this point in the history
  18. Add and rename label

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    ddf4cdf View commit details
    Browse the repository at this point in the history
  19. Get finalized bank

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    78fe0c8 View commit details
    Browse the repository at this point in the history
  20. Add metrics for each commitment level

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    2a861d9 View commit details
    Browse the repository at this point in the history
  21. Use block_commitment_cache

    Instead of propagating `rpc_processor`, use the `block_commitment_cache`
    structure to get different bank confirmation levels
    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    390a8c5 View commit details
    Browse the repository at this point in the history
  22. Limit block_commitment_cache read lock.

    As ruuda pointed out, there is a deadlock if we acquire a read lock for
    both `block_commitment_cache` and `bank_forks`, in ruuda words:
    - We take the read lock on block_commitment_cache.
    - Some other thread takes a write lock on bank_forks.
    - We want to take the read lock on bank_forks, but this blocks because
      the other thread holds a write lock.
    - The other thread wants to take a write lock on block_commitment_cache,
      but that blocks because we hold the read lock.
    - Deadlock!
    
    Instead, we guard the `block_commitment_cache` read lock so we don't
    hold two read locks concurrently. This might lead, as ruuda also
    pointed out, to an inconsistency that's known to Solana and dealt
    already in the code the same way it's dealt in `rpc/src/rpc.rs`.
    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    399e9e1 View commit details
    Browse the repository at this point in the history
  23. Correct prometheus type

    Should be "counter", not "count"
    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    2aebf10 View commit details
    Browse the repository at this point in the history
  24. Save metrics about the validator's vote account

    Also update Cargo.lock.
    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    b7e4d96 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    9d97a4e View commit details
    Browse the repository at this point in the history
  26. Rename, specify metrics

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    f25093e View commit details
    Browse the repository at this point in the history
  27. Get last vote

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    e224e52 View commit details
    Browse the repository at this point in the history
  28. Clone Lamports struct

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    ad69c55 View commit details
    Browse the repository at this point in the history
  29. Add label to vote balance

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    f9727f3 View commit details
    Browse the repository at this point in the history
  30. Rename labels

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    11a6f7f View commit details
    Browse the repository at this point in the history
  31. Add parameter to observe vote accounts.

    Down the rabbit hole from the arguments, propagating it to the
    prometheus part, we add a flag so we can track multiple vote accounts.
    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    3a1fad8 View commit details
    Browse the repository at this point in the history
  32. Add vote metrics

    Modify how metrics are written to account for when there's nothing to
    report.
    Add metrics about votes: last voted and vote balance
    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    c5421d1 View commit details
    Browse the repository at this point in the history
  33. Naming changes, add vote credits information

    Change variable and function names, and add information about vote
    credits
    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    0888bc4 View commit details
    Browse the repository at this point in the history
  34. Write vote account metrics

    Slight change on how metrics are recorded
    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    d7045e7 View commit details
    Browse the repository at this point in the history
  35. Rename prometheus metrics help

    Co-authored-by: Ruud van Asseldonk <[email protected]>
    enriquefynn and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    da01458 View commit details
    Browse the repository at this point in the history
  36. Refer as validator metrics

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    e432aae View commit details
    Browse the repository at this point in the history
  37. Rename variables

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    b711766 View commit details
    Browse the repository at this point in the history
  38. Bugfix: Correct initialization

    enriquefynn authored and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    e45bbac View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    ac132cf View commit details
    Browse the repository at this point in the history
  40. Change metric name

    Co-authored-by: Ruud van Asseldonk <[email protected]>
    enriquefynn and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    980fb16 View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    d46b45a View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    0af8d74 View commit details
    Browse the repository at this point in the history
  43. Update metric name

    Co-authored-by: Ruud van Asseldonk <[email protected]>
    enriquefynn and ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    eb9f025 View commit details
    Browse the repository at this point in the history
  44. Expose epoch schedule metrics in Prometheus

    With the epoch start slots and the number of slots in the epoch (and the
    current slot, which we already had), we can infer/estimate:
    
     * Epoch progress percentage
     * Slots left until the next epoch
     * Time left until the next epoch (from slot height increase)
    
    These are useful metrics to have about the network.
    ruuda committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    db9b7f7 View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2022

  1. Export gossip metrics with a macro

    Derive a macro for `GossipStats`, a less invasive and more concise way
    of writing all metrics from it.
    Currently, the macro only accepts `Counter` type and will fail if used
    otherwise, but we can probably expand it in the future to work with more
    data types.
    enriquefynn committed Aug 6, 2022
    Configuration menu
    Copy the full SHA
    dccf07d View commit details
    Browse the repository at this point in the history
  2. Comment submit_gossip_stats

    This function clears the gossip stats.
    enriquefynn committed Aug 6, 2022
    Configuration menu
    Copy the full SHA
    3109cbf View commit details
    Browse the repository at this point in the history
  3. Do not update last_print

    Since we commented the previous line, doesn't make sense to update this
    variable.
    enriquefynn committed Aug 6, 2022
    Configuration menu
    Copy the full SHA
    8f54039 View commit details
    Browse the repository at this point in the history