Saat mengaktifkan penerusan proxy HTTP, Anda membuat satu titik tempat beberapa mesin
mengirim permintaan ke server eksternal. Jika Anda berada di balik proxy atau firewall perusahaan, Apigee mungkin tidak dapat mengirim metrik ke Cloud Monitoring dengan setelan defaultnya. Anda dapat menetapkan dan mengubah setelan langsung di kolektor OpenTelemetry agar permintaannya melewati server proxy.
Topik ini menjelaskan cara mengonfigurasi setelan kolektor OpenTelemetry menggunakan salah satu dari tiga variabel lingkungan yang tersedia:
NO_PROXY: Menerima daftar nama host atau alamat IP yang traffic-nya tidak boleh mengalir melalui proxy HTTP.
HTTP_PROXY: Menerima URL proxy yang servernya digunakan untuk koneksi HTTP.
HTTPS_PROXY: Menerima URL proxy yang servernya digunakan untuk koneksi HTTPS.
Mengonfigurasi setelan kolektor OpenTelemetry
Anda dapat mengonfigurasi setelan kolektor OpenTelemetry agar berfungsi dengan penerusan proxy HTTP menggunakan properti metrics.collector.envVars di overrides.yaml. Properti metrics.collector.envVars
memungkinkan Anda meneruskan variabel lingkungan yang didukung oleh OpenTelemetry. Lihat
Dukungan proxy dalam dokumentasi OpenTelemetry untuk mengetahui detail selengkapnya.
Anda dapat menggunakan nilai berikut untuk properti metrics.collector.envVars:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-05 UTC."],[],[],null,["# OpenTelemetry collector with HTTP proxy forwarding enabled\n\nWhen you enable HTTP proxy forwarding, you create a single point through which multiple machines\nsend requests to an external server. If you are behind a corporate proxy or firewall, Apigee\nmay not be able to send metrics to Cloud Monitoring with its default settings. You can set and\nmodify settings directly in the OpenTelemetry collector to have its requests pass through the proxy server.\n\nThis topic describes how to configure the OpenTelemetry collector settings using one of the three available\nenvironment variables:\n\n- `NO_PROXY`: Accepts a list of hostnames or IP addresses whose traffic should not flow through the HTTP proxy.\n- `HTTP_PROXY`: Accepts the URL of the proxy whose server is used for HTTP connections.\n- `HTTPS_PROXY`: Accepts the URL of the proxy whose server is used for HTTPS connections.\n\n\u003cbr /\u003e\n\nConfigure OpenTelemetry collector settings\n------------------------------------------\n\nYou can configure the OpenTelemetry collector settings to work with HTTP proxy forwarding by using the\n`metrics.collector.envVars` property in `overrides.yaml`. The `metrics.collector.envVars` property\nallows you to pass in the environment variables supported by OpenTelemetry. See [Proxy support](https://opentelemetry.io/docs/collector/configuration/#proxy-support)in the OpenTelemetry documentation for more details.\n\nYou can use the following values for the `metrics.collector.envVars` property:\n\n- For an `http` proxy: \n\n ```\n metrics:\n ...\n collector:\n envVars:\n HTTP_PROXY: '\u003cproxy-address\u003e'\n ```\n\n for example: \n\n ```\n envVars:\n HTTP_PROXY: 'http://1.1.1.1:80'\n ```\n- For an `https` proxy: \n\n ```\n metrics:\n ...\n collector:\n envVars:\n HTTPS_PROXY: '\u003cproxy-address\u003e'\n ```\n\n for example: \n\n ```\n envVars:\n HTTPS_PROXY: 'https://1.1.1.1:80'\n ```\n- For addresses that must not use the proxy: \n\n ```\n metrics:\n ...\n collector:\n envVars:\n NO_PROXY: '\u003ccomma-separated-values\u003e'\n ```\n\n for example: \n\n ```\n envVars:\n NO_PROXY: 'http://1.1.1.1:80, http://1.1.1.1:81'\n ```\n\nApply the changes\n-----------------\n\nUse the following command to apply the changes with the `apigee-telemetry` chart: \n\n```\nhelm upgrade telemetry apigee-telemetry/ \\\n --namespace APIGEE_NAMESPACE \\\n --atomic \\\n -f OVERRIDES_FILE\n```\n| **Note:** If you see an error saying `Error: UPGRADE FAILED: \"telemetry\" has no deployed releases`, replace `upgrade` with `install` and try the command again.\n\nWhat's next\n-----------\n\n- See [`metrics.collector.envVars`](/apigee/docs/hybrid/v1.15/config-prop-ref#logger-envVars) in the Configuration properties reference.\n- Learn how to [Configure forward proxying for API proxies](/apigee/docs/hybrid/v1.15/forward-proxy)."]]