Skip to content

Commit e60f9cf

Browse files
committed
Minor doc adjustments
1 parent 2c1d07b commit e60f9cf

File tree

7 files changed

+64
-65
lines changed

7 files changed

+64
-65
lines changed

guides/Getting Started.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Getting Started
22

3-
This guide is an introduction to the ErrorTracker, an Elixir based built-in error tracking solution. The ErrorTracker provides a basic and free error-tracking solution integrated in your own application. It is designed to be easy to install and easy to use so you can integrate it in your existing project with minimal changes. The only requirement is a relational database in which errors will be tracked.
3+
This guide is an introduction to ErrorTracker, an Elixir-based built-in error tracking solution. ErrorTracker provides a basic and free error-tracking solution integrated in your own application. It is designed to be easy to install and easy to use so you can integrate it in your existing project with minimal changes. The only requirement is a relational database in which errors will be tracked.
44

5-
In this guide we will learn how to install the ErrorTracker in an Elixir project so you can start reporting errors as soon as possible. We will also cover more advanced topics such as how to report custom errors and how to add extra context to reported errors.
5+
In this guide we will learn how to install ErrorTracker in an Elixir project so you can start reporting errors as soon as possible. We will also cover more advanced topics such as how to report custom errors and how to add extra context to reported errors.
66

7-
**This guide requires you to have setup Ecto with PostgreSQL beforehand.**
7+
**This guide requires you to have set up Ecto with PostgreSQL beforehand.**
88

99
## Installing the ErrorTracking as a dependency
1010

11-
The first step add the ErrorTracker to your application is to declare the package as a dependency in your `mix.exs` file:
11+
The first step to add ErrorTracker to your application is to declare the package as a dependency in your `mix.exs` file:
1212

1313
```elixir
1414
# mix.exs
@@ -19,29 +19,29 @@ defp deps do
1919
end
2020
```
2121

22-
Once the ErrorTracker is declared as a dependency of your application, you can install it with the following command:
22+
Once ErrorTracker is declared as a dependency of your application, you can install it with the following command:
2323

2424
```bash
2525
mix deps.get
2626
```
2727

28-
## Configuring the ErrorTracker
28+
## Configuring ErrorTracker
2929

30-
The ErrorTracker needs a few configuration options to work. This configuration should be added in your `config/config.exs` file:
30+
ErrorTracker needs a few configuration options to work. This configuration should be added to your `config/config.exs` file:
3131

3232
```elixir
3333
config :error_tracker,
3434
repo: MyApp.Repo,
3535
otp_app: :my_app
3636
```
3737

38-
The `:repo` option specifies the repository that will be used by the ErrorTracker. You can use your regular application repository, or a different one if you prefer to keep errors in a different database.
38+
The `:repo` option specifies the repository that will be used by ErrorTracker. You can use your regular application repository or a different one if you prefer to keep errors in a different database.
3939

40-
The `:otp_app` option specifies your application name. When an error happens the ErrorTracker will use this information to understand which parts of the stacktrace belong to your application and which parts belong to third party dependencies. This allows you to filter in-app vs third-party frames when viewing errors.
40+
The `:otp_app` option specifies your application name. When an error occurs, ErrorTracker will use this information to understand which parts of the stack trace belong to your application and which parts belong to third-party dependencies. This allows you to filter in-app vs third-party frames when viewing errors.
4141

4242
## Setting up the database
4343

44-
Since the ErrorTracker stores errors in the database you must create a database migration to add the required tables:
44+
Since ErrorTracker stores errors in the database you must create a database migration to add the required tables:
4545

4646
```
4747
mix ecto.gen.migration add_error_tracker
@@ -58,17 +58,17 @@ defmodule MyApp.Repo.Migrations.AddErrorTracker do
5858
end
5959
```
6060

61-
You can run the migration and perform the database changes with the following command:
61+
You can run the migration and apply the database changes with the following command:
6262

6363
```bash
6464
mix ecto.migrate
6565
```
6666

67-
For more information about how to handle migrations take a look at the `ErrorTracker.Migration` module docs.
67+
For more information about how to handle migrations, take a look at the `ErrorTracker.Migration` module docs.
6868

6969
## Automatic error tracking
7070

71-
At this point, the ErrorTracker is ready to track errors. It will automatically start when your application boots and track errors that happen in your Phoenix controllers, Phoenix LiveViews and Oban jobs. The `ErrorTracker.Integrations.Phoenix` and `ErrorTracker.Integrations.Oban` provide detailed information about how this works.
71+
At this point, ErrorTracker is ready to track errors. It will automatically start when your application boots and track errors that occur in your Phoenix controllers, Phoenix LiveViews and Oban jobs. The `ErrorTracker.Integrations.Phoenix` and `ErrorTracker.Integrations.Oban` provide detailed information about how this works.
7272

7373
If your application uses Plug but not Phoenix, you will need to add the relevant integration in your `Plug.Builder` or `Plug.Router` module.
7474

@@ -81,7 +81,7 @@ defmodule MyApp.Router do
8181
end
8282
```
8383

84-
This is also required if you want to track errors that happen in your Phoenix endpoint, before the Phoenix router starts handling the request. Keep in mind that this won't be needed in most cases as endpoint errors are very infrequent.
84+
This is also required if you want to track errors that happen in your Phoenix endpoint, before the Phoenix router starts handling the request. Keep in mind that this won't be needed in most cases as endpoint errors are infrequent.
8585

8686
```elixir
8787
defmodule MyApp.Endpoint do
@@ -98,17 +98,17 @@ You can learn more about this in the `ErrorTracker.Integrations.Plug` module doc
9898

9999
The default integrations include some additional context when tracking errors. You can take a look at the relevant integration modules to see what is being tracked out of the box.
100100

101-
In certain cases you may want to include some additional information when tracking errors. For example it may be useful to track the user ID that was using the application when an error happened. Fortunately, the ErrorTracker allows you to enrich the default context with custom information.
101+
In certain cases, you may want to include some additional information when tracking errors. For example it may be useful to track the user ID that was using the application when an error happened. Fortunately, ErrorTracker allows you to enrich the default context with custom information.
102102

103-
The `ErrorTracker.set_context/1` function stores the given context in the current process so any errors that happen in that process (for example a Phoenix request or an Oban job) will include this given context along with the default integration context.
103+
The `ErrorTracker.set_context/1` function stores the given context in the current process so any errors that occur in that process (for example, a Phoenix request or an Oban job) will include this given context along with the default integration context.
104104

105105
```elixir
106106
ErrorTracker.set_context(%{user_id: conn.assigns.current_user.id})
107107
```
108108

109109
## Manual error tracking
110110

111-
If you want to report custom errors that fall outside the default integrations scope you may use `ErrorTracker.report/2`. This allows you to report an exception by yourself:
111+
If you want to report custom errors that fall outside the default integration scope, you may use `ErrorTracker.report/2`. This allows you to report an exception yourself:
112112

113113
```elixir
114114
try do
@@ -123,6 +123,6 @@ You can also use `ErrorTracker.report/3` and set some custom context that will b
123123

124124
## Web UI
125125

126-
The ErrorTracker also provides a dashboard built with Phoenix LiveView that can be used to see and manage the recorded errors.
126+
ErrorTracker also provides a dashboard built with Phoenix LiveView that can be used to see and manage the recorded errors.
127127

128-
This is completely optional and you can find more information about it in the `ErrorTracker.Web` module documentation.
128+
This is completely optional, and you can find more information about it in the `ErrorTracker.Web` module documentation.

lib/error_tracker.ex

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
11
defmodule ErrorTracker do
22
@moduledoc """
3-
En Elixir based built-in error tracking solution.
3+
En Elixir-based built-in error tracking solution.
44
55
The main objectives behind this project are:
66
7-
* Provide a basic free error tracking solution: because tracking errors on
8-
your application should be a requirement to almost any project, and helps to
7+
* Provide a basic free error tracking solution: because tracking errors inm\
8+
your application should be a requirement for almost any project, and helps to
99
provide quality and maintenance to your project.
1010
11-
* Be easy to use: by providing plug and play integrations, documentation and a
11+
* Be easy to use: by providing plug-and-play integrations, documentation and a
1212
simple UI to manage your errors.
1313
1414
* Be as minimalistic as possible: you just need a database to store errors and
15-
an Phoenix application if you want to inspect them via web. That's all.
15+
a Phoenix application if you want to inspect them via web. That's all.
1616
1717
## Requirements
1818
19-
ErrorTracker requires Elixir 1.15+, Ecto 3.11+, Phoenix LiveView 0.19+ and PostgreSQL
19+
ErrorTracker requires Elixir 1.15+, Ecto 3.11+, Phoenix LiveView 0.19+, and PostgreSQL.
2020
2121
## Integrations
2222
2323
We currently include integrations for what we consider the basic stack of
24-
an application: Phoenix, Plug and Oban.
24+
an application: Phoenix, Plug, and Oban.
2525
2626
However, we may continue working in adding support for more systems and
27-
libraries in the future if there is enough interest by the community.
27+
libraries in the future if there is enough interest from the community.
2828
29-
If you want to manually report an error you can use the `ErrorTracker.report/3` function.
29+
If you want to manually report an error, you can use the `ErrorTracker.report/3` function.
3030
3131
## Context
3232
33-
Aside from the information abot each exception (kind, message, stacktrace...)
33+
Aside from the information about each exception (kind, message, stack trace...)
3434
we also store contexts.
3535
36-
Contexts are arbitrary maps that allow you to store extra information of an
36+
Contexts are arbitrary maps that allow you to store extra information about an
3737
exception to be able to reproduce it later.
3838
39-
Each integration includes a default context with the useful information they
40-
can gather, but aside from that you can also add your own information. You can
41-
do this in a per-process way or in a per-call way (or both).
39+
Each integration includes a default context with useful information they
40+
can gather, but aside from that, you can also add your own information. You can
41+
do this in a per-process basis or in a per-call basis (or both).
4242
4343
**Per process**
4444
45-
This allows you to set general context for the current process such as a Phoenix
46-
request or an Oban job. For example you could include the following code in your
47-
authentication Plug to automatically include the user ID on any error that is
45+
This allows you to set a general context for the current process such as a Phoenix
46+
request or an Oban job. For example, you could include the following code in your
47+
authentication Plug to automatically include the user ID in any error that is
4848
tracked during the Phoenix request handling.
4949
5050
```elixir
@@ -53,9 +53,9 @@ defmodule ErrorTracker do
5353
5454
**Per call**
5555
56-
As we had seen before you can use `ErrorTracker.report/3` to manually report an
56+
As we had seen before, you can use `ErrorTracker.report/3` to manually report an
5757
error. The third parameter of this function is optional and allows you to include
58-
extra context that will be tracked along with that error.
58+
extra context that will be tracked along with the error.
5959
"""
6060

6161
@typedoc """
@@ -67,13 +67,13 @@ defmodule ErrorTracker do
6767
alias ErrorTracker.Repo
6868

6969
@doc """
70-
Report a exception to be stored.
70+
Report an exception to be stored.
7171
72-
Aside from the exception, it is expected to receive the stacktrace and,
72+
Aside from the exception, it is expected to receive the stack trace and,
7373
optionally, a context map which will be merged with the current process
7474
context.
7575
76-
Keep in mind that errors that happen in Phoenix controllers, Phoenix live views
76+
Keep in mind that errors that occur in Phoenix controllers, Phoenix LiveViews
7777
and Oban jobs are automatically reported. You will need this function only if you
7878
want to report custom errors.
7979
@@ -88,16 +88,16 @@ defmodule ErrorTracker do
8888
8989
## Exceptions
9090
91-
Exceptions passed can be in three different forms:
91+
Exceptions can be passed in three different forms:
9292
93-
* An exception struct: the module of the exception is stored alongside with
93+
* An exception struct: the module of the exception is stored along with
9494
the exception message.
9595
96-
* A `{kind, exception}` tuple in which the `exception` is an struct: it
96+
* A `{kind, exception}` tuple in which the `exception` is a struct: it
9797
behaves the same as when passing just the exception struct.
9898
99-
* A `{kind, reason}` tuple: it stores the kind and the message itself casted
100-
to strings, as it is useful for some errors like EXIT signals or custom error
99+
* A `{kind, reason}` tuple: it stores the kind and the message itself cast
100+
to strings, which is useful for some errors like EXIT signals or custom error
101101
messages.
102102
"""
103103
def report(exception, stacktrace, given_context \\ %{}) do
@@ -151,13 +151,12 @@ defmodule ErrorTracker do
151151
end
152152

153153
@doc """
154-
Sets current process context.
154+
Sets the current process context.
155155
156-
By default it will merge the current context with the new one received, taking
157-
preference the new context's contents over the existsing ones if any key
158-
matches.
156+
The given context will be merged into the current process context. The given context
157+
may override existing keys from the current process context.
159158
160-
## Depth of the context
159+
## Context depth
161160
162161
You can store context on more than one level of depth, but take into account
163162
that the merge operation is performed on the first level.

lib/error_tracker/migration.ex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
defmodule ErrorTracker.Migration do
22
@moduledoc """
3-
Create and modify the database tables for the ErrorTracker.
3+
Create and modify the database tables for ErrorTracker.
44
55
## Usage
66
7-
To use the ErrorTracker migrations in your application you will need to generate
7+
To use ErrorTracker migrations in your application you will need to generate
88
a regular `Ecto.Migration` that performs the relevant calls to `ErrorTracker.Migration`.
99
1010
```bash
@@ -30,7 +30,7 @@ defmodule ErrorTracker.Migration do
3030
mix ecto.migrate
3131
```
3232
33-
As new versions of the ErrorTracker are released you may need to run additional migrations.
33+
As new versions of ErrorTracker are released you may need to run additional migrations.
3434
To do this you can follow the previous process and create a new migration:
3535
3636
```bash
@@ -73,7 +73,7 @@ defmodule ErrorTracker.Migration do
7373
```
7474
7575
This will automatically create the database schema for you. If the schema does already exist
76-
the migration may fail when trying to recreate it. In such cases you can instruct the ErrorTracker
76+
the migration may fail when trying to recreate it. In such cases you can instruct ErrorTracker
7777
not to create the schema again:
7878
7979
```elixir
@@ -85,7 +85,7 @@ defmodule ErrorTracker.Migration do
8585
end
8686
```
8787
88-
If you are using a custom schema other than the default "public" you need to configure the
88+
If you are using a custom schema other than the default "public" you need to configure
8989
ErrorTracker to use that schema:
9090
9191
```elixir

lib/error_tracker/schemas/error.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
defmodule ErrorTracker.Error do
22
@moduledoc """
3-
Schema to store an error or exception recorded by the ErrorTracker.
3+
Schema to store an error or exception recorded by ErrorTracker.
44
55
It stores a kind, reason and source code location to generate a unique
66
fingerprint that can be used to avoid duplicates.

lib/error_tracker/web.ex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
defmodule ErrorTracker.Web do
22
@moduledoc """
3-
ErrorTracker includes a dashboard to view and inspect errors occurred on your
4-
application and already stored on the database.
3+
ErrorTracker includes a dashboard to view and inspect errors that occurred
4+
on your application and are already stored in the database.
55
6-
In order to use it, you need to add the following to your Phoenix's `
7-
router.ex` file:
6+
In order to use it, you need to add the following to your Phoenix's\
7+
`router.ex` file:
88
99
```elixir
1010
defmodule YourAppWeb.Router do
@@ -17,14 +17,14 @@ defmodule ErrorTracker.Web do
1717
end
1818
```
1919
20-
This will add the routes needed for the ErrorTracker dashboard to work.
20+
This will add the routes needed for ErrorTracker's dashboard to work.
2121
2222
## Security considerations
2323
2424
Errors may contain sensitive information, like IP addresses, users information
2525
or even passwords sent on forms!
2626
27-
Securing your dashboard is an important part of integrating `ErrorTracker` on
27+
Securing your dashboard is an important part of integrating ErrorTracker on
2828
your project.
2929
3030
In order to do so, we recommend implementing your own security mechanisms in

lib/error_tracker/web/router.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
defmodule ErrorTracker.Web.Router do
22
@moduledoc """
3-
Integration of the ErrorTracker UI into your application's router.
3+
ErrorTracker UI integration into your application's router.
44
"""
55

66
@doc """

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ defmodule ErrorTracker.MixProject do
5050
end
5151

5252
def description do
53-
"An Elixir based built-in error tracking solution"
53+
"An Elixir-based built-in error tracking solution"
5454
end
5555

5656
defp groups_for_modules do

0 commit comments

Comments
 (0)