Is there any metrics related to Ledger API Connections

I was looking for metrics that related to Ledger API connections. Things like number of ledger API connections, sessions and bandwidth etc. Is there anything like that in the current release?

2 Likes

The new stand-alone daml-on-sql distribution (aka “DAML for PostgreSQL”) has a comprehensive readme that covers metrics. First, there’s a section on how to enable and get hold of metrics. Further on, there’s a comprehensive list of metrics.

Neither of these is completely uniform across different DAML Ledgers. We currently see monitoring as Ledger specific functionality. However, the way daml-on-sql does it should give you a good idea what’s available in general and how to work with the data.

Is your monitoring use-case covered by what’s available? I don’t think the specific metrics you are looking for are available but the number of gRPC connections is not that informative in itself as idle gRPC subscriptions/connections use virtually no resources.

1 Like

Thanks @bernhard. Looks like the daml-on-sql metrics cover how DAML command perform and the interaction with the underlying ledger. It is handy for monitoring the performance of the ledger.

In the mean time I’m looking for some metrics related to the ledger API connection. Considering the scenario where multiple clients/ledger API users operate on the same ledger through a ledger API connection. The resource consumption or connection status will help in monitoring. Things like a client might create multiple connections using the same ledger API user due to some programming issue. In some cases it might be security related such as the external client attempt to connect continuously using incorrect token or the token contains invalid information such as incorrect application id or party. Metrics and logs on the ledger api would help in those scenario. Or maybe there are other ways to address them?

1 Like

I’m not sure there’s a good way to monitor the number of connections without an additional piece of infrastructure like a reverse proxy, but the security use case should be covered by logging. Any attempt to call the Ledger API with an incorrect token is logged. The aforementioned docs also have a section on logging.

1 Like

Just curious, current sandbox can run on either memory or postgresql. With the daml-on-sql, is it going to a different flavour of sandbox?

@bernhard, I probably missed something but in the link you shared, there are a lot discussions around metrics but not much about what events are logged.

2 Likes

As indicated in the release notes, we would like to properly distinguish between the development tool Sandbox, and an open source (and commercial) ledger “DAML for PostgreSQL”.
Sandbox’s persistence mode will be deprecated when daml-on-sql becomes stable.

As for you observation about logging, that points to a documentation gap. I’ve opened #7206, thanks!

1 Like

@bernhard, @SamirTalwar
Just want to follow up the above. I also post another question which might related to this discussion.

Any thoughts?

2 Likes