Type to search.

Connectivity issues with Elastic OpenTelemetry

Serverless

Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Serverless interfaces and procedures might differ from classic Elastic Stack deployments.

Elastic Agent

Elastic Agent can run in OpenTelemetry mode to retrieve traces, metrics, and logs from your infrastructure and applications, and forward them to Elastic Observability.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

Connectivity problems occur when the EDOT SDKs or the Elastic Agent can't reach Elastic. Even with correct proxy settings, network restrictions such as blocked ports or firewalls can prevent data from flowing.

You might see one or more of the following error messages:

  • connection refused
  • network unreachable
  • i/o timeout
  • tls: handshake failure

These errors might appear either in application logs (from the SDK) or in the Collector logs.

Example (Collector):

Text
2024-09-15T12:44:30Z error exporterhelper/queued_retry.go:149 Exporting failed. Rejecting data. Error: context deadline exceeded

Example (Python SDK):

Text
opentelemetry.sdk ERROR OTLPSpanExporter - Failed to export spans: [Errno 111] Connection refused

Connectivity errors usually trace back to one of the following issues:

  • Firewall or port blocking

    Outbound traffic may be blocked by corporate firewalls or network policies.

    Check that the required protocol and port combination is allowed:

    • OTLP/HTTP: TCP 4318
    • OTLP/gRPC: TCP 4317
    • Elasticsearch (over HTTPS): 443
    • Elasticsearch: 9200

    Also confirm whether your environment uses IPv4 or IPv6, as routing and firewall rules may differ.

  • Endpoint errors

    The endpoint is unreachable or not listening on the specified port:

    • connection refused: endpoint not listening
    • network unreachable: VPN, routing, or DNS failure
    • timeout: traffic dropped by firewall, proxy, or load balancer
  • Proxy misconfiguration

    Proxy environment variables (HTTP_PROXY, HTTPS_PROXY) might be set correctly but the proxy itself lacks access to Elastic or restricts ports. Refer to Proxy settings for more information.

Errors can look similar whether they come from an SDK or the Collector. Identifying the source helps you isolate the problem.

Note

Note: Some SDKs support setting a proxy directly (for example, using HTTPS_PROXY). Refer to Proxy settings for EDOT SDKs for details.

Application logs report failures when the SDK cannot send data to the Collector or directly to Elastic. These often appear as connection refused or timeout messages. If seen, verify that the Collector endpoint is reachable.

For guidance on enabling logs in your SDK, refer to Enable SDK debug logging.

Example (Java SDK):

Text
io.opentelemetry.exporter.otlp.internal.grpc.OkHttpGrpcExporter - Failed to export spans. Error: UNAVAILABLE: io exception

Collector logs show export failures when it cannot forward data to Elastic. Look for messages like cannot send spans or failed to connect to <endpoint>. If present, confirm the Collector’s exporters configuration and network access.

Before you dig into SDK or Collector configuration, confirm that your environment can reach the Elastic endpoint.

Note

The examples below use command syntax from Linux and macOS. On Windows or when testing IPv6, the equivalent tooling or syntax may differ (for example, Test-NetConnection in PowerShell).

  1. Verify DNS resolution

    Make sure the hostname for your Elastic endpoint resolves correctly:

    Shell
    nslookup <your-endpoint>
    
  2. Test network reachability

    Shell
    ping <your-endpoint>
    
  3. Check open ports

    Test whether the required OTLP ports are open (default 443 for HTTPS):

    Shell
    nc -vz <your-endpoint> 443
    
  4. Verify TLS/SSL

    Check that TLS certificates can be validated:

    Shell
    openssl s_client -connect <your-endpoint>:443
    

If any of these steps fail, the issue is likely caused by network infrastructure rather than your SDK or Collector configuration.

If basic checks and configuration look correct but issues persist, collect more details before escalating: