# OTEL (auto) ingest for Kubernetes services

**URL:** <https://community.dynatrace.com/t/otel-auto-ingest-for-kubernetes-services/42661>\
**Category:** OpenTelemetry\
**Tags:** opentelemetry\
**Created:** [November 16, 2023, 4:37pm UTC](https://community.dynatrace.com/t/otel-auto-ingest-for-kubernetes-services/42661 "2023-11-16T16:37:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [November 16, 2023, 4:37pm UTC](https://community.dynatrace.com/t/otel-auto-ingest-for-kubernetes-services/42661/1 "2023-11-16T16:37:31Z")

</div>

Hello,  
we are trying to get a vert.x java service traced with the support of OpenTelemetry.  
The service runs in a K8s pod which is monitored already by Oneagent (dynakube).

The process should be very straight forward, just following [these steps](https://docs.dynatrace.com/docs/extend-dynatrace/opentelemetry/walkthroughs/java#tabgroup--dynatrace-docs--automatic-ingestion-with-oneagent). Using oneagent ingestion.

- add OTEL agent to the java startup
- disable default exporters via env variables  
OTEL\_EXPORTER\_OTLP\_PROTOCOL=http/protobufOTEL\_EXPORTER=none

However when the application is start up it always still tries to perform the export to localhost:

```markup
SEVERE: Failed to export metrics. The request could not be executed. Full error message: Failed to connect to localhost/127.0.0.1:431884java.net.ConnectException: Failed to connect to localhost/127.0.0.1:431883	at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:297)82

```

When we try to set the exporter URL manually to directly export to the SaaS instance it seems to work (a connection attempt is made). But we cannot use that setup due to firewall restrictions.

Now I have a few questions:

In the above log the export tries to connect to localhost/127.0.0.1:431883… What port ist that? That doesn’t seem to be a valid port range?  
In that configuration (oneagent ingested) there shouldn’t be any attempt to export traces anywhere, right? The oneagent within the process should pick up those traces, right?

Thanks!

---

<div class="post-metadata">

**Author:** ![alexander\_dt](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@alexander\_dt](https://community.dynatrace.com/u/alexander_dt)\
**Post date:** [December 19, 2023, 6:39am UTC](https://community.dynatrace.com/t/otel-auto-ingest-for-kubernetes-services/42661/2 "2023-12-19T06:39:36Z")

</div>

You are right, 431883 is way beyond port 65535. My guess for the network level would be, that value gets truncated and turns into 38667. Not that this would be a standard port for OpenTelemetry either, however.

As for the ingestion question, OneAgent used to disable that but doesn’t do so any more as of version 1.259 - [Use OneAgent with OpenTelemetry data — Dynatrace Docs](https://docs.dynatrace.com/docs/shortlink/opentelemetry-oneagent#java) - so the error message itself is not surprising. That being said, I would usually assume setting “OTEL\_EXPORTER” to “none” should do the trick and disable exporting on an OpenTelemetry level. Going by [Automatically instrument your Java application with OpenTelemetry — Dynatrace Docs](https://docs.dynatrace.com/docs/shortlink/otel-wt-java-auto#disable-default-trace-exporter), could you try to specifically set OTEL\_TRACES\_EXPORTER?

Other than that, that particular port number is very specific and seemingly does refer to the default port of OTLP via HTTP at port 4318, but I somewhat doubt any of the involed standard components would render a port invalid by appending “83” out of the blue. Could it be that you have this configured (in code or as environment variable) somewhere? The usual typo :). Could you grep the file system in question for “431883” or maybe just for “4318” and then check if something appends “83”?

Best,  
Alexander

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [December 19, 2023, 7:09am UTC](https://community.dynatrace.com/t/otel-auto-ingest-for-kubernetes-services/42661/3 "2023-12-19T07:09:11Z")

</div>

It turned out that the documentation was wrong at the time of writing the above post.

Back then it mentioned to set OTEL\_EXPORTER while it has to be OTEL\_TRACES\_EXPORTER.

I mentioned this to the doc team and they now fixed that.

---

<div class="post-metadata">

**Author:** ![alexander\_dt](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@alexander\_dt](https://community.dynatrace.com/u/alexander_dt)\
**Post date:** [December 19, 2023, 8:48am UTC](https://community.dynatrace.com/t/otel-auto-ingest-for-kubernetes-services/42661/4 "2023-12-19T08:48:58Z")

</div>

Right, that would be the global value. So there was still a traces specific value configured with that port?

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [December 19, 2023, 8:58am UTC](https://community.dynatrace.com/t/otel-auto-ingest-for-kubernetes-services/42661/5 "2023-12-19T08:58:10Z")

</div>

No, as per the recent [OTEL documentation](https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md#disabling-opentelemetrysdk) there is no such environment variable as OTEL\_EXPORTER. Only OTEL\_TRACES\_EXPORTER, OTEL\_METRICS\_EXPORTER and OTEL\_LOGS\_EXPORTER.  
Where that port is coming from we do not know, might be also som log/formatting issue maybe…
