Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for metrics collection (#1762)
<!-- please provide a detailed description of the changes made in this pull request. --> This PR introduces a package for instrumenting the code for metrics collection. The new README details the environment variables that need to be set and includes an example of how one might configure their local pipeline to export metrics to Grafana Cloud. I've added a few metrics in the `tm2` package; I _think_ they are in the correct spots. You may notice that the `metrics` subfolder in the `telemetry` package is unnecessarily modular. This is because this package originally include code for gathering traces as well. There is an existing issue with this and have decide to presently exclude it from this PR until it is fixed and/or requested -- this is a feature we would almost certainly not want to enable in a production environment. Metrics collection is more likely to be enabled in prod because they can be set to be exported to a local collector application that handles more complex batching, retry requests, and publishing to the end data store, in this case Grafana. <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [x] Updated the official documentation or not needed - [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x] Added references to related issues and PRs - [x] Provided any useful hints for running manual tests - [x] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details>
- Loading branch information