spandex-project / spandex

A platform agnostic tracing library
MIT License
335 stars 53 forks source link

make the ecto service name configurable #27

Closed craig-day closed 6 years ago

craig-day commented 6 years ago

First thanks for this amazing tool!

This adds a simple configuration to the ecto logger to allow for customizing the service name. This can be useful if you have a lot of projects using ecto and you want to ensure the traces stay separate. This is also supported by the Datadog official APM clients so this brings the Elixir client closer to them.

I noticed there is currently no mention of the ecto logger tracer in the readme, so I didn't mention this configuration there.

Hope others find this helpful!

/cc @zachdaniel

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.2%) to 69.039% when pulling 35785df674096e6d7ec78124a1f1822d2f1c4627 on craig-day:craig-day/ecto_service_name into a49fac85220ce8c332211918e45fab7c8b8d91d5 on zachdaniel:master.

zachdaniel commented 6 years ago

This is great :). What would you think about making the service name default to the name of the repo module? Since if you have many repos, they'll all have different names. I think that you can get the repo module off of a log entry.

craig-day commented 6 years ago

@zachdaniel unfortunately it doesn't look like we get the repo in the log entry. The source field contains the schema (table) name.

zachdaniel commented 6 years ago

I'll merge this today and build a point release.

craig-day commented 6 years ago

@zachdaniel that's great. Looking forward to it!