<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article K8s pod OneAgent missing code level monitoring when there is a delay to setup network in Troubleshooting</title>
    <link>https://community.dynatrace.com/t5/Troubleshooting/K8s-pod-OneAgent-missing-code-level-monitoring-when-there-is-a/ta-p/261452</link>
    <description>&lt;P&gt;&lt;LI-TOC indent="15" liststyle="disc" maxheadinglevel="2"&gt;&lt;/LI-TOC&gt;&lt;/P&gt;
&lt;H1&gt;Symptoms&lt;/H1&gt;
&lt;P&gt;Sometimes, due to the delay from the K8s pod to setup network, the OneAgent code-modules&amp;nbsp;injected into the monitored process time out when trying to setup the initial connection:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;2024-10-02 07:40:48.031 UTC [00000007] info [comm ] Initial connect: not successful within 6s - giving up 2024-10-02 07:40:48.031 UTC [00000007] info [comm ] Initial connect: connection to initial gateways failed (last error Failed to connect to dynakube-activegate.dynatrace port 443 after 0 ms: Couldn't connect to server) using any of

2024-10-02 07:40:48.031 UTC [00000007] info [comm ] ....

2024-10-02 07:40:48.031 UTC [00000007] info [comm ] .....

2024-10-02 07:40:48.031 UTC [00000007] warning [native] Unable to do initial setup because no server is reachable. Last error: Failed to connect to dynakube-activegate.dynatrace port 443 after 0 ms: Couldn't connect to server&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, when the K8 pod finishes the network setup, the OneAgent connected to the DT cluster:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;2024-10-02 07:41:03.603 UTC [0000000e] info [comm ] Connected to https://dynakube-activegate.dynatrace:443/communication&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Overall, monitoring is working, and the data is reaching Dynatrace, but some features are not enabled.&lt;/P&gt;
&lt;P&gt;As a result, the OneAgent code-modules can monitor the metric of the technology of the monitored process (example: jvm metric), however, due to the initial connection timeout, the OneAgent doesn't get the config/ sensors from the cluster to instrument the process, then it can't detect any server and report the Purepath.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;&lt;STRONG&gt;Solutions&lt;/STRONG&gt;&lt;/H1&gt;
&lt;P&gt;You can fix this problem by increasing the OneAgent initial connection timeout.&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;STRONG&gt;Classic Full-Stack mode solution&lt;/STRONG&gt;&lt;/H2&gt;
&lt;P&gt;Increase the OneAgent initial connection timeout through the pod system env:&lt;/P&gt;
&lt;P&gt;env:&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;- name: DT_INITIAL_CONNECT_RETRY_MS&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;value: "30000"&lt;/P&gt;
&lt;P&gt;and restart the pod to reload the config.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;App-only and Cloud-native Full-Stack solution&lt;/H2&gt;
&lt;P&gt;Add the following feature flag to DynaKube:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;kubectl annotate dynakube &amp;lt;name-of-your-DynaKube&amp;gt; feature.dynatrace.com/oneagent-initial-connect-retry-ms=6000  -n dynatrace&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;See&amp;nbsp;&lt;A id="link_7" class="page-link lia-link-navigation lia-custom-event" href="https://community.dynatrace.com/t5/Troubleshooting/OneAgent-unable-to-connect-when-using-Istio/ta-p/230217" target="_blank" rel="noopener"&gt;OneAgent unable to connect when using Istio&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;&lt;/H2&gt;
&lt;P&gt;Since increasing the initial connection timeout waits on the monitored process to startup, it will delay the monitored process to load the application.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Nov 2024 07:21:49 GMT</pubDate>
    <dc:creator>guangjun_yin</dc:creator>
    <dc:date>2024-11-26T07:21:49Z</dc:date>
    <item>
      <title>K8s pod OneAgent missing code level monitoring when there is a delay to setup network</title>
      <link>https://community.dynatrace.com/t5/Troubleshooting/K8s-pod-OneAgent-missing-code-level-monitoring-when-there-is-a/ta-p/261452</link>
      <description>&lt;P&gt;&lt;LI-TOC indent="15" liststyle="disc" maxheadinglevel="2"&gt;&lt;/LI-TOC&gt;&lt;/P&gt;
&lt;H1&gt;Symptoms&lt;/H1&gt;
&lt;P&gt;Sometimes, due to the delay from the K8s pod to setup network, the OneAgent code-modules&amp;nbsp;injected into the monitored process time out when trying to setup the initial connection:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;2024-10-02 07:40:48.031 UTC [00000007] info [comm ] Initial connect: not successful within 6s - giving up 2024-10-02 07:40:48.031 UTC [00000007] info [comm ] Initial connect: connection to initial gateways failed (last error Failed to connect to dynakube-activegate.dynatrace port 443 after 0 ms: Couldn't connect to server) using any of

2024-10-02 07:40:48.031 UTC [00000007] info [comm ] ....

2024-10-02 07:40:48.031 UTC [00000007] info [comm ] .....

2024-10-02 07:40:48.031 UTC [00000007] warning [native] Unable to do initial setup because no server is reachable. Last error: Failed to connect to dynakube-activegate.dynatrace port 443 after 0 ms: Couldn't connect to server&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, when the K8 pod finishes the network setup, the OneAgent connected to the DT cluster:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;2024-10-02 07:41:03.603 UTC [0000000e] info [comm ] Connected to https://dynakube-activegate.dynatrace:443/communication&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Overall, monitoring is working, and the data is reaching Dynatrace, but some features are not enabled.&lt;/P&gt;
&lt;P&gt;As a result, the OneAgent code-modules can monitor the metric of the technology of the monitored process (example: jvm metric), however, due to the initial connection timeout, the OneAgent doesn't get the config/ sensors from the cluster to instrument the process, then it can't detect any server and report the Purepath.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;&lt;STRONG&gt;Solutions&lt;/STRONG&gt;&lt;/H1&gt;
&lt;P&gt;You can fix this problem by increasing the OneAgent initial connection timeout.&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;STRONG&gt;Classic Full-Stack mode solution&lt;/STRONG&gt;&lt;/H2&gt;
&lt;P&gt;Increase the OneAgent initial connection timeout through the pod system env:&lt;/P&gt;
&lt;P&gt;env:&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;- name: DT_INITIAL_CONNECT_RETRY_MS&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;value: "30000"&lt;/P&gt;
&lt;P&gt;and restart the pod to reload the config.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;App-only and Cloud-native Full-Stack solution&lt;/H2&gt;
&lt;P&gt;Add the following feature flag to DynaKube:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;kubectl annotate dynakube &amp;lt;name-of-your-DynaKube&amp;gt; feature.dynatrace.com/oneagent-initial-connect-retry-ms=6000  -n dynatrace&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;See&amp;nbsp;&lt;A id="link_7" class="page-link lia-link-navigation lia-custom-event" href="https://community.dynatrace.com/t5/Troubleshooting/OneAgent-unable-to-connect-when-using-Istio/ta-p/230217" target="_blank" rel="noopener"&gt;OneAgent unable to connect when using Istio&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;&lt;/H2&gt;
&lt;P&gt;Since increasing the initial connection timeout waits on the monitored process to startup, it will delay the monitored process to load the application.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 07:21:49 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Troubleshooting/K8s-pod-OneAgent-missing-code-level-monitoring-when-there-is-a/ta-p/261452</guid>
      <dc:creator>guangjun_yin</dc:creator>
      <dc:date>2024-11-26T07:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: K8s pod OneAgent missing code level monitoring when there is a delay to setup network</title>
      <link>https://community.dynatrace.com/t5/Troubleshooting/K8s-pod-OneAgent-missing-code-level-monitoring-when-there-is-a/tac-p/269929#M849</link>
      <description>&lt;P&gt;"&lt;SPAN&gt;Since increasing the initial connection timeout waits on the monitored process to startup, it will delay the monitored process to load the application."&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Do you mean the JVM injection for deep dive which would in turn delay the startup of the JVM that will be monitored by the oneagent deep dive or the oneagent monitoring itself? We have this issue on our ActiveGates when installing the oneagent for self-monitoring (infrastructure only monitoring) as well as most of our application servers we are monitoring.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 18:22:51 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Troubleshooting/K8s-pod-OneAgent-missing-code-level-monitoring-when-there-is-a/tac-p/269929#M849</guid>
      <dc:creator>matthew_k</dc:creator>
      <dc:date>2025-02-12T18:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: K8s pod OneAgent missing code level monitoring when there is a delay to setup network</title>
      <link>https://community.dynatrace.com/t5/Troubleshooting/K8s-pod-OneAgent-missing-code-level-monitoring-when-there-is-a/tac-p/284582#M966</link>
      <description>&lt;P&gt;Excellent tip, thanks.&lt;/P&gt;&lt;P&gt;We had exactly this scenario: up to a 9-second delay and features like Log Trace/Span enrichment and Java Memory Profiling. For example, in an application with 5 pods, 2 worked and 3 didn't. After restart, 1 worked and 4 didn't, and so on. Sometimes 3 worked, randomly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ex. from our logs:&lt;/P&gt;&lt;P&gt;2025-08-21 03:05:10.792 UTC [00000007] info [comm] Initial connect: Connection to initial gateways failed (last error SSL connection timeout) using any of:&lt;/P&gt;&lt;P&gt;XXXX, XXXX, XXXX ...&lt;/P&gt;&lt;P&gt;2025-08-21 03:05:10.793 UTC [00000007] warning [native] Unable to do initial setup because no server is reachable. Last error: SSL connection timeout&lt;/P&gt;&lt;P&gt;2025-08-21 03:05:19.584 UTC [0000000e] info [comm ] Connected to XXXX...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This solve the issue. Great!&lt;/P&gt;</description>
      <pubDate>Sun, 24 Aug 2025 01:27:05 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Troubleshooting/K8s-pod-OneAgent-missing-code-level-monitoring-when-there-is-a/tac-p/284582#M966</guid>
      <dc:creator>mwduarte</dc:creator>
      <dc:date>2025-08-24T01:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: K8s pod OneAgent missing code level monitoring when there is a delay to setup network</title>
      <link>https://community.dynatrace.com/t5/Troubleshooting/K8s-pod-OneAgent-missing-code-level-monitoring-when-there-is-a/tac-p/284593#M968</link>
      <description>&lt;P&gt;You can also work around the issue in Istio (1.7+) with the holdApplicationUntilProxyStarts setting.&lt;/P&gt;&lt;P&gt;Global (Mesh Level):&lt;/P&gt;&lt;P&gt;apiVersion: install.istio.io/v1alpha1&lt;BR /&gt;kind: IstioOperator&lt;BR /&gt;spec:&lt;BR /&gt;&amp;nbsp;meshConfig:&lt;BR /&gt;&amp;nbsp; &amp;nbsp;defaultConfig:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;holdApplicationUntilProxyStarts: true&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By POD:&lt;/P&gt;&lt;P&gt;apiVersion: apps/v1&lt;BR /&gt;kind: Deployment&lt;BR /&gt;metadata:&lt;BR /&gt;&amp;nbsp; name: my-app&lt;BR /&gt;spec:&lt;BR /&gt;&amp;nbsp; template:&lt;BR /&gt;&amp;nbsp; &amp;nbsp;metadata:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;annotations:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;proxy.istio.io/config: '{ "holdApplicationUntilProxyStarts": true }'&lt;BR /&gt;&amp;nbsp; spec:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; containers:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; - name: my-app-container&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;image: my-app-image&lt;/P&gt;</description>
      <pubDate>Sun, 24 Aug 2025 23:39:56 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Troubleshooting/K8s-pod-OneAgent-missing-code-level-monitoring-when-there-is-a/tac-p/284593#M968</guid>
      <dc:creator>mwduarte</dc:creator>
      <dc:date>2025-08-24T23:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: K8s pod OneAgent missing code level monitoring when there is a delay to setup network</title>
      <link>https://community.dynatrace.com/t5/Troubleshooting/K8s-pod-OneAgent-missing-code-level-monitoring-when-there-is-a/tac-p/284595#M970</link>
      <description>&lt;P&gt;As last comment,&amp;nbsp;&lt;BR /&gt;I find this issue normally happens if / where Istio is enabled.&amp;nbsp; it can easily be addressed by adding the following annotation:&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;PRE&gt;proxy.istio.io/config: '{ "holdApplicationUntilProxyStarts": true }'&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;A href="https://istio.io/latest/docs/ops/common-problems/injection/#pod-or-containers-start-with-network-issues-if-istio-proxy-is-not-ready" target="_blank" rel="noopener"&gt;Istio / Sidecar Injection Problems&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also please note that adding this Dynatrace annotation:&lt;/P&gt;&lt;PRE&gt;oneagent-initial-connect-retry-ms&lt;/PRE&gt;&lt;P&gt;can have significant impacts on some applications (like hazlecast / spring / tomcat) as it can delay start-up of application components and trigger applications to not load components correctly due to timeouts - causing additional connectivity issues at the application layer that it was trying to resolve.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Aug 2025 23:44:31 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Troubleshooting/K8s-pod-OneAgent-missing-code-level-monitoring-when-there-is-a/tac-p/284595#M970</guid>
      <dc:creator>gopher</dc:creator>
      <dc:date>2025-08-24T23:44:31Z</dc:date>
    </item>
  </channel>
</rss>

