When I tried to use ScoutAPM in dev env following the instruction from ReadMe, i'm getting the following error when I start the app. Phoenix version 1.4.16
** (exit) an exception was raised:
** (Protocol.UndefinedError) protocol Jason.Encoder not implemented for %ScoutApm.Payload.Metadata{agent_pid: 16608, agent_time: "2020-04-21T09:26:10.701350Z", agent_version: "1.0.6", app_root: "/Users/*******", language: "elixir", language_version: "1.10.2", payload_version: 1, platform: "elixir", platform_version: "1.10.2", unique_id: "an3e4bqsGNsyhWeHQRIh"} of type ScoutApm.Payload.Metadata (a struct), Jason.Encoder protocol must always be explicitly implemented.
If you own the struct, you can derive the implementation specifying which fields should be encoded to JSON:
@derive {Jason.Encoder, only: [....]}
defstruct ...
It is also possible to encode all fields, although this should be used carefully to avoid accidentally leaking private information when new fields are added:
@derive Jason.Encoder
defstruct ...
When I tried to use ScoutAPM in dev env following the instruction from ReadMe, i'm getting the following error when I start the app. Phoenix version 1.4.16