ErrorTracker - an Elixir-based built-in error tracking solution

I just installed it in one of the application and this project is very promising .

Testing the UI a quick feature came to my mind to have some integration with the service management tool used for error/bugs tracking such as github to follow related SDLC processes for bug fixing

Thanks, will do. And Iā€™m deploying as a release, not with mix.

We have just released v0.1.2 which solves this issue. Thanks for the detailed error reports and stacktraces.

3 Likes

Update on notifications!

We are working right now on adding Telemetry events (we love Telemetry, is the base of this project), so anyone can attach handlers to send notifications on their preferred way (email, slack, text messages, etc.).

It may not be as plug and play as many expect, but it is the most flexible way we could find without building a full notification system (which is complex), and it lets the developer to build their own rules and use their preferred notification channels.

It doesnā€™t mean that we will never build notifications in the library, just not now. But the options to be able to get notifications will arrive soon (hopefully next version)

5 Likes

hopefully it will be possible to integrate from the current UI where you select the error and decide to send this error to your notification channel ā€œCould be a bug tracking system like githubā€

Version 0.2.0 is out!

This update includes several improvements to the library:

  • SQLite 3 compatibility (including a better way to track database schema versions)
  • Telemetry events - can be used to integrate your own notifications
  • UI improvements - more refined styles and UX
  • A better test suite, including testing in both RDBMS and different Elixir/Erlang versions in the CI

GitHub release
Hex.pm release

If you are already using the library: there is a new version of the DB schema, so you need to create a new migration to migrate to version 2.

We hope this version fixes some of the issues reported :slight_smile: any feedback is welcome!

10 Likes

Amazing work!

Iā€™m trying to build a website and i donā€™t want to connect it to any external services so your project is really useful to me :slight_smile:

1 Like

Iā€™ve been using this and I really like it, itā€™s great :smiley:

A bit confused about needing to generate a new migration after updating to v0.2.0 though. Iā€™ve already been running it in prod without doing so, and creating an ew migration with the same migration functions of:

def up, do: ErrorTracker.Migration.up()
def down, do: ErrorTracker.Migration.down()

Doesnā€™t make any changes to the schema when running them again after updating.

Additionally, having the same function ErrorTracker.Migration.down() in two diffirent migrations canā€™t be rolled back twice - the second raises an error because the tables were already dropped from the first down.

Do we need to put migration version numbers in the up/down calls, like Oban does I think when migrating between versions?

That makes sense, because V02 in PostgreSQL systems creates a new table to store meta information and moves the information about which migration version is the latest to that table.

Tables and structures used by ErrorTracker are not changed - we may use the new error_tracker_meta table in the future, but not now - so the system will work without that migration but it is really recommended to stay up to date.

As we migrated how the schema version number is stored - and it is an important information to take into account on the migration process - that migration is different to others, but we have tested it and should work as expected.

Thatā€™s the issue! We should have included that in the release message, but the idea is to have it like:

defmodule MyApp.Repo.Migrations.UpdateErrorTrackerToV02 do
  use Ecto.Migration

  def up, do: ErrorTracker.Migration.up(version: 2)
  def down, do: ErrorTracker.Migration.down(version: 2)
end

which produces this output when migrating:

15:42:49.730 [info] == Running 20240814134232 MyApp.Repo.Migrations.UpdateErrorTrackerToV02.up/0 forward

15:42:49.764 [info] create table if not exists public.error_tracker_meta

15:42:49.800 [info] execute "COMMENT ON TABLE \"public\".error_tracker_errors IS ''"

15:42:49.801 [info] execute "INSERT INTO public.error_tracker_meta (key, value)\nVALUES ('migration_version', '2'), ('migration_timestamp', '1723642969')\nON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value\n"

15:42:49.807 [info] == Migrated 20240814134232 in 0.0s

in the way you created it works fine if you go up, but on the down it will remove all migrations, so reverting the other one will result in errors because tables donā€™t exist anymore.

Yes!

Hope it helps!! If you have more issues please feel free to open an issue and we can find a solution there.

6 Likes

- user error on the bug.

Thanks for making this! I have had sentry on my to do list but will do this first. Just got it working and already it is reporting an error! Will have to remember to keep checking it :slight_smile:

Thanks again! So far so good!

1 Like

Hey, this looks awesome and Iā€™m willing to try it!

My only concern is whether this can be used in an app where Iā€™m already using AppSignal or Sentry. Can you think of any incompatibilities?

1 Like

ErrorTracker just attaches to some Telemetry events and does its own thing. There shouldnā€™t be any problems when using it along AppSignal or Sentry. (We havenā€™t tested it, though)

4 Likes

Thanks, that sounds great, there shouldnā€™t be any problem but Iā€™ll report if I find any.

I am already working on the suggestion I did some days ago:

If everything goes well, I think I could release a first release of the package this weekend. I will notice you!

7 Likes

Hey ErrorTracker team, thanks a lot for your effort in putting this together! I already fixed an error thanks to your library :slight_smile:

Please consider adding a way to sponsor the project, it will surely be well-received by the community.

10 Likes

Hi all!

Weā€™ve just pushed a new release that includes support for reporting LiveComponent errors. Get it while it is fresh! :rocket:

4 Likes

Any way you can support have error_tracker support liveview 1.0.0 and its RCs?

Thanks!

The spec is currently prepared for 1.0.0 final release. We can take a look at supporting RC, but in the meanwhile you can use override: true to ignore the requirements.

I will look into this to see if we can solve it for the next release to avoid having to override a dependency :hugs:

1 Like

Hello!

We have just released v0.2.6.

It includes some exciting new features:

  • Ignorer: you can now create a custom module to decide if you want the ErrorTracker to store a given exception or not.
  • Pruner: a plug-in that automatically prune errors from the database after they have been resolved for some time.
  • Global enable configuration flag: set to true by default, it allows to enable or disable error tracking globally. It is perfect to avoid populating your database with errors in development, for example.

Note: this release includes a new schema migration that improves pruning performance (the new schema version to migrate is version: 3), so you need to migrate your system to perform this update! It applies to both PostgreSQL and SQLite systems.

Thanks to everyone who use the ErrorTracker and add issues with ideas and improvements :hugs: :heart:

6 Likes

Hi all!

We have just released v0.3.0 with a few exciting new features:

  • Support for MySQL and MariaDB. ErrorTracker now support all major open source relational database engines (PostgreSQL and SQLite were already supported).
  • Improved error grouping in the Oban integration. Previously errors from different Oban workers could be incorrectly grouped together.

Thanks to everyone who uses the ErrorTracker and improves it either by opening issues or pull requests :hugs: :heart:

4 Likes