<?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 Tiss Joseph on Medium]]></title>
        <description><![CDATA[Stories by Tiss Joseph on Medium]]></description>
        <link>https://medium.com/@tiss.joseph?source=rss-318da9337c7f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*O2WD4aEqjvlJRE7D</url>
            <title>Stories by Tiss Joseph on Medium</title>
            <link>https://medium.com/@tiss.joseph?source=rss-318da9337c7f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 12:24:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tiss.joseph/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[Instana Java Tracer — Configuration based SDK]]></title>
            <link>https://medium.com/ibm-cloud/instana-java-tracer-configuration-based-sdk-26deecbb038d?source=rss-318da9337c7f------2</link>
            <guid isPermaLink="false">https://medium.com/p/26deecbb038d</guid>
            <category><![CDATA[configuration-based-sdk]]></category>
            <category><![CDATA[ibm-instana]]></category>
            <category><![CDATA[ibm]]></category>
            <category><![CDATA[instana]]></category>
            <category><![CDATA[ibm-cloud]]></category>
            <dc:creator><![CDATA[Tiss Joseph]]></dc:creator>
            <pubDate>Fri, 20 Jun 2025 10:14:20 GMT</pubDate>
            <atom:updated>2025-06-20T14:50:06.537Z</atom:updated>
            <content:encoded><![CDATA[<h3>Instana Java Tracer — Configuration-based SDK</h3><p>In modern observability practices, real-time tracing of application flows is essential.<a href="https://www.ibm.com/docs/en/instana-observability/current?topic=overview"> <strong>IBM Instana</strong></a> offers a comprehensive observability platform that enables tracing, monitoring, and performance analysis across microservices and distributed systems.</p><p>Instana’s tracing model introduces two important concepts:</p><ul><li>A <strong>Trace</strong> represents the complete journey of a request as it moves across services and components.</li><li>A <strong>Span</strong> represents a single step or unit of work in that trace, like a method call, a database operation, or an internal computation.</li></ul><h4>Span Types in Instana</h4><p>Instana categorizes method calls into the following span types:</p><ul><li><strong>Entry Span (Server Span):</strong> Represents an incoming request into a traced service, such as an HTTP or RPC call, or a scheduled job. Entry spans mark the beginning of a transaction in a service.</li><li><strong>Exit Span (Client Span):</strong> Represents outgoing communication from one service to another system, such as making a call to an API or accessing a database.</li><li><strong>Intermediate Span (Local Span):</strong> Represents internal operations that occur within a service. These spans are used selectively to track significant internal logic or method calls that don’t involve inter-service communication.</li></ul><p>These method calls are instrumented at both the entry and exit points, and the duration along with contextual metadata is captured as a span.</p><p>Have you ever tried to trace what’s happening inside a Java application, but couldn’t modify the source code? Maybe it’s a legacy system, or you’re working with a third-party app. That’s where <strong>Instana’s configuration-based Java Trace SDK</strong> can save the day.</p><p>While Instana provides automatic tracing out-of-the-box (Instana AutoTrace), there are cases where more control is needed, especially when you don’t want or aren’t able to modify the application’s source code. In such scenarios, Instana’s configuration-based Java Trace SDK is a practical alternative. It allows you to define spans, attach metadata, and monitor specific methods — all through a configuration file, without requiring code changes.</p><p><strong>What if you can’t touch the code? Here’s your alternative</strong></p><p>You might face a situation where you need tracing, but modifying the source code isn’t an option. The configuration-based Java Trace SDK lets you configure tracing declaratively — by editing the Instana agent’s configuration.yaml file.</p><p>Although it’s less feature-rich and somewhat brittle against code changes, it’s a practical way to cover common use cases without writing a single line of Java code. Just remember: if the method signature changes, you’ll need to update the configuration too.</p><p><strong>Enabling the Configuration-Based SDK</strong></p><p>To enable the Java Trace SDK, modify the Instana agent’s configuration.yaml file and specify which packages to scan for SDK instrumentation. <br>By default, no packages are scanned. To disable or enable it again, simply comment out the relevant configuration block.</p><p><strong>Configuration Format</strong></p><pre># Java Tracing<br>com.instana.plugin.javatrace:<br>  instrumentation:<br>    sdk:<br>      targets:<br>        - match:<br>            type: &#39;interface&#39;|&#39;class&#39;|&#39;baseclass&#39;<br>            name: &#39;&lt;type-name&gt;&#39;<br>            method: &#39;&lt;method-name&gt;&#39;<br>            [argumentTypes:<br>              - &#39;&lt;argument-type-index0&gt;&#39;<br>              - &#39;&lt;argument-type-indexn&gt;&#39;]<br>            [returnType: &#39;&lt;return-type-name&gt;&#39;]<br>          span:<br>            name: &#39;&lt;span-name&gt;&#39;<br>            [type: &#39;&lt;span-type&gt;&#39;]<br>            [stackDepth: &lt;depth&gt;]<br>            [tags:<br>              - kind: &#39;argument&#39;<br>                name: &#39;name&#39;<br>                index: 0<br>              - kind: &#39;return&#39;<br>                name: &#39;name&#39;<br>              - kind: &#39;constant&#39;<br>                name: &#39;name&#39;<br>                value: &#39;constant-value&#39;]</pre><p>This configuration has two parts:</p><p><strong>match</strong>: Defines which method in which class/interface/base class should be instrumented.</p><ul><li>type: Whether you are matching a class, interface, or base class.</li><li>name: The fully qualified class name (e.g., org.example.HelloController).</li><li>method: The method to instrument</li><li>Optional: argumentTypes and returnType can be used to match overloaded methods.</li></ul><p><strong>span</strong>: Specifies how the span will be recorded and tagged.</p><ul><li>name: The name under which the span appears in Instana.</li><li>type: Can be ENTRY, EXIT, or INTERMEDIATE.</li><li>stackDepth: (Optional) Number of stack frames to capture.</li><li>tags: (Optional) Annotations for the span:</li><li>argument: Captures a method argument.</li><li>return: Captures the return value.</li><li>constant: Attaches a constant value.</li></ul><h4><strong>Real Example</strong></h4><p>Let’s take a simple login controller in a Spring Boot application and trace the validation logic using the configuration-based SDK.</p><pre>@RestController<br>public class LoginController {<br><br>    private String username;<br><br>    @Autowired<br>    private RestTemplate restTemplate;<br><br>    @PostMapping(&quot;/login&quot;)<br>    public boolean login(@RequestParam String username) {<br>        this.username = username;<br>        if (&quot;admin&quot;.equals(username)) {<br>            return validateAdmin();<br>        } else if (&quot;user&quot;.equals(username)) {<br>            return validateUser();<br>        }<br>        return false;<br>    }<br><br>    public boolean validateAdmin() {<br>    //  Validation logic<br>        return true;<br>    }<br>    public boolean validateUser() {<br>    //  Validation logic<br>        return true;<br>    }<br>}</pre><p><strong>Corresponding Configuration</strong>:</p><pre>com.instana.plugin.javatrace:<br>  instrumentation:<br>    sdk:<br>      targets:<br>        - match:<br>            type: &#39;class&#39;<br>            name: &#39;org.example.LoginController&#39;<br>            method: &#39;validateAdmin&#39;<br>          span:<br>            name: &#39;Admin&#39;<br>            type: &#39;INTERMEDIATE&#39;<br>            tags:<br>              - kind: &#39;return&#39;<br>                name: &#39;Is.it ADMIN&#39;<br>                <br>        - match:<br>            type: &#39;class&#39;<br>            name: &#39;org.example.LoginController&#39;<br>            method: &#39;validateUser&#39;<br>          span:<br>            name: &#39;User&#39;<br>            type: &#39;INTERMEDIATE&#39;<br>            tags:<br>              - kind: &#39;return&#39;<br>                name: &#39;Is.it USER&#39;</pre><p>This configuration defines two spans:</p><ul><li>Admin: for the validateAdmin() method</li><li>User: for the validateUser() method<br>Each span captures the <strong>boolean return value</strong> and tags it appropriately as Is.it ADMIN or Is.it USER.</li></ul><p><strong>Instana UI Output</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*88_fBr_0UizsYxanwhyTFg.png" /></figure><p>On the other hand, when you hit /login?username=admin, only the the validateAdmin() method is invoked.</p><ul><li>You’ll see <strong>one span</strong>: sdk.Admin</li><li>The <strong>tag</strong> Is.it ADMIN will show true</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZxSfIZAqp_Z4nibsSR4cwQ.png" /></figure><p>When you hit /login?username=user, only the validateUser() method is invoked.</p><ul><li>You’ll see <strong>one span</strong>: sdk.User</li><li>The <strong>tag</strong> Is.it USER will show true</li></ul><p>These tags reflect the boolean values returned from the instrumented methods, completely configured without modifying the code.</p><p><strong>Limitations</strong></p><p>Keep in mind the following restrictions when using the configuration-based Java Trace SDK:</p><ul><li>You cannot instrument constructors.</li><li>Spans must start and end in the same method. You can’t begin a span in one method and close it in another.</li><li>You must explicitly define tags for arguments and return values. Instana won’t capture them unless you specify.</li><li>All argument positions must be listed. You can’t skip or use wildcards for method arguments.</li><li>No wildcards for class or method names. You must provide exact names.</li><li>You cannot restore a trace context like SpanSupport.inheritNext() from the programmatic SDK.</li></ul><p>Use this approach only when the application structure is stable and you don’t have access to modify the code.</p><p><strong>Conclusion</strong></p><p>IBM Instana’s configuration-based Java Trace SDK is a practical tool when direct code changes aren’t possible. It provides a way to add observability to specific methods declaratively, enabling you to enrich traces with spans and tags. While it may not offer the flexibility of the programmatic SDK, it’s highly useful for legacy codebases or external applications where source code access is limited.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26deecbb038d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ibm-cloud/instana-java-tracer-configuration-based-sdk-26deecbb038d">Instana Java Tracer — Configuration based SDK</a> was originally published in <a href="https://medium.com/ibm-cloud">IBM Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>