docs: Render api_short_name visibly in the Monitoring guide (#500)

This commit is contained in:
Rebecca Le 2023-02-01 12:20:51 +08:00 committed by GitHub
parent 6ba7a03f62
commit e8563a03eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 9 deletions

View file

@ -8,14 +8,16 @@ Ash emits the following telemetry events, suffixed with `:start` and `:stop`. St
### Important
Note the mention of `:start` and `:stop` suffixes. The event below `[:ash, <api_short_name>, :create]`, is actually referring to two events, `[:ash, <api_short_name>, :create, :start]` and `[:ash, <api_short_name>, :create, :stop]`.
Note the mention of `:start` and `:stop` suffixes. The event below `[:ash, (api_short_name), :create]`, is actually referring to two events, `[:ash, (api_short_name), :create, :start]` and `[:ash, (api_short_name), :create, :stop]`.
_Replace `(api_short_name)` with your API short name, from `d:Ash.Api.Info.short_name`._
### Events
- `[:ash, <api_short_name>, :create]` - The execution of a create action. Use `resource_short_name` and `action` metadata to break down measurements.
- `[:ash, <api_short_name>, :update]` - The execution of a update action. Use `resource_short_name` and `action` metadata to break down measurements.
- `[:ash, <api_short_name>, :read]` - The execution of a read action. Use `resource_short_name` and `action` metadata to break down measurements.
- `[:ash, <api_short_name>, :destroy]` - The execution of a destroy action. Use `resource_short_name` and `action` metadata to break down measurements.
- `[:ash, (api_short_name), :create]` - The execution of a create action. Use `resource_short_name` and `action` metadata to break down measurements.
- `[:ash, (api_short_name), :update]` - The execution of a update action. Use `resource_short_name` and `action` metadata to break down measurements.
- `[:ash, (api_short_name), :read]` - The execution of a read action. Use `resource_short_name` and `action` metadata to break down measurements.
- `[:ash, (api_short_name), :destroy]` - The execution of a destroy action. Use `resource_short_name` and `action` metadata to break down measurements.
- `[:ash, :changeset]` - A changeset being processed for a given action, i.e with `Ash.Changeset.for_create`. Use `resource_short_name` metadata to break down measurements.
- `[:ash, :query]` - A query being processed for an action, with `Ash.Query.for_read`. Use `resource_short_name` metadata to break down measurements.
- `[:ash, :validation]` - A validation being run on a changeset. Use `resource_short_name` and `validation` metadata to break down measurements.

View file

@ -119,7 +119,7 @@ defmodule Ash.Api.Info do
end
@doc "The short name for an api"
@spec short_name(Ash.Api.t()) :: nil | :infinity | integer()
@spec short_name(Ash.Api.t()) :: atom
def short_name(api) do
Extension.get_opt(api, [:execution], :short_name, nil) || api.default_short_name()
end