input-output-hk / hydra

Implementation of the Hydra Head protocol
https://hydra.family/head-protocol/
Apache License 2.0
264 stars 86 forks source link

Report Hydra head transaction history when closing head. #1467

Open StakeWithPride opened 4 weeks ago

StakeWithPride commented 4 weeks ago

Why

Provide developers the ability to capture rich telemetry.

What

The original idea was to be able to track TPS by self-reporting the count of transactions and the period over which they occurred.

There are probably other use cases and applications that developers will want so probably best we keep reporting malleable. Should reporting be optional? Is an honor system used be having only one party report or is the metric signed by all parties? What else should we be discussing?

How

The ask is to start a discussion about what sort of transaction history could be reported upon closing the head.

v0d1ch commented 3 weeks ago

I think Hydra node logs could provide the metrics you are looking for already? Upon each valid transaction we output TxValid message so one could compute some metrics by looking at the start time, end time and all occurrences of TxValid. We can, of course, do more but I would say let's talk about the specific use-case you had in mind first and see if we actually need to do anything or the information hydra-node provides is already enough? TPS is not really a good metric but one that keeps popping back to us :)

StakeWithPride commented 3 weeks ago

Hydra node logs could provide the metrics

This feature request is to provide standardization around posting these metrics publicly on-chain in an efficient manner. Substantial work will be performed within Hydra and publishing a summary would permit dashboards to highlight the success of Hydra beyond number of instantiations.

TPS is not really a good metric

Agreed. Was simply using it for illustration purposes. Hopefully this discussion with folks more familiar with Hydra can suggest other meaningful metrics that could be of interest and provide a generic enough function to meet current and future metric ideas.

Sebastian and Arnaud indicated in Discord this would be a good thread to initiate on GH so with their enthusiasm I created this

ch1bo commented 2 weeks ago

Thanks for sharing this idea @StakeWithPride

FWIW there is already a basic prometheus monitor in place. Right now it allows to consume transaction confirmation times and number of txs IIRC. See https://hydra.family/head-protocol/docs/how-to/operating-hydra#monitoring for details.

With #183 we thought it might be good to adopt the open-telemetry approach which sounds a lot the standardization you would be interested as well.

What is new, is the idea of putting aggregated metrics on chain. Why would we want to do this?

I would love to see this or #183 progress as I think the metrics story is not very good with hydra right now. Is there something we can learn from the cardano-node and maybe provide similar transaction-based metrics - is there something standardized for Cardano (L1) even?