OpenTelemetry collector with HTTP proxy forwarding enabled

When you enable HTTP proxy forwarding, you create a single point through which multiple machines send requests to an external server. If you are behind a corporate proxy or firewall, Apigee may not be able to send metrics to Cloud Monitoring with its default settings. You can set and modify settings directly in the OpenTelemetry collector to have its requests pass through the proxy server.

This topic describes how to configure the OpenTelemetry collector settings using one of the three available environment variables:

  • NO_PROXY: Accepts a list of hostnames or IP addresses whose traffic should not flow through the HTTP proxy.
  • HTTP_PROXY: Accepts the URL of the proxy whose server is used for HTTP connections.
  • HTTPS_PROXY: Accepts the URL of the proxy whose server is used for HTTPS connections.

Configure OpenTelemetry collector settings

You can configure the OpenTelemetry collector settings to work with HTTP proxy forwarding by using the metrics.collector.envVars property in overrides.yaml. The metrics.collector.envVars property allows you to pass in the environment variables supported by OpenTelemetry. See Proxy supportin the OpenTelemetry documentation for more details.

You can use the following values for the metrics.collector.envVars property:

  • For an http proxy:
    metrics:
    ...
    collector:
      envVars:
        HTTP_PROXY: '<proxy-address>'

    for example:

      envVars:
        HTTP_PROXY: 'http://1.1.1.1:80'
  • For an https proxy:
    metrics:
    ...
    collector:
      envVars:
        HTTPS_PROXY: '<proxy-address>'

    for example:

      envVars:
        HTTPS_PROXY: 'https://1.1.1.1:80'
  • For addresses that must not use the proxy:
    metrics:
    ...
    collector:
      envVars:
        NO_PROXY: '<comma-separated-values>'

    for example:

      envVars:
        NO_PROXY: 'http://1.1.1.1:80, http://1.1.1.1:81'

Apply the changes

Use the following command to apply the changes with the apigee-telemetry chart:

helm upgrade telemetry apigee-telemetry/ \
  --namespace APIGEE_NAMESPACE \
  --atomic \
  -f OVERRIDES_FILE

What's next