Open telemetry using aws x-ray

i’m trying to use open telemetry to send messages to aws x-ray from my elixir livewiew project. from an aws point of view i need to use aws distro, however what i’m not sure of is which libraries to use from the elixir side. i came across the following article Elixir, OpenTelemetry, and the Infamous N+1 · Fly and from what i understand the flow of data is as follows

code -> collector (collects and exports) -> AWS Distro -> AWS X-Ray

Is this understanding correct, if its correct also how do i configure the collector to export the data to AWS Distro ?

also based on the articles mentioned above i need to use the following libraries

  {:opentelemetry_exporter, "~> 1.0"},
    {:opentelemetry, "~> 1.0"},
    {:opentelemetry_api, "~> 1.0"},
    {:opentelemetry_ecto, "~> 1.0"},
    {:opentelemetry_liveview, "~> 1.0.0-rc.4"},
    {:opentelemetry_phoenix, "~> 1.0"},
    {:opentelemetry_cowboy, "~> 0.2"}

if the libraries are the correct ones its fine (i can upgraded to the latest version) or are there a different set of libraries i should be using ?

From my understanding your diagram is partially correct. You can send traces to a collector, which can forward to AWS Distro (or any number of other collectors). However AWS Distro is a collector as well, so you can forward directly to it from your application bypassing any other collectors in between if you don’t need them .

Those libraries do seem correct though. This ElixirConf talk: Monitoring Elixir With OpenTelemetry | Kamil Kowalski | ElixirConf EU 2021 - YouTube shows a working demo of forwarding to an otel-collector. He uses Grafana Tempo instead of AWS Distro, but technically it should be possible to switch out one otel-colelctor from another, since they are all using the same protocol to collect distributed traces.

thanks, i saw the video as well, with regards to your statement of sending directly to AWS Distro, how do i do that ?

I think the default otel-collector port is 4318 for http recievers. AWS Distro might have a similar port open to send your traces to. When configuring opentelemetry-exporter you can specify the port to export to in your elixir app’s config.