Giter Site home page Giter Site logo

Comments (7)

gmr avatar gmr commented on August 31, 2024

I'll have to check into this. I've not developed behind a proxy and I am not sure of the Python standard library's use of the environment variable you set. Most likely if it's not respecting it, I'll have to add a proxy config section.

from newrelic-plugin-agent.

scottbecker avatar scottbecker commented on August 31, 2024

I got this working by manually adding proxy info to agent.py. Note that my https proxy needs you to talk to it via http so I forced this with an http://proxy

/usr/local/lib/python2.7/dist-packages/newrelic_plugin_agent/agent.py

line 179

    proxyDict = {
          "http"  : "myserver:787",
          "https" : "http://myserver:787"
        }

    try:
        response = requests.post(self.PLATFORM_URL,
                                 headers=self.http_headers,proxies=proxyDict,
                                 data=json.dumps(body, ensure_ascii=False))

Ideally, this should pickup the NEW_PROXY_HOST and NEW_PROXY_PORT env variables mentioned here (https://newrelic.com/docs/python/python-agent-configuration#environment-variables). I will likely update this unless you guys prefer fixing this yourselves a different way.

from newrelic-plugin-agent.

gmr avatar gmr commented on August 31, 2024

Would love a pull request. Ideally it would allow for both a configuration option in the YAML file and it would pick up the right env variables.

On Saturday, June 29, 2013 at 11:16 PM, Scott Becker wrote:

I got this working by manually adding proxy info to agent.py. Note that my https proxy needs you to talk to it via http so I forced this with an http://proxy
/usr/local/lib/python2.7/dist-packages/newrelic_plugin_agent/agent.py
line 179
proxyDict = { "http" : "myserver:787", "https" : "http://myserver:787" } try: response = requests.post(self.PLATFORM_URL, headers=self.http_headers,proxies=proxyDict, data=json.dumps(body, ensure_ascii=False))
Ideally, this should pickup the NEW_PROXY_HOST and NEW_PROXY_PORT env variables mentioned here. I will likely update this unless you guys prefer fixing this yourselves a different way.


Reply to this email directly or view it on GitHub (#31 (comment)).

from newrelic-plugin-agent.

jplock avatar jplock commented on August 31, 2024

Is anyone working on a pull request to support proxies? I really need this, so if not, I can do it. Thanks.

from newrelic-plugin-agent.

scottbecker avatar scottbecker commented on August 31, 2024

I am not working on it anytime soon.

from newrelic-plugin-agent.

theonlymonica avatar theonlymonica commented on August 31, 2024

This proxy patch doesn't seem to work for me.

If I set the ENV var https_proxy, in log I can see:

INFO 2013-07-10 15:37:02 6714 MainProcess MainThread requests.packages.urllib3.connectionpool _new_conn L202 : Starting new HTTP connection (1): proxy-dmz.mydomain.com (I hide real proxy name)

and then:

DEBUG 2013-07-10 15:37:03 6714 MainProcess MainThread requests.packages.urllib3.connectionpool _make_request L296 : "POST https://platform-api.newrelic.com/platform/v1/metrics HTTP/1.1" 501 1109
DEBUG 2013-07-10 15:37:03 6714 MainProcess MainThread newrelic_plugin_agent.agent send_components L185 : Response: 501: ( - and a message from proxy: MethodNotAllowed)

But if I use this patch I don't see anything in log: it seems that the parameter is ignored.

from newrelic-plugin-agent.

gmr avatar gmr commented on August 31, 2024

If your proxy server is returning 501, MethodNotAllowed, how is the parameter being ignored?

from newrelic-plugin-agent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.