<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Get started with Pyroscope on Grafana Labs</title><link>https://grafana.com/docs/pyroscope/v1.18.x/get-started/</link><description>Recent content in Get started with Pyroscope on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/pyroscope/v1.18.x/get-started/index.xml" rel="self" type="application/rss+xml"/><item><title>Ride share tutorial with Pyroscope</title><link>https://grafana.com/docs/pyroscope/v1.18.x/get-started/ride-share-tutorial/</link><pubDate>Wed, 08 Apr 2026 14:38:28 +0000</pubDate><guid>https://grafana.com/docs/pyroscope/v1.18.x/get-started/ride-share-tutorial/</guid><content><![CDATA[&lt;!-- INTERACTIVE page intro.md START --&gt;
&lt;h1 id=&#34;ride-share-tutorial-with-pyroscope&#34;&gt;Ride share tutorial with Pyroscope&lt;/h1&gt;
&lt;p&gt;This tutorial demonstrates a basic use case of Pyroscope by profiling a &amp;ldquo;Ride Share&amp;rdquo; application.
In this example, you learn:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How an application is instrumented with Pyroscope, including techniques for dynamically tagging functions.&lt;/li&gt;
&lt;li&gt;How to view the resulting profile data in Grafana using the Profiles View.&lt;/li&gt;
&lt;li&gt;How to integrate Pyroscope with Grafana to visualize the profile data.&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- INTERACTIVE ignore START --&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;p&gt;You need to have the following prerequisites to complete this tutorial:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Git&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://docs.docker.com/compose/install/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Docker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;The Docker Compose plugin (included with Docker Desktop)&lt;/li&gt;
&lt;/ul&gt;


&lt;div class=&#34;admonition admonition-tip&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Tip&lt;/p&gt;&lt;p&gt;Try this tutorial in an interactive learning environment: &lt;a href=&#34;https://killercoda.com/grafana-labs/course/pyroscope/ride-share-tutorial&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Ride share tutorial with Pyroscope&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s a fully configured environment with all the dependencies installed.&lt;/p&gt;
&lt;p&gt;Provide feedback, report bugs, and raise issues in the &lt;a href=&#34;https://github.com/grafana/killercoda&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana Killercoda repository&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;!-- INTERACTIVE ignore END --&gt;
&lt;h2 id=&#34;background&#34;&gt;Background&lt;/h2&gt;
&lt;p&gt;In this tutorial, you will profile a simple &amp;ldquo;Ride Share&amp;rdquo; application. The application is a Python Flask app that simulates a ride-sharing service. The app has three endpoints which are found in the &lt;code&gt;lib/server.py&lt;/code&gt; file:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/bike&lt;/code&gt;    : calls the &lt;code&gt;order_bike(search_radius)&lt;/code&gt; function to order a bike&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/car&lt;/code&gt;     : calls the &lt;code&gt;order_car(search_radius)&lt;/code&gt; function to order a car&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/scooter&lt;/code&gt; : calls the &lt;code&gt;order_scooter(search_radius)&lt;/code&gt; function to order a scooter&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To simulate a highly available and distributed system, the app is deployed on three distinct servers in 3 different regions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;us-east&lt;/li&gt;
&lt;li&gt;eu-north&lt;/li&gt;
&lt;li&gt;ap-south&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is simulated by running three instances of the server in Docker containers. Each server instance is tagged with the region it represents.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
    style=&#34;max-width: 100%;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/media/docs/pyroscope/ride-share-demo.gif&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/media/docs/pyroscope/ride-share-demo.gif&#34;alt=&#34;Getting started sample application&#34;width=&#34;1366&#34;height=&#34;900&#34;title=&#34;Getting started sample application&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/pyroscope/ride-share-demo.gif&#34;
            alt=&#34;Getting started sample application&#34;width=&#34;1366&#34;height=&#34;900&#34;title=&#34;Getting started sample application&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Getting started sample application&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;In this scenario, a load generator will send mock-load to the three servers as well as their respective endpoints. This lets you see how the application performs per region and per vehicle type.&lt;/p&gt;

&lt;!-- INTERACTIVE page intro.md END --&gt;
&lt;!-- INTERACTIVE page step1.md START --&gt;
&lt;h2 id=&#34;clone-the-repository&#34;&gt;Clone the repository&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Clone the repository to your local machine:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;git clone https://github.com/grafana/pyroscope.git &amp;amp;&amp;amp; cd pyroscope&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Navigate to the tutorial directory:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;cd examples/language-sdk-instrumentation/python/rideshare/flask&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;start-the-application&#34;&gt;Start the application&lt;/h2&gt;
&lt;p&gt;Start the application using Docker Compose:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;docker compose up -d&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This may take a few minutes to download the required images and build the demo application. Once ready, you will see the following output:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;console&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-console&#34;&gt; ✔ Network flask_default  Created
 ✔ Container flask-ap-south-1  Started
 ✔ Container flask-grafana-1  Started
 ✔ Container flask-pyroscope-1  Started
 ✔ Container flask-load-generator-1 Started
 ✔ Container flask-eu-north-1 Started
 ✔ Container flask-us-east-1 Started&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Optional: To verify the containers are running, run:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;docker ps -a&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;!-- INTERACTIVE page step1.md END --&gt;
&lt;!-- INTERACTIVE page step2.md START --&gt;
&lt;h2 id=&#34;accessing-profiles-drilldown-in-grafana&#34;&gt;Accessing Profiles Drilldown in Grafana&lt;/h2&gt;
&lt;p&gt;Grafana includes the 
    &lt;a href=&#34;/docs/grafana/latest/explore/simplified-exploration/profiles/&#34;&gt;Profiles Drilldown&lt;/a&gt; app that you can use to view profile data. To access Profiles Drilldown, open a browser and navigate to &lt;a href=&#34;http://localhost:3000/a/grafana-pyroscope-app/profiles-explorer&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;http://localhost:3000/a/grafana-pyroscope-app/profiles-explorer&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;how-tagging-works&#34;&gt;How tagging works&lt;/h3&gt;
&lt;p&gt;In this example, the application is instrumented with Pyroscope using the Python SDK.
The SDK allows you to tag functions with metadata that can be used to filter and group the profile data in the Profiles Drilldown.
This example uses static and dynamic tagging.&lt;/p&gt;
&lt;p&gt;To start, let&amp;rsquo;s take a look at a static tag use case. Within the &lt;code&gt;lib/server.py&lt;/code&gt; file, find the Pyroscope configuration:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Python&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-python&#34;&gt; pyroscope.configure(
     application_name = app_name,
     server_address   = server_addr,
     basic_auth_username = basic_auth_username, # for grafana cloud
     basic_auth_password = basic_auth_password, # for grafana cloud
     tags             = {
         &amp;#34;region&amp;#34;:   f&amp;#39;{os.getenv(&amp;#34;REGION&amp;#34;)}&amp;#39;,
     }
 )&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This tag is considered static because the tag is set at the start of the application and doesn&amp;rsquo;t change.
In this case, it&amp;rsquo;s useful for grouping profiles on a per region basis, which lets you see the performance of the application per region.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open Grafana using the following url: &lt;a href=&#34;http://localhost:3000/a/grafana-pyroscope-app/profiles-explorer&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;http://localhost:3000/a/grafana-pyroscope-app/profiles-explorer&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;In the main menu, select &lt;strong&gt;Drilldown&lt;/strong&gt; &amp;gt; &lt;strong&gt;Profiles&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select  &lt;strong&gt;Labels&lt;/strong&gt; in the &lt;strong&gt;Exploration&lt;/strong&gt; path.&lt;/li&gt;
&lt;li&gt;Select  &lt;strong&gt;ride-sharing-app&lt;/strong&gt; in the &lt;strong&gt;Service&lt;/strong&gt; drop-down menu.&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;region&lt;/strong&gt; tab in the &lt;strong&gt;Group by labels&lt;/strong&gt; section.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You should now see a list of regions that the application is running in. You can see that &lt;code&gt;eu-north&lt;/code&gt; is experiencing the most load.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
    style=&#34;max-width: 100%;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/media/docs/pyroscope/ride-share-tag-region-2.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/media/docs/pyroscope/ride-share-tag-region-2.png&#34;data-srcset=&#34;/media/docs/pyroscope/ride-share-tag-region-2.png?w=320 320w, /media/docs/pyroscope/ride-share-tag-region-2.png?w=550 550w, /media/docs/pyroscope/ride-share-tag-region-2.png?w=750 750w, /media/docs/pyroscope/ride-share-tag-region-2.png?w=900 900w, /media/docs/pyroscope/ride-share-tag-region-2.png?w=1040 1040w, /media/docs/pyroscope/ride-share-tag-region-2.png?w=1240 1240w, /media/docs/pyroscope/ride-share-tag-region-2.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Region Tag&#34;width=&#34;3198&#34;height=&#34;1836&#34;title=&#34;Region Tag&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/pyroscope/ride-share-tag-region-2.png&#34;
            alt=&#34;Region Tag&#34;width=&#34;3198&#34;height=&#34;1836&#34;title=&#34;Region Tag&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Region Tag&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;Next, look at a dynamic tag use case. Within the &lt;code&gt;lib/utility/utility.py&lt;/code&gt; file,  find the following function:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Python&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-python&#34;&gt; def find_nearest_vehicle(n, vehicle):
     with pyroscope.tag_wrapper({ &amp;#34;vehicle&amp;#34;: vehicle}):
         i = 0
         start_time = time.time()
         while time.time() - start_time &amp;lt; n:
             i &amp;#43;= 1
         if vehicle == &amp;#34;car&amp;#34;:
             check_driver_availability(n)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This example uses &lt;code&gt;tag_wrapper&lt;/code&gt; to tag the function with the vehicle type.
Notice that the tag is dynamic as it changes based on the vehicle type.
This is useful for grouping profiles on a per vehicle basis, allowing us to see the performance of the application per vehicle type being requested.&lt;/p&gt;
&lt;p&gt;Use Profiles Drilldown to see how this tag is used:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open Profiles Drilldown using the following url: &lt;a href=&#34;http://localhost:3000/a/grafana-pyroscope-app/profiles-explorer&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;http://localhost:3000/a/grafana-pyroscope-app/profiles-explorer&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Select on &lt;strong&gt;Labels&lt;/strong&gt; in the &lt;strong&gt;Exploration&lt;/strong&gt; path.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Group by labels&lt;/strong&gt; section, select the &lt;strong&gt;vehicle&lt;/strong&gt; tab.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You should now see a list of vehicle types that the application is using. You can see that &lt;code&gt;car&lt;/code&gt; is experiencing the most load.&lt;/p&gt;
&lt;!-- INTERACTIVE page step2.md END --&gt;
&lt;!-- INTERACTIVE page step3.md START --&gt;
&lt;h2 id=&#34;identifying-the-performance-bottleneck&#34;&gt;Identifying the performance bottleneck&lt;/h2&gt;
&lt;p&gt;The first step when analyzing a profile outputted from your application, is to take note of the largest node which is where your application is spending the most resources.
To discover this, you can use the &lt;strong&gt;Flame graph&lt;/strong&gt; view:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open Profiles Drilldown using the following url: &lt;a href=&#34;http://localhost:3000/a/grafana-pyroscope-app/profiles-explorer&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;http://localhost:3000/a/grafana-pyroscope-app/profiles-explorer&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Flame graph&lt;/strong&gt; from the &lt;strong&gt;Exploration&lt;/strong&gt; path.&lt;/li&gt;
&lt;li&gt;Verify that  &lt;code&gt;ride-sharing-app&lt;/code&gt; is selected in the &lt;strong&gt;Service&lt;/strong&gt; drop-down menu and &lt;code&gt;process_cpu/cpu&lt;/code&gt; in the &lt;strong&gt;Profile type&lt;/strong&gt; drop-down menu.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;It should look something like this:&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
    style=&#34;max-width: 100%;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/media/docs/pyroscope/ride-share-bottle-neck-3.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/media/docs/pyroscope/ride-share-bottle-neck-3.png&#34;data-srcset=&#34;/media/docs/pyroscope/ride-share-bottle-neck-3.png?w=320 320w, /media/docs/pyroscope/ride-share-bottle-neck-3.png?w=550 550w, /media/docs/pyroscope/ride-share-bottle-neck-3.png?w=750 750w, /media/docs/pyroscope/ride-share-bottle-neck-3.png?w=900 900w, /media/docs/pyroscope/ride-share-bottle-neck-3.png?w=1040 1040w, /media/docs/pyroscope/ride-share-bottle-neck-3.png?w=1240 1240w, /media/docs/pyroscope/ride-share-bottle-neck-3.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Bottleneck&#34;width=&#34;1200&#34;height=&#34;700&#34;title=&#34;Bottleneck&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/pyroscope/ride-share-bottle-neck-3.png&#34;
            alt=&#34;Bottleneck&#34;width=&#34;1200&#34;height=&#34;700&#34;title=&#34;Bottleneck&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Bottleneck&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;The flask &lt;code&gt;dispatch_request&lt;/code&gt; function is the parent to three functions that correspond to the three endpoints of the application:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;order_bike&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;order_car&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;order_scooter&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By tagging both &lt;code&gt;region&lt;/code&gt; and &lt;code&gt;vehicle&lt;/code&gt; and looking at the 
    &lt;a href=&#34;/docs/grafana/latest/explore/simplified-exploration/profiles/choose-a-view/#labels&#34;&gt;&lt;strong&gt;Labels&lt;/strong&gt; view&lt;/a&gt;, you can hypothesize:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Something is wrong with the &lt;code&gt;/car&lt;/code&gt; endpoint code where &lt;code&gt;car&lt;/code&gt; vehicle tag is consuming &lt;strong&gt;68% of CPU&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Something is wrong with one of our regions where &lt;code&gt;eu-north&lt;/code&gt; region tag is consuming &lt;strong&gt;54% of CPU&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;From the flame graph, you can see that for the &lt;code&gt;eu-north&lt;/code&gt; tag the biggest performance impact comes from the &lt;code&gt;find_nearest_vehicle()&lt;/code&gt; function which consumes close to &lt;strong&gt;68% of cpu&lt;/strong&gt;.
To analyze this, go directly to the comparison page using the comparison dropdown.&lt;/p&gt;
&lt;h3 id=&#34;comparing-two-time-periods&#34;&gt;Comparing two time periods&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Diff flame graph&lt;/strong&gt; view lets you compare two time periods side by side.
This is useful for identifying changes in performance over time.
This example compares the performance of the &lt;code&gt;eu-north&lt;/code&gt; region within a given time period against the other regions.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open Profiles Drilldown in Grafana using the following url: &lt;a href=&#34;http://localhost:3000/a/grafana-pyroscope-app/profiles-explorer&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;http://localhost:3000/a/grafana-pyroscope-app/profiles-explorer&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Diff flame graph&lt;/strong&gt; in the &lt;strong&gt;Exploration&lt;/strong&gt; path.&lt;/li&gt;
&lt;li&gt;Verify that  &lt;code&gt;ride-sharing-app&lt;/code&gt; is selected in the &lt;strong&gt;Service&lt;/strong&gt; drop-down menu and &lt;code&gt;process_cpu/cpu&lt;/code&gt; in the &lt;strong&gt;Profile type&lt;/strong&gt; drop-down menu.&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;Baseline&lt;/strong&gt;, filter by &lt;code&gt;region&lt;/code&gt; and select &lt;code&gt;!= eu-north&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;Comparison&lt;/strong&gt;, filter by &lt;code&gt;region&lt;/code&gt; and select &lt;code&gt;== eu-north&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;Choose a preset&lt;/strong&gt; drop-down, select the time period you want to compare against.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Scroll down to compare the two time periods side by side.
Note that the &lt;code&gt;eu-north&lt;/code&gt; region (right side) shows an excessive amount of time spent in the &lt;code&gt;find_nearest_vehicle&lt;/code&gt; function.
This looks to be caused by a mutex lock that is causing the function to block.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
    style=&#34;max-width: 100%;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/media/docs/pyroscope/ride-share-time-comparison-2.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/media/docs/pyroscope/ride-share-time-comparison-2.png&#34;data-srcset=&#34;/media/docs/pyroscope/ride-share-time-comparison-2.png?w=320 320w, /media/docs/pyroscope/ride-share-time-comparison-2.png?w=550 550w, /media/docs/pyroscope/ride-share-time-comparison-2.png?w=750 750w, /media/docs/pyroscope/ride-share-time-comparison-2.png?w=900 900w, /media/docs/pyroscope/ride-share-time-comparison-2.png?w=1040 1040w, /media/docs/pyroscope/ride-share-time-comparison-2.png?w=1240 1240w, /media/docs/pyroscope/ride-share-time-comparison-2.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Time Comparison&#34;width=&#34;1000&#34;height=&#34;500&#34;title=&#34;Time Comparison&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/pyroscope/ride-share-time-comparison-2.png&#34;
            alt=&#34;Time Comparison&#34;width=&#34;1000&#34;height=&#34;500&#34;title=&#34;Time Comparison&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Time Comparison&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;!-- INTERACTIVE page step3.md END --&gt;
&lt;!-- INTERACTIVE page step4.md START --&gt;
&lt;h2 id=&#34;how-was-pyroscope-integrated-with-grafana-in-this-tutorial&#34;&gt;How was Pyroscope integrated with Grafana in this tutorial?&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;docker-compose.yml&lt;/code&gt; file includes a Grafana container that&amp;rsquo;s pre-configured with the Pyroscope plugin:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;  grafana:
    image: grafana/grafana:latest
    environment:
    - GF_PLUGINS_PREINSTALL_SYNC=grafana-pyroscope-app
    - GF_AUTH_ANONYMOUS_ENABLED=true
    - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
    - GF_AUTH_DISABLE_LOGIN_FORM=true
    volumes:
    - ./grafana-provisioning:/etc/grafana/provisioning
    ports:
    - 3000:3000&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Grafana is also pre-configured with the Pyroscope data source.&lt;/p&gt;
&lt;h3 id=&#34;challenge&#34;&gt;Challenge&lt;/h3&gt;
&lt;p&gt;As a challenge, see if you can generate a similar comparison with the &lt;code&gt;vehicle&lt;/code&gt; tag.&lt;/p&gt;
&lt;!-- INTERACTIVE page step4.md END --&gt;
&lt;!-- INTERACTIVE page finish.md START --&gt;
&lt;h2 id=&#34;summary&#34;&gt;Summary&lt;/h2&gt;
&lt;p&gt;In this tutorial, you learned how to profile a simple &amp;ldquo;Ride Share&amp;rdquo; application using Pyroscope.
You have learned some of the core instrumentation concepts such as tagging and how to use Profiles Drilldown identify performance bottlenecks.&lt;/p&gt;
&lt;h3 id=&#34;next-steps&#34;&gt;Next steps&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Learn more about the Pyroscope SDKs and how to 
    &lt;a href=&#34;/docs/pyroscope/v1.18.x/configure-client/&#34;&gt;instrument your application with Pyroscope&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Deploy Pyroscope in a production environment using the 
    &lt;a href=&#34;/docs/pyroscope/v1.18.x/deploy-kubernetes/&#34;&gt;Pyroscope Helm chart&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Continue exploring your profile data using 
    &lt;a href=&#34;/docs/grafana/latest/explore/simplified-exploration/profiles/investigate/&#34;&gt;Profiles Drilldown&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- INTERACTIVE page finish.md END --&gt;
]]></content><description>&lt;!-- INTERACTIVE page intro.md START -->
&lt;h1 id="ride-share-tutorial-with-pyroscope">Ride share tutorial with Pyroscope&lt;/h1>
&lt;p>This tutorial demonstrates a basic use case of Pyroscope by profiling a &amp;ldquo;Ride Share&amp;rdquo; application.
In this example, you learn:&lt;/p></description></item></channel></rss>