<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Vijay Krishna Kakarla on Medium]]></title>
        <description><![CDATA[Stories by Vijay Krishna Kakarla on Medium]]></description>
        <link>https://medium.com/@vijaykrishnakakarla?source=rss-dc4672b56c41------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*R3tH_0cpyYlkBUvw.jpg</url>
            <title>Stories by Vijay Krishna Kakarla on Medium</title>
            <link>https://medium.com/@vijaykrishnakakarla?source=rss-dc4672b56c41------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 13:04:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vijaykrishnakakarla/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[OpenTelemetry for Java: No-Code vs. Code-Based Instrumentation (with Dynatrace Integration)]]></title>
            <link>https://medium.com/@vijaykrishnakakarla/opentelemetry-for-java-no-code-vs-code-based-instrumentation-with-dynatrace-integration-ed3f080a1795?source=rss-dc4672b56c41------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed3f080a1795</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[dynatrace]]></category>
            <category><![CDATA[opentelemetry]]></category>
            <category><![CDATA[opentelemetry-collector]]></category>
            <dc:creator><![CDATA[Vijay Krishna Kakarla]]></dc:creator>
            <pubDate>Mon, 10 Feb 2025 04:03:47 GMT</pubDate>
            <atom:updated>2025-02-28T06:27:05.557Z</atom:updated>
            <content:encoded><![CDATA[<p>OpenTelemetry (OTel) is rapidly becoming the go-to standard for application observability. This vendor-neutral framework allows you to collect traces, metrics, and logs from your applications, providing valuable insights into performance and behavior. This post will guide you through instrumenting your Java applications with OpenTelemetry, exploring both no-code and code-based approaches, and specifically how to integrate with Dynatrace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*vFT9HSZ6QSSWeOatNA_sZg@2x.jpeg" /></figure><p><strong>Why OpenTelemetry?</strong></p><ul><li><strong>Vendor Neutrality:</strong> Avoid vendor lock-in and choose the backend that best suits your needs (e.g., Dynatrace, Jaeger, Prometheus, etc.).</li><li><strong>Standardization:</strong> Use a consistent API and data format across your applications.</li><li><strong>Community-Driven:</strong> Benefit from a thriving open-source ecosystem.</li></ul><p><strong>Scenario: Integrating with Dynatrace</strong></p><p>We’ll focus on integrating with Dynatrace as our observability backend. Dynatrace provides advanced analytics, AI-powered problem detection, and automated remediation capabilities on top of the telemetry data collected through OpenTelemetry. This includes automated analysis, AI-powered insights, and full-stack observability, making it a powerful platform for monitoring complex Java applications.</p><p><strong>No-Code Instrumentation: The Power of the Java Agent</strong></p><p>The OpenTelemetry Java agent is a game-changer for quick and easy instrumentation. It allows you to collect telemetry data from your Java applications <em>without</em> making any code changes.</p><p><strong>1. Add the Java Agent Dependency:</strong></p><p>Include the OpenTelemetry Java agent as a runtime dependency in your pom.xml (or build.gradle):</p><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;io.opentelemetry.javaagent&lt;/groupId&gt;<br>    &lt;artifactId&gt;opentelemetry-javaagent&lt;/artifactId&gt;<br>    &lt;version&gt;2.2.0&lt;/version&gt;  &lt;!-- Use the latest version --&gt;<br>    &lt;scope&gt;runtime&lt;/scope&gt;<br>&lt;/dependency&gt;</pre><p><strong>2. Configure the Java Agent at Runtime:</strong></p><p>When starting your Java application, use the -javaagent flag to specify the path to the opentelemetry-javaagent.jar file. You’ll also need to configure the exporter and other settings using system properties or environment variables.</p><ul><li><strong>System Properties Example:</strong></li></ul><p>java -javaagent:path/to/opentelemetry-javaagent.jar \ -Dotel.service.name=&quot;your-service-name&quot; \ -Dotel.exporter.otlp.endpoint=&quot;https://&lt;your-dynatrace-environment-id&gt;.live.dynatrace.com:443/api/v2/otlp/v1/traces&quot; \ -Dotel.exporter.otlp.headers=&quot;Authorization=Api-Token &lt;your-dynatrace-api-token&gt;&quot; \ -jar your-application.jar</p><ul><li><strong>Configuration File (otel.properties) Example:</strong></li></ul><p>otel.service.name=your-service-name otel.exporter.otlp.endpoint=https://&lt;your-dynatrace-environment-id&gt;.live.dynatrace.com:443/api/v2/otlp/v1/traces otel.exporter.otlp.headers=Authorization=Api-Token &lt;your-dynatrace-api-token&gt;</p><p>java -javaagent:path/to/opentelemetry-javaagent.jar -Dotel.config.file=path/to/otel.properties -jar your-application.jar</p><p><strong>Configuration Notes (Crucial for Dynatrace):</strong></p><ul><li><strong>otel.service.name:</strong> Set this to a meaningful name for your application. This is <em>critical</em> for identifying your application in Dynatrace. Without this, Dynatrace may not properly correlate traces and metrics.</li><li><strong>otel.exporter.otlp.endpoint:</strong> Set this to the Dynatrace OTLP endpoint for your environment. It will have the format https://&lt;your-dynatrace-environment-id&gt;.live.dynatrace.com:443/api/v2/otlp/v1/traces.</li><li><strong>otel.exporter.otlp.headers:</strong> Set the Authorization header with your Dynatrace API token. Create a Dynatrace API token with the “Ingest OpenTelemetry traces” permission in Dynatrace (Settings -&gt; API tokens). <strong>Securely store your API token; never hardcode it in your code or configuration files.</strong></li></ul><p><strong>Benefits of the Java Agent:</strong></p><ul><li><strong>Automatic Instrumentation:</strong> The agent automatically instruments common Java frameworks and libraries (e.g., Spring, Apache HTTP Client, JDBC), reducing the need for manual code changes.</li><li><strong>Context Propagation:</strong> Automatically propagates tracing context between services.</li></ul><p><strong>Code-Based Instrumentation: Gaining Fine-Grained Control</strong></p><p>While the Java agent is great for getting started, code-based instrumentation provides more fine-grained control over the telemetry data you collect.</p><p><strong>1. Add OpenTelemetry Dependencies:</strong></p><p>Add the core OpenTelemetry dependencies to your pom.xml:</p><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;io.opentelemetry&lt;/groupId&gt;<br>    &lt;artifactId&gt;opentelemetry-api&lt;/artifactId&gt;<br>    &lt;version&gt;1.32.0&lt;/version&gt;  &lt;!-- Use the latest version --&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;io.opentelemetry&lt;/groupId&gt;<br>    &lt;artifactId&gt;opentelemetry-sdk&lt;/artifactId&gt;<br>    &lt;version&gt;1.32.0&lt;/version&gt;  &lt;!-- Use the latest version --&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;io.opentelemetry&lt;/groupId&gt;<br>    &lt;artifactId&gt;opentelemetry-exporter-otlp&lt;/artifactId&gt;<br>    &lt;version&gt;1.32.0&lt;/version&gt;  &lt;!-- Use the latest version --&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;io.opentelemetry&lt;/groupId&gt;<br>    &lt;artifactId&gt;opentelemetry-semconv&lt;/artifactId&gt;<br>    &lt;version&gt;1.32.0-alpha&lt;/version&gt;<br>&lt;/dependency&gt;</pre><p><strong>2. Configure the OpenTelemetry SDK:</strong></p><p>Configure the OpenTelemetry SDK and the OTLP exporter to send data to Dynatrace in your startup code.</p><pre>import io.opentelemetry.api.OpenTelemetry;<br>import io.opentelemetry.api.common.Attributes;<br>import io.opentelemetry.sdk.OpenTelemetrySdk;<br>import io.opentelemetry.sdk.resources.Resource;<br>import io.opentelemetry.sdk.trace.SdkTracerProvider;<br>import io.opentelemetry.sdk.trace.export.BatchSpanProcessor;<br>import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter;<br>import io.opentelemetry.semconv.resource.attributes.ResourceAttributes;</pre><pre>public class OpenTelemetryConfig {</pre><pre>    private static OpenTelemetry openTelemetry;</pre><pre>    public static OpenTelemetry initOpenTelemetry(String dynatraceEndpoint, String dynatraceApiToken, String serviceName) {</pre><pre>        Resource resource = Resource.getDefault().merge(Resource.create(Attributes.of(ResourceAttributes.SERVICE_NAME, serviceName)));</pre><pre>        OtlpGrpcSpanExporter spanExporter = OtlpGrpcSpanExporter.builder()<br>                .setEndpoint(dynatraceEndpoint)  //  Your Dynatrace OTLP endpoint<br>                .addHeader(&quot;Authorization&quot;, &quot;Api-Token &quot; + dynatraceApiToken) // API token with &quot;Ingest OpenTelemetry traces&quot; permission<br>                .build();</pre><pre>        SdkTracerProvider tracerProvider = SdkTracerProvider.builder()<br>                .addSpanProcessor(BatchSpanProcessor.builder(spanExporter).build())<br>                .setResource(resource)<br>                .build();</pre><pre>        openTelemetry = OpenTelemetrySdk.builder()<br>                .setTracerProvider(tracerProvider)<br>                .buildAndRegisterGlobal();</pre><pre>        return openTelemetry;<br>    }</pre><pre>    public static OpenTelemetry get() {<br>        return openTelemetry;<br>    }<br>}</pre><p><strong>Configuration Notes (Crucial for Dynatrace):</strong></p><ul><li><strong>dynatraceEndpoint:</strong> Your Dynatrace OTLP endpoint.</li><li><strong>dynatraceApiToken:</strong> A Dynatrace API token with the “Ingest OpenTelemetry traces” permission. <strong>Store securely!<br>While creating the api token make sure it has access to ingest open telemetry logs, traces and metrics.</strong></li><li><strong>serviceName:</strong> A meaningful name for your application.Service name later can be used to located application in dynatrace.</li></ul><p><strong>3. Instrument Your Code:</strong></p><p>Use the OpenTelemetry API to create spans and record events within your application code.</p><pre>import io.opentelemetry.api.OpenTelemetry;<br>import io.opentelemetry.api.trace.Span;<br>import io.opentelemetry.api.trace.Tracer;</pre><pre>public class MyClass {</pre><pre>    private static final Tracer tracer = OpenTelemetryConfig.get().getTracer(&quot;my-application&quot;, &quot;1.0.0&quot;);</pre><pre>    public void myMethod() {<br>        Span span = tracer.spanBuilder(&quot;myMethod&quot;).startSpan();<br>        try {<br>            // Your business logic here<br>            span.setAttribute(&quot;my.attribute&quot;, &quot;some value&quot;);<br>        } finally {<br>            span.end();<br>        }<br>    }<br>}</pre><p><strong>4. Propagate Context:</strong></p><p>Propagate the tracing context when making calls to other services. This typically involves injecting context into HTTP headers or message queues. The OpenTelemetry API provides classes for this.</p><p><strong>Benefits of Code-Based Instrumentation:</strong></p><ul><li><strong>Fine-Grained Control:</strong> Trace specific business logic and add custom attributes.</li><li><strong>Custom Metrics:</strong> Collect metrics tailored to your application’s unique needs.</li><li><strong>Flexibility:</strong> Instrument code that isn’t automatically covered by the Java agent.</li></ul><p><strong>Combining Automatic and Manual Instrumentation</strong></p><p>A best practice is to <em>start</em> with automatic instrumentation using the Java agent. Then, identify gaps and selectively add manual instrumentation to provide more context or trace specific business logic.</p><p><strong>Dynatrace Integration: Configuration and Deployment</strong></p><p><strong>1. Configuring Dynatrace:</strong></p><ul><li><strong>API Token:</strong> Create a Dynatrace API token with the “Ingest OpenTelemetry traces” permission (Settings -&gt; API tokens). This token is <em>essential</em> for authenticating your application with Dynatrace.</li><li><strong>OTLP Endpoint:</strong> Obtain the OTLP endpoint for your Dynatrace environment. This endpoint is used to send OpenTelemetry data to Dynatrace. It typically looks like: https://&lt;your-dynatrace-environment-id&gt;.live.dynatrace.com:443/api/v2/otlp/v1/traces</li><li><strong>Enable OTLP Ingestion:</strong> While typically enabled by default, double-check that OTLP ingestion is enabled within your Dynatrace environment.</li></ul><p><strong>2. Kubernetes Deployment with the Java Agent and Existing Dynatrace OneAgent:</strong></p><p>When deploying to Kubernetes with an existing Dynatrace OneAgent, the approach is simplified. The OneAgent is designed to automatically discover and ingest OpenTelemetry data.</p><ul><li><strong>Add the Java Agent (as described above):</strong> Include the OpenTelemetry Java agent in your application’s Docker image or use the Dynatrace Operator for automatic injection.</li><li><strong>Set otel.service.name:</strong> This is <em>absolutely critical</em>! Set the otel.service.name property (either as a system property or in an otel.properties file) to a meaningful name for your application. This is how Dynatrace identifies your application and properly correlates the telemetry data.</li></ul><p>java -javaagent:path/to/opentelemetry-javaagent.jar -Dotel.service.name=&quot;your-service-name&quot; -jar your-application.jar</p><ul><li><strong>No Direct OTLP Export (Usually):</strong> In <em>most</em> cases, you <em>don’t</em> need to configure a direct OTLP exporter in your application when a Dynatrace OneAgent is present. The OneAgent handles the data collection and forwarding.</li><li><strong>Exceptions:</strong> If you have very specific data transformation or filtering requirements <em>before</em> the data reaches Dynatrace, you <em>might</em> consider using an OTLP Collector as an intermediary. However, this adds complexity.</li><li><strong>Verify OneAgent Configuration:</strong> Ensure the OneAgent is configured to monitor the Kubernetes namespace where your application is deployed.</li><li><strong>Dynatrace Operator (Recommended):</strong> If you are using the Dynatrace Operator for Kubernetes, it can simplify the Java agent injection and configuration process. Refer to the Dynatrace documentation for details on how to configure the operator for OpenTelemetry.</li></ul><p><strong>Troubleshooting in Kubernetes with Dynatrace:</strong></p><ul><li><strong>Check OneAgent Logs:</strong> Examine the OneAgent logs on the Kubernetes nodes for any errors related to OpenTelemetry ingestion.</li><li><strong>Application Logs:</strong> Ensure spans are being created correctly and that there are no OpenTelemetry-related errors in your application logs.</li><li><strong>Dynatrace UI:</strong> Verify that your application is being detected by Dynatrace and that traces are being displayed. Look for any error messages or warnings in the Dynatrace UI. If you don’t see your service, double-check the otel.service.name setting.</li><li><strong>Kubernetes Events:</strong> Check the Kubernetes events for your application’s pods to see if there are any issues with the OneAgent injection or configuration.</li></ul><p><strong>Key Takeaways</strong></p><ul><li>OpenTelemetry empowers you to standardize your observability strategy.</li><li>The Java agent provides a no-code way to get started quickly.</li><li>Code-based instrumentation gives you more fine-grained control.</li><li>Combine both approaches for the best of both worlds.</li><li><strong>When integrating with Dynatrace, the otel.service.name property is paramount!</strong></li><li>In Kubernetes with the OneAgent, avoid direct OTLP export unless necessary.</li></ul><p>By following these guidelines, you can effectively instrument your Java applications with OpenTelemetry and send the data to Dynatrace for comprehensive observability. Prioritize security, use semantic conventions, and understand the nuances of deploying with the Dynatrace OneAgent in Kubernetes. Happy tracing!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed3f080a1795" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[KCNA : Preparation tips and Experience]]></title>
            <link>https://medium.com/@vijaykrishnakakarla/kcna-preparation-tips-and-experience-6bbc112913d2?source=rss-dc4672b56c41------2</link>
            <guid isPermaLink="false">https://medium.com/p/6bbc112913d2</guid>
            <category><![CDATA[kubernetes-certification]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kcna]]></category>
            <dc:creator><![CDATA[Vijay Krishna Kakarla]]></dc:creator>
            <pubDate>Tue, 12 Mar 2024 03:26:04 GMT</pubDate>
            <atom:updated>2024-03-13T05:10:24.381Z</atom:updated>
            <content:encoded><![CDATA[<h3>KCNA : Preparation tips and Experience</h3><p>I recently appeared for the Kubernetes and Cloud Native Associate (KCNA) exam and cleared it. I thought I could share my experience to help or provide insight for others planning to take this exam or already preparing for it. Refer to <a href="https://training.linuxfoundation.org/certification-catalog/">The Linux Foundation Learning Portal </a>for the exam composition and several important instructions associated with it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5wKdFpBP7O0BARdKsy2W_w.png" /></figure><h3><strong>Why this certification is important?</strong></h3><ul><li>KCNA covers the Cloud Native ecosystem end-to-end. With all enterprises moving towards the Cloud, this certification adds value, whether you are a beginner or experienced.</li><li>Kubernetes: from what Kubernetes solves to all its components. By the time you pass this exam, you will be proficient in all Kubernetes components, services, CNI, CSI, Kubectl, config maps, secrets, Helm, etc.</li><li>Networking: a great chance to brush up on your networking basics or learn about networking if you’re a novice.</li><li>Knowledge about modern Cloud Native infrastructure, CI/CD tools like Jenkins X, CircleCI, GitOps tools like Argo/Flux, and Service Mesh tools like Istio. Most importantly, Prometheus and Grafana for Kubernetes Metrics telemetry.</li><li>Knowledge about Infrastructure as Code, Serverless, CNCF Governance, modern deployment strategies, etc.</li></ul><h3><strong>How I prepared for the exam?</strong></h3><p>I have some experience working with Kubernetes, however I consider myself as beginner in Kubernetes. I followed the below resources and some experiences of mine which would help</p><ol><li><strong>CNCF Kubernetes and Cloud Native Associate Certification Course (KCNA) by Andrew Brown Youtube</strong></li></ol><p>This is very detailed youtube course and covers all the syllabus for this exam and it’s free. This is 13 hour long video, there are other content creators too but this is specific to this certification</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FAplluksKvzI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DAplluksKvzI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FAplluksKvzI%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/fe0a59df2c5bc34998ee5af076de56a6/href">https://medium.com/media/fe0a59df2c5bc34998ee5af076de56a6/href</a></iframe><p><strong>2. Andrew Brown-Exam pro KCNA</strong></p><p>This course is similar to the YouTube video but organized into individual topics followed by quizzes and flashcards. The most impressive thing about these lessons is that every video comes with references. I strongly recommend going through those references, ranging from Kubernetes docs to multiple open-source docs by various vendors. Going through these references will give you a holistic understanding of the components/ecosystem and increase your chances of passing the exam.</p><p>This is a paid course and comes with four practice tests, which are really helpful. Do not consider appearing for the exam without attempting and reviewing these questions/answers. KCNA is a little tougher than these practice tests, so you need to score really well here.</p><p><a href="https://www.exampro.co/kcna">CNCF Kubernetes and Cloud-Native Associate - ExamPro</a></p><p><strong>3. Implement and Practice:</strong></p><p>You have to practice all the Kubernetes components on your computer or AWS Cloud9 using Minikube or kind or any tool of your choice. I have used Minikube along with Docker, and I also recommend using Cloud9 in the AWS console. Make sure you practice and visually see the following:</p><ul><li>Deploy the application using kubectl create/apply and view the deployments.</li><li>Play with Replicas/Auto Scaling.</li><li>Services: Define all the services using YAMLs and see how the services are being created.</li><li>NodePort</li><li>Headless (how do you define port for headless is a question to me)</li><li>Ingress</li><li>Storage and Stateful sets, PV and PVC.</li></ul><p><strong>4. KUBECTL</strong></p><p>Master the kubectl commands, with more emphasis on kubectl logs, deployment, describe, edit, expose, etc.</p><p>I have seen questions on kubectl commands for logs from a container in a pod. It’s hard to expect the exam without kubectl logs commands.</p><p><a href="https://www.bluematador.com/learn/kubectl-cheatsheet">Kubectl Cheatsheet | Free Cheatsheet</a></p><p><strong>5. Reading Kubernetes Official documentation:</strong> <br>Constantly read through the Kubernetes documentation. Even though I completed the ExamPro course and gone through various YouTube videos on topics, I observed questions appeared from completely new concepts. For example, refer to <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/">Taint and Tolerance</a>. So it is a must to refer to Kubernetes documentation as much as you can.</p><p><strong>6. Discuss </strong>: Try to discuss with your friends or colleagues about various topics if you are new, it’s advisable to ensure your understanding is right and not to confuse between topics. With implementation and dicussion your understanding of kubernetes will become stronger.</p><p><strong>7. Remember tools and specifically what they do. </strong><br> Rook, Mini IO, K3’s (Kubernetes for small independent devices), Kind, Microkube, Container D, CRI-O,ARGO FLUX e.t.c</p><p>Thanks for reading; I hope this helps. And all the best for your preparation. Good luck.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bbc112913d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>