1"use strict";(globalThis.webpackChunkparca_dev=globalThis.webpackChunkparca_dev||[]).push([[2686],{5680(e,a,r){r.d(a,{xA:()=>p,yg:()=>u});var n=r(6540);function t(e,a,r){return a in e?Object.defineProperty(e,a,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[a]=r,e}function o(e,a){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);a&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function s(e){for(var a=1;a<arguments.length;a++){var r=null!=arguments[a]?arguments[a]:{};a%2?o(Object(r),!0).forEach(function(a){t(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function c(e,a){if(null==e)return{};var r,n,t=function(e,a){if(null==e)return{};var r,n,t={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],a.indexOf(r)>=0||(t[r]=e[r]);return t}(e,a);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],a.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(t[r]=e[r])}return t}var l=n.createContext({}),i=function(e){var a=n.useContext(l),r=a;return e&&(r="function"==typeof e?e(a):s(s({},a),e)),r},p=function(e){var a=i(e.components);return n.createElement(l.Provider,{value:a},e.children)},d={inlineCode:"code",wrapper:function(e){var a=e.children;return n.createElement(n.Fragment,{},a)}},g=n.forwardRef(function(e,a){var r=e.components,t=e.mdxType,o=e.originalType,l=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),g=i(r),u=t,m=g["".concat(l,".").concat(u)]||g[u]||d[u]||o;return r?n.createElement(m,s(s({ref:a},p),{},{components:r})):n.createElement(m,s({ref:a},p))});function u(e,a){var r=arguments,t=a&&a.mdxType;if("string"==typeof e||t){var o=r.length,s=new Array(o);s[0]=g;var c={};for(var l in a)hasOwnProperty.call(a,l)&&(c[l]=a[l]);c.originalType=e,c.mdxType="string"==typeof e?e:t,s[1]=c;for(var i=2;i<o;i++)s[i]=r[i];return n.createElement.apply(null,s)}return n.createElement.apply(null,r)}g.displayName="MDXCreateElement"},6889(e,a,r){r.d(a,{A:()=>g});var n=r(6540);const t="browserWindow_my1Q",o="browserWindowHeader_jXSR",s="buttons_uHc7",c="browserWindowAddressBar_Pd8y",l="dot_giz1",i="browserWindowMenuIcon_Vhuh",p="bar_rrRL",d="browserWindowBody_Idgs";const g=function({children:e,minHeight:a,url:r}){return n.createElement("div",{className:t,style:{minHeight:a}},n.createElement("div",{className:o},n.createElement("div",{className:s},n.createElement("span",{className:l,style:{background:"#f25f58"}}),n.createElement("span",{className:l,style:{background:"#fbbe3c"}}),n.createElement("span",{className:l,style:{background:"#58cb42"}})),n.createElement("div",{className:c},r),n.createElement("div",{className:i},n.createElement("div",null,n.createElement("span",{className:p}),n.createElement("span",{className:p}),n.createElement("span",{className:p})))),n.createElement("div",{className:d},e))}},362(e,a,r){r.r(a),r.d(a,{assets:()=>i,contentTitle:()=>c,default:()=>g,frontMatter:()=>s,metadata:()=>l,toc:()=>p});var n=r(8168),t=(r(6540),r(5680)),o=r(6889);const s={},c="Parca from Snapcraft",l={unversionedId:"parca-snap",id:"parca-snap",title:"Parca from Snapcraft",description:"You can install Parca using the snap package.",source:"@site/docs/parca-snap.mdx",sourceDirName:".",slug:"/parca-snap",permalink:"/docs/parca-snap",draft:!1,editUrl:"https://github.com/parca-dev/parca.dev/edit/main/docs/parca-snap.mdx",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"Parca from Binary",permalink:"/docs/binary"},next:{title:"Parca Agent from Binary",permalink:"/docs/agent-binary"}},i={},p=[{value:"Invoking <code>parca</code> manually",id:"invoking-parca-manually",level:2},{value:"Using the <code>parca</code> service",id:"using-the-parca-service",level:2}],d={toc:p};function g({components:e,...a}){return(0,t.yg)("wrapper",(0,n.A)({},d,a,{components:e,mdxType:"MDXLayout"}),(0,t.yg)("h1",{id:"parca-from-snapcraft"},"Parca from Snapcraft"),(0,t.yg)("p",null,"You can install Parca using the ",(0,t.yg)("a",{parentName:"p",href:"https://snapcraft.io/about"},"snap")," package."),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-shell"},"sudo snap install parca\n")),(0,t.yg)("p",null,"The snap has two primary modes of operation, one-shot or service."),(0,t.yg)("h2",{id:"invoking-parca-manually"},"Invoking ",(0,t.yg)("inlineCode",{parentName:"h2"}
1,"parca")," manually"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-shell"},'Usage: parca\n\nFlags:\n -h, --help Show context-sensitive help.\n --config-path="parca.yaml" Path to config file.\n --mode="all" Scraper only runs a scraper that sends to a remote gRPC endpoint. All runs all components.\n --http-address=":7070" Address to bind HTTP server to.\n --http-read-timeout=5s Timeout duration for HTTP server to read request body.\n --http-write-timeout=1m Timeout duration for HTTP server to write response body.\n# ...\n')),(0,t.yg)("p",null,"You can find more information about invoking ",(0,t.yg)("inlineCode",{parentName:"p"},"parca")," manually in the ",(0,t.yg)("a",{parentName:"p",href:"https://www.parca.dev/docs/binary"},"binary installation")," docs."),(0,t.yg)("h2",{id:"using-the-parca-service"},"Using the ",(0,t.yg)("inlineCode",{parentName:"h2"},"parca")," service"),(0,t.yg)("p",null,"The snap package also ships with a minimally configurable service that is managed by ",(0,t.yg)("inlineCode",{parentName:"p"},"snapd"),"."),(0,t.yg)("p",null,"To get started without any customisation, once the snap is installed, invoke:"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-shell"},"sudo snap start parca\n")),(0,t.yg)("p",null,"This will start ",(0,t.yg)("inlineCode",{parentName:"p"},"parca")," on http://localhost:7070, with a default active memory storage limit of 512MB."),(0,t.yg)("p",null,"There are a few config options available for the snap service:"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-shell"},"sudo snap get parca\nKey Value\nenable-persistence false\nhttp-address :7070\nlog-level info\nremote-store-address grpc.polarsignals.com:443\nremote-store-bearer-token\nremote-store-insecure false\nstorage-active-memory 536870912\n")),(0,t.yg)("p",null,"Each can be customised individually. If a config value is changed, the service must be restarted for the changes to take effect. For example:"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-shell"},"# Change the bind port\nsudo snap set parca http-address=:8080\n\n# Restart the service\nsudo snap restart parca\n")),(0,t.yg)("p",null,"You can view the ",(0,t.yg)("inlineCode",{parentName:"p"},"parca")," service logs using the ",(0,t.yg)("inlineCode",{parentName:"p"},"snap logs")," command:"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-shell"},'sudo snap logs parca\n2022-08-31T17:05:24+01:00 systemd[1]: Started Service for snap application parca.parca-svc.\n2022-08-31T17:05:24+01:00 parca.parca-svc[513345]: ooooooooo.\n2022-08-31T17:05:24+01:00 parca.parca-svc[513345]: `888 `Y88.\n2022-08-31T17:05:24+01:00 parca.parca-svc[513345]: 888 .d88\' .oooo. oooo d8b .ooooo. .oooo.\n2022-08-31T17:05:24+01:00 parca.parca-svc[513345]: 888ooo88P\' `P )88b `888""8P d88\' `"Y8 `P )88b\n2022-08-31T17:05:24+01:00 parca.parca-svc[513345]: 888 .oP"888 888 888 .oP"888\n2022-08-31T17:05:24+01:00 parca.parca-svc[513345]: 888 d8( 888 888 888 .o8 d8( 888\n2022-08-31T17:05:24+01:00 parca.parca-svc[513345]: o888o `Y888""8o d888b `Y8bod8P\' `Y888""8o\n2022-08-31T17:05:24+01:00 parca.parca-svc[513345]:\n2022-08-31T17:05:24+01:00 parca.parca-svc[513345]:\n2022-08-31T17:05:24+01:00 parca.parca-svc[513345]:\n2022-08-31T17:05:24+01:00 parca.parca-svc[513345]: level=info name=parca ts=2022-08-31T16:05:24.28687815Z caller=factory.go:52 msg="loading bucket configuration"\n2022-08-31T17:05:24+01:00 parca.parca-svc[513345]: level=info name=parca ts=2022-08-31T16:05:24.296458501Z caller=badger.go:53 msg="Set nextTxnTs to 0"\n2022-08-31T17:05:24+01:00 parca.parca-svc[513345]: level=info name=parca ts=2022-08-31T16:05:24.312880949Z caller=server.go:93 msg="starting server" addr=:7070\n')),(0,t.yg)("p",null,"Once Parca is running, you can navigate to the web interface on the browser."),(0,t.yg)(o.A,{mdxType:"BrowserWindow"},(0,t.yg)("p",null,(0,t.yg)("img",{parentName:"p",src:"https://user-images.githubusercontent.com/8681572/133893063-8cc9fc8a-4d55-431d-80fc-6a2fe8de7019.png",alt:"image"}))),(0,t.yg)("p",null,"You should shortly see the ",(0,t.yg)("inlineCode",{parentName:"p"},"Select profile...")," dropdown menu populate with the profiles that Parca is retrieving from itself.\nSelecting one of these profile types and clicking the ",(0,t.yg)("inlineCode",{parentName:"p"},"Search")," button will retrieve the profiles of that type for the time selection (default Last Hour)"),(0,t.yg)(o.A,{mdxType:"BrowserWindow"},(0,t.yg)("p",null,(0,t.yg)("img",{parentName:"p",src:"https://user-images.githubusercontent.com/8681572/133893237-f069a552-e928-4065-80db-603fb5f85e6a.png",alt:"image"}))),(0,t.yg)("p",null,"This should result in a time series based on the profile that is interactable. Clicking anywhere on the line graph should then bring up a Flame Graph for the profile that you've selected."),(0,t.yg)(o.A,{mdxType:"BrowserWindow"},(0,t.yg)("p",null,(0,t.yg)("img",{parentName:"p",src:"https://user-images.githubusercontent.com/8681572/133893258-96fdbc0a-8036-4d89-bb4c-578fb131c8e0.png",alt:"image"}))),(0,t.yg)("p",null,"You can then interact with the Flame Graph to better understand how Parca is behaving."))}g.isMDXComponent=!0}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.