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

feat(metrics) add invocation and error counts for actor invocations #1602

Merged

Conversation

protochron
Copy link
Contributor

@protochron protochron commented Feb 29, 2024

Feature or Problem

Add two new metrics for actors:

  • the count of the number of invocations (wasmcloud_host.actor.invocations)
  • the count of errors (wasmcloud_host.actor.errors)

This also adds a bunch of new attributes to the existing actor metrics so that they make sense in an environment with multiple hosts. Specifically this adds:

  • the lattice ID
  • the host ID
  • provider information if a provider invoked the actor: ** the contract ID
    • the provider ID
    • the name of the linkdef

For actor to actor calls, instead of having the provider metadata it instead has the public key of the invoking actor.

An example of what this looks like as an exported Prometheus metric:

wasmcloud_host_actor_invocations_total{actor_ref="wasmcloud.azurecr.io/echo:0.3.8", caller_provider_contract_id="wasmcloud:httpserver", caller_provider_id="VAG3QITQQ2ODAOWB5TTQSDJ53XK3SHBEIFNK4AYJ5RKAX2UNSCAPHA5M", caller_provider_link_name="default", host="ND7L3RZ6NLYJGN25E6DKYS665ITWXAPXZXGZXLCUQEDDU65RB5TVUHEN", job="wasmcloud-host", lattice="default", operation="HttpServer.HandleRequest"}

Provider metrics will likely need to wait until the wRPC work is finished.

Related Issues

A start on adding some of the additional metrics highlighted in #664.

Release Information

Consumer Impact

Testing

Tested locally with an OTEL collector relaying metrics to Prometheus.

Unit Test(s)

Acceptance or Integration

Manual Verification

@protochron protochron force-pushed the additional_actor_metrics branch 4 times, most recently from c0b7c62 to aef79c7 Compare February 29, 2024 01:02
Copy link
Contributor

@vados-cosmonic vados-cosmonic left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

crates/host/src/metrics.rs Outdated Show resolved Hide resolved
Add two new metrics for actors:
* the count of the number of invocations (`wasmcloud_host.actor.invocations`)
* the count of errors (`wasmcloud_host.actor.invocation.errors`)

This also adds a bunch of new attributes to the existing actor metrics so that they make sense in an environment with multiple hosts. Specifically this adds:
* the lattice ID
* the host ID
* provider information if a provider invoked the actor: ** the contract ID
** the provider ID
** the name of the linkdef

For actor to actor calls, instead of having the provider metadata it instead has the public key of the invoking actor.

An example of what this looks like as an exported Prometheus metric:

```
wasmcloud_host_actor_invocations_total{actor_ref="wasmcloud.azurecr.io/echo:0.3.8", caller_provider_contract_id="wasmcloud:httpserver", caller_provider_id="VAG3QITQQ2ODAOWB5TTQSDJ53XK3SHBEIFNK4AYJ5RKAX2UNSCAPHA5M", caller_provider_link_name="default", host="ND7L3RZ6NLYJGN25E6DKYS665ITWXAPXZXGZXLCUQEDDU65RB5TVUHEN", job="wasmcloud-host", lattice="default", operation="HttpServer.HandleRequest"}
```

Provider metrics will likely need to wait until the wRPC work is finished.

Signed-off-by: Dan Norris <protochron@users.noreply.github.com>
@vados-cosmonic
Copy link
Contributor

Tried to merge but it looks like we need an approval from @thomastaylor312

@brooksmtownsend
Copy link
Member

@thomastaylor312 bump

@brooksmtownsend brooksmtownsend merged commit 7d51408 into wasmCloud:main Mar 5, 2024
43 checks passed
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.

None yet

4 participants