newrelic / elixir_agent

New Relic's Open Source Elixir Agent

Home Page:https://hex.pm/packages/new_relic_agent

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use proxy to send metrics to NR endpoint

lenfree opened this issue · comments

Is your feature request related to a problem? Please describe.
I need to configure proxy to connect to NR endpoint. I had a look at http://erlang.org/doc/apps/inets/http_client.html as mentioned in #68 with regards to setting up proxy but I couldn't find any doco about injecting this via environment variables or via configuration.

Describe the solution you'd like
Can be configured via environment variable or config file.

Describe alternatives you've considered
Hack the code to include http proxy option to :httpc request.

Hello, there are examples on how to configure httpc to use a proxy here:

https://erlang.org/doc/apps/inets/http_client.html#getting-started

@binaryseed just letting you know that I am new to Elixir and Erlang and I still couldn't figure out how to do this. I tried below but it does not work. I'd appreciate it if can you please share how to properly configure proxy?

config :inets,
  services: [
    httpc: [
      set_options: [
        proxy: {{"localhost", 3128}, {}}
      ]
    ]
  ]