<?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 Arpana Mehta on Medium]]></title>
        <description><![CDATA[Stories by Arpana Mehta on Medium]]></description>
        <link>https://medium.com/@winter-code?source=rss-c484705e735------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*5tBkxJs15UwaXRR1</url>
            <title>Stories by Arpana Mehta on Medium</title>
            <link>https://medium.com/@winter-code?source=rss-c484705e735------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 08:20:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@winter-code/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[Vertex AI AutoML: Tutorial to create classification models]]></title>
            <link>https://medium.com/google-cloud/unlock-the-power-of-your-data-google-clouds-vertex-ai-automl-172ac3b4b032?source=rss-c484705e735------2</link>
            <guid isPermaLink="false">https://medium.com/p/172ac3b4b032</guid>
            <category><![CDATA[automl]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[vertex-ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Arpana Mehta]]></dc:creator>
            <pubDate>Tue, 10 Oct 2023 10:08:57 GMT</pubDate>
            <atom:updated>2023-11-03T06:10:37.614Z</atom:updated>
            <content:encoded><![CDATA[<h4>Build high quality models with your datasets without writing any code.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bxrpjW2rL0buDZAYdujHKQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@christinhumephoto?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Christin Hume</a> on <a href="https://unsplash.com/photos/mfB1B1s4sMc?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a></figcaption></figure><p>In today’s data-driven world, organizations are constantly seeking ways to harness the power of their data to make informed decisions and gain a competitive edge. Machine learning has emerged as a crucial tool in this endeavor, allowing businesses to extract valuable insights and predictions from their data. However, machine learning model development can be a process often requiring a high level of AI expertise.</p><p>Google Cloud’s AI portfolio has been designed to cater to all kind of users — whether <strong>business user, developer or an AI practitioner</strong>. <br>If you are an organisation or user looking to get value out of your rich dataset without having to write any code, you can explore Vertex AI AutoML. AutoML offers a <strong>GUI tool</strong> with an intuitive guide to help you with the <strong>end-to-end process</strong> of ML model <strong>development and deployment</strong>.</p><p>The whole process is automated: automatically train your model, automated feature engineering, model selection, tuning before putting it into production and finally an automatic deployment of it with a click to start making predictions.</p><p>What used to take months can now be done in weeks or even a matter of days.</p><h3>📝 Steps to Create Classification Models</h3><p>Let’s delve into the process of creating classification models using Vertex AI AutoML, highlighting how it simplifies and expedites the entire journey.</p><h4>🗂️ <strong>Creating your dataset</strong></h4><p>To begin, you need a dataset. For this tutorial, we’ll assume your data is stored in Google Cloud Storage, but you can also upload it directly from your computer or use data stores in BigQuery. Preparing your data is a critical step, and Vertex AI AutoML allows you to work with structured data, images, or text, depending on your project’s requirements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g9qFNFFKWeQYci-YdruSEw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dPW8lBRkLRit9muiv33j7A.png" /><figcaption>Create Dataset &gt; Select source [Screenshot by author]</figcaption></figure><h4>🛠️ Training your model</h4><p>Below are the steps to follow once your dataset is created:</p><ol><li>Go to the Google Cloud Console and navigate to Vertex AI &gt; Model Registry.</li><li>Click on the “Create Model” button.</li><li>Select the appropriate dataset you prepared in the previous step.</li><li>Choose to create a model using AutoML for quick and hassle-free model building. Alternatively, you can opt for custom training if you have specific frameworks like TensorFlow or XGBoost in mind. This blog focuses on AutoML so we will use the first option.</li><li>Customize your model easily by specifying which fields to include or exclude from your training data.</li><li>Set the number of nodes per hour for training, starting with a small number to save costs initially. The training time may vary, typically taking around 5–6 hours or more, depending on your dataset’s size and node configuration.</li><li>Once trained, view your model evaluation fields after navigating to your model in the Model Registry to assess its performance.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*Dlb0QjeixI7fdlHHuYlHeg.gif" /><figcaption>[Screenshots by Author] <strong>And that’s it! These straightforward steps encapsulate the process of building classification models using Vertex AI AutoML.</strong></figcaption></figure><h3>Deployment and Responsible AI</h3><p>But Vertex AI AutoML doesn’t stop at model creation. Once your model is ready, you can seamlessly deploy and test it within the same user interface using Vertex AI endpoints. This streamlined deployment process saves you valuable time, ensuring that your models are ready to provide predictions and insights to your organization swiftly.</p><h4>Understanding Model Outputs with Feature Attribution</h4><p>One of the key features that Vertex AI AutoML offers is feature attribution. This feature helps organizations adhere to the principles of responsible AI by shedding light on how the model makes decisions and which features contribute most to the model’s outputs. It doesn’t keep the model as a black box, even for someone who is a beginner in this space.</p><p>Feature attribution allows you to:</p><ul><li><strong>Interpret Model Outputs:</strong> By understanding the contribution of each feature, you gain insights into why the model makes specific predictions. This transparency is essential for responsible AI, as it helps you ensure that your model’s decisions are fair and unbiased.</li><li><strong>Identify Model Biases:</strong> Feature attribution can reveal any biases present in your model by highlighting which features have the most significant impact on predictions. This insight empowers you to take corrective measures and align your model with ethical standards.</li></ul><h3>Use Cases Beyond Classification</h3><p>While we used Vertex AI AutoML for classification in this blog, it’s essential to note that it’s a versatile tool that can be applied to various machine learning tasks. Here are some additional use cases:</p><ul><li><strong>Forecasting: </strong>You can use Vertex AI AutoML for time series forecasting, helping you predict future trends and make informed decisions based on historical data.</li><li><strong>Regression Models:</strong> It’s equally adept at building regression models, which are used to predict continuous numerical values, making it valuable for tasks like price prediction and demand forecasting.</li></ul><p>In conclusion, Google Cloud’s Vertex AI AutoML simplifies the process of building machine learning models while promoting responsible AI practices. Its ease of use, automation, and feature attribution reduce the barriers to entry for those without extensive machine learning expertise. To learn more about Vertex AI, head to the <a href="https://cloud.google.com/vertex-ai/docs/tutorials/image-recognition-automl">these tutorials</a> and play with image, text, tabular or video format datasets.</p><p>Happy building! 🖥️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=172ac3b4b032" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/unlock-the-power-of-your-data-google-clouds-vertex-ai-automl-172ac3b4b032">Vertex AI AutoML: Tutorial to create classification models</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[To containerize or not — check if you are ready!]]></title>
            <link>https://medium.com/google-cloud/to-containerize-or-not-c3366c55f0b?source=rss-c484705e735------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3366c55f0b</guid>
            <category><![CDATA[application-modernization]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[application]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[containers]]></category>
            <dc:creator><![CDATA[Arpana Mehta]]></dc:creator>
            <pubDate>Wed, 10 Aug 2022 21:10:50 GMT</pubDate>
            <atom:updated>2022-08-15T13:55:48.552Z</atom:updated>
            <content:encoded><![CDATA[<h3>To containerize or not — that is the question</h3><h4>Google Cloud brings you a free tool to determine how ‘fit’ your application is, to move to containers.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*34wVEr2NcPMmTSt9WwAx4Q.jpeg" /><figcaption>Containers | Photo by <a href="https://unsplash.com/@ventiviews?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Venti Views</a> on <a href="https://unsplash.com/s/photos/container?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Microservices are smaller &amp; simpler services leading to<strong> </strong>faster innovation, better products. And a lot other cool things!<br>Despite knowing the benefits, sometimes it can be difficult to decide if you are ready to containerize your applications. And if yes, how do you go about it? Will you need to write things from scratch? Can little-to-no refactoring itself do the job? These questions can have subjective answers and one might end up contemplating the decision for long.</p><p>If you don’t want to procrastinate like me, you can simply use the ‘<strong>Modernisation fit</strong>’ tool provided by Google Cloud. The tool generates a report which — as the name suggests — <strong>determines how ready your application is for moving to a modern platform</strong>. Based on the results you can decide whether you can move with little-to-no change, should you refactor, or completely re-write it. This is a quick, free and objective way.</p><blockquote>In this blog we will see how to use this tool for an application running on a virtual machine to check if we should move it to containers running on GKE.</blockquote><p>The generated assessment report describes any issues that must be resolved before migration, and an overall fit assessment of either:</p><ul><li>Excellent fit.</li><li>Good fit, with some findings that might require attention.</li><li>Needs <strong>minimal</strong> work before migrating.</li><li>Needs <strong>moderate</strong> work before migrating.</li><li>Needs <strong>major</strong> work before migrating.</li><li>No fit.</li><li>Insufficient data.</li></ul><p>If you are curious how the tool determines the fit, check out this <a href="https://cloud.google.com/migrate/containers/docs/mfit-how-it-works">doc</a>.</p><h3>So, how to use it?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bc-lRAO6csGD6LCGDA9bCA.jpeg" /><figcaption>Overview | Image by Author</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7465060a40b707d3b106117838aa0e1d/href">https://medium.com/media/7465060a40b707d3b106117838aa0e1d/href</a></iframe><h4><strong>Generating readable report</strong> —</h4><p>Search for <a href="https://cloud.google.com/anthos">Anthos</a> in the GCP console search bar and go to the <a href="https://medium.com/console.cloud.google.com/anthos/migrate/migrations">Migrate to Containers</a> section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_flFgVaOsiLERsbR" /><figcaption>Anthos &gt; Migrate to containers | Screenshot by Author</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ep3yQPGrM4lVzwDbsgedTg.png" /></figure><p>Click on ‘Open fit assessment report’. It will ask for a json file. Browse through downloaded files and upload the file that you had downloaded from cloudshell, <em>app-mfit-report.json</em> in my case. A new screen appears and a report is generated under ‘My reports &gt; Assessed VMs’ section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7ZlVYGXVdnGnQ7GERYAakQ.gif" /><figcaption>Upload the json, click on report name and read through details! | GIF by author arpana_naa 👩🏻‍💻</figcaption></figure><p>Click on the name of the report to view it. Read through the details. You can see the application judges what is a good fit or not, and suggests changes required as well. <br>This is a free tool, so you can try it out even if you are curious to see the report for your own applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s1YkH0UhNhntEcfmFkArxQ.png" /><figcaption>A section of the report. | Screenshot by author</figcaption></figure><p>Rules here like ‘<strong><em>ATL1APP-x</em></strong>’, etc imply what is a fit platform. For example, ‘<strong><em>A1L-APP-3’</em></strong> means you have docker running in a VM, consider running it directly on GKE.</p><p>You can read other rule inferences <a href="https://cloud.google.com/migrate/containers/docs/mfit-rules">here</a>. It is quite amazing to me what this tool can do! To know more about the mFit tool, or to check what other platforms you can check your readiness for, head to <a href="https://cloud.google.com/migrate/containers/docs/mfit-about#modernization_journeys">this section</a> in the Google Cloud docs.</p><p>If you have any questions, feel free to drop a comment, or reach out to me on <a href="https://www.linkedin.com/in/arpana11/">Linkedin</a>/<a href="https://twitter.com/arpana_naa">Twitter</a>! 💁🏽‍♀️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3366c55f0b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/to-containerize-or-not-c3366c55f0b">To containerize or not — check if you are ready!</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A year (and some more time) at Google!]]></title>
            <link>https://medium.com/plain-simple-software/an-year-and-some-more-time-at-google-by-arpana-1b735a0c8f96?source=rss-c484705e735------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b735a0c8f96</guid>
            <category><![CDATA[software]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[experience]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Arpana Mehta]]></dc:creator>
            <pubDate>Sun, 08 May 2022 14:46:40 GMT</pubDate>
            <atom:updated>2022-07-06T14:26:28.301Z</atom:updated>
            <content:encoded><![CDATA[<h4>Tech Careers</h4><h3>A year (and some more time) at Google</h3><h4>Arpana put togethers her favourite moments at work from the past year as a customer engineer fresh out of college.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hOdp7zMbPsfaRXTg16PhzA.jpeg" /><figcaption>OK Google!</figcaption></figure><p>6 months ago, I wrote my first technical blog post. It is something I wanted to do for a long, long time but always lacked the confidence but.. now, here you are, on my blog, reading something written (and published online!) by yours truly.</p><p>Writing online can sometimes seem like throwing your message in an ocean but Google search taught me No! And so did my manager and team lead, and I can never be thankful enough to both of you.</p><p>Well, this year has been about trying out a lot of new things and I decided to put this together in the best way I know, by writing about it. This is more a memoir for me (and not a tech blog post), and a lot of gratitude spilling out time and now. I hope you enjoy reading it.</p><p>Before we rewind to Feb 2021, I am going to say something you have already heard a million times — That thing you have been planning to do for a long time but putting off because you are not ready? Do it. The job opening you think you will apply to after doing 150 Leetcode problems, the friend you’ve been meaning to call, the course you have kept on hold for months now, do it. And if you cannot complete it today, at least begin somewhere. <br>Not able to call that friend? Leave a text. :)</p><h3>Nathan Howe on Twitter: &quot;- An imperfect solution now is better than a perfect solution that will never happen.- Doing the thing is often less painful than thinking about doing the thing.- Acknowledging how the problem is affecting you can reduce its power over you.10/ / Twitter&quot;</h3><p>An imperfect solution now is better than a perfect solution that will never happen.- Doing the thing is often less painful than thinking about doing the thing.- Acknowledging how the problem is affecting you can reduce its power over you.10/</p><p>I joined Google on February 1st, 2021. I had been working at <a href="https://www.codingal.com/">Codingal</a>, an ed-tech startup based in Bengaluru for about 7 months as a developer on contract, had my farewell there on Jan 28th, and so I was also a little sad about having left my first team out of college (and an absolutely lovely one that!). I was wondering if not taking a break before my joining was a good idea or not, but living in the pandemic we are, my corp laptop arrived a week later due to logistic issues. So yes, I got the break. Going with the flow sometimes?</p><h4>February 2021</h4><p>Day 1 Week 1 saw a 10 am meeting. Huge transition for somebody who was doing after-dinner debugging sessions just a week ago. Thankfully the excitement/first-day-fears/the-fear-of-unknown kept me up! :D</p><p>My fav memory from feb is my birthday which was just about a week later. My corp laptop had just arrived — a little late but sitting on my desk were flowers perfectly timed and a celebration disguised in a ‘quick-sync’ meeting. I was on cloud nine! People who know me are guessing I was all teary, and yes you are right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*Vx7qWOH6fEXtpHfGoG3tAg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*xc-Wk82SQkMknJxwkzAtbw.jpeg" /><figcaption>Grateful! ❤️</figcaption></figure><p>Despite the remote onboarding and all the confusion of being in a new situation, February was a very warm welcome. ❤</p><h4><strong>March 2021</strong></h4><p>This month was about ramping up as a GCP Googler — exploring products on the cloud, going through documentation, running small POCs for myself to get hands-on with the most commonly used solutions, and meeting a lot of people 1:1. (in rectangular screens though but still realize how kind everybody is.)</p><p>And then I got my first GCP certification — Associate Cloud Engineer and again, sitting on my desk were flowers. 🥺</p><p>Needless to say, I was very happy, but my mother was more.</p><h4>April 2021</h4><p>April had a cool microphone, a webcam, and a Google Cloud T-shirt (my first till then!) delivered at home. I did my first ever webinar and spoke about how serverless technology can reduce your time to market and operational overhead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*76Xj0STu42CZG2U5tnb-bw.jpeg" /></figure><p>It was such a great time working on the content for it, doing dry runs with the marketing team, getting feedback, and learning about presenting online. <br>My mother keeps all her very precious crockery packed, and after the event suggested that we pack the mic and place it on a shelf.</p><h4>May 2021</h4><p>I have always wanted to share what I learn and I am grateful for the people who trust on me to teach them something. In May I got this amazing opportunity to be a part of Jumpstart — a 6 week certification program for Google Cloud Customers to get ACE certified. Having completed my ACE cert very recently it was timed perfectly. I demoed in front of a live audience — 100+ people! Let us now take a minute to thank the demo gods for being in my favour (except for one small glitch which I was able to handle)<br>The demos, the glitch, the audience — everything feels great now. Now.</p><h4>June 2021</h4><p>I won’t talk a lot about this month, but in short it is my favorite. ❤️<br>It is in June I figured out the internal process to write for GCP community and wrote my first ever tech blog. Special shoutout to Nikhila and Rishi!</p><h4>July 2021</h4><p>Googlers joining in the pandemic only saw pictures of cool offsites of their peers in 100 different places, and offsite for us meant —</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*NLtT3TkqDDcKPZ9Eyz63eQ.png" /><figcaption>Maybe something non-work while being in a meet call? How do I know I have never been to a real offsite?</figcaption></figure><p>But then I, with my colleague Jolene, thought we should make this something fun! That was the goal, just fun. :D (and getting a budget for a lot of swag — hope Dav is not reading this)<br>We organised a 4 day offsite which is called the coolest remote offsite ever!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EfqaiDAA6GHQCUw3rY6yBA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*6S5_iaktQJpb-0L3oDTtvw.png" /><figcaption>JAPAC Scaled CE team on Offsite day 1: A communication workshop where we built a lego baby Yoda!</figcaption></figure><p>Anyway truth be spoken, I am desperately waiting for a real offsite. 🥺</p><p>Right after the offsite I took a tech writing course and wrote another blog — the learnings of which came from working with customers.</p><p>By this month I was solving and designing for customers on my own and trying to feel like I am ‘architecting’ these solutions for real. I would sometimes not look at the internal resources first and hop around youtube and the product documentations to test myself and see if I could think without looking at a solution. The validation came with my 2nd cert — Professional Cloud Architect.<br>Definitely so much more to learn but this milestone held huge importance to me as I had failed my first attempt to it and prepared for the new exam with resources spread across the internet. Worth it :)</p><h4>August 2021</h4><p>My team had been really kind and after having figured out the process internally to publish for GCP medium community, and written a few blogs — they asked me to share the learnings with them. I did a tech blogging session attended by 30+ people.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*hDWUJfh_thN5WBgw171UyA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UZGt247zXItCG_6QNfNfVg.png" /><figcaption>Snippets from the tech blogging session | Special thanks to Franziska and Carlos for guiding me about this process :)</figcaption></figure><p>I peer reviewed blogs for the CE interns batch ’21 (the first!), and it was an out of the world feeling to see their blogs published and appreciated!</p><p>August was also when I wrote my first performance review doc. (I started to!)</p><h4>September 2021</h4><p>And it took me two weeks to finish and finalise that doc — that with the help with our team lead who spent days editing the doc with us — Phew. When I had first started to write it I thought I did not work on anything meaningful at all, but I have realised it is easy to forget things over months.</p><p>✅ Now, I keep a running doc which I update monthly to not miss on anything of ‘impact’.</p><p>Anyhoo, In September we welcomed the second cohort of grad CEs and were assigned as ‘buddies’ to them! I call this experience ‘cute’ in my head. We kicked off a study group for their certification prep, something which was done for us when we had joined!</p><p>And I packed.</p><h4>October 2021</h4><p>To move to Bangalore! 👩🏻‍💻</p><p>Bangalore week 1 was greaaat. Luckily, covid numbers were dropping and it was during this time we were allowed a few get togethers in office — with a lot of permissions — but I met a few people from my team in-person in office the same week I came here!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PeKl1Jtqe9dxNy5vVmv2oQ.jpeg" /><figcaption>First day in office!</figcaption></figure><p>October is also when our performance reviews are released. I was too scared, almost like a parent-teacher meeting day in school. I don’t know what I was expecting but it was such a happy talk with my manager, us going over our notes and discussing plans moving forward! Yayy 🙈</p><h4>November 2021</h4><p>It takes a cool team to have an Oscar’s of their own! 🪄</p><p>And it is cooler to get an award at one :P <br>However this sounds to you, it was super duper amazing for somebody seeing that for the FIRST time. It wasn’t a formality! We had cool hosts, goofy scripts prepared (yes! PREPARATION!) and so much fun dressing up with a theme! I got the Diwali award, and I really did not have a speech ready. 😂</p><p>In November, I also co-presented Google Cloud Operations suite to an audience of 150+ people as part of Jumpstart. You can catch the recording <a href="https://cloudonair.withgoogle.com/events/apac-jumpstart-program">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/290/1*0TUH_hopuZqoQeZxFXZNPQ.gif" /><figcaption>A gif from the Jumpstart event!</figcaption></figure><h4>December 2021</h4><p>By December I was meeting a lot of customers every week (online), felt confident about some pillars in GCP and was able to fix and find solutions for even advanced use cases. <br>I shared my learnings on Cloud with the batch of Nooglers across APAC in a Cloud Orientation session and it felt nice being able to answer their questions (like yes, things really have progressed for me in some way!)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*e-mDJQGwoAKvkRDGqv0P4Q.png" /><figcaption>Google Bangalore, a glimpse :)</figcaption></figure><p>Oh, and I went to office quite a few times. Checking the breakfast menu a day before is always a good motivation to wake up early.</p><h4>2022 (January to now!)</h4><p>I started the year with Professional DevOps certification (4x certified now), and joined the team I was supposed to graduate to. A little earlier than the planned timeline!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*WopkNg7A27_wXDg8dem9_w.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qf6NoOny5MQafYMN8xaeYA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mtqUUxa1raa5ZzNuP4dbaw.jpeg" /><figcaption>Left to right: My father fixing my much awaited noogler hat, meeting corporate team members for the first time, fav item on the breakfast menu.</figcaption></figure><p>A new team, newer customers, newer challenges! If there was one thing constant across these months then it was ‘Kubernetes’. Everybody in my family is very familiar with this term now. :)</p><p>I have also met customer teams in person now, travelled for meetings.. And yes, I got promoted! 🤗</p><p>Over the past year I have learnt that there is something everybody can teach you. Helping somebody can be helpful to your own self too. Sometimes you are looking for mentors, sometimes mentors find you because they want to see you grow. Don’t shy away from bringing your authentic self!</p><p>If it was real life I could just stop mid sentence and look at you to conclude the monologue, but I hope you can sense we are at an end now. Hope you have a good day, especially since you read until this point :)</p><p>Otherwise too. :P</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*xl8yLFSs9eeHrTGaiKDtUA.jpeg" /><figcaption>Things I like apart from work — tea, books, plants and pictures. | I also manage to draw on weekends now! [Photo by Author]</figcaption></figure><p><em>Thoughts? I tweet at </em><a href="https://twitter.com/arpana_naa"><em>@arpana_naa</em></a><em>. </em>🐦</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b735a0c8f96" width="1" height="1" alt=""><hr><p><a href="https://medium.com/plain-simple-software/an-year-and-some-more-time-at-google-by-arpana-1b735a0c8f96">A year (and some more time) at Google!</a> was originally published in <a href="https://medium.com/plain-simple-software">Plain Simple Software</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serverless on GCP with Cloud Run]]></title>
            <link>https://medium.com/data-science/serverless-on-gcp-with-cloud-run-b3dab7a60e63?source=rss-c484705e735------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3dab7a60e63</guid>
            <category><![CDATA[google-cloud-run]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[eventing]]></category>
            <category><![CDATA[google-cloud]]></category>
            <dc:creator><![CDATA[Arpana Mehta]]></dc:creator>
            <pubDate>Tue, 09 Nov 2021 08:39:50 GMT</pubDate>
            <atom:updated>2021-11-14T12:26:44.251Z</atom:updated>
            <content:encoded><![CDATA[<h4>A platform built on top of Knative, ideal for both serving and eventing architectures</h4><p>Serverless has been in discussion for quite some time now, and it is here to stay. Moving infra management away from developers translates to their time and efforts aligned towards building and improving the product, and a faster time to delivery to market.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HNz9KIUuwj4FMREcxLF_YA.jpeg" /><figcaption>[Photo by <a href="https://unsplash.com/@nathanareboucas?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Nathana Rebouças</a> on <a href="https://unsplash.com/collections/18533954/researcher?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>]</figcaption></figure><blockquote>Cloud Run lets you run containerised applications on a fully managed serverless platform. In this blog, I will walk you through the following — <br><strong>a. Background<br>b. Steps for deploying your application<br>c. Overview of a sample app to showcase serving and eventing</strong></blockquote><p>Let’s dive in then!</p><h3><strong>a. Background</strong></h3><p>Cloud Run is built on top of Knative, which is a serverless framework that aims to provide the building blocks needed to <strong>make serverless applications a reality on Kubernetes</strong> and not necessarily be a full-blown solution by itself. If you have used k8s or even a managed version of k8s, you know it takes some (read a lot of!) time to get the hang of it. Cloud Run, as you will see with the sample application discussed in this blog, has simplified this management for you.</p><p>Interested in a more holistic understanding of when you should use cloud run? Head to <a href="https://cloud.google.com/blog/topics/developers-practitioners/cloud-run-story-serverless-containers">this blog</a>.<br>Ps: If you are a student or somebody planning to have a portfolio hosted somewhere, I would really recommend giving Cloud Run a try. 👩🏻‍💻</p><h3>b. The 3 simple (magical?) steps</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-sVulbjJYNZJvGiRhZRiZQ.png" /><figcaption>[Photo by Author]</figcaption></figure><ol><li><strong>Build — Package your application<br></strong>The sample app I am using here is <a href="https://github.com/winter-code/cloud-run-tutorial/">present on Github</a>. You can clone the repo for starters and experiment with the source code.<br>Now assuming you have your application code ready, note that it has a Dockerfile in it. We will create a container image using this file, and it will be stored in <a href="https://cloud.google.com/container-registry/?utm_source=google&amp;utm_medium=cpc&amp;utm_campaign=japac-IN-all-en-dr-bkws-all-pkws-trial-e-dr-1009882&amp;utm_content=text-ad-none-none-DEV_c-CRE_468709901001-ADGP_Hybrid%20%7C%20BKWS%20-%20EXA%20%7C%20Txt%20~%20Containers%20~%20Container%20Registry_container%20registry-general%20-%20Products-KWID_43700049545546359-aud-970366092687%3Akwd-197849459819&amp;userloc_9061993-network_g&amp;utm_term=KW_google%20container%20registry&amp;gclid=CjwKCAiA1aiMBhAUEiwACw25MQPg7NHPn--lq0BWMELwlgKRn-JOjZYpt8bqYbxiiJ3B3o7ulho4kxoClo4QAvD_BwE&amp;gclsrc=aw.ds">Container Registry</a>. This image will be used by our Cloud Run service when it needs to autoscale. Behind the hood it is a lot of work but for you this step only means cd to your source code folder where you have your Dockerfile and running this command — <br>gcloud builds submit --tag gcr.io/project-id/image-name .<br>You will be prompted to answer whether or not would you want to allow public invocation of the HTTP endpoints of your services. Answer accordingly, but of course this is something you can edit later on as well through the Cloud Run console.<br><em>Recommended: You can understand this command and it&#39;s parameters </em><a href="https://cloud.google.com/build/docs/running-builds/start-build-command-line-api#running_builds"><em>here</em></a><em>. This documentation also provides a comprehensive way to understand what happens during the &#39;build&#39; step.</em></li><li><strong>Deploy<br></strong>To deploy your app, simply run — gcloud run deploy<br>This step takes some time and you will be able to see the progress as your service is deployed from the image and the revision starts serving traffic. If the deployment is successful, the final result will show what percentage of traffic is being served by the deployed revision and what is the HTTP url you can use to access the service. Unsuccessful deployment will return an error with a url to the logs. These logs can be used to debug the issues with your deployment.<br>If you wish to deploy from an already existing container image, use this command — gcloud run deploy &lt;service-name&gt; --image &lt;image-url&gt;</li><li><strong>Accessing service<br>On successful deployment you can access your service using the service url that is output of the last command or find it on the console.<br></strong>curl &lt;service_url&gt; -H “Authorization: Bearer $(gcloud auth print-identity-token)&quot;<br>This identity-token contains user information and, is required when you have not allowed public invocation of your service.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_QlEULW3TZ-3tT43cBbbqg.png" /><figcaption>Every Cloud Run service has an HTTP endpoint that can even be mapped to a domain through the console itself. [Photo by Author]</figcaption></figure><h3>c. Overview — Serving and Eventing</h3><p>For most people, Serverless means Function-as-a-Service. The question sometimes is, when we can use ‘Cloud Functions’ which is GCP’s Faas offering directly for eventing architectures, then why Cloud Run?</p><p>For me, it is —</p><ul><li>Having the abstraction as containers which can be moved across platforms with little to no-code change</li><li>Ability to use any languages/runtime binaries</li><li>The choice to be able to try out advanced capabilities available with k8s deployments like traffic splitting, canary deployments, etc without having to have an added service mesh like <a href="https://cloud.google.com/learn/what-is-istio">Istio</a>.</li></ul><p>You can do these tasks right from the UI, or the gcloud command line if you prefer the terminal.</p><p>By ‘serving’ on Cloud Run I mean that your service is listening for requests at a particular PORT exposed by you. On the other hand, ‘eventing’ means that only when an action happens (event), a Cloud Run service is triggered. We will be using Pub/Sub as the connecting medium between our ‘event’ and ‘service’. Pub/Sub is where we will <strong>define ‘when X action happens, trigger Y service’</strong>.</p><p>Now coming to our sample app, if you are interested in getting hands-on with the cloud-run and you can fork <a href="https://github.com/winter-code/cloud-run-tutorial/">this repo</a> and follow the steps in the readme to proceed. Authentication, IAM roles and permissions needed for you to allow pub/sub to be able to trigger an internal service are well-defined in <a href="https://cloud.google.com/run/docs/tutorials/pubsub#integrating-pubsub">GCP docs</a>. Please have a look at these.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0uo1Z_HT4v6pD3aFdcKYfQ.png" /><figcaption>Overview — Architecture diagram</figcaption></figure><h4>Serving — Process web traffic</h4><p>In our sample application, serving is done via a ‘GET’ request that calls the endpoint associated with the service you deployed. When you hit the endpoint, an instance of your service is created and webpage is served. If another request is made to that endpoint within a certain period (timeout period) then the same instance continues to serve the new requests. Basically, Cloud run deployments can handle upto 80 concurrent requests. If your service does not receive any requests for 60 seconds the instance is killed.</p><h4>Eventing — Process asynchronous requests</h4><p>A common use-case in a lot of organisations is a web-hook triggering a service on an action by some user. I have created a simple web-hook in our sample itself (we all know, web-hooks are basically POST requests!) and also deployed a service (let’s call it service_1).</p><p>This web-hook will be manually triggered by us like a user on a website doing some action. This event will send a message to the pub/sub topic. The message is received by the subscription of this topic, which have their endpoint defined in push mode as the url for service_1 deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mBC8wJ9fr1DY2B0Dju0jIg.png" /><figcaption>Image showing how you can set the endpoint for each subscription in pub/sub — In our case it is our previously deployed service_1 [Image by Author — Screenshot from GCP console]</figcaption></figure><p>The sample application we are deploying in this blog has pub/sub integration needed and so you will need to have those APIs enabled and will need to follow steps to integrate pub/sub but if you are looking for some ready to be deployed stateless applications, you can pick and deploy any service from this <a href="https://github.com/as-a-service">GitHub repository</a> and use it’s url as the endpoint to be triggered.</p><blockquote>Steps — build, deploy, access endpoint!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MSczJSZ_Djot3y4XBY51Sg.jpeg" /><figcaption>[Photo by Author]</figcaption></figure><p>Hope you learnt something about the possibilities with Cloud Run. Please feel free to comment in any questions you might have with this deployment procedure or create an issue within the repo if you face any issues with the application code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3dab7a60e63" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/serverless-on-gcp-with-cloud-run-b3dab7a60e63">Serverless on GCP with Cloud Run</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AutoML NLP: Convert PDFs to JSONLs!]]></title>
            <link>https://medium.com/google-cloud/automl-nlp-convert-pdfs-to-jsonls-c01f1da0899?source=rss-c484705e735------2</link>
            <guid isPermaLink="false">https://medium.com/p/c01f1da0899</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Arpana Mehta]]></dc:creator>
            <pubDate>Sun, 19 Sep 2021 20:19:46 GMT</pubDate>
            <atom:updated>2024-03-21T14:42:02.370Z</atom:updated>
            <content:encoded><![CDATA[<h4>Learn to use the script provided by AutoML docs to convert your textual files to jsonl format.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i9R9dCrcspzJpYi6B3SOlA.png" /><figcaption>Screenshot from GCP <a href="https://cloud.google.com/natural-language/automl/docs/prepare#expandable-2">AutoML docs</a> [Photo by author]</figcaption></figure><p>If you started with anything related to AutoML NLP on GCP, you already know the first step. Convert your documents to .jsonl format before passing them as the training data. <a href="https://cloud.google.com/automl/docs">AutoML</a> documentation already provides you a python script but if you found the script a little tough to understand or use, you are not alone!</p><p>When I was going through the docs I wished there was <strong>a step-by-step guide to use the </strong><a href="https://cloud.google.com/natural-language/automl/docs/scripts/input_helper_v2.py"><strong>python script</strong></a>, so here it is.</p><h4>What is AutoML?</h4><p>AutoML is one of the building blocks of AI on Google Cloud Platform. It is especially useful when you want to create and train custom high-quality models and have limited machine learning expertise to do the same. It provides an interface to help you transfer your data to the algorithm to build your model. It automatically selects the best neural network architecture, and tunes the hyper-parameters for you based on your goal, basically saving manual effort in re-training and fine-tuning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uogTxM0a-lVa__VkjFBjew.jpeg" /><figcaption>The script provided in the docs is written in Python2. [ Photo by <a href="https://unsplash.com/@hiteshchoudhary?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Hitesh Choudhary</a> on <a href="https://unsplash.com/s/photos/python?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a> ]</figcaption></figure><h4>So, step 1 — Get your data in!</h4><p>I will not be writing about all steps in the process of creating and training a model on AutoML as you can find them very well documented <a href="https://cloud.google.com/natural-language/automl/docs">here</a>. Our focus is on the task causing a bit of friction.</p><p>Make sure your PDFs of size &lt; 2 Mb. If they contain pictures or any graphical data, you might want to read this <a href="https://towardsdatascience.com/how-to-extract-the-text-from-pdfs-using-python-and-the-google-cloud-vision-api-7a0a798adc13"><strong>article</strong></a> explaining how you can extract textual data from images in PDFs using the cloud vision API and of course, python.</p><h3>Converting PDFs to JSONL — in the gCloud shell</h3><p>This script can be run in the gCloud command line shell or if you have installed the gCloud SDK then you can run the script directly from your machine and convert the pdfs stored in GCS buckets in jsonl files. It is written in Python2 and takes in three arguments — <em>the script file name, path to pdf files and path to destination bucket</em>.</p><pre>python2 &lt;script&gt; gs://&lt;path_to_src_pdf&gt; gs://&lt;dest_bucket&gt;/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_uFtiDmMTKCxnyRzN22VkQ.png" /><figcaption>Upload the script and your source pdf files to a GCS bucket [Photo by author]</figcaption></figure><ol><li>Upload the <a href="https://cloud.google.com/natural-language/automl/docs/scripts/input_helper_v2.py">script</a> (input_helper_v2.py) and your source PDF(referred to as src.pdf later) file into a GCS bucket. Note the paths for these two documents.</li><li>Install python2 in cloud shell. sudo apt install python2</li><li>Create a GCS bucket in region (us-central1) and storage class set to standard. The region must be us-central1 for AutoML processing. (Data as of Sep’21)</li><li>Copy the script stored in your GCS bucket in your cloud shell home directory. gsutil -m cp gs://&lt;path_to_script&gt;</li><li>Step 4 was to load the script in our cloud shell VM’s home directory. Run ls to confirm if the script is copied successfully.</li><li>In the cloud shell, run python2 input_helper_v2.py gs://&lt;path_to_src_pdf&gt; gs://&lt;path_to_gcs_bucket&gt;/</li></ol><blockquote>If you want to convert multiple files at once, you can use *.extension instead of one file name. Example — *.pdf</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a26cb67590b6b849f2125a8dbceae749/href">https://medium.com/media/a26cb67590b6b849f2125a8dbceae749/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*bPbu_TLlMM4mCiwU" /><figcaption>JSONL file created after running script [Photo by author — Screenshot from GCP console &gt; cloud storage]</figcaption></figure><p>A CSV dataset with jsonl file URIs(which you can directly use for importing the training data) and a jsonl file has been created and stored in the destination GCS bucket specified by you. Head to <a href="https://cloud.google.com/natural-language/automl/docs/prepare#importing_training_documents">the docs</a> (importing your training data in the autoMl console) and continue building your custom model!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V2GWn1Z62HwcPQhuu4Fifg.jpeg" /><figcaption>Hope this guide is helpful to you! Do comment if face any issues. [Photo by author, inspired by <a href="https://medium.com/u/9b9e67983b04">Priyanka Vergadia</a> 🤗]</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c01f1da0899" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/automl-nlp-convert-pdfs-to-jsonls-c01f1da0899">AutoML NLP: Convert PDFs to JSONLs!</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Missing data points in your monitoring API response? Use page iterators!]]></title>
            <link>https://medium.com/google-cloud/missing-data-points-in-your-monitoring-api-response-use-page-iterators-81d27e954c70?source=rss-c484705e735------2</link>
            <guid isPermaLink="false">https://medium.com/p/81d27e954c70</guid>
            <category><![CDATA[stackdriver]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[gcp-security-operations]]></category>
            <dc:creator><![CDATA[Arpana Mehta]]></dc:creator>
            <pubDate>Mon, 09 Aug 2021 09:15:26 GMT</pubDate>
            <atom:updated>2021-09-22T14:12:29.599Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<h3>Getting started with Google Cloud Monitoring APIs — Part 3</h3><h4>Iterators simplify the process of paging through API responses. Learn to use page iterators to get all data points from the `list_time_series` call.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yPZap7X4nhqiLrkQZe-6wQ.jpeg" /><figcaption>Missing some data? [ Photo by <a href="https://unsplash.com/@franki?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Franki Chamaki</a> on <a href="https://unsplash.com/s/photos/data?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a> ]</figcaption></figure><p>Enterprises running on GCP often have multiple instances of a resource in different regions/zones for HA (High Availability) i.e. for providing a consistent level of uptime for prolonged periods.</p><blockquote>A GCP customer I worked with, had 9 routers set up in their cloud environment. These routers generated a data point with value as either 0 or 1 every minute, where ‘1’ denoted downtime of the router. Can you picture the number of data points in your head?</blockquote><blockquote>9 * 30 * 24 * 60 = something! Phew.</blockquote><p>My <a href="https://medium.com/google-cloud/fetching-monitoring-metrics-data-from-gcp-into-your-application-using-python-214358b0047e">last blog post</a> discusses how you can fetch these metric data points. When the API response returns more than 100,000 data points, like in the case above —388800 points, the response only contains the first 100,000 points and a nextPageToken which can be used to get the next set of points. This can be a little confusing. How can you use nextPageToken? This blog suggests two ways to which you can use to get all your data points.</p><h3>Where are all my data points?</h3><p>As a beginner using the monitoring APIs, it was quite difficult to understand why the response did not contain all the data points, especially when you did not pass a pageSize in the request along with parameters like filter or interval.<br>The answer is that, if thepageSize passed in the request is empty (not passed) or more than 100,000 results, the effective pageSize is 100,000 results. If view is set to FULL, this is the maximum number of Points returned.</p><h3>How can I get the remaining data points?</h3><p>Refer to the API response in detail <a href="https://cloud.google.com/monitoring/api/ref_v3/rest/v3/ListTimeSeriesResponse">here</a>.</p><pre>{<br>  &quot;timeSeries&quot;: [<br>    {<br>      object (<a href="https://cloud.google.com/monitoring/api/ref_v3/rest/v3/TimeSeries"><strong>TimeSeries</strong></a>)<br>    }<br>  ],<br>  &quot;nextPageToken&quot;: string,<br>  &quot;executionErrors&quot;: [<br>    {<br>      object (<a href="https://cloud.google.com/monitoring/api/ref_v3/rest/Shared.Types/Status"><strong>Status</strong></a>)<br>    }<br>  ],<br>  &quot;unit&quot;: string<br>}</pre><h4>Using nextPageToken directly</h4><p>As the documentation says, if there are more results than have been returned, then the nextPageTokenis set to a non-empty value.</p><p>To see the additional results, pass the nextPageTokenas the pageToken in the request for next call to this method. The response is a <strong>list of results/data points with a token for the next page</strong>, until you’ve reach a call where the nextPageToken is empty, implying all values are returned.</p><p>You are wondering isn’t this quite a long process? Well yes, making the calls yourselves and adding the token value yourself in every value is. That is why we are using pages.</p><h4>Using page iterators</h4><p>Iterators simplify the process of paging through API responses. API clients that have methods that follow the list pagination pattern can return an <a href="https://googleapis.dev/python/google-api-core/latest/page_iterator.html#google.api_core.page_iterator.Iterator"><strong>Iterator</strong></a>. You can use this iterator to get <strong>all</strong> of the results across all pages.</p><pre>results = client.list_time_series(request={ ... })</pre><p>Take a case where results contains the response from your last API call with appropriate parameters in the request. Now, we know that if the response contains more than 100,000 points the response will be paginated. Simply use the below code snippet to iterate over the pages and store all your points in a separate list. This list stays in memory. Later, we can use the points from the list instead of making calls to the API for each page.</p><pre>all_points = []<br>for page in results.pages:<br>    for series in page.time_series:<br>        for point in series.points:<br>             all_points.append(point)</pre><p>Since we have not mutated any points or changed them to list objects, we can still use the native methods that points have to get the time and corresponding values (metric value) at that time.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b43ec5873a107cfce30cafbe805658b9/href">https://medium.com/media/b43ec5873a107cfce30cafbe805658b9/href</a></iframe><h4>Some recommendations straight from the developers of the monitoring APIs —</h4><p>Pagination as we can imagine, is making one server call per page, and hence is quite slow. A better approach when you have a large number of points is to structure your filters better so that the number of points in the response becomes lesser than 100,000. Explaining it using the router example from the beginning of the blog —</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gwh4ElgPDfTIF0AfGxrdxQ.jpeg" /><figcaption>Retrieved all the data now :) [ Photo by <a href="https://unsplash.com/@franki?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Franki Chamaki</a> on <a href="https://unsplash.com/s/photos/data?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a> ]</figcaption></figure><p>If all the routers have about the same number of points, you could try sending 9 queries that each have a filter with “router = x” to just get each router’s data individually. Each of the responses can then have values fitting in one page. You can use list_time_series with view set to HEADERS to get just the values of x (headers gives you just which timeseries exist without any of the actual data).</p><h3>Understand `list pagination` in detail</h3><p>Since these methods follow a common scheme for all APIs with paginated response, you can check <a href="https://cloud.google.com/apis/design/design_patterns#list_pagination">list pagination</a> in the Google API Style Guide for more details.<br>I actually found the solution for the monitoring API problem by referring to a lot of answers on the google APIs for calendar, because, yes, they follow the same style guide. This also makes a case for how it is important to follow best practices while writing your code. Patterns make it easy for people to assimilate information, and use it further.</p><p>Hope you found this useful!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HZNHwm0jMNuVl7Zvn9mNlg.jpeg" /><figcaption>[Photo by Author — Ending the monitoring series here with a little digital art I tried ! 👋🏼]</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81d27e954c70" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/missing-data-points-in-your-monitoring-api-response-use-page-iterators-81d27e954c70">Missing data points in your monitoring API response? Use page iterators!</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fetching monitoring metrics data from GCP into your application — Using python]]></title>
            <link>https://medium.com/google-cloud/fetching-monitoring-metrics-data-from-gcp-into-your-application-using-python-214358b0047e?source=rss-c484705e735------2</link>
            <guid isPermaLink="false">https://medium.com/p/214358b0047e</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[gcp-security-operations]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Arpana Mehta]]></dc:creator>
            <pubDate>Mon, 26 Jul 2021 08:25:53 GMT</pubDate>
            <atom:updated>2022-08-24T14:49:00.697Z</atom:updated>
            <content:encoded><![CDATA[<h3>Getting started with Google Cloud Monitoring APIs — Part 2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1JRkU_O63GncmX01QYCxTA.png" /><figcaption>A typical monitoring dashboard on GCP ( For compute instances )</figcaption></figure><p>So you have a project on GCP. You have set up your monitoring dashboards in the console, all the graphs are making sense and through just one single UI, you are able to keep a check on your whole GCP environment. Hi, you monitoring expert! Thank you for managing everything so well.</p><p>Now, what if you want these metric graphs in some part of your application? Maybe you want to format the graphs with your brand colors, pull out real-time data and present it on your website.</p><blockquote>‘Our APIs have an impressive response time 24x7! — Here, have a look at this graph on our website itself.’</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FvVbZccqMzFF3Ui-qJuMKA.jpeg" /><figcaption>Get me those graphs! [Photo by <a href="https://unsplash.com/@mjessier?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Myriam Jessier</a> on <a href="https://unsplash.com/s/photos/computer?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>]</figcaption></figure><p>In my previous <a href="https://medium.com/google-cloud/confused-with-custom-monitoring-metrics-on-gcp-c514cd4a776b">blog</a> in this series, I wrote about how you can create custom monitoring metrics using the Python client library for Google Cloud monitoring APIs, and thereby automate this process. In this blog, I will be explaining how to use the list_time_series method to read metric data and fetch it for our use. Quick reminder, metric data is referred to as ‘time-series data’.</p><h3>Setting the scene</h3><p>I highly recommend going through the previous <a href="https://medium.com/google-cloud/confused-with-custom-monitoring-metrics-on-gcp-c514cd4a776b">blog</a> to get an understanding of metrics, how they are stored and how you should authenticate your service account to use these APIs directly or through the client library.</p><p>I have tried this in a <a href="https://cloud.google.com/notebooks#:~:text=Notebooks%20is%20a%20managed%20service,and%20deploy%20models%20into%20production.">Jupyter notebook</a> on GCP, but you can do this in either a local notebook or use the methods explained here, in your application code. To install google-cloud-monitoring in your environment —</p><pre>pip install google-cloud-monitoring</pre><p>You can fetch metric data for any <a href="https://cloud.google.com/monitoring/api/v3#monitored_resources">monitored resource</a> on GCP. You can find a list of metric names for reference in your application in the GCP documentation, or experiment with the metric explorer under the monitoring section on your GCP console. The metrics explorer lets you filter out metrics based on resource types, resource IDs, etc and also helps you build queries for these filters which can be used in your application. If filters don’t make sense here, don’t worry we will be discussing them in the next section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xeUABJccpNC_yIYXzpIbag.png" /><figcaption>Using filters in the metric explorer through the GUI. Alternatively, click on the ‘MQL’ tab to get the equivalent query.</figcaption></figure><h3>About the ‘list_time_series’ method</h3><p>The list_time_series is the method in the client library that we will use to fetch our time series data.</p><pre>results = client.list_time_series(<br>    request={<br>        &quot;<strong>name</strong>&quot;: project_name,<br>        &quot;<strong>filter</strong>&quot;: &#39;metric.type = &quot;compute.googleapis.com/instance/cpu/usage_time&quot;&#39;,<br>        &quot;<strong>interval</strong>&quot;: interval,<br>        &quot;<strong>view</strong>&quot;: monitoring_v3.ListTimeSeriesRequest.TimeSeriesView.FULL,<br>    }<br>)</pre><p>The <strong>request</strong> sent using this method is an abstraction over the API to call the list method, as it might be understood from the name and can be compared to the request body in a similar API call. Here we have four parameters in the example ( order not important ) —</p><ol><li>name : The name of the project from where you want to fetch the monitoring metric data.</li><li>filter : This is where you specify the metric you want the data of. In this example, we only have a type but it can also have other <a href="https://cloud.google.com/monitoring/custom-metrics/reading-metrics#time_series_filters">filters</a> as I mentioned earlier. I mostly use the metric explorer to build my filtering query. Essentially we want the output from the monitoring UI to be the one we see in our application, so validating your query using the metric explorer is a good idea.</li><li>view : There can be two responses possible from this method — <br><strong>i. FULL view:</strong> The response contains the metadata of your metric and the time series data as points<br><strong>ii. HEADER view</strong>: The response only contains the meta data of your metric</li><li>interval : The time window from which you want the data. You have to specify <strong>the parameters </strong>start_time<strong> </strong>and<strong> </strong>end_time<strong> </strong>where the time input is in <a href="https://www.epoch101.com/">unix epoch</a>. It is a notion to donate your time value as the number of seconds that have elapsed since January 1, 1970 at midnight UTC time.<br>Note that <strong>by default, data is stored only for 6 weeks</strong>. If you wish to persist you monitoring data for longer, consider moving it to a database like cloud storage or BigQuery.</li></ol><pre>interval = monitoring_v3.TimeInterval(<br>    {<br>        &quot;<strong>end_time</strong>&quot;: {&quot;seconds&quot;: start_time, &quot;nanos&quot;: nanos},<br>        &quot;<strong>start_time</strong>&quot;: {&quot;seconds&quot;: (start_time - seconds_in_a_month ), &quot;nanos&quot;: nanos},<br>    }<br>)</pre><h3><strong>Fetching and plotting the metric data</strong></h3><p>I have used the list_time_series in the code snippet below and used matplotlib (plotting library in Python) to plot the points returned as response by the API.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fd9b0b69244e44e6ed35e657956332e0/href">https://medium.com/media/fd9b0b69244e44e6ed35e657956332e0/href</a></iframe><blockquote>Note: In the above code snippet, results store the API response. results is an object you can iterate over to get metrics data. Each object is the collection of points for one resource/metric kind depending on the filter you specified. Time series data i.e. metric data is stored in points and can be accessed by iterating over result.points where result is an object in results.</blockquote><p>Unlike me, please learn more about <a href="https://matplotlib.org/">Matplotlib</a> and make better use of the metric data. This can be a good starting point, but way to go! Here’s the output plot from the code snippet above:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C5mY3lfJMtU6g2o3XdWu2g.png" /><figcaption>A rather non-presentable graph but please make use of your aesthetic and technical brain.</figcaption></figure><p>If you have more than 10,000 data points in your response, you might not be able to see all the data points in the response. This is because, for a large response, the response is automatically paginated by the API and what is returned is the <strong>first page</strong> of the whole output, containing <strong>10,000</strong> points. I have discussed this in detail in <a href="https://towardsdatascience.com/missing-data-points-in-your-monitoring-api-response-use-page-iterators-81d27e954c70">this blog</a> below. :)</p><p><a href="https://medium.com/google-cloud/missing-data-points-in-your-monitoring-api-response-use-page-iterators-81d27e954c70">Missing data points in your monitoring API response? Use page iterators!</a></p><p><strong>Note: </strong>This blog post is written keeping in mind the product’s and the client library’s current latest version. For more information on monitoring on GCP, refer to <a href="https://cloud.google.com/monitoring/docs">https://cloud.google.com/monitoring/docs</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=214358b0047e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/fetching-monitoring-metrics-data-from-gcp-into-your-application-using-python-214358b0047e">Fetching monitoring metrics data from GCP into your application — Using python</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating custom monitoring dashboards on GCP — using Python!]]></title>
            <link>https://medium.com/google-cloud/confused-with-custom-monitoring-metrics-on-gcp-c514cd4a776b?source=rss-c484705e735------2</link>
            <guid isPermaLink="false">https://medium.com/p/c514cd4a776b</guid>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[gcp-app-dev]]></category>
            <dc:creator><![CDATA[Arpana Mehta]]></dc:creator>
            <pubDate>Fri, 11 Jun 2021 20:48:03 GMT</pubDate>
            <atom:updated>2022-08-24T14:50:41.314Z</atom:updated>
            <content:encoded><![CDATA[<h3>Getting started with Google Cloud Monitoring APIs— Part 1</h3><blockquote>If you have your application deployed, you particularly want to focus on pushing features as soon as possible and not spend time checking if your services are down, right? This is where monitoring comes into picture.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H-iVQX4tYqFablCwo-xtTg.jpeg" /><figcaption>[Photo by <a href="https://www.pexels.com/@mikael-blomkvist?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Mikael Blomkvist</a> from <a href="https://www.pexels.com/photo/simple-workspace-at-home-6476587/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Pexels</a>]</figcaption></figure><p>Google cloud operations suite, earlier known as Stackdriver provides a built-in monitoring dashboard for you to check various metrics from your projects on either GCP or in hybrid environments.</p><p>Let’s say you want to make your custom monitoring dashboards on GCP, and want to automate this process (or just that you are a developer more comfortable in the terminal/editor and don’t want to use the UI ). You can use google-cloud-monitoring — a client library for the monitoring APIs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*zYCGOmiveN6u8W2fNKrvpA.jpeg" /><figcaption>Source: Reddit</figcaption></figure><p>In this blog, I’m going to create a custom metric first and then use it to create our dashboard, without leaving our editor! ✨<br>Our focus will be on two methods specifically — create_metric_descriptor and create_time_series . You don’t necessarily have to know how APIs work but some python knowledge is a good-to-have.</p><h3>What is a metric anyway?</h3><p>Metrics on GCP have the three elements listed below:</p><ul><li>A set of <strong>data points</strong>.</li><li><strong>Metric-type</strong> information, which tells you what the data points represent.</li><li><strong>Monitored-resource </strong>information, which tells you where the data points originated. This can be anything from your VMs to K8s clusters or any task that has been defined by you.</li></ul><p>You can try out creating custom metrics in a Jupyter notebook on the AI platform in your project on GCP or follow these steps for authentication to use the monitoring APIs — <a href="https://cloud.google.com/monitoring/docs/reference/libraries#setting_up_authentication">Setting up authentication</a>.</p><p>First things first! If you are a a python developer you know the drill already :D</p><pre>pip install google-cloud-monitoring</pre><h3><strong>Creating custom metrics and time series</strong></h3><p>Your custom metric should have a <strong>string identifier unique</strong> among all the metric names in your google cloud project, and prefixed with custom.googleapis.com. So if your metric is called my-metric, the identifier will look like custom.googleapis.com/my-metric.</p><blockquote><strong>Note:</strong> Because these metric identifiers have to be unique, you can understand that if you try to write data to an existing metric i.e. one that already has a defined source, you will receive an error. I was stuck at a 403 for some time! A tip that always works for me is to refer to the library’s source code to see what is happening how! Or simply keep printing out stuff at every step 😛</blockquote><p>Now coming to <strong>monitored resource</strong>, let’s say this custom metric of ours is being generated by a virtual machine, so your resource type is gce_instance. You can find a list of resource types <a href="https://cloud.google.com/monitoring/custom-metrics/creating-metrics#custom-metric-resources">here</a>. You can add a field ‘labels’ to specify any labels you want for the resource. For example, instance_id or zone. Remember that this is <strong>additional information about our data source</strong>.</p><blockquote>.create_metric_descriptor()</blockquote><p>If you write metric data when a metric descriptor for that custom metric doesn’t yet exist, then a metric descriptor is created automatically. There is a limit to auto-creation of metric descriptors, so prefer adding this data yourself.<br>Of the two components for the descriptor — metric_kind and value_type , I was particularly confused with the metric kind. The <em>kind</em> of metric data tells you how to interpret the values relative to each other. It can be either GAUGE , which represents the value of a metric at a particular point, unlike DELTA , where value measures the change since it was last recorded.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/620dac9ac27aba6a9f2af976715d3329/href">https://medium.com/media/620dac9ac27aba6a9f2af976715d3329/href</a></iframe><pre>descriptor = client.create_metric_descriptor(name=project_name, metric_descriptor=descriptor)</pre><p>Now that we have a custom metric, we can write our data points to display them on the monitoring dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OIE2xQdqQgvlR9C4rNTKOg.png" /><figcaption>Look for your custom metric in monitoring&gt;metric explorer</figcaption></figure><p>You write data points by passing a list of <a href="https://cloud.google.com/monitoring/api/ref_v3/rest/v3/TimeSeries">TimeSeries</a> objects to <a href="https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/create">timeSeries.create</a>. The maximum list size is 200. Each <a href="https://cloud.google.com/monitoring/api/ref_v3/rest/v3/TimeSeries">TimeSeries</a> object must contain only a single <a href="https://cloud.google.com/monitoring/api/ref_v3/rest/v3/TimeSeries#Point">Point</a> object. If you want to write more than one point to the same time series, then use a separate call to the <a href="https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/create">timeSeries.create</a>.</p><blockquote>.create_time_series()</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0abc40e99cbcca238a9546c04d8cc0e1/href">https://medium.com/media/0abc40e99cbcca238a9546c04d8cc0e1/href</a></iframe><p>You can thus push values against an interval for a particular time series, by changing the value for key double_value and running the code a few times. This can be used to push data as soon as a change in metric value happens. You can create triggers using async tasks in celery or make use of cloud pub/sub. Don’t write data to a single time series faster than one point each 10 seconds.</p><p>Check the monitoring dashboard under metrics explorer to watch your time series making waves! 🥳</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*38aJDzFmA7DPfzU6gjE_dw.png" /><figcaption>After writing a few more values for the time series</figcaption></figure><p>For more information, refer to <a href="https://cloud.google.com/monitoring/custom-metrics/creating-metrics#writing-ts">https://cloud.google.com/monitoring/custom-metrics/creating-metrics</a>, or ping me on twitter at @<a href="https://twitter.com/arpana_naa">arpana_naa</a>!</p><p>Find the other posts in this series at — <a href="https://medium.com/google-cloud/fetching-monitoring-metrics-data-from-gcp-into-your-application-using-python-214358b0047e">Part 2</a>, <a href="https://medium.com/google-cloud/missing-data-points-in-your-monitoring-api-response-use-page-iterators-81d27e954c70">Part 3</a>.</p><p><a href="https://medium.com/google-cloud/fetching-monitoring-metrics-data-from-gcp-into-your-application-using-python-214358b0047e">Fetching monitoring metrics data from GCP into your application — Using python</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c514cd4a776b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/confused-with-custom-monitoring-metrics-on-gcp-c514cd4a776b">Creating custom monitoring dashboards on GCP — using Python!</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>