{"componentChunkName":"component---src-components-mark-down-block-js","path":"/docs/edgescope-docker/","result":{"data":{"markdownRemark":{"html":"<h1 id=\"running-appscope-with-cribl-edge-in-a-docker-container\" style=\"position:relative;\"><a href=\"#running-appscope-with-cribl-edge-in-a-docker-container\" aria-label=\"running appscope with cribl edge in a docker container permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Running AppScope With Cribl Edge in a Docker Container</h1>\n<p>This topic walks you through a setup procedure, and then through the two basic AppScope techniques:</p>\n<ol>\n<li><strong>Scope by PID</strong> – Instrumenting one process on one host or container.</li>\n<li><strong>Scope by Rule</strong> – Instrumenting multiple processes on an entire Edge Fleet.</li>\n</ol>\n<p>We assume that you have an Edge Leader running in Cribl.Cloud, you want to add a new Edge Node to its Fleet – and that that Edge Node will be in a Docker container (or another type of container that's also <a href=\"https://opencontainers.org/\">Open Container Initiative</a>-compliant).</p>\n<p>We assume that your goal is to scope processes running on the host where the new Edge Node’s Docker container resides, or, that run on other containers on that host.</p>\n<p>You can easily modify these instructions to add more than one Edge Node and then use Scope by Rules to scope processes on the entire Fleet.</p>\n<h2 id=\"setting-up-a-new-edge-node\" style=\"position:relative;\"><a href=\"#setting-up-a-new-edge-node\" aria-label=\"setting up a new edge node permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Setting Up a New Edge Node</h2>\n<p>In Cribl.Cloud:</p>\n<ol>\n<li>Click <strong>Manage Edge</strong>.</li>\n<li>Select the Fleet where you’ll be adding a Linux host – <code>default_fleet</code> is fine.</li>\n<li>From the <strong>Add/Update Edge Node</strong> drop-down, select <strong>Docker</strong> to open the <strong>Add Docker Node</strong> modal.</li>\n<li>\n<p>Click <strong>Copy script</strong> and dismiss the modal.</p>\n<ul>\n<li>Note: Several parameters provided on this modal can alter the contents of the script. Defaults are fine for this example.</li>\n<li>Alternative: Copy the script <a href=\"https://docs.cribl.io/edge/deploy-running-docker\">from the docs</a>.</li>\n</ul>\n</li>\n<li>Note the value of <strong>Edge Nodes</strong> at upper left.</li>\n</ol>\n<p>On the Linux host we want to observe with Edge:</p>\n<ol>\n<li>Paste the script into the shell.</li>\n<li>\n<p>Add  <code>-v /var/run/appscope:/var/run/appscope</code> to the script.</p>\n<ul>\n<li>This step is not necessary if you copied the script from the docs.</li>\n</ul>\n</li>\n<li>Execute the script – this will run Edge in a Docker container.   </li>\n</ol>\n<p>Return to Cribl.Cloud UI to verify that the new Node is present:</p>\n<ol>\n<li>The value of <strong>Edge Nodes</strong> should have increased by 1.</li>\n<li>Select <strong>List View</strong> (and filtering by host if needed) – the new Edge Node should appear in the list.  </li>\n</ol>\n<p>At this point, Edge is running in a Docker container and is connected to the Edge Leader.  </p>\n<h2 id=\"scoping-by-pid\" style=\"position:relative;\"><a href=\"#scoping-by-pid\" aria-label=\"scoping by pid permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Scoping by PID</h2>\n<p>Still in Edge’s <strong>List View</strong> tab:</p>\n<ol>\n<li>Click the GUID for the host we’ve just added.</li>\n<li>Click the count of <strong>running processes</strong> at upper left to open a list view of processes.</li>\n</ol>\n<p>On the Linux host: </p>\n<ul>\n<li>In a shell, start a process you want to scope.  For this example, let’s start <code>top</code>.  </li>\n</ul>\n<p>Back in Edge: </p>\n<p>Within seconds, <code>top</code> should appear in the process list. (If you don’t see it, try filtering by command.) At this point <code>top</code> is running but is not yet instrumented by AppScope.</p>\n<ol>\n<li>Select the <code>top</code> command's row to open the <strong>Process: top</strong> drawer.</li>\n<li>\n<p>In the <strong>AppScope</strong> tab, select the AppScope <strong>Configuration</strong> we want to use for this process. </p>\n<ul>\n<li>Select <code>A sensible AppScope configuration ...</code> .  </li>\n</ul>\n</li>\n<li>\n<p>Leave the default <strong>Source</strong> as <code>in_appscope</code>.</p>\n<ul>\n<li>If you use a different AppScope Source, configure that Source to set <strong>General Settings</strong> > <strong>Optional Settings</strong> > <strong>UNIX socket permissions</strong> to <code>777</code>.</li>\n</ul>\n</li>\n<li>\n<p>Click <strong>Start monitoring</strong>.  </p>\n<ul>\n<li>After a minute or so, you should see green checkmarks in all the Status columns.</li>\n</ul>\n</li>\n</ol>\n<p>Now you’ll want to confirm that Edge is receiving AppScope data for the scoped <code>top</code> process.</p>\n<p>On the Edge Leader, navigate to <strong>More</strong> > <strong>Sources</strong> and select <strong>AppScope</strong> to open the Source page. </p>\n<p>In the row where <code>ID</code> is <code>in_appscope</code>: </p>\n<ul>\n<li>The Source should be enabled.</li>\n<li>Socket should be set to <code>$CRIBL_HOME/state/appscope.sock</code>.  </li>\n<li>In the Status column, click <strong>Live</strong>, and you should now see events flowing.</li>\n</ul>\n<h3 id=\"scoping-by-rule\" style=\"position:relative;\"><a href=\"#scoping-by-rule\" aria-label=\"scoping by rule permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Scoping by Rule</h3>\n<p>On the Linux host: </p>\n<ul>\n<li>In your shell, start a process you want to scope.  Again, let’s  run <code>top</code>.  </li>\n</ul>\n<p>On the Edge Leader:</p>\n<ul>\n<li>Navigate to <strong>More</strong> > <strong>Sources</strong> and select <strong>AppScope</strong> to open the Source page. </li>\n<li>Select the row where <code>ID</code> is <code>in_appscope</code> .</li>\n</ul>\n<p>In the AppScope Rules tab, under Rules, click <strong>Add Rule</strong> and complete the Rule as follows:</p>\n<ul>\n<li><strong>Process name</strong>: <code>top</code></li>\n<li><strong>Process argument</strong>: Skip this, because <strong>Process name</strong> and <strong>Process argument</strong> are mutually exclusive.</li>\n<li><strong>AppScope config</strong>: Select <code>A sensible AppScope configuration ...</code> .  </li>\n</ul>\n<p>Next:</p>\n<ol>\n<li>Click <strong>Save</strong>.</li>\n<li>Click <strong>Commit</strong> and provide a commit message. </li>\n<li>Click <strong>Commit and Deploy</strong>.</li>\n</ol>\n<p>Wait for the changes to be deployed to the Edge Node – probably around 30 seconds. </p>\n<ul>\n<li>Click the <strong>Live Data tab</strong>, and you should now see events flowing. Next, we'll show that any process matching your Rule gets scoped.</li>\n</ul>\n<p>Back on the Linux host:</p>\n<ol>\n<li>In your shell, start <strong>another</strong> <code>top</code> process.</li>\n<li>Click the <strong>Live Data tab</strong>.</li>\n</ol>\n<p>You should now see events flowing from two <code>top</code> processes – they’ll have different PIDs.</p>\n<p>Return to Edge’s <strong>List View</strong> tab – the <strong>AppScope</strong> column should indicate that both <code>top</code> processes are being scoped.</p>\n<p>This gets to what’s so powerful about Rules: You can start processes <strong>after</strong> setting things up, and they get scoped.</p>\n<p>Optionally, you can try the other two configurations and see how the scoped data changes. For the config that has payloads enabled, <code>curl</code> and <code>wget</code> are good choices.</p>\n<p>If you want to do more, consider creating Routes and Pipelines in Cribl Edge, to send AppScope data to your favorite Destination(s).</p>","frontmatter":{"title":"Cribl Edge in Docker"}}},"pageContext":{"slug":"/edgescope-docker/","id":"025777e4-e686-51a1-aa6e-21ba23207be9"}},"staticQueryHashes":["2787008656","306729481","625673991","640077088"]}