Splunk Observability Cloud

Need Help Resolving OpenTelemetry Collector Data Reception Issue in Dockerized Django Application

Anders
New Member

Hi Splunk Community,

I'm working on a Django-based website server running inside a Docker container, and I'm facing an issue with OpenTelemetry Collector (Otel) data reception. Despite following the official Splunk documentation for installing Otel within a Docker container. I'm encountering an issue where the Otel installed on my VM isn't receiving any data from my Django application.

Here are the warning logs from the Otel container:

2024-03-14 04:49:05,592 WARNING [opentelemetry.exporter.otlp.proto.grpc.exporter] [exporter.py:293] [trace_id=0 span_id=0 resource.service.name=website trace_sampled=False] - Transient error StatusCode.UNAVAILABLE encountered while exporting metrics to localhost:4317, retrying in 32s.

 

Initially, my Dockerfile was configured with OTEL_EXPORTER_OTLP_ENDPOINT='localhost:4317'. Considering that might be the issue, I updated it to OTEL_EXPORTER_OTLP_ENDPOINT='otelcol:4317', aiming to directly communicate with the Otel collector service running as a Docker container. However, I'm still observing attempts to connect to localhost:4317 in the error logs.

Here's a brief overview of my setup:

  • Django application running in a Docker container.
  • OpenTelemetry Collector deployed as a separate Docker container named 'otel-collector'.
  • Dockerfile for the Django application updated to use the OpenTelemetry Collector container endpoint.

    Could anyone provide insights or suggestions on what might be going wrong here? How can I ensure that my Django application correctly sends telemetry data to the Otel Collector?

    Thank you in advance for your help and suggestions!

0 Karma

bishida
Splunk Employee
Splunk Employee

Hi,

Here are a couple of thoughts to consider. If you want to run the OTel collector in its own container, are you using appropriate networking mode for your container? For example, port 4317 (as well as others) would need to bind to the host networking ports so that your other container running your application can refer to "localhost:4317". You may want to start the OTel collector container first and then try some simple tests on the host command line to make sure it's accessible (e.g., 'telnet localhost 4317' or 'nc -vz localhost 4317') https://lantern.splunk.com/Data_Descriptors/Docker/Setting_up_the_OpenTelemetry_Demo_in_Docker


Also, I didn't see any mention of container orchestration (kubernetes). This might be a good use-case for kubernetes where you run your application container with kubernetes and the OTel collector can run in a side-car configuration. https://docs.splunk.com/observability/en/gdi/opentelemetry/collector-kubernetes/kubernetes-config.ht...

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Quantify Your Splunk Investment Impact: Introducing Savings Metrics to Value Insights

Building on the foundation established in our initial Value Insights releases, we are introducing the Savings ...

Event Series: Telemetry Pipeline Management

Balancing Scale and Spend: Gaining Control Over High-Volume Metrics in Splunk Observability Cloud As ...

Kick the Tires Before You Commit: A Hands-On Tour of the Splunk Observability Cloud ...

Evaluating an enterprise observability platform usually goes like this: fill out a form, get a free trial with ...