elastic / elastic/apm-agent-java

Separate agent proxy settings from standard JVM settings

Aperta
#958 0 commenti 1 reazione 0 assegnatari Vedi su GitHub
enhancement setup technical-debt
Lingua principale
Java
Stelle
594
Fork
338
Merge medio
1g 13h
PR unite (30g)
25

Descrizione

**Is your feature request related to a problem? Please describe.**

When agent to use a proxy to reach apm server, we advise to use standard JVM properties `http.proxyHost` and `http.proxyPort` to define the proxy that [should be used](https://www.elastic.co/guide/en/apm/agent/java/1.x/config-reporter.html#config-server-urls).

While it will definitely be fine for most cases, it will not be optimal in the following situations:

- an internal proxy is being used by the JVM, and this proxy has no access to the apm server. Changing proxy config/permissions includes extra complexity for deployment

- an internal proxy is being used by the JVM for some http connections, but agent should not use it (direct connection). It is still possible to configure `http.nonProxyHosts` but adds extra complexity.

- there is no support for proxies with authentication, thus adding support for this in the future would require dedicated properties anyway.

[Reference to the JDK network settings](https://docs.oracle.com/javase/7/docs/api/java/net/doc-files/net-properties.html)

**Describe the solution you'd like**

Agent should have a distinct set of properties to support proxy configuration, for example:
- `elastic.apm.proxy_host=proxy-host` and `elastic.apm.proxy_port=proxy-host`
- a single URL with optional credentials `elastic.apm.proxy=http://user:password@proxy-host:3128/`, this one having the advantage to be a single configuration item and to provide protocol

The default values of those properties should be set with the values of the standard JVM properties (if they are available), which will make it work by default if the proxy can reach apm-server.

The expected benefits here would be multiple:
- will work with JVM settings if those are suitable
- will prevent breaking existing proxy settings, application won't be affected.
- avoids any extra operational deployment complexity: changing network or proxy configuration and security is always tedious and requires extra caution
- allow to add authenticated proxy support that is not supported with JVM settings (future-proofing).

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Iniziate individuando come l’agente legge e applica attualmente le proprietà proxy standard della JVM. Confrontate le impostazioni separate proposte per host/porta con l’unico URL proxy, incluso l’uso dei valori JVM come valori predefiniti; il lavoro è completato quando il comportamento del proxy dell’agente è configurabile indipendentemente senza modificare le impostazioni proxy dell’applicazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
networking
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.