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

Add telemetry #463

Merged
merged 1 commit into from
Mar 19, 2021
Merged

Add telemetry #463

merged 1 commit into from
Mar 19, 2021

Conversation

alpe
Copy link
Contributor

@alpe alpe commented Mar 18, 2021

Resolves #387

@alpe alpe requested a review from ethanfrey March 18, 2021 15:30
Copy link
Member

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

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

Looks good. Open question about how the metrics work with recursive calls.
This probably needs manual testing to determine and can be improved in another PR. Adding this at all is already a great improvement.

contrib/prometheus/README.md Show resolved Hide resolved
@@ -443,6 +447,7 @@ func (k Keeper) migrate(ctx sdk.Context, contractAddress sdk.AccAddress, caller
// another native Go module directly. Thus, the keeper doesn't place any access controls on it, that is the
// responsibility or the app developer (who passes the wasm.Keeper in app.go)
func (k Keeper) Sudo(ctx sdk.Context, contractAddress sdk.AccAddress, msg []byte) (*sdk.Result, error) {
defer telemetry.MeasureSince(time.Now(), "wasm", "contract", "sudo")
Copy link
Member

Choose a reason for hiding this comment

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

Nice, so we get a count and time used for all the keeper calls.

If we have recursive contract calls (A calls B calls C), we will get 3 prometheus events, right? (A + B + C, B + C, and C). Is it possible to annotate that these are nested somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are very broad metrics that measure an operation but not link them with the contract itself. With recursive calls we would get 3 events. I had chosen to not add contract labels as this would be a growing dataset. But I agree that some sort of tracing makes a lot of sense. We should look into https://opentelemetry.io/ and friends instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pinned could be a good category label in a new iteration

This was referenced Mar 18, 2021
@alpe alpe merged commit 63fe568 into master Mar 19, 2021
@alpe alpe deleted the telemetry_387 branch March 19, 2021 08:31
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.

Collect Contract Metrics
2 participants