<?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 Daksh Jain on Medium]]></title>
        <description><![CDATA[Stories by Daksh Jain on Medium]]></description>
        <link>https://medium.com/@daksh-jain00?source=rss-be3e81eb6076------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*LrlJRiQ9yd4VrUtmQv2Fbw.jpeg</url>
            <title>Stories by Daksh Jain on Medium</title>
            <link>https://medium.com/@daksh-jain00?source=rss-be3e81eb6076------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 05:24:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@daksh-jain00/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[3 Months of Learning, Coding, & Growing: My LFX Mentorship Journey with KubeArmor]]></title>
            <link>https://daksh-jain00.medium.com/3-months-of-learning-coding-growing-my-lfx-mentorship-journey-with-kubearmor-bb4cdc0bbb27?source=rss-be3e81eb6076------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb4cdc0bbb27</guid>
            <category><![CDATA[kubearmor]]></category>
            <category><![CDATA[lfx-mentorship]]></category>
            <category><![CDATA[cncf]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Daksh Jain]]></dc:creator>
            <pubDate>Sat, 31 May 2025 07:31:47 GMT</pubDate>
            <atom:updated>2025-05-31T07:31:47.452Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LoicJcqanLM8as8WbNgKGA.png" /></figure><h3>🧩 Introduction: From Curiosity to Contribution</h3><p>For a while, I had been diving into Kubernetes and Linux security — reading docs, watching talks, and running sample demos. But something was missing. I wanted more than just theory. I wanted to <strong>build</strong>, <strong>break</strong>, and <strong>learn</strong> — with a purpose, on real-world projects that actually mattered.</p><p>That’s when I discovered the <strong>CNCF LFX Mentorship</strong>. I applied to a few projects that aligned with my interests and skillset, and soon after, I got selected for one that truly excited me — <strong>KubeArmor</strong>, a runtime security enforcement engine leveraging eBPF and LSMs.</p><p>Over the next 3 months:</p><ul><li>Created security policies for popular workloads like nginx, wordpress, mariadb &amp; more.</li><li>Automated testing of the KubeArmor policies across multiple application versions using GitHub Actions.</li><li>Built a CLI in Golang, karmor recommend, to fetch policies from Artifact Hub based on container images or entire Kubernetes clusters.</li></ul><p>It’s been a thrilling journey of exploration and contribution.</p><p><strong>Let’s dive deeper — one step at a time.</strong></p><h3>Getting Started: Onboarding &amp; the Learning Curve</h3><p>We began with weekly calls and a clear roadmap — tasks split by priority and time. I set up KubeArmor on a Linux box with K3s, added Loki + Grafana to visualize logs, and started exploring how KubeArmor works behind the scenes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4_oVykVQlpg2Zp1e-Fffhg.png" /></figure><p>I spent time understanding how policies are defined and enforced.</p><p>The first couple of weeks were a bit slow as I got up to speed, but constant Slack support and quick calls with mentors helped a lot. Soon enough, we found our rhythm and started moving fast 🚀</p><h3>3. Major Contribution</h3><p>Here are the core areas I worked on during the mentorship, with deep technical focus and hands-on implementation:</p><h4>✅ 3.1 Creating Security Policies for Popular Apps</h4><p>One of my key goals during the mentorship was to contribute real, reusable security policies that developers and platform engineers could directly apply to secure their Kubernetes workloads using <strong>KubeArmor</strong>.</p><p>We plan to push all these policies to Artifact Hub as charts from where it can be pulled directly and used in production environments.</p><p>I started by identifying <strong>popular open-source applications</strong> commonly used in cloud-native setups — like <strong>Nginx</strong>, <strong>MariaDB</strong>, <strong>WordPress</strong>, and more. Then, I created <strong>KubeArmor security policies</strong> tailored to these workloads, using KubeArmor’s powerful CRDs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eTKrQbUivFtB1v-Q28EXzA.png" /></figure><p>These policies allow fine-grained control over runtime behaviours, including:</p><ul><li><strong>Process Execution Controls</strong> — Allow/block specific binaries from running.</li><li><strong>File Access Restrictions</strong> — Prevent unauthorised reads/writes to sensitive files.</li><li><strong>Network Flow Rules</strong> — Restrict inbound/outbound connections to specific IPs or ports.</li></ul><p>The main focus of the policies were to create zero trust policies to reduce the attack surface to the least.</p><h4>Example: Blocking /bin/sleep in containers with a specific label</h4><pre>apiVersion: security.kubearmor.com/v1<br>kind: KubeArmorPolicy<br>metadata:<br>  name: block-sleep<br>  namespace: multiubuntu<br>spec:<br>  selector:<br>    matchLabels:<br>      group: group-1<br>  process:<br>    matchPaths:<br>    - path: /bin/sleep<br>  action: Block</pre><p>This simple rule enforces a policy where any container with label group: group-1 is denied execution of /bin/sleep. With a few lines of YAML, you&#39;re actively reducing the container&#39;s attack surface.</p><h4>Default Posture</h4><p>To complement these policies, I also experimented with <strong>namespace-level default postures</strong>, such as:</p><pre>kubearmor-file-posture=block</pre><p>This annotation ensures that <strong>all file access is denied by default</strong>, and only explicitly allowed paths are accessible — effectively enabling a <strong>zero-trust model</strong> for container file systems.</p><p>📁 You can find all the policies in my <a href="https://github.com/Dakshjain1/lfx-kubearmor/">GitHub repo</a> here.<br> 📖 For a deeper dive, check out the official <a href="https://docs.kubearmor.io/kubearmor/documentation/security_policy_specification">Policy Specification</a> and <a href="https://docs.kubearmor.io/kubearmor/documentation/security_policy_examples">Examples</a> doc from KubeArmor.</p><h4>⚙️ 3.2 Automating Policy Tests using GitHub Actions</h4><p>To ensure the reliability and compatibility of the security policies across multiple app versions, I designed a GitHub Actions workflow that:</p><ul><li>🚀 <strong>Bootstraps a lightweight Kubernetes (k3s) cluster</strong> inside the CI pipeline for each test run.</li><li>📦 <strong>Deploys different versions</strong> of workloads like Nginx, WordPress, MariaDB, etc.</li><li>🛡️ <strong>Applies corresponding KubeArmor policies</strong> to each workload.</li><li>⚙️ <strong>Runs parallel tests</strong> for faster execution using matrix strategy.</li><li>📊 <strong>Automatically updates a results table</strong> in the repo’s README.md, indicating policy success/failure for each version.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_56Ji4EAFaH4S2QkknBpVA.png" /></figure><p>Here’s a sample format of the results table:</p><pre>| App       | Version | Policy Status |<br>| --------- | ------- | ------------- |<br>| Nginx     | 1.21    | ✅ Passed      |<br>| Nginx     | 1.22    | ✅ Passed      |<br>| Nginx     | 1.23    | ✅ Passed      |<br>| Nginx     | 1.24    | ❌ Failed      |</pre><p>📌 This allows users to <strong>quickly verify</strong> which versions are fully secured by the current policy definitions.</p><p>🔗 GitHub Workflow Code is <a href="https://github.com/Dakshjain1/lfx-kubearmor/tree/main/.github/workflows">here</a>: ./.github/workflows</p><h4>💻 3.3 Building the karmor recommend CLI in Go</h4><p>To streamline the discovery and application of security policies, I built a CLI tool in <strong>Golang</strong> called karmor recommend. This tool helps users fetch recommended policies for container images directly from Artifact Hub and apply them with ease.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bgsyBQeHEF_erGYjywSGDg.png" /></figure><h4>🔧 Key Features</h4><ul><li><strong>Fetch by Image Name</strong><br> Simply pass the image name using the --image flag to get the matching policy link.<br> ➕ Add --download to automatically fetch the YAML file to your local directory.</li><li><strong>Customize via Labels</strong><br> Use the --append-labels or --overwrite-labels flag to inject custom labels into the policy on-the-fly before applying it to your cluster.</li><li><strong>Cluster-Wide Auto-Recommendation</strong><br> With the --cluster flag, the tool scans all running pods in the specified cluster, extracts their image names, and checks for available policies.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vle9MorOrWhkLbjhG6VO9w.png" /></figure><p><strong>You can then:</strong></p><ul><li>✅ View which images have policies available.</li><li>📥 Use --download to fetch policies for <strong>all matched images</strong> at once.</li></ul><p>🧪 Example Commands</p><pre>  karmor recommend --image nginx<br>  karmor recommend --image nginx --download<br>  karmor recommend --image nginx --overwrite-labels team=dev,env=prod<br>  karmor recommend --image nginx --append-labels owner=security,env=poc<br>  karmor recommend --image nginx --download --overwrite-labels team=dev,env=prod<br>  karmor recommend --image nginx --download --append-labels owner=security,env=poc<br>  karmor recommend --cluster</pre><p>This tool bridges the gap between <strong>security policy availability</strong> and <strong>practical enforcement</strong>, making it easier to adopt KubeArmor in real-world environments.</p><p>PR — <a href="https://github.com/kubearmor/kubearmor-client/pull/491">https://github.com/kubearmor/kubearmor-client/pull/491</a></p><h3>Mentorship &amp; Community: Beyond the Code</h3><p>Some of the best moments came when I was stuck — whether on a design choice or implementation detail. A quick Slack ping often turned into a helpful call or deep async thread. From pair debugging to reviewing PRs together, my mentors didn’t just unblock issues — they shared thought processes, trade-offs, and best practices. It wasn’t just about writing code — it was about writing code <em>together</em>, the open-source way.</p><h3>6. Outcome &amp; Impact</h3><ul><li>✅ <strong>Strengthened KubeArmor’s usability</strong> by creating production-ready security policies for commonly used applications.</li><li>⚙️ <strong>Improved reliability</strong> through automated policy testing across multiple versions, giving users instant visibility into policy compatibility.</li><li>🛠️ <strong>Enhanced developer experience</strong> with the karmor recommend CLI — enabling quick, cluster-aware policy discovery and application.</li><li>🧠 <strong>Deepened understanding of system-level security</strong> using eBPF, Kubernetes internals, and policy enforcement mechanisms.</li><li>🌱 <strong>Contributed to community adoption</strong> by reducing entry barriers for developers and operators exploring KubeArmor.</li></ul><p>This mentorship was more than a contribution — it was a real-world learning journey that resulted in tools and practices the community can use and build on.</p><h3>Final Takeaways</h3><p>The biggest technical win for me was finally learning and working with <strong>Golang</strong> — not through tutorials or side projects, but by building something real that others could use. Getting hands-on with a live codebase helped me understand the language in a much deeper way.</p><p>Beyond the code, this mentorship gave me something even more valuable: <strong>confidence</strong>. Confidence to ask questions, to collaborate, and to contribute meaningfully in open-source communities. I definitely plan to stay involved with KubeArmor and continue contributing to more projects in the ecosystem.</p><p>This experience showed me that open source isn’t just a space for experts — it’s where you <em>become</em> one.</p><h3>Acknowledgements</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q28uMmzUTi3tiD6vFHnOrA.png" /></figure><p>A huge thank you to my mentors <a href="https://www.linkedin.com/in/barun-acharya/"><strong>Barun Acharya</strong></a>, <a href="https://www.linkedin.com/in/rishabhsoni31/"><strong>Rishabh Soni</strong></a> and <a href="https://www.linkedin.com/in/prateek-nandle/"><strong>Prateek Nandle</strong></a><strong> </strong>for their constant support, guidance, and quick feedback throughout the mentorship. You made the learning curve a lot smoother and the experience incredibly rewarding. Shoutout to the amazing <strong>KubeArmor</strong> team and the wider <strong>CNCF community</strong> for being welcoming, responsive, and collaborative.</p><p>Grateful to the <strong>CNCF LFX Mentorship Program</strong> for making this opportunity possible. If you’re someone looking to get started with real-world open source contributions, I highly recommend checking out LFX Mentorships — it’s a great launchpad.</p><h3>Call to Action</h3><p>If you’re working with Kubernetes, give my CLI tool karmor recommend a try — it helps fetch recommended security policies directly from Artifact Hub, based on image names or your running cluster.</p><p>To students and engineers out there: if you’ve ever wanted to contribute to open source but didn’t know where to start — dive in. Programs like LFX make it approachable, and the community is more supportive than you think.</p><p>Feel free to connect with me on <a href="https://github.com/Dakshjain1">GitHub</a> or <a href="https://www.linkedin.com/in/dakshjain09/">LinkedIn</a> — always happy to chat, help, or collaborate!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb4cdc0bbb27" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Auto-Instrument Python App without Collector]]></title>
            <link>https://daksh-jain00.medium.com/auto-instrument-python-app-without-collector-489dc76d9f18?source=rss-be3e81eb6076------2</link>
            <guid isPermaLink="false">https://medium.com/p/489dc76d9f18</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[opentelemetry]]></category>
            <dc:creator><![CDATA[Daksh Jain]]></dc:creator>
            <pubDate>Fri, 09 May 2025 19:23:50 GMT</pubDate>
            <atom:updated>2025-05-09T19:23:50.142Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*leC1ddT8FFExt58ga-qvmA.png" /></figure><h4>Welcome to this comprehensive OpenTelemetry series, taking you from basics to advanced concepts. Whether you’re just exploring, experimenting or looking to deepen your understanding around OTel, this guide will cover almost everything you need to know. Each blog covers a specific topic or demo with links to previous and next blogs, ensuring a smooth learning journey. At the beginning of each blog, you’ll find your current position within the series, ensuring an easy-to-follow learning journey from zero to hero. 👨‍💻</h4><h3>Series Breakdown -</h3><ul><li><a href="https://medium.com/@daksh-jain00/opentelemetry-101-architecture-key-terminology-2c6f67e5fdd6">OpenTelemetry 101: Architecture &amp; Key Terminology</a></li><li><strong><em>YOU ARE HERE</em><br></strong>📌 <strong>Demo: Auto-Instrument Python App without Collector</strong></li><li>Demo: Auto-Instrument Go App without Collector</li><li>Real Use Case: Auto-Instrumentation without Collector<br> — Kafka Cluster + Go Producer &amp; Consumer App</li><li>Building a Lightweight Collector with OpenTelemetry Builder in Go</li><li>Creating Custom Components: Receivers, Exporters, and More</li><li>Real Use Case:Auto-Instrument Kafka Cluster <strong>with</strong> Collector<br> — Using <strong>kafkametrics</strong> receiver provided by OTel Collector contrib<br>— Using <strong>prometheus</strong> based metrics via <strong>kafka</strong>+ <strong>jmx</strong> exporters</li><li><strong><em>~ More topics will be added (Please add comments for topic suggestions) </em></strong>🚀</li></ul><blockquote><strong><em>If link is not present, hang in there, I am working on the blogs</em></strong><em> 👨‍💻😊</em></blockquote><p>We’ll collect <strong>Metrics</strong>, <strong>Logs</strong>, and <strong>Traces</strong> from a Python application, observe them via the CLI, and eventually push them to observability platforms for richer visualization.</p><h4>🔍 <strong>Understand the Data</strong></h4><p>Before diving into tools, let’s first understand the types of telemetry data we’ll be working with and create a simple application to generate all the data.</p><p>📈🔥 <strong>Metrics</strong><br> Metrics provide insights into the application’s performance. These can include latency, request rates, error rates, Apdex scores, and key business operations.</p><p>📦🕒 <strong>Traces</strong><br> To generate trace data, we’ll build a minimal Flask API. This allows us to trigger and inspect trace spans using simple <strong>curl</strong> commands.</p><p>🔍📜 <strong>Logs</strong><br> We’ll use Python’s built-in <strong>logging</strong> module to output structured log lines directly to the console.</p><p>This is our sample code: <strong>app.py</strong>.</p><pre>import datetime<br>import flask<br>import logging<br><br>######################<br>## initialization<br>######################<br>app = flask.Flask(__name__)<br>start = datetime.datetime.now()<br><br>log = logging.getLogger(&#39;werkzeug&#39;)<br>log.disabled = True<br><br>######################<br>## routes<br>######################<br>@app.route(&#39;/&#39;, methods=[&#39;GET&#39;])<br>def root():<br>  logging.warning(&#39;main route accessed&#39;)<br>  return flask.jsonify({&#39;message&#39;: &#39;flask app root/&#39;})<br><br>@app.route(&#39;/healthz&#39;, methods=[&#39;GET&#39;])<br>def healthz():<br>  now = datetime.datetime.now()<br>  logging.warning(&#39;healthz route accessed&#39;)<br>  return flask.jsonify({&#39;message&#39;: f&#39;up and running since {(now - start)}&#39;})<br><br>@app.errorhandler(404)<br>def page_not_found(error):<br>    logging.error(f&quot;404 Error: {error}&quot;)<br>    return flask.jsonify({&#39;message&#39;: &#39;Route not found&#39;}), 404<br><br>######################<br>if __name__ == &#39;__main__&#39;:<br>######################<br>  app.run(debug=True, host=&#39;0.0.0.0&#39;, port=5000)</pre><p>The <strong>requirements.txt</strong> file looks like this —</p><pre>Flask==3.0.3<br>opentelemetry-distro==0.50b0<br>opentelemetry-exporter-otlp==1.29.0</pre><p>Auto instrumentation with Python uses a Python agent that can be attached to any Python application. The <strong>opentelemetry-distro</strong> package installs the API, SDK, the <strong>opentelemetry-bootstrap</strong> and <strong>opentelemetry-instrument</strong> tools.</p><h4>👨‍💻 <strong>Install packages</strong></h4><p>Run <strong>pip3 install -r requirements.txt</strong> to install all packages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*QZA1gHzv7HOr8oqSqWi7gw.png" /><figcaption><strong>Install main OTel packages</strong></figcaption></figure><p>Then run the <strong>opentelemetry-bootstrap -a install</strong> command. It reads through the list of packages installed in your active <strong>site-packages</strong> folder, and installs the corresponding instrumentation libraries for these packages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*B9OKGaIJNviwyiTd3etfJQ.png" /><figcaption><strong>Runs through all active packages and installs corresponding instrumentation libraries</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/1*0NEnd4t0Hg43L216WEAudw.png" /><figcaption><strong>List of all instrumentation as per my machine</strong></figcaption></figure><h4>🚀 <strong>Finally start the flask app</strong></h4><p>Run the flask app using <strong>opentelemetry-instrument</strong> agent. It is highly configurable via the CLI or via ENV variables inside the application.</p><p>Use <strong>opentelemetry-instrument --help</strong> to explore all variables.</p><h4><strong>💡 TIP:</strong></h4><blockquote><strong>--trace_exporter</strong> this is a CLI argument.</blockquote><blockquote>To use it as env variable make it Upper case + add prefix OTEL_<br>so it becomes <strong>OTEL_</strong>TRACES_EXPORTER</blockquote><p>We will use the CLI argument <strong>--trace_exporter, --metrics_exporter &amp; --logs_exporter</strong> to push the auto instrumented data on the “console” 1 by 1.</p><ul><li>📈🔥 <strong>Metrics</strong><br>Below is a snippet of one of the <strong>http</strong> metrics that OpenTelemetry outputs to the console. There is a lot of data that is printed on the console, which we will look further in the blog.</li><li>Once you run the <strong>opentelemetry-instrument </strong>cmd, hit an API using <strong>curl localhost:3000/</strong> to get some data on the console.</li></ul><pre>$ opentelemetry-instrument --metrics_exporter console \<br>--traces_exporter none --logs_exporter none \<br>flask run -h 0.0.0.0 -p 3000<br><br>{<br>&quot;resource_metrics&quot;: [<br>{<br> ...<br>  ...<br>   &quot;metrics&quot;: [<br>     {<br>        &quot;name&quot;: &quot;http.server.active_requests&quot;,<br>        &quot;description&quot;: &quot;measures the number of concurrent HTTP requests that are currently in-flight&quot;,<br>        &quot;unit&quot;: &quot;requests&quot;,<br>        &quot;data&quot;: {<br>            &quot;data_points&quot;: [<br>                {<br>                    &quot;attributes&quot;: {<br>                        &quot;http.method&quot;: &quot;GET&quot;,<br>                        &quot;http.server_name&quot;: &quot;0.0.0.0&quot;,<br>                        &quot;http.scheme&quot;: &quot;http&quot;,<br>                        &quot;http.host&quot;: &quot;localhost:3000&quot;,<br>                        &quot;http.flavor&quot;: &quot;1.1&quot;<br>                    },<br>                    &quot;start_time_unix_nano&quot;: 1746532167056534000,<br>                    &quot;time_unix_nano&quot;: 1746532223300409000,<br>                    &quot;value&quot;: 0,<br>                    &quot;exemplars&quot;: [<br>                        {<br>                            &quot;filtered_attributes&quot;: {},<br>                            &quot;value&quot;: 1,<br>                            &quot;time_unix_nano&quot;: 1746532175142951000,<br>                            &quot;span_id&quot;: 5150759136375062841,<br>                            &quot;trace_id&quot;: 195192224755062845452848862747093803506<br>                        }<br>                    ]<br>                }<br>            ],<br>            &quot;aggregation_temporality&quot;: 2,<br>            &quot;is_monotonic&quot;: false<br>        }<br>     },<br>   ...   <br>  ...<br> ...<br> ]<br>}</pre><ul><li>📦🕒 <strong>Traces<br></strong>Once we hit an endpoint like <strong>curl localhost:3000/</strong> we generated a trace and get this output on the console.</li></ul><pre>$ opentelemetry-instrument --traces_exporter console \<br>--metrics_exporter none --logs_exporter none \<br>flask run -h 0.0.0.0 -p 3000<br><br> * Debug mode: off<br>WARNING:root:main route accessed<br>{<br>    &quot;name&quot;: &quot;GET /&quot;,<br>    &quot;context&quot;: {<br>        &quot;trace_id&quot;: &quot;0xe18f33e3af2a28a965498fc087c7345f&quot;,<br>        &quot;span_id&quot;: &quot;0x311a60d39ac0255f&quot;,<br>        &quot;trace_state&quot;: &quot;[]&quot;<br>    },<br>    &quot;kind&quot;: &quot;SpanKind.INTERNAL&quot;,<br>    &quot;parent_id&quot;: &quot;0x24319ce8cf248d66&quot;,<br>    &quot;start_time&quot;: &quot;2025-05-06T11:46:22.227295Z&quot;,<br>    &quot;end_time&quot;: &quot;2025-05-06T11:46:22.228006Z&quot;,<br>    &quot;status&quot;: {<br>        &quot;status_code&quot;: &quot;UNSET&quot;<br>    },<br>    &quot;attributes&quot;: {<br>        &quot;http.method&quot;: &quot;GET&quot;,<br>        &quot;http.server_name&quot;: &quot;0.0.0.0&quot;,<br>        &quot;http.scheme&quot;: &quot;http&quot;,<br>        &quot;net.host.name&quot;: &quot;localhost:3000&quot;,<br>        &quot;http.host&quot;: &quot;localhost:3000&quot;,<br>        &quot;net.host.port&quot;: 3000,<br>        &quot;http.target&quot;: &quot;/&quot;,<br>        &quot;net.peer.ip&quot;: &quot;127.0.0.1&quot;,<br>        &quot;net.peer.port&quot;: 57348,<br>        &quot;http.user_agent&quot;: &quot;curl/8.7.1&quot;,<br>        &quot;http.flavor&quot;: &quot;1.1&quot;,<br>        &quot;http.route&quot;: &quot;/&quot;,<br>        &quot;http.status_code&quot;: 200<br>    },<br>    &quot;events&quot;: [],<br>    &quot;links&quot;: [],<br>    &quot;resource&quot;: {<br>        &quot;attributes&quot;: {<br>            &quot;telemetry.sdk.language&quot;: &quot;python&quot;,<br>            &quot;telemetry.sdk.name&quot;: &quot;opentelemetry&quot;,<br>            &quot;telemetry.sdk.version&quot;: &quot;1.29.0&quot;,<br>            &quot;telemetry.auto.version&quot;: &quot;0.50b0&quot;,<br>            &quot;service.name&quot;: &quot;unknown_service&quot;<br>        },<br>        &quot;schema_url&quot;: &quot;&quot;<br>    }<br>}</pre><ul><li>📜🔍 <strong>Logs<br></strong>Logging support is still in <strong>alpha</strong>, so we need to enable it explicitly.<br>For logs we need to setup some python specific configuration options by prefixing environment variables with <strong>OTEL_PYTHON_</strong>.</li></ul><p>We have used <strong>OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true </strong>to enable auto-instrumentation of logs. This attaches OTLP handler to Python root logger. To explore more configuration options like log format, log level, explore this <a href="https://opentelemetry.io/docs/zero-code/python/configuration/">link</a>.</p><p>Once we hit an endpoint like <strong>curl localhost:3000/healthz</strong> we generated logs and get this output on the console.</p><pre>$ export OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true<br>$ opentelemetry-instrument --traces_exporter none \<br>--metrics_exporter none --logs_exporter console \<br>flask run -h 0.0.0.0 -p 3000<br><br> * Debug mode: off<br>{<br>    &quot;body&quot;: &quot;healthz route accessed&quot;,<br>    &quot;severity_number&quot;: 13,<br>    &quot;severity_text&quot;: &quot;WARN&quot;,<br>    &quot;attributes&quot;: {<br>        &quot;otelSpanID&quot;: &quot;e7f346c543ea0d81&quot;,<br>        &quot;otelTraceID&quot;: &quot;6d043d012174e9753ce54f4eb7089a67&quot;,<br>        &quot;otelTraceSampled&quot;: true,<br>        &quot;otelServiceName&quot;: &quot;unknown_service&quot;,<br>        &quot;code.filepath&quot;: &quot;/Users/loki/Desktop/otelblog/flaskApp/app.py&quot;,<br>        &quot;code.function&quot;: &quot;healthz&quot;,<br>        &quot;code.lineno&quot;: 27<br>    },<br>    &quot;dropped_attributes&quot;: 0,<br>    &quot;timestamp&quot;: &quot;2025-05-06T12:09:08.029382Z&quot;,<br>    &quot;observed_timestamp&quot;: &quot;2025-05-06T12:09:08.029460Z&quot;,<br>    &quot;trace_id&quot;: &quot;0x6d043d012174e9753ce54f4eb7089a67&quot;,<br>    &quot;span_id&quot;: &quot;0xe7f346c543ea0d81&quot;,<br>    &quot;trace_flags&quot;: 1,<br>    &quot;resource&quot;: {<br>        &quot;attributes&quot;: {<br>            &quot;telemetry.sdk.language&quot;: &quot;python&quot;,<br>            &quot;telemetry.sdk.name&quot;: &quot;opentelemetry&quot;,<br>            &quot;telemetry.sdk.version&quot;: &quot;1.29.0&quot;,<br>            &quot;telemetry.auto.version&quot;: &quot;0.50b0&quot;,<br>            &quot;service.name&quot;: &quot;unknown_service&quot;<br>        },<br>        &quot;schema_url&quot;: &quot;&quot;<br>    }<br>}<br>{<br>    &quot;body&quot;: &quot;404 Error: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.&quot;,<br>    &quot;severity_number&quot;: 17,<br>    &quot;severity_text&quot;: &quot;ERROR&quot;,<br>    &quot;attributes&quot;: {<br>        &quot;otelSpanID&quot;: &quot;d48a3d0dfcfb6881&quot;,<br>        &quot;otelTraceID&quot;: &quot;6d043d012174e9753ce54f4eb7089a67&quot;,<br>        &quot;otelTraceSampled&quot;: true,<br>        &quot;otelServiceName&quot;: &quot;unknown_service&quot;,<br>        &quot;code.filepath&quot;: &quot;/Users/loki/Desktop/otelblog/flaskApp/app.py&quot;,<br>        &quot;code.function&quot;: &quot;page_not_found&quot;,<br>        &quot;code.lineno&quot;: 32<br>    },<br>    &quot;dropped_attributes&quot;: 0,<br>    &quot;timestamp&quot;: &quot;2025-05-06T12:09:31.988434Z&quot;,<br>    &quot;observed_timestamp&quot;: &quot;2025-05-06T12:09:31.988470Z&quot;,<br>    &quot;trace_id&quot;: &quot;0x6d043d012174e9753ce54f4eb7089a67&quot;,<br>    &quot;span_id&quot;: &quot;0xd48a3d0dfcfb6881&quot;,<br>    &quot;trace_flags&quot;: 1,<br>    &quot;resource&quot;: {<br>        &quot;attributes&quot;: {<br>            &quot;telemetry.sdk.language&quot;: &quot;python&quot;,<br>            &quot;telemetry.sdk.name&quot;: &quot;opentelemetry&quot;,<br>            &quot;telemetry.sdk.version&quot;: &quot;1.29.0&quot;,<br>            &quot;telemetry.auto.version&quot;: &quot;0.50b0&quot;,<br>            &quot;service.name&quot;: &quot;unknown_service&quot;<br>        },<br>        &quot;schema_url&quot;: &quot;&quot;<br>    }<br>}</pre><p>As we can see, we’re now collecting various types of telemetry data, but in a production environment, this approach <strong>isn’t</strong> <strong>scalable</strong> &amp; <strong>readable</strong>. To properly visualize and manage this data, we’ll set up an observability platform using the LGTM stack, with Grafana as the frontend for viewing the complete telemetry data.</p><h4>🚢🐳 Containerize the Python Application</h4><p>This is a straightforward step — we simply need to create a <strong>Dockerfile</strong> for the application with the necessary build arguments, and everything will be set up for containerization.</p><p><strong>🗂️ <em>Directory Structure -</em></strong></p><pre>./demo-python/<br>├── Dockerfile<br>├── README.md<br>├── app.py<br>├── cmd.md<br>└── requirements.txt</pre><p>Below is the <strong>Dockerfile</strong> containing the necessary instructions to build the application image.</p><pre>FROM python:3.8-slim-buster<br>WORKDIR /python-docker<br>COPY . .<br>RUN pip3 install -r requirements.txt &amp;&amp; opentelemetry-bootstrap -a install &amp;&amp; apt update &amp;&amp; apt install curl -y<br>ENV OTEL_TRACES_EXPORTER=console<br>ENV OTEL_METRICS_EXPORTER=none<br>ENV OTEL_LOGS_EXPORTER=none<br>EXPOSE 3000<br>CMD [&quot;opentelemetry-instrument&quot;, &quot;flask&quot;, &quot;run&quot; , &quot;-h&quot;, &quot;0.0.0.0&quot;, &quot;-p&quot;, &quot;3000&quot;]</pre><p>Build the container image using — <strong>docker build -t flaskapp:v1 .</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b8eJIK9BMfIGS-3KbWxuhQ.png" /><figcaption><strong>Build Image</strong></figcaption></figure><p>Check <strong>docker images</strong> .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*rIItPFrogOuLSYDlnJk4mQ.png" /><figcaption><strong>List images</strong></figcaption></figure><p>Run the container with port exposed. <br><strong>docker run -dit -p 3000:3000 flaskapp:v1</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*SZksQE9hiOwxVQmOyqaXIw.png" /><figcaption><strong>Run the container</strong></figcaption></figure><p>Hit some curl requests.</p><pre>$ curl localhost:3000/<br>200<br><br>$ curl localhost:3000/healthz<br>200<br><br>$ curl localhost:3000/notexist<br>404</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/453/1*EMy-aMHiFMabG_zKKcHYrA.png" /><figcaption><strong>curl requests</strong></figcaption></figure><p>Check the container logs. <br><strong>docker logs -f kind_lamport</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*wEZnkHaC0-8nfpTjc-weJw.png" /><figcaption><strong>docker logs</strong></figcaption></figure><p>We have enabled only tracing output to the console (in the Dockerfile) and are successfully receiving the expected data. With that, our container image and pod setup are complete.</p><p>In the upcoming steps, once LGTM is deployed, we will point the flask container to send telemetry data to LGTM instead of console.</p><h4>🚢🐳 Set Up the Containerized LGTM Stack</h4><p>Create a custom Docker network to ensure that all containers are launched within the same network namespace, enabling seamless inter-container communication.</p><pre>$ docker network create my-net</pre><p>We will use the container image <strong>grafana/otel-lgtm</strong> to deploy the complete observability stack for our demo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VUE2QRMRx4zwAHQ6.png" /><figcaption><strong>Source: Grafana blog</strong></figcaption></figure><p>The <strong>grafana/otel-lgtm</strong> image contains a preconfigured OpenTelemetry backend based on the <a href="https://opentelemetry.io/docs/collector/">OpenTelemetry Collector</a>, <a href="https://github.com/prometheus/prometheus">Prometheus</a>, <a href="https://github.com/grafana/loki/">Loki</a>, <a href="https://github.com/grafana/tempo/">Tempo</a>, and <a href="https://github.com/grafana/grafana">Grafana</a>.</p><p>The <strong>OpenTelemetry Collector</strong> receives -<br>📡🌐 OpenTelemetry signals on ports 4317 (gRPC) and 4318 (HTTP).<br>📦🕒 Forwards spans to a <strong>Tempo</strong> database.<br>📈🔥 Forwards metrics to a <strong>Prometheus</strong> database.<br>📜🔍 Forwards logs to a <strong>Loki</strong> database.</p><p>📊🧭 <strong>Grafana</strong> has all three databases configured as data sources and exposes its Web UI on port <strong>3000</strong>.</p><p>To read more about the stack you can follow these links:</p><ul><li><strong>Docker image:</strong> <a href="https://hub.docker.com/r/grafana/otel-lgtm">https://hub.docker.com/r/grafana/otel-lgtm</a></li><li><strong>Github Repo:</strong> <a href="https://github.com/grafana/docker-otel-lgtm">https://github.com/grafana/docker-otel-lgtm</a></li><li><strong>More info:</strong> <a href="https://grafana.com/blog/2024/03/13/an-opentelemetry-backend-in-a-docker-image-introducing-grafana/otel-lgtm/">https://grafana.com/blog/2024/03/13/an-opentelemetry-backend-in-a-docker-image-introducing-grafana/otel-lgtm/</a></li></ul><p>⚡️ Run the LGTM container:</p><pre>$ docker run -p 3000:3000 -p 4317:4317 -p 4318:4318  -dit \<br>--network my-net --name otel-lgtm grafana/otel-lgtm</pre><p>Check the container is up ! 🚀</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FZb72DKQu7msoGeKKyHQ_w.png" /><figcaption><strong>docker</strong> <strong>ps</strong></figcaption></figure><p>Login to the grafana web UI using <strong>localhost:3000</strong> with login credentials <strong>admin:admin</strong> .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*eC2dWhQjh9O0VzTr8T8y4Q.png" /><figcaption><strong>Grafana Web UI</strong></figcaption></figure><h4>🐍➡️📊 Send Python Telemetry Data to the LGTM Stack</h4><p>⚡️ Now run the flask application by updating the ENV vars in the <strong>docker</strong> <strong>run</strong> cmd to point traces, logs and metrics to <strong>otlp</strong> .</p><pre>$ docker run -dit -p 3010:3000 --network my-net  \<br>-e OTEL_TRACES_EXPORTER=otlp \<br>-e OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://otel-lgtm:4317 \<br>-e OTEL_METRICS_EXPORTER=otlp \<br>-e OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://otel-lgtm:4317 \<br>-e OTEL_LOGS_EXPORTER=otlp \<br>-e OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=http://otel-lgtm:4317 \<br>-e OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true \<br>-e OTEL_SERVICE_NAME=flask-app \<br>--name flask  flaskapp:v1</pre><p>Check the container is up ! 🚀</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kVVSXy0OS2AUiVzpIT-wSA.png" /><figcaption><strong>docker ps</strong></figcaption></figure><p>Check the environment variables are set in the container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*41X233XYVTt71V69_jd-qQ.png" /><figcaption><strong>docker exec</strong></figcaption></figure><p>📡🌐 Let’s start by reviewing a few out of the box OTel related metrics in Grafana.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EQgI_J0zn4g8IeU7o_6mHw.gif" /><figcaption><strong>OTel available metrics</strong></figcaption></figure><p>The <strong>up</strong> metric is available to verify the operational status of the OpenTelemetry Collector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gxoOXwYTZfNuS2xiGkAJHQ.gif" /><figcaption><strong>“up” metric</strong></figcaption></figure><p>Few other metrics critical metrics:</p><ul><li>The <strong>otelcol_exporter_send_failed_metric_points_total</strong> metric indicates the total number of metric points that the OpenTelemetry Collector failed to export via an exporter. It’s useful for monitoring data delivery reliability and diagnosing exporter-related issues.</li><li>The <strong>otelcol_process_cpu_seconds_total</strong> metric reports the total CPU time consumed by the OpenTelemetry Collector process, measured in seconds. It helps assess the collector&#39;s resource usage and overall performance.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G-W5kU6AZxIDrFqMkAEwGw.gif" /><figcaption><strong>Few more critical metrics</strong></figcaption></figure><p>Next, we’ll hit the Flask API and observe the telemetry data in Grafana.</p><p>📈🔥 First lets use the Prometheus data source to explore the <strong>metrics</strong>.</p><p>We made one request to the <strong>/</strong> endpoint, which returned a 200 OK, and another to the non-existent <strong>/fd</strong> endpoint, which resulted in a 404 Not Found. Both responses are clearly reflected by the metric <strong>http_server_duration_milliseconds_count</strong> in the visualization below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8XsN9n8H-tIOHJkONvj8Kg.gif" /><figcaption><strong>Explore http* metrics sent by flask app</strong></figcaption></figure><p>📦🕒 Next is the <strong>trace</strong> data in Grafana through the Tempo data source.</p><p>We made one request to the <strong>/</strong> endpoint, which returned a 200 OK, and another to the non-existent <strong>/notexist</strong> endpoint, which resulted in a 404 Not Found. The trace data and span attributes provide detailed insights that can be leveraged to analyze and troubleshoot a wide range of issues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w55WUkHwpP2ahT51EMf0Sw.gif" /><figcaption><strong>Traces</strong></figcaption></figure><p>📜🔍 Now, let’s review the <strong>logs</strong> in Grafana using the Loki data source.</p><p>This visualization displays live logs from API calls, with <strong>WARN</strong> and <strong>ERROR</strong> logs clearly highlighted using color-coded indicators.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OkxBX6HVjSESXHQ6HuImuA.gif" /><figcaption><strong>Logs</strong></figcaption></figure><p>🔗 We can also do advance operations like correlate logs and traces in Grafana to get full observability context across services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L2XI0cCg6tdpR6ukT3N89g.gif" /><figcaption><strong>Correlate traces with logs</strong></figcaption></figure><p><strong>Mission accomplished! 🚀 </strong>We’ve successfully launched our Python Flask telemetry — logs, metrics, and traces — straight into Grafana via OpenTelemetry. Full observability achieved! 🐍📊</p><p><strong>The entire code is available in my GitHub repository: </strong><a href="https://github.com/Dakshjain1/otel-zero2hero"><strong>otel-zero2hero</strong></a></p><p>💯 In the next blog, we’ll walk through <strong>auto-instrumenting a Go application without using a collector</strong>. Another language, another code, another system observed and conquered. Stay tuned!</p><p><strong>Next up — Coming soon…</strong></p><h3>For any doubt, suggestions, or feedback connect to me on <a href="https://www.linkedin.com/in/dakshjain09/">LinkedIn</a>.</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=489dc76d9f18" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenTelemetry 101: Architecture & Key Terminology]]></title>
            <link>https://daksh-jain00.medium.com/opentelemetry-101-architecture-key-terminology-2c6f67e5fdd6?source=rss-be3e81eb6076------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c6f67e5fdd6</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[opentelemetry]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[site-reliability-engineer]]></category>
            <dc:creator><![CDATA[Daksh Jain]]></dc:creator>
            <pubDate>Sun, 09 Mar 2025 04:24:27 GMT</pubDate>
            <atom:updated>2025-05-10T18:52:07.478Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*3wHuG2v4-YAt6jwjX_3wYA.png" /></figure><h4>Welcome to this comprehensive OpenTelemetry series, taking you from basics to advanced concepts. Whether you’re just exploring, experimenting or looking to deepen your understanding around OTel, this guide will cover almost everything you need to know. Each blog covers a specific topic or demo with links to previous and next blogs, ensuring a smooth learning journey. At the beginning of each blog, you’ll find your current position within the series, ensuring an easy-to-follow learning journey from zero to hero. 👨‍💻</h4><h3>Series Breakdown -</h3><ul><li><strong><em>YOU ARE HERE</em><br></strong>📌 <strong>OpenTelemetry 101: Architecture &amp; Key Terminology</strong></li><li><a href="https://daksh-jain00.medium.com/auto-instrument-python-app-without-collector-489dc76d9f18">Demo: Auto-Instrument Python App without Collector</a></li><li>Demo: Auto-Instrument Go App without Collector</li><li>Real Use Case: Auto-Instrumentation without Collector<br> — Kafka Cluster + Go Producer &amp; Consumer App</li><li>Building a Lightweight Collector with OpenTelemetry Builder in Go</li><li>Creating Custom Components: Receivers, Exporters, and More</li><li>Real Use Case:Auto-Instrument Kafka Cluster <strong>with</strong> Collector<br> — Using <strong>kafkametrics</strong> receiver provided by OTel Collector contrib<br> — Using <strong>prometheus</strong> based metrics via <strong>kafka</strong>+ <strong>jmx</strong> exporters</li><li><strong><em>~ More topics will be added (Please add comments for topic suggestions) </em></strong>🚀</li></ul><blockquote><strong>If link is not present, hang in there, I am working on the blogs</strong> <em>👨‍💻😊</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*MW-d2ABZ5sYoxLFQrvrAyw.png" /></figure><h4>What is OpenTelemetry?</h4><p>OpenTelemetry is an <a href="https://opentelemetry.io/docs/concepts/observability-primer/#what-is-observability"><strong>observability</strong></a> framework designed to <strong>create</strong>, <strong>manage</strong>, and <strong>export</strong> <strong>telemetry</strong> <strong>data</strong> such as <a href="https://opentelemetry.io/docs/concepts/signals/traces/">traces</a>, <a href="https://opentelemetry.io/docs/concepts/signals/metrics/">metrics</a>, and <a href="https://opentelemetry.io/docs/concepts/signals/logs/">logs</a>.</p><h4>Is OpenTelemetry an observability backend?</h4><p>❌ <strong>No.</strong> It focuses on <strong>generating, collecting</strong>, and <strong>exporting</strong> telemetry data, leaving storage and visualization to other tools like Jaeger, Prometheus, Datadog or New Relic.</p><h4>What makes OpenTelemetry better?</h4><p>It’s <strong>vendor-agnostic</strong> and works seamlessly with a wide variety of observability backends like Jaeger, Prometheus, or any enterprise tool like Datadog or New Relic.</p><h4>What is OpenTelemetry’s main goal?</h4><p>To simplify <strong>instrumentation</strong> across any language, infrastructure, or runtime, making it easier for developers to gather telemetry data.</p><h4>What are OpenTelemetry’s core principles?</h4><ul><li><strong>Data Ownership</strong>: You own the telemetry data you generate, ensuring there’s no vendor lock-in.</li><li><strong>Unified API</strong>: You only need to learn one set of APIs and conventions to work with OpenTelemetry, regardless of your backend.</li></ul><h3>Instrumentation</h3><p>To make a <strong>system observable</strong> it <strong>needs</strong> to be <strong>instrumented</strong>, meaning, you need to ensure that the system’s components <strong>emit</strong> traces, metrics, and logs. This allows for monitoring and debugging, providing insights into the system’s performance and behaviour.</p><h4>What are the primary ways to instrument your code with OpenTelemetry?</h4><ol><li><a href="https://opentelemetry.io/docs/concepts/instrumentation/code-based/"><strong>Code-based solutions</strong></a> via official APIs and SDKs for various <a href="https://opentelemetry.io/docs/languages/">languages</a>.</li><li><a href="https://opentelemetry.io/docs/concepts/instrumentation/zero-code/"><strong>Zero-code solutions</strong></a>, which require no code modifications.</li></ol><h4>When is zero-code solutions (auto instrumentation) useful?</h4><ul><li>Ideal when you <strong>can’t modify the application</strong> or when you’re looking for a <strong>quick</strong> <strong>setup</strong>.</li><li>It captures telemetry from the <strong>external environment </strong>and libraries, focusing on the boundaries of your application.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*rIgJ38U2n-KYz_Ma5bxhUw.png" /></figure><h4>Why use code-based instrumentation?</h4><ul><li>Provides <strong>more detailed and granular insights</strong> into your application by generating telemetry from your code.</li><li>Complements the data collected by zero-code solutions.</li></ul><h4>Can you use both methods together?</h4><ul><li>✅ <strong>Yes</strong>, combining both code-based and zero-code solutions gives you a fuller, richer view of your system’s performance and behaviour.</li></ul><h3>Signals</h3><ul><li><strong>Signals</strong> refer to the data emitted by a system that represent its operational state and activity.</li><li>They capture <strong>system metrics</strong> (e.g., CPU, memory usage), <strong>events</strong> (e.g., request traces), and <strong>context</strong> across components in a distributed environment.</li><li>Signals can be <strong>grouped</strong> to provide <strong>insights</strong> into the system from different perspectives, such as performance, errors, or resource utilization.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UqN2-4-GVIrmuf-x-E9nBA.png" /></figure><h4>What types of signals does OpenTelemetry support?</h4><ol><li><strong>Traces</strong>:<br><strong>-</strong> Provide a comprehensive view of a <strong>request’s journey </strong>across services or components, essential for tracking performance and <strong>dependencies</strong> in a distributed system.<br><strong>-</strong> Provides <strong>visibility</strong> into the request lifecycle, regardless of architecture type (monolithic or micro services).</li><li><strong>Metrics</strong>:<br><strong>-</strong> <strong>Quantitative</strong> <strong>measurements</strong> of system or application behavior.<br><strong>-</strong> Include <strong>time series data </strong>with associated <strong>metadata</strong>, captured at <strong>specific</strong> <strong>intervals</strong> (e.g., CPU load, memory consumption, request latency).</li><li><strong>Logs</strong>:<br><strong>-</strong> <strong>Timestamped</strong> <strong>records</strong> <strong>of</strong> <strong>events</strong>, generated by the system, capturing <strong>detailed</strong> <strong>information</strong> about execution flows or errors.<br><strong>-</strong> Can be <strong>structured</strong> (JSON, key-value pairs) or <strong>unstructured</strong> text. Widely used for <strong>troubleshooting</strong> and system diagnostics.</li><li><strong>Baggage</strong>:<br><strong>-</strong> <strong>Contextual</strong> <strong>data</strong> associated with a request or operation, implemented as a <strong>key-value store</strong>.<br><strong>-</strong> <strong>Propagates</strong> <strong>across</strong> <strong>service</strong> boundaries, allowing metadata to be <strong>attached</strong> to <strong>traces</strong>, <strong>metrics</strong>, or <strong>logs</strong> for full observability of distributed operations.</li><li><strong>Profiles:<br>-</strong> Offers a <strong>deep-dive</strong> into an application’s performance at the <strong>code</strong> <strong>level.</strong><br>- Highlights <strong>resource</strong> <strong>usage</strong> and performance hotspots.<br><strong><em>(not in stable state yet)</em></strong></li></ol><h3>Collector</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fut-0fwxgFQJCdKddp449Q.png" /></figure><p>The OpenTelemetry Collector is a vendor-agnostic proxy designed to <strong>receive</strong>, <strong>process</strong>, and <strong>export</strong> telemetry data.</p><ul><li>It <strong>supports multiple data formats</strong> like OTLP, Jaeger, Prometheus, and various proprietary tools.</li><li>The Collector allows for <strong>processing</strong> and <strong>filtering</strong> <strong>telemetry</strong> <strong>data </strong>before exporting it to one or more backends.</li></ul><blockquote><em>🚨</em> <strong>You have the option to use or not use a collector, so let’s dig deeper into where it is most beneficial and why it might be necessary in certain scenarios.</strong></blockquote><h4>No Collector</h4><ul><li>The <strong>simplest</strong> pattern is not to use a collector at all.</li><li>In this pattern we <strong>install</strong> the <strong>OpenTelemetry</strong> <strong>SDK</strong> along with the application to be instrumented.</li><li>Follow this <a href="https://opentelemetry.io/docs/languages/"><strong>link</strong></a> to find the <strong>SDKs</strong> for available language.</li><li>Now once the application code runs it will <strong>export</strong> telemetry signals (traces, metrics, logs) <strong>directly</strong> into a backend like this:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*LudtjAVDiWYYi9Fo--7xTA.png" /><figcaption><strong>Direct</strong></figcaption></figure><h4>Why use a collector ?</h4><p>If the previous “simple” implementation works, then the collector seems like just another intermediary between applications services and the observability backend. Under what circumstances is it necessary to use a collector <strong>instead of having each service send data directly to the backend?</strong></p><ul><li>Sending data directly to a backend works for <strong>quick experimentation</strong>, especially in dev or small-scale environments.</li><li>Using a <strong>collector</strong> is <strong>recommended</strong> for most use cases as it offloads data quickly from the service &amp; <strong>handles the processing</strong> of data like retries, batching, encryption, and sensitive data filtering.</li><li>Setting up a collector is <strong>easy</strong>, as the default OTLP exporters assume a local collector endpoint, and once collector is launched, it <strong>starts receiving</strong> telemetry data.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/933/1*nXDLLwpeB20u1TviiN-vPg.png" /><figcaption><strong>Processing power of collector</strong></figcaption></figure><h4>Tradeoffs</h4><p><strong>Pros:</strong></p><ul><li><strong>Simple</strong> to use &amp; <strong>no additional components</strong> to manage in production.</li></ul><p><strong>Cons:</strong></p><ul><li>Requires <strong>code changes</strong> if collection, processing, or ingestion needs change.</li><li>Creates <strong>strong coupling between</strong> application code and the backend.</li><li><strong>Limited</strong> <strong>number</strong> <strong>of exporters</strong> available for each language implementation.</li></ul><p>Now that you’re familiar with the key terminologies, you’re all set to instrument your first piece of code. In the next blog, we’ll walk through <strong>auto-instrumenting a Python application without using a collector</strong>. This will be the simplest implementation, giving you the confidence to explore the full potential of OpenTelemetry. Stay tuned!</p><p><strong>Next up — </strong><a href="https://daksh-jain00.medium.com/auto-instrument-python-app-without-collector-489dc76d9f18"><strong>Click here</strong></a><strong> for Python auto instrumentation demo !!</strong></p><h3>For any doubt, suggestions, or feedback connect to me on <a href="https://www.linkedin.com/in/dakshjain09/">LinkedIn</a>.</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c6f67e5fdd6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning in Cyber Security]]></title>
            <link>https://daksh-jain00.medium.com/machine-learning-in-cyber-security-a9610e89e170?source=rss-be3e81eb6076------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9610e89e170</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[k-means]]></category>
            <category><![CDATA[cyber-security-solutions]]></category>
            <category><![CDATA[analyst]]></category>
            <dc:creator><![CDATA[Daksh Jain]]></dc:creator>
            <pubDate>Mon, 02 Aug 2021 08:16:01 GMT</pubDate>
            <atom:updated>2021-08-02T08:16:01.042Z</atom:updated>
            <content:encoded><![CDATA[<p>It is almost impossible for any Data Analyst to look at a time series chart of network traffic &amp; draw any conclusion from it. Even if it is possible for some it is impossible for all humans to do it 24x7. Too many false alerts cause analysts to simply ignore some of what they’re seeing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ao8P--a_bYpp2ovu.jpg" /><figcaption><strong>Machine Learning in Cyber Security</strong></figcaption></figure><p>Machine Learning makes it possible to view and analyze huge data with multiple dimensions. It makes it possible to do operations for a variety of use cases. Block access to hackers stealing company data, stop the hijacking of computers, and whatnot.</p><h3>K-means clustering</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KBFJLbkj0fzyYAl9.png" /></figure><p>We use the <strong>k-mean clustering </strong>algorithm, which separates data along with any number of axes. This is an unsupervised model because there are no <strong>labels</strong>, only <strong>features</strong>. So, we don’t need to train the model, as there’s nothing to predict. Instead, we are observing.</p><p>Traditional security systems such as Intrusion Detection Systems (IDS) are not capable of handling such a growing amount of data set in real-time. Cybersecurity analytics is an alternative solution to such traditional security systems, which can use big data analytics techniques to provide a faster and scalable framework to handle a large amount of cyber security-related data in real time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/0*QJ8tWUn2QVdL6WFi.png" /></figure><p>k-means clustering is one of the commonly used clustering algorithms in cybersecurity analytics aimed at dividing security-related data into groups of similar entities, which in turn can help in gaining important insights about the known and unknown attack patterns. This technique helps a security analyst to focus on the data specific to some clusters only for the analysis. To improve performance, k-means can exploit the triangle inequality to skip many point-center distance computations, without affecting the clustering results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*dp6oEIyqXKWpxMGJYubZlQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EqF7GBHDZhCwKROW.png" /></figure><h4>Advantages of clustering for crime pattern analysis</h4><ul><li>This approach helps us to analyze the historical crime rates and enhance the crime resolution rate of the present.</li><li>Take actions to prevent future incidents by using preventive mechanisms based on observed patterns.</li><li>Reduce the training time of the officers that are assigned to a new location and have no prior knowledge of site-specific crimes.</li><li>Increase operational efficiency by optimally redeploying limited resources to the right places at the right times.</li></ul><h4>Limitations of crime pattern detection</h4><ul><li>Crime pattern analysis can only help the detectives and not replace them. It is up to the human experts to interpret what the clusters are telling us.</li><li>Data mining is sensitive to the quality of input data and that can be inaccurate sometimes. Missing information can also cause errors.</li><li>Mapping data mining attributes is a difficult task and hence it requires a skilled data miner and a crime data analyst with good domain knowledge.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9610e89e170" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Web Portal using JS & Py-CGI]]></title>
            <link>https://daksh-jain00.medium.com/kubernetes-web-portal-using-js-py-cgi-242fa3b40687?source=rss-be3e81eb6076------2</link>
            <guid isPermaLink="false">https://medium.com/p/242fa3b40687</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[website]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[js]]></category>
            <dc:creator><![CDATA[Daksh Jain]]></dc:creator>
            <pubDate>Tue, 06 Jul 2021 16:35:14 GMT</pubDate>
            <atom:updated>2021-07-06T16:35:14.972Z</atom:updated>
            <content:encoded><![CDATA[<h4>In my Docker Web Portal, I took input from the user via key:value pair. In this web app, I have used a smarter approach. Here you can write/speak English statements and the Python CGI Code will understand the statement &amp; convert it into commands and present the commands &amp; their output on the web app.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6mLr1C3kR7DkaZ9eB0Vh3g.png" /></figure><h3>Frontend ➡</h3><ul><li>HTML</li><li>CSS</li><li>JavaScript</li></ul><h3>Backend ➡</h3><ul><li>Python CGI</li><li>Kubernetes</li></ul><p>Using Python CGI Codes I am taking input from the client (via the web portal) in the form of <strong>English Statements</strong> &amp; the code runs the particular <strong>kubectl commands</strong> and gives the output back to JS functions that display it on the webpage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h8v_QdyHj9zy_sAI-a8z0w.png" /><figcaption><strong>The Website</strong></figcaption></figure><h3>Features of the Website:</h3><ul><li>Display all pods, deployment, service</li><li>Create pods, deployment, services</li><li>Expose deployments</li><li>Scale the deployment</li><li>Delete particular/all resources</li></ul><h4>Pre-requisites to run the web app</h4><ul><li>Create appropriate firewall rules &amp; SELinux rules, or for simplicity switch it off.</li><li>Setup the Apache webserver for the codes to run.</li><li>Install kubectl command line and configure the kubectl to use either a local minikube cluster or a cloud-based cluster.</li><li>Then you need the configuration files, keys &amp; certificates in the proper folder and kubeconfig path properly set, to use the kubectl command line.</li></ul><pre><strong># kubectl version</strong></pre><ul><li>Using this command check whether you can connect to the server.</li></ul><p>After this, using simple if…else conditions, I am converting the English statements into the proper kubectl commands that will be run on the background by the CGI codes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VN6Xp0qQEnR3KofCizQaKg.png" /><figcaption>A screenshot of how the code is basically working</figcaption></figure><p>For the complete action you can refer to the video below :</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FW2aHcXxuU4s%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DW2aHcXxuU4s&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FW2aHcXxuU4s%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/87525c19c037f9c67661d28a5cc37dd3/href">https://medium.com/media/87525c19c037f9c67661d28a5cc37dd3/href</a></iframe><h4>This project is done along with <a href="https://www.linkedin.com/in/khushi-thareja/">Khushi Thareja</a>.<br>Do comment and share it if you like. 😃</h4><h3>I am always open to suggestions &amp; available for fun projects as well !!</h3><p>Connect with me over <a href="https://www.linkedin.com/in/dakshjain09/"><strong>LinkedIn</strong></a><strong> :)</strong><br>Follow me on <a href="https://daksh-jain00.medium.com/"><strong>Medium</strong></a><strong>…</strong><br>Check out my <a href="https://github.com/Dakshjain1"><strong>Github</strong></a>!</p><blockquote><strong><em>This Repo — </em></strong><a href="https://github.com/Dakshjain1/JS-K8S-Web-Portal"><strong><em>JS-K8S-Web_portal</em></strong></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=242fa3b40687" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackOn 2.0 @ HackerEarth]]></title>
            <link>https://medium.com/hackonhackathon/hackon-2-0-hackerearth-fd727424173f?source=rss-be3e81eb6076------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd727424173f</guid>
            <category><![CDATA[winner]]></category>
            <category><![CDATA[entrepreneur]]></category>
            <category><![CDATA[hackerearth]]></category>
            <category><![CDATA[team]]></category>
            <category><![CDATA[solutions]]></category>
            <dc:creator><![CDATA[Daksh Jain]]></dc:creator>
            <pubDate>Tue, 22 Jun 2021 16:39:12 GMT</pubDate>
            <atom:updated>2021-06-28T21:35:56.162Z</atom:updated>
            <content:encoded><![CDATA[<h4>I and my Teammate participated in this event &amp; created a superb web portal to release your Anxiousness. HackOn is <em>a pan India Hackathon, and we won the title</em><strong><em> ‘Best use of A</em></strong>uth0<strong><em>’</em></strong></h4><h4>Here’s the link to the project we made:<br><a href="https://hackon.hackerearth.com/challenges/hackathon/hackon/dashboard/60c3d6d/submission/published/baatcheet/">https://hackon.hackerearth.com/challenges/hackathon/hackon/dashboard/60c3d6d/submission/published/baatcheet/</a></h4><h3>Baatcheet</h3><p><strong>Theme: Mental Health and Awareness</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*s1acOfkf0CVazu2C.png" /></figure><h4>Project description</h4><p><strong>Baatcheet Karlo yaar!</strong> Something is making you feel anxious? We are here. Something is causing you pain? We are here. Something is causing you depression? We are here. We are ready to listen. We are there for you. No Judgments, No questions, only someone to listen to you, to help you let go of the pain and stress. Talk to our specialists, listen to songs, read memes and quotes and live your best life.</p><h4>#YOLO</h4><h4>The Team: @codimg</h4><p>👨‍💻 <a href="https://www.linkedin.com/in/vaibhavsharma190317/"><strong>Vaibhav Sharma</strong></a><a href="https://www.linkedin.com/in/dakshjain09/"><strong><br></strong></a>👨‍💻 <a href="https://www.linkedin.com/in/dakshjain09/"><strong>Daksh Jain</strong></a></p><h4>Features:</h4><ul><li>Chill zone where you can use our voice assistant to have a friend to talk to. Watching movies, read quotes and memes!</li><li>Create Appointments with the Therapists on Google Meet</li><li>Minimal UI</li><li>Made the site robust by using Kubernetes</li><li>Auth0 for secure access and no privacy issues.</li></ul><h3>Video Link</h3><p><a href="https://youtu.be/ngVlszefAO0">https://youtu.be/ngVlszefAO0</a></p><h3>Demo Link — Use our portal</h3><p><a href="http://baattcheet.herokuapp.com/">http://baattcheet.herokuapp.com/</a></p><h3>It was a really great experience at HackOn. Although it was virtually, the sessions and the complete experience were really engaging!!</h3><h3>😃😃</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd727424173f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackonhackathon/hackon-2-0-hackerearth-fd727424173f">HackOn 2.0 @ HackerEarth</a> was originally published in <a href="https://medium.com/hackonhackathon">HackOn</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Face Recognition Model using Azure Custom Vision Service]]></title>
            <link>https://medium.com/analytics-vidhya/face-recognition-model-using-azure-custom-vision-service-ff15e0330646?source=rss-be3e81eb6076------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff15e0330646</guid>
            <category><![CDATA[microsoft-azure]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[facial-recognition]]></category>
            <dc:creator><![CDATA[Daksh Jain]]></dc:creator>
            <pubDate>Mon, 21 Jun 2021 12:02:45 GMT</pubDate>
            <atom:updated>2021-06-30T09:12:10.026Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Facial Recognition Model using Microsoft Azure Custom Vision Service. The model is then used to detect some particular faces &amp; do certain designated tasks as per our business logic.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*z7g-UXgiCRoUKVMaMkV7vw.jpeg" /></figure><p>In this article, I will explain how I have created the Face Recognition model using Azure <strong>Custom Vision </strong>Service.</p><p>A big shoutout to <a href="https://medium.com/u/940e606ec51a">Microsoft</a> for such great documentation and GitHub repositories for learning. I took references from this repository of <a href="https://github.com/MicrosoftLearning/mslearn-ai900/blob/main/02%20-%20Image%20Classification.ipynb">Microsoft AI900</a>.</p><h4>Let’s jump in!</h4><h4>Step 1</h4><p>Capture photos of the team members. These photos will be provided to the model for training. The model is based on<strong> Supervised Learning</strong>, as while uploading the images we provide labels to them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V__wXf8tVhe0kXqIrSTbVg.png" /><figcaption><strong>Code to click images</strong></figcaption></figure><p>The code can be found on this link — <a href="https://github.com/Dakshjain1/LWSummer2021/blob/main/Task6-FaceRecognition/Capture%20100%20photos.ipynb"><strong>Capture Photos</strong></a>.</p><h4>Step 2</h4><p>Now the major process begins. Creating the model on <strong>Microsoft Azure</strong>.<br>Computer Vision is a technique that gives the capability to the webcam to “understand ”what it sees. <br>Similarly, Computer Vision in Azure is a service that lets you play around with the pre-created models.</p><p>Now, to build one, they have another service “<strong>Custom Vision</strong>” that helps to easily create a model for your business logic.</p><p>Carefully follow the screenshots and you will be ready with your own model!</p><p><strong>This article assumes that you already have an Azure account, a subscription, and 1 resource group ready.</strong><br><strong>- Azure Account</strong> can be made from this <a href="https://azure.microsoft.com/en-in/free/">link</a>.<br><strong>- Subscription</strong> is the billing account, from where you will be charged for the resources you use. You can easily start with a free account that gives you access to a lot of services.<br><strong>- Resource group</strong> is a logical container that will hold all the resources you create in Azure.</p><p>Search for <strong>Custom Vision </strong>in the <strong>Azure Marketplace.<br></strong>Click on Create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dWYk9BvUMvx1_POJYdrZJw.png" /><figcaption><strong>Custom Vision</strong></figcaption></figure><p>Create Option — <strong>Both (for training &amp; prediction)<br></strong>Select appropriate <strong>Subscription </strong>and <strong>Resource Group</strong>.<br>Select the same <strong>Location </strong>&amp; <strong>Pricing Tier </strong>for both the resources being created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*gB-6MY8zO7sZ0uMjpMqv6g.png" /><figcaption><strong>Create</strong></figcaption></figure><p>After 1–2 minutes the deployment of both resources should be complete.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pVIhQJqlvayXMD8GD05A2w.png" /><figcaption><strong>Deployment Complete</strong></figcaption></figure><p>Click on “Go to resource”.<br>Then click on <strong>Custom Vision Portal</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hc4db3v_abf5YENjty5QZg.png" /><figcaption><strong>Resource</strong></figcaption></figure><p>Sign-in into the portal, with the same Microsoft account, as the cloud portal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hAN8ALnA0-1VcZRxruwoTQ.png" /><figcaption><strong>Sign-in</strong></figcaption></figure><p>Click on create a<strong> New Project</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*NDZyhfeCTSfnpAgsu3i-IA.png" /><figcaption><strong>New Project</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*2hSQdud22isC40U3MtdkUA.png" /></figure><p>Then it will give these options.</p><p>Give a name and description that works for you.</p><p>Select the resource from the drop-down (you created already).</p><p>Project Type: <strong>Classification</strong><br>Multiclass Classification.</p><p>Domains: If your business logic is in the options supported by Azure then select that, else go for a general model.</p><p>Click on <strong>Create</strong>.</p><p>This new window will open, which is your empty new project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_I6N3CUSWzpUYnG3OBe73Q.png" /><figcaption><strong>New Project</strong></figcaption></figure><p>Now it asks you to add images, so 1 by 1 add images of the team members.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*5oPI5d-j-c5FhvNQaVvYLQ.png" /><figcaption><strong>Team all images</strong></figcaption></figure><p>Provide the <strong>correct label </strong>and click on <strong>Upload</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PV0WtAPN-habNk1LKMSl6Q.png" /><figcaption><strong>Upload Images</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*plCKlH_3Z_NrpR-7h9xrIA.png" /><figcaption><strong>Uploading</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*nN-VmdNphgq_sc_iroxuMw.png" /><figcaption><strong>Done</strong></figcaption></figure><p>Click <strong>Done </strong>after image upload.</p><p>Do similarly for all the team members, label is important here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*NqgKFCBhm5KzPN-EZuUhVw.png" /><figcaption><strong>Training type.</strong></figcaption></figure><p>Then choose your desired training type and click on <strong>Train</strong>.</p><p>The training will take few minutes based on the number of images you have given.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ugxgfumtXX32dRZ4LKyp2w.png" /><figcaption><strong>Training</strong></figcaption></figure><h4>Intermediate step -</h4><p>Check the accuracy of your model, by clicking on <strong>Quick Test </strong>and provide the testing images.</p><p>You can see that after a certain hit and trials, my model is accurate enough to be deployed.</p><p>I performed a quick test using images of all my teammates and the results are as follows-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vrs9BErsy6mMVvqJf4aWUQ.png" /><figcaption><strong>Vikash — 65.8%</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j_McSrmkmMXUd7VfVtwKSw.png" /><figcaption><strong>Khushi— 62.8%</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*haSG7T6r9E7qStq1FzbmAQ.png" /><figcaption><strong>Daksh— 96.3%</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TPc7072MhwJj_tduRF4MIQ.png" /><figcaption><strong>Madhhav— 54.7%</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QAaRFCm723ymYzPfqn5RxA.png" /><figcaption><strong>Madhhav — 91.7%</strong></figcaption></figure><p>You can see the varying results.</p><p>After successful testing when you are happy with the model, <strong>Publish the model.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*T8fPMRm-4-pu4G5OXpqh3A.png" /><figcaption><strong>Publish</strong></figcaption></figure><p>The<strong> model name</strong> you give here is very important, <strong>so remember it !<br>Keep a Note of the Model Name.</strong></p><p>Click on <strong>Publish</strong>.</p><p>Click on the <strong>Gear icon ⚙ </strong>on the <strong>same page</strong>.<br>These are the details of the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EwUTLgXvRQj-mOuF-BDDeg.png" /><figcaption><strong>Settings of model</strong></figcaption></figure><p><strong>Note</strong> the <strong>Project ID </strong>(left side) and <strong>Endpoint </strong>(right side)<strong>.</strong></p><p>Now click on the <strong>eye icon 👁 </strong>on the top left corner and now click the <strong>Gear icon ⚙</strong> on this page. This will give the details of the predictor. From here we need the <strong>KEY.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_mPJ5z7gDz7DAF8b4By0rw.png" /><figcaption><strong>Settings of Predictor</strong></figcaption></figure><p><strong>Note </strong>the value of<strong> the key</strong>.</p><p><strong>Required Details — Checklist</strong></p><ol><li><strong>Model name when you published it.</strong></li><li><strong>Project ID and Endpoint from the Model Settings</strong></li><li><strong>Key from the Portal settings</strong></li></ol><h4>Step 3</h4><p>Now finally use this Model in the Application.</p><pre><strong>pip install azure-cognitiveservices-vision-customvision<br>pip install dotenv<br>pip install </strong></pre><p>Our Application was to do some tasks based on who is in front of the camera.</p><h4>The tasks to be done were -</h4><ol><li>Send mail</li><li>Send Whatsapp Message</li><li>Create AWS Instance, EBS Storage and attach it to the instance</li><li>Open LinkedIn profile</li></ol><h4>You can see in the videos below how it is working.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EDnP11FJBvoHF_a98JN4Vg.gif" /><figcaption><strong>Daksh — send Whatsapp Message</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8x3nyy3vKhjr-WZfg9vSHA.gif" /><figcaption><strong>Khushi — AWS Instance</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rzMB13DLAF9LUZC0h23BBA.gif" /><figcaption><strong>Madhhav — Send Mail</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UG6w9uH54kHpqskxYlPPEA.gif" /><figcaption><strong>Vikash — Open LinkedIn</strong></figcaption></figure><p>The complete codes for the application and clicking photos is available on this <a href="https://github.com/Dakshjain1/LWSummer2021/tree/main/Task6-FaceRecognition"><strong>Github Repo</strong></a>.</p><h3>For any queries, corrections, or suggestions you can always connect with me on my LinkedIn.</h3><p><a href="https://www.linkedin.com/in/dakshjain09/">Daksh Jain - Azure Cloud &amp; DevOps Intern - Piramal Glass | LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff15e0330646" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/face-recognition-model-using-azure-custom-vision-service-ff15e0330646">Face Recognition Model using Azure Custom Vision Service</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript usage in the industry over the years…]]></title>
            <link>https://daksh-jain00.medium.com/javascript-usage-in-the-industry-over-the-years-e3016814f6b?source=rss-be3e81eb6076------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3016814f6b</guid>
            <dc:creator><![CDATA[Daksh Jain]]></dc:creator>
            <pubDate>Sun, 20 Jun 2021 10:57:09 GMT</pubDate>
            <atom:updated>2021-06-20T11:09:13.990Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/532/0*VmBFD8rTvLmG-HSq.gif" /></figure><h4>According to the NPM Blog Archives:</h4><p>“There were meaningful differences across industries in how and why people use JavaScript.</p><ul><li>tech: 45%</li><li>finance: 7%</li><li>advertising and marketing: 5%</li><li>education: 5%</li><li>entertainment: 5%</li><li>business support and logistics: 4%</li><li>healthcare: 4%</li><li>retail: 3%</li><li>government: 2%</li><li>manufacturing: 2%</li></ul><p>Angular was a fairly popular choice across all industries, but strongest in finance. Developers in entertainment were the least likely to use Angular, their strongest preference being for React (65%).</p><h3>LinkedIn</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*8w1BiB2Jjt1eU_E1.png" /></figure><p>LinkedIn relies on NodeJS for its mobile site. A few years back, LinkedIn used Rails for its mobile site. As with other large Rails applications, it was slow, monolithic, and it scaled poorly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8MyiaEOsRONUXWue.png" /></figure><p>LinkedIn switched over to NodeJS to solve its scaling problems. Node’s asynchronous capabilities allowed the LinkedIn mobile site to perform more quickly than before while using fewer resources. Node also made data sharing and building APIs easier for LinkedIn developers.</p><p>After switching to node.js the Linkedin development team realized the advantages.</p><ol><li>Much better performance and lower memory overhead than other tested options, running up to 20x faster in some scenarios</li><li>Programmers could leverage their JavaScript skills.</li><li>Frontend and backend mobile teams could be combined into a single unit.</li><li>Servers were cut to 3 from 30. Enough headroom remains to handle 10x current levels of resource utilization.</li><li>The development could focus more on application development than firefighting.</li></ol><h4>JavaScript is Everywhere!</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3016814f6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker Portal using JavaScript & Python CGI]]></title>
            <link>https://daksh-jain00.medium.com/docker-portal-using-javascript-python-cgi-cc1bdba84b80?source=rss-be3e81eb6076------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc1bdba84b80</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[unique]]></category>
            <category><![CDATA[interesting]]></category>
            <dc:creator><![CDATA[Daksh Jain]]></dc:creator>
            <pubDate>Sun, 20 Jun 2021 09:32:03 GMT</pubDate>
            <atom:updated>2021-06-20T09:49:02.501Z</atom:updated>
            <content:encoded><![CDATA[<h4>Another fun project!! For people who don’t want to go to the Black Screen, but still wish to try on technologies like Docker, I have created a Docker Web Portal with some functionalities.</h4><p>This is my first hands-on Project using JavaScript. I understood how to use JS, HTML, &amp; CSS, how they are managed in code files, and how each one complements the other.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*CuMAcffrpQexuZUx--a-oA.png" /></figure><h4>Frontend ➡</h4><ul><li>HTML</li><li>CSS</li><li>JavaScript</li></ul><h4>Backend ➡</h4><ul><li>Python CGI</li></ul><p>Using Python CGI Codes I am taking input from the client (via the web portal) &amp; the code runs particular docker commands and gives the output back to JS functions that display it on the webpage.</p><h4>Let’s get going!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*ACXOoh3RR-Kc4E1zHG2gLg.png" /><figcaption><strong>Frontend</strong></figcaption></figure><p>This is the <strong>file structure </strong>of the front end.</p><p>I have created <strong>different styling</strong> for the elements used in the webpage, present in the CSS folder.</p><p>For each <strong>function </strong>being called in the HTML page, a different <strong>JS file</strong> is made.</p><p><strong>Photos </strong>folder consists of the <strong>images</strong> being used on the website.</p><p><strong>The code is available on my </strong><a href="https://github.com/Dakshjain1/JS-Docker-Web-Portal"><strong>Github</strong></a><strong>. Feel free to put a ⭐.</strong></p><p>My website is running in a Linux-hosted Apache webserver on RHEL8. So all these files are present in the /var/www/html folder.</p><blockquote>How to set up a web server and all other details are mentioned in the GitHub link provided above.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AmCCnPNPpQ62ghthZ30j5Q.png" /><figcaption><strong>JS &amp; HTML</strong></figcaption></figure><p>In the .js file, a function is created which is called on the button property of <strong>onclick.<br></strong>In the function I am using XMLHttpRequest() function which can send and get result over http requests.<br><strong>.send() </strong>function sends the request to the given URL — which is a CGI code.<br><strong>.onload()</strong> gets the data and I am presenting it in the alert dialog.</p><p>Similarly, the code is written.</p><p>The backend files are present in the /var/www/cgi-bin folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*lYu3f5g0_sFw4rE_3WNOBQ.png" /><figcaption><strong>All CGI Codes</strong></figcaption></figure><p>These files run the backend docker commands that give output back on the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_6UQDOp-CuFoVKcSDXCQsA.png" /><figcaption><strong>1 Code to explain basic CGI Code</strong></figcaption></figure><p>Similarly, all other CGI codes are written, which takes some input and based on command gives certain output back to the JS code.</p><h4>Features of the Website:</h4><ol><li><strong>Launch </strong>a Container</li><li><strong>Stop </strong>a Container</li><li><strong>Remove </strong>a Container</li><li>List all available <strong>images</strong></li><li><strong>List </strong>all <strong>containers </strong>with status</li><li>A <strong>Scale </strong>to keep a track of <strong>how many containers</strong> are launched on the server!</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3VvUa9guUgJFQgavEGSEcQ.png" /></figure><h3>Video Demo</h3><p>Do watch this short 2 min video</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fa7mp4Fnv7Pk%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Da7mp4Fnv7Pk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fa7mp4Fnv7Pk%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/ced364bb02c15eb877cfa616496dcbc9/href">https://medium.com/media/ced364bb02c15eb877cfa616496dcbc9/href</a></iframe><p>Wait for the Docker to move on the scale 😉. Do comment how you loved it ❤</p><h4>This my first JS Project!<br>This project is done along with <a href="https://www.linkedin.com/in/khushi-thareja/">Khushi Thareja</a>.<br>Do comment and share it if you like. 😃</h4><h4>I am always open to suggestions &amp; available for fun projects as well !!</h4><p>Connect with me over <a href="https://www.linkedin.com/in/dakshjain09/"><strong>LinkedIn</strong></a><strong> :)</strong><br>Follow me on <a href="https://daksh-jain00.medium.com/"><strong>Medium</strong></a><strong>…</strong><br>Check out my <a href="https://github.com/Dakshjain1"><strong>Github</strong></a>!</p><blockquote><strong>This Repo — </strong><a href="https://github.com/Dakshjain1/JS-Docker-Web-Portal"><strong>JS-Docker-Web_portal</strong></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc1bdba84b80" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Play around with OpenCV]]></title>
            <link>https://daksh-jain00.medium.com/play-around-with-opencv-78edacf5aee3?source=rss-be3e81eb6076------2</link>
            <guid isPermaLink="false">https://medium.com/p/78edacf5aee3</guid>
            <category><![CDATA[opencv]]></category>
            <category><![CDATA[image-processing]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[opencv-python]]></category>
            <category><![CDATA[fun]]></category>
            <dc:creator><![CDATA[Daksh Jain]]></dc:creator>
            <pubDate>Wed, 09 Jun 2021 13:25:36 GMT</pubDate>
            <atom:updated>2021-06-09T13:25:36.515Z</atom:updated>
            <content:encoded><![CDATA[<p>Image is nothing but an array.<br>A coloured image is a 3D array having RGB colours or a 2D matrix which may be a grayscale.</p><p>I am showing here a few fun examples that you can also try in your python IDE.</p><h4>1. Create your own image</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AmpvS_ATw1njOQixEstsiQ.png" /></figure><h4>2. Merge 2 images</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NH3hJeE9o5_aGJz1jq5vxg.gif" /></figure><h4>3. Swap images</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i2wk5DrfOObZ7zwjofGBTw.gif" /></figure><h3>For any doubt, suggestions, or feedback connect to me on LinkedIn.</h3><p><a href="https://www.linkedin.com/in/dakshjain09/">Daksh Jain - Azure Cloud &amp; DevOps Intern - Piramal Glass | LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78edacf5aee3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>