<?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 Gary Brown on Medium]]></title>
        <description><![CDATA[Stories by Gary Brown on Medium]]></description>
        <link>https://medium.com/@objectiser?source=rss-7efcc28ad087------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*TjxijHYsW7Sw3g4b.</url>
            <title>Stories by Gary Brown on Medium</title>
            <link>https://medium.com/@objectiser?source=rss-7efcc28ad087------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 02:55:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@objectiser/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[Using Jaeger with Eclipse Che]]></title>
            <link>https://medium.com/jaegertracing/using-jaeger-with-eclipse-che-d0581c7da431?source=rss-7efcc28ad087------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0581c7da431</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[jaeger]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[tracing]]></category>
            <category><![CDATA[eclipse-che]]></category>
            <dc:creator><![CDATA[Gary Brown]]></dc:creator>
            <pubDate>Thu, 31 Oct 2019 14:54:31 GMT</pubDate>
            <atom:updated>2019-11-08T08:36:54.674Z</atom:updated>
            <content:encoded><![CDATA[<p>As explained on the <a href="https://www.eclipse.org/che/">Eclipse Che website</a>, “Che brings your Kubernetes application into your development environment and provides an in-browser IDE, allowing you to code, build, test and run applications exactly as they run on production from any machine”. However when deployed in your production environment, those same applications can be monitored using observability tools to understand their performance to help inform future improvements. Wouldn’t it be nice if we could also leverage these observability tools within the Che development environment, to identify these improvement opportunities before rolling out the changes to a test (staging) or production environment?</p><p>In this blog post we will show how simple it is to add <a href="https://www.jaegertracing.io/">Jaeger</a> to your development workspace and observe how your application performs. We will use <a href="http://che.openshift.io/">che.openshift.io</a> as the hosting environment, although you could <a href="https://www.eclipse.org/che/docs/che-7/running-che-locally/">setup a local Che server</a>.</p><h3>Create the Workspace</h3><p>Che 7 introduced the capability to define a development workspace in a yaml format called a <a href="https://www.eclipse.org/che/docs/che-7/configuring-a-workspace-using-a-devfile/">devfile</a>. Example devfiles can be found in the <a href="https://github.com/redhat-developer/devfile">Red Hat Developers GitHub organization</a>.</p><p>For this post, we are going to use a modified version of the <a href="https://github.com/redhat-developer/devfile/blob/master/getting-started/spring-boot/devfile.yaml">Spring Boot getting started devfile</a> that adds the Jaeger all-in-one backend to the workspace. The main change is to add the following section just before the commands top level node:</p><pre>-<br>    type: dockerimage<br>    alias: tracing<br>    image: jaegertracing/all-in-one:latest<br>    env:<br>      - name: MEMORY_MAX_TRACES<br>        value: &quot;5000&quot;<br>      - name: COLLECTOR_ZIPKIN_HTTP_PORT<br>        value: &quot;9411&quot;<br>    memoryLimit: 128Mi<br>    endpoints:<br>      - name: &#39;tracing-ui&#39;<br>        port: 16686<br>      - name: &#39;collector-grpc&#39;<br>        port: 14250<br>        attributes:<br>           public: &#39;false&#39;<br>      - name: &#39;collector-http&#39;<br>        port: 14268<br>        attributes:<br>           public: &#39;false&#39;<br>      - name: &#39;collector-zipkin&#39;<br>        port: 9411<br>        attributes:<br>           public: &#39;false&#39;<br>      - name: &#39;agent-config&#39;<br>        port: 5778<br>        attributes:<br>           public: &#39;false&#39;<br>      - name: &#39;6831/udp&#39;<br>        port: 6831<br>        attributes:<br>           public: &#39;false&#39;<br>      - name: &#39;6832/udp&#39;<br>        port: 6832<br>        attributes:<br>           public: &#39;false&#39;<br>    volumes:<br>      - name: tmp<br>        containerPath: /tmp</pre><p>The modified version of the devfile can be found <a href="https://gist.github.com/objectiser/667615926a40d6cd8eb675859ddee1a1">here</a>, with some additional memory limit changes required when using with che.openshift.io.</p><p>To start the workspace on che.openshift.io, open a browser (Chrome recommended due to issue on some versions of Firefox), with <a href="http://che.openshift.io/f?url=https://gist.githubusercontent.com/objectiser/667615926a40d6cd8eb675859ddee1a1/raw/06d25e2026d7a689dd8b38a343eec9a9cc431cde/che-spring-boot-devfile.yaml">this url</a>.</p><h3>Add OpenTracing instrumentation</h3><p>When the workspace is initially opened, there is no OpenTracing instrumentation of the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vTCVAKgAH2OWEZtmzmX3WQ.png" /></figure><p>OpenTracing instrumentation can implicitly be added by including a dependency on opentracing-spring-jaeger-cloud-starter as shown in the updated pom.xml below, along with updating the spring-boot-starter-parent version to 2.2.0.RELEASE (required by the OpenTracing instrumentation).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*V-hmBuHznxxZOLPm_wmrsw.png" /></figure><p>This dependency automatically instruments the inbound and outbound HTTP requests. It also bootstraps the Jaeger tracer to report the tracing data to the Jaeger backend (included in the workspace). The default configuration of the tracer will report the data via UDP to the Jaeger agent, although the application can be configured to report the data via <a href="https://github.com/opentracing-contrib/java-spring-jaeger#configuration">HTTP directly to the collector</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*4UvHpYHBeVmEwCloieCMlA.png" /></figure><p>The final step is to add a property that will define the service name within the tracing data. This is achieved by creating the src/main/resources folder and then create a file application.properties with the contents above.</p><h3>Tracing the running application</h3><p>On the righthand side of the workspace is a cube symbol that when selected causes a tree to be expanded. Under the User Runtimes/tools tree node is a task called run webapp. Selecting this option will run the Spring Boot application. When started, a window will appear with a button Open Link. Press this button to start a browser for the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZhhBGyH33oUy7aanm5x_9g.png" /></figure><p>In the same tree, select the User Runtimes/tracing option tracing-ui which will launch the Jaeger UI in a separate browser tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*UHth5DNp5XytEdQi0MD_3w.png" /></figure><p>Press the refresh button at the top of the browser a couple of times to see the text Span reported in the console window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7tPMIj_cG_5twI2eFEWrzQ.png" /></figure><p>Change to the Jaeger UI tab to see the resulting traces that were reported from the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p2yPCuZBAMf7STzb14TAQQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Dlp26olhQP3_kDCtsRMtQ.png" /></figure><h3>Summary</h3><p>This post has demonstrated how OpenTracing with Jaeger can easily be introduced into an Eclipse Che workspace, to allow a developer to obtain tracing information from their application during development.</p><p>Although this particular example is simple, only capturing tracing from a single service, the benefit offered by Che is to enable complete applications (multiple services) to be used within the same workspace — thus producing more interesting traces, and enabling the developer to understand the performance of their developed service in the context of the complete application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0581c7da431" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jaegertracing/using-jaeger-with-eclipse-che-d0581c7da431">Using Jaeger with Eclipse Che</a> was originally published in <a href="https://medium.com/jaegertracing">JaegerTracing</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Jaeger to trace an Apache Camel application]]></title>
            <link>https://medium.com/jaegertracing/using-jaeger-to-trace-an-apache-camel-application-2b8118efbb4d?source=rss-7efcc28ad087------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b8118efbb4d</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[distributed-tracing]]></category>
            <category><![CDATA[apache-camel]]></category>
            <category><![CDATA[opentracing]]></category>
            <dc:creator><![CDATA[Gary Brown]]></dc:creator>
            <pubDate>Wed, 01 Aug 2018 15:16:35 GMT</pubDate>
            <atom:updated>2018-08-03T08:40:20.439Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="http://camel.apache.org/">Apache Camel</a> has included support for distributed tracing using <a href="http://opentracing.io/">OpenTracing</a> since Camel version 2.19.0. OpenTracing is a vendor neutral API to enable applications to report tracing information to a backend for storage, analysis and visualisation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q5VSc8kRd5nY8xKws71fng.png" /></figure><p>In this article we will show how two Apache Camel examples can be easily updated to enable the distributed tracing information to be reported to <a href="https://www.jaegertracing.io/">Jaeger</a>.</p><p>If you don’t already have a copy of Apache Camel, then download the latest version from the <a href="http://camel.apache.org/download.html">download page</a>. Before we look at the examples, we need to start an instance of the Jaeger backend and access the UI. Instructions for this can be found <a href="https://www.jaegertracing.io/docs/getting-started/#all-in-one-docker-image">here</a>. The following examples will be using the latest Jaeger java client, version 0.30.3 at the time of writing.</p><h3>Camel OpenTracing Example</h3><p>This example can be found in the “examples/camel-example-opentracing” folder. Follow the instructions in the readme to build and run the example as distributed with Camel. The example uses a simple logging tracer that outputs the distributed tracing (span) information to the console.</p><p>To change this example to use Jaeger there are two steps:</p><ul><li>We simply need to edit the <strong>pom.xml</strong> files in <strong>client</strong>, <strong>service1</strong> and <strong>service2</strong> folders to replace the example logging based tracer:</li></ul><pre>&lt;dependency&gt;<br>  &lt;groupId&gt;org.apache.camel.example&lt;/groupId&gt;<br>  &lt;artifactId&gt;camel-example-opentracing-loggingtracer&lt;/artifactId&gt;<br>  &lt;version&gt;${project.version}&lt;/version&gt;<br>&lt;/dependency&gt;</pre><p>with the Jaeger java client:</p><pre>&lt;dependency&gt;<br>  &lt;groupId&gt;io.jaegertracing&lt;/groupId&gt;<br>  &lt;artifactId&gt;jaeger-client&lt;/artifactId&gt;<br>  &lt;version&gt;${jaeger.version}&lt;/version&gt;<br>&lt;/dependency&gt;</pre><ul><li>The only other change is to supply the service name as an environment variable or system property. So the simplest approach is just to run the following in each of the service command windows, where “&lt;name&gt;” would be<strong> client</strong>, <strong>service1</strong> or <strong>service2</strong>:</li></ul><pre>export JAEGER_SERVICE_NAME=&lt;name&gt;</pre><p><em>NOTE: By default the Jaeger java client will use a probabilistic sampler set to report every 1000th trace instance. For testing purposes, we can configure it to report every instance by setting the environment variable “JAEGER_SAMPLER_PARAM=1.0”. This only needs to be set in the command window running the </em><strong><em>client</em></strong><em>, as the client is responsible for making the sampling decision that is then propagated to the other two services.</em></p><p>Once the services have been started and the client has triggered at least one request, you can now open the <a href="http://localhost:16686">Jaeger UI</a> selecting the “client” service to see the captured traces. If you select one, then the details view will show the interactions between client, service1 and service2 (unexpanded version shown in the image at the top of this article). Notice that log information is also captured from the Camel route.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Floi8KpQGIRIH4sQS4Bbig.png" /></figure><h3>Camel JMS Loan Broker Example</h3><p>Unlike the previous example, the JMS loan broker example has no OpenTracing support “out of the box”. This example can be found in the “examples/camel-example-loan-broker-jms” folder.</p><p><a href="https://github.com/apache/camel/blob/master/components/camel-opentracing/src/main/docs/opentracing.adoc">Instructions for adding OpenTracing support</a> to a Camel application show there are three different ways. If the example was using Spring Boot, then this would be as simple as adding a single <a href="http://twitter.com/CamelOpenTracing">@CamelOpenTracing</a> annotation to the application.</p><p>However in the case of this example we need to use the explicit programmatic approach. Follow these steps:</p><ul><li>Add these dependencies to the pom.xml:</li></ul><pre>    &lt;dependency&gt;<br>      &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;<br>      &lt;artifactId&gt;camel-opentracing&lt;/artifactId&gt;<br>    &lt;/dependency&gt;<br>    &lt;dependency&gt;<br>      &lt;groupId&gt;io.jaegertracing&lt;/groupId&gt;<br>      &lt;artifactId&gt;jaeger-client&lt;/artifactId&gt;<br>      &lt;version&gt;${jaeger.version}&lt;/version&gt;<br>    &lt;/dependency&gt;</pre><ul><li>Update “org.apache.camel.loanbroker.Client”</li></ul><pre>import org.apache.camel.opentracing.OpenTracingTracer;</pre><pre>    ....</pre><pre>    CamelContext context = applicationContext.getBean(&quot;camel&quot;, CamelContext.class);<br>    context.start();</pre><pre>    OpenTracingTracer ottracer = new OpenTracingTracer();<br>    ottracer.init(context);</pre><pre>    ....</pre><ul><li>Update “org.apache.camel.loanbroker.LoanBrokerRoute”</li></ul><pre>import org.apache.camel.opentracing.OpenTracingTracer;</pre><pre>....</pre><pre>public void configure() {<br>    OpenTracingTracer ottracer = new OpenTracingTracer();<br>    ottracer.init(getContext());</pre><pre>    ....</pre><ul><li>Follow the steps in the readme to run the example, making sure the JAEGER_SERVICE_NAME (and possibly JAEGER_SAMPLER_PARAM) environment variable is exported first for the client and loan broker. This should result in a trace as below:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZU8ZyWg6Ws6WLw1oC67GVg.png" /></figure><p>Note: in this example, the spans representing the messaging sends and receives are using “span.kind” tags of <strong>consumer</strong> and <strong>producer</strong>. These represent asynchronous messaging communications, whereas the <strong>client</strong> and <strong>server</strong> span kinds are generally used for RPC communications.</p><p>This article has shown how to quickly add OpenTracing instrumentation to some Camel examples and use Jaeger to store and visualise the trace instances.</p><p>If you have questions regarding Jaeger, then please <a href="https://www.jaegertracing.io/docs/get-in-touch/">contact us</a>. If you have suggestions for improvements to the OpenTracing support in Apache Camel, please <a href="https://issues.apache.org/jira/projects/CAMEL">create a jira</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b8118efbb4d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jaegertracing/using-jaeger-to-trace-an-apache-camel-application-2b8118efbb4d">Using Jaeger to trace an Apache Camel application</a> was originally published in <a href="https://medium.com/jaegertracing">JaegerTracing</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Avoid undesirable trace instances when scraping Prometheus metrics in Istio]]></title>
            <link>https://medium.com/jaegertracing/avoid-undesirable-trace-instances-when-scraping-prometheus-metrics-in-istio-92c26ebd7108?source=rss-7efcc28ad087------2</link>
            <guid isPermaLink="false">https://medium.com/p/92c26ebd7108</guid>
            <category><![CDATA[opentracing]]></category>
            <category><![CDATA[istio]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[jaeger]]></category>
            <category><![CDATA[prometheus]]></category>
            <dc:creator><![CDATA[Gary Brown]]></dc:creator>
            <pubDate>Fri, 11 May 2018 13:05:53 GMT</pubDate>
            <atom:updated>2018-09-21T08:08:33.573Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Update: As of Istio 1.0.0, prometheus scrape requests are automatically excluded from tracing.</em></p><p>Hopefully most people now understand the benefits that distributed tracing can provide when diagnosing issues in a distributed (e.g. microservices based) application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E2Xfp03qSo6Lrh_LV7oyTQ.png" /></figure><p><a href="https://istio.io/">Istio</a> has now made it very easy to benefit from distributed tracing, by providing most of the capabilities as part of the infrastructure, with applications only having to take responsibility for propagating the trace context to any outbound requests.</p><p>However, if we also want to capture application metrics from our services using <a href="https://prometheus.io/">Prometheus</a>, we find that Istio will unfortunately record trace instances each time Prometheus scrapes metrics from our services. This can add up to a large number of unnecessary trace instances.</p><p>For example, after installing a couple of services on Istio, configured with both <a href="http://www.jaegertracing.io/">Jaeger</a> and Prometheus, we find a series of trace instances being recorded before even any real “business” invocation of the service has been performed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wzI4Bz0-jCn24PBOtXF-RA.png" /></figure><p>If we look at the details for one of these trace instances we see that it has been created as the result of a request to the <strong><em>/metrics</em></strong> endpoint:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D0g7FgQaei5Z699c35DKXA.png" /></figure><p>Although the <a href="http://opentracing.io/">OpenTracing</a> framework instrumentations can be configured to ignore requests to certain endpoints, such as in the case of <a href="https://github.com/opentracing-contrib/java-spring-web/blob/4f23c3de4e0cb8082530f00593ed89a5ada7f96c/opentracing-spring-web-autoconfigure/src/main/java/io/opentracing/contrib/spring/web/autoconfig/WebTracingProperties.java#L16-L18">java-spring-web</a> used by my example services, it is currently not possible to configure the Istio proxy to ignore tracing on specific endpoints.</p><p>This post will show a quick way to disable trace instances resulting from Prometheus scrape requests.</p><p>The first step is to deploy a <a href="http://nginx.org/">NGINX</a> proxy that will add a specific header to the scrape request. The header is “X-B3-Sampled: 0”, and will instruct the tracer used within the Istio proxy not to sample this request. Unfortunately Prometheus does not provide a mechanism for adding such a header to the scrape request, so instead we use the NGINX proxy.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/23ffd85d4b693710fa35d1c7ce254d9d/href">https://medium.com/media/23ffd85d4b693710fa35d1c7ce254d9d/href</a></iframe><p>This can be deployed using the following command:</p><pre>kubectl create -f prometheus-nginx.yml -n istio-system</pre><p>The second step is to update the Prometheus scrape configuration(s) to use the NGINX proxy. If using the ‘addon’ Prometheus template provided by Istio, this would involve adding the <em>proxy_url</em> property in the following two locations:</p><pre>    # scrape config for service endpoints.<br>    - job_name: &#39;kubernetes-service-endpoints&#39;<br>      proxy_url: &#39;http://prometheus-nginx:9191&#39;<br><br>    ...<br><br>    # Example scrape config for pods<br>    - job_name: &#39;kubernetes-pods&#39;<br>      proxy_url: &#39;http://prometheus-nginx:9191&#39;<br><br>    ...</pre><p>Once these changes are deployed, the only traces reported for the example services will now be the real invocation of the services:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MKl9nVQWTBZHk0PZdsHv4w.png" /></figure><p>with the details of this trace instance being shown in the first image of the blog post.</p><p>Hopefully a more general solution will be provided in Istio in the near future, to enable specific endpoints to be excluded from tracing. But until that time, this provides a short term solution to minimise the unnecessary tracing data being generated by the Istio service mesh.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92c26ebd7108" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jaegertracing/avoid-undesirable-trace-instances-when-scraping-prometheus-metrics-in-istio-92c26ebd7108">Avoid undesirable trace instances when scraping Prometheus metrics in Istio</a> was originally published in <a href="https://medium.com/jaegertracing">JaegerTracing</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>