## 1. Project Overview & Quickstart (fzyzcjy/precompiled_binaries)

# precompiled_binaries

Open-source repository fzyzcjy/precompiled_binaries

### Repository Details
- **Repository:** [fzyzcjy/precompiled_binaries](https://github.com/fzyzcjy/precompiled_binaries)
- **Primary Language:** Code

*Note: High-volume repository documentation is actively indexed and synchronized by YakaAI.*

## 2. Official Technical Reference & Guides (fzyzcjy/docs)

## File: docs/admin-server.mdx

---
id: admin-server
title: Pyroscope Admin Server
sidebar_label: Overview
slug: /admin-server
keywords: [ pyroscope, admin, server, config, configure, configuration, setup, options ]
---


:::note
This functionality is available starting from version 0.4.0.
:::

Pyroscope has an admin server for certain administration tasks. It uses HTTP over [unix domain sockets](https://en.wikipedia.org/wiki/Unix_domain_socket).
Which means:
* that you **MUST** have file system access to that socket (ie. access over the netork should not be possible)
* that you can interact either via our the `pyroscope admin` command or via the API directly.


## Interacting via the CLI
The CLI has an `admin` subcommand that allows you to interact with the admin server. It even has autocomplete!

From the same machine that's running the server, run:

```shell
pyroscope admin app get
```

## Interacting via the API directly
Although this is not the preferred method, it's still possible to do it. All you need is a HTTP client that can do HTTP over unix domain sockets. We recommend using curl, which supports it [since version 7.40](https://daniel.haxx.se/blog/2015/01/08/curl-7-40-0-unix-domain-sockets-and-smb/).

From the same machine that's running the server, run:
```shell
curl --unix-socket /tmp/pyroscope.sock http://pyroscope/v1/apps
```

[See the complete API reference](#api-reference)

## Troubleshooting
### Failed to contact the admin socket server
That happens when the admin server is not up. Check if you have its flag enabled.

By default, the admin server will create a socket to `/tmp/pyroscope.sock`.

Also keep in mind that the regular file system permission apply, so you should use either the **same user** that run the `pyroscope server` or `root`.

### Can't start the server
When starting a new instance, the cli checks if the socket exists, and if so, try to ping it.

If the socket responds, it means there's already a server running. In that case you can either stop that other instance or create the socket in a different path (`--admin-socket-path`).

If the socket exists but it's not responding, we try to take over. If it's still not possible, try to remove that socket manually.



## API Reference

| Name | Body | Description |
| :- | :- | :- |
| GET /v1/apps | | Get the list of all apps |
| DELETE /v1/apps | `{ "name": "foo" }`| Delete an app |

---

## File: docs/admin-server-delete.mdx

---
id: admin-server-delete-app
title: pyroscope admin delete app
sidebar_label: Delete App
slug: /admin-server-delete-app
keywords: [ pyroscope, admin, server, delete ]
---

# Deleting an App

To delete an app, run

```shell
$ pyroscope admin app delete $APP_NAME
```

You will be asked to confirm that app name:
```
> Are you sure you want to delete the app 'myapp'? This action can not be reversed.
> Type 'myapp' to confirm (without quotes).
myapp
> Deleted app 'myapp'.
```

If you prefer to skip that validation, the `--force` flag can be used:

```shell
$ pyroscope admin app delete myapp --force
> Deleted app 'myapp'.
```

By default, a timeout of **30 minutes** is used. You can overwrite that behaviour by passing the `--timeout` flag.

```shell
$ pyroscope admin app delete myapp --force --timeout=10s
> Deleted app 'myapp'.
```

# Warnings
The database will be locked for writes while performing that operation, which means that a lot of profiling data may be dropped depending on how long the command takes to run (although we try to minimize how long it holds the lock).

---

## File: docs/agent-configuration.mdx

---
id: agent-configuration-overview
title: Pyroscope Agent Configuration
sidebar_label: Overview
slug: /agent-configuration-overview
keywords: [ pyroscope, agent, config, configure, configuration, setup, options, arguments, cli, env, environment, variables ]
---

There are 3 ways to configure **Pyroscope Agent**. Configuration precedence is evaluated in the following order:
* command line arguments
* environment variables
* configuration files

Configuration options are different depending on how **Pyroscope Agent** is running:
* [`pyroscope exec`](/docs/agent-configuration-exec)
* [`pyroscope connect`](/docs/agent-configuration-connect)
* [`pyroscope agent`](/docs/agent-configuration-agent)
* [`pyroscope adhoc`](/docs/agent-configuration-adhoc)

## Configuration files

Configuration files are stored in [YAML format](https://yaml.org/start.html). You can specify configuration file
location with `-config ` argument, for example:

```shell
pyroscope agent -config /tmp/my-config.yml {args}
```

Or an environment variable, for example:

```
PYROSCOPE_CONFIG=/tmp/my-config.yml pyroscope exec {args}
```

## Environment variables

Environment variables **MUST** have `PYROSCOPE_` prefix and be in `UPPER_SNAKE_CASE` format, for example:
```shell
PYROSCOPE_API_BIND_ADDR=:9999 pyroscope server
```

---

## File: docs/agent-configuration-adhoc.mdx

---
id: agent-configuration-adhoc
title: pyroscope adhoc
hide_title: true
sidebar_label: pyroscope adhoc
slug: /agent-configuration-adhoc
keywords: [ pyroscope, adhoc, config, start, launch, config, configure, configuration, setup, options, arguments, cli, env, environment, variables ]
---


### `pyroscope adhoc`

This command saves profiling data into files instead of sending it to a server.
It generates these files in two ways:
- Pyroscope stores the profiling data in its native format and data directory
by default. These profiles are then available for analysis using pyroscope UI
(the 'Adhoc Profiling' section), which requires a running pyroscope server.
This output can be disabled with `--no-json-output`.
- Pyroscope also generates profiling data in an external format.
Depending on the number of generated profiles, pyroscope will generate either
a file or a directory, in the directory where pyroscope is run from.
The currently supported formats are standalone HTML (which can then be
shared or directly open in a browser to analyze), pprof or collapsed
(these last two can then be shared and used with either pyroscope UI or other
tooling). The flag `--output-format` is used to specify this format.

pyroscope adhoc is useful for testing programs that are short-lived (scripts, benchmarks, etc.)
and it also makes it easy to share profiling results.

There are multiple ways to gather the profiling data (it supports all the agent modes),
and not all of them are available for all the languages.
The best way to use it depends on several factors: what the language supports,
how the profiled process is launched, and how the profiled process provides the profiled data.

The different supported ways are:
- `exec`. This is the adhoc version of `pyroscope exec`,
  pyroscope creates a different process for the profiled program
  and uses a spy to directly gather profiling data.
  It's a useful way to profile a program that has no other pyroscope integration,
  but it only works for languages where a spy is available.
  It's the default when the spy is provided (using `--spy-name`) or auto detected.
- `connect`. This is the adhoc version of `pyroscope connect`.
  It's similar to `exec`, but it spies an arlaedy running process,
  indicated through `--pid` flag.
- `push`. Pyroscope creates a different process for the profiled program
  and launches an HTTP server with an ingestion endpoint.
  It's useful to profile programs already integrated with Pyroscope using its
  [HTTP API](server-api-reference.mdx#http-api).
  Push mode is used by default when no spy is detected and no `--url` flag is
  provided. It can also be override the default exec mode with the `--push` flag.
- `pull`. This is the adhoc version of pull-mode,
  pyroscope periodically connects to the URL specified thorugh `--url`
  where it tries to retrieve profiling data in any of the supported formats.
  Arguments are optional, and if provided, they are used to launch a new process before polling the URL.


#### Supported methods by language

| Language | exec | connect | push | pull |
|:--------:|:----:|:-------:|:----:|:----:|
| Go       |      |         | ✅    | ✅   |
| Python   | ✅    | ✅      | ✅    |     |
| eBPF     |      | ✅      |       |     |
| Java     |      |         | ✅    |     |
| Ruby     | ✅    | ✅      | ✅    |     |
| PHP      | ✅    | ✅      |       |     |
| .NET     | ✅    | ✅      |       |     |
| NodeJS   |       |         |  ✅   | ✅  |

### Command line arguments


| Name | Default Value | Adhoc type | Usage |
| :- | :- | :- | :- |
| analytics-opt-out | false | all | Disables analytics. |
| spy-name | auto | exec, connect | Name of the profiler you want to use. Supported ones are: pyspy, rbspy, phpspy, dotnetspy, ebpfspy. Used in `exec` and `connect` modes. |
| application-name | | all | Application name used when saving profiling data. |
| sample-rate | 100 | exec, connect | Sample rate for the profiler in Hz. 100 means reading 100 times per second. |
| detect-subprocesses | true | exec, connect | Makes pyroscope keep track of and profile subprocesses of the main process. |
| log-level | info | all | Log level: debug&#124;info&#124;warn&#124;error. |
| no-logging | false | all| Disables logging from pyroscope. |
| pid | 0 | connect | PID of the process you want to profile. Pass -1 to profile the whole system (only supported by ebpfspy). |
| pyspy-blocking | false | exec, connect | Enables blocking mode for pyspy. |
| rbspy-blocking | false | exec, connect | Enables blocking mode for rbspy. |
| push | false | push | Use push mode, exposing an ingestion endpoint for the profiled program to use. |
| url |  | pull | URL to gather profiling data from. |
| output-format | json | all | Format to export profiling data, supported formats are: html, pprof, collapsed, none. |
| no-json-output | false | all | disables generating native JSON file(s) in pyroscope data directory. |
| data-path | OS dependent | all | Directory where pyroscope stores adhoc profiles. |
| max-nodes-render | 8192 | all | Max number of nodes used to display data on the frontend. |
| max-nodes-serialization | 2048 | all | Max number of nodes used when saving profiles to disk. |



### Environment variables

Environment variables **MUST** have `PYROSCOPE_` prefix and be in `UPPER_SNAKE_CASE` format, for example:
```shell
PYROSCOPE_APPLICATION_NAME=my.awesome.app
```

### Examples

Check out the [adhoc examples](https://github.com/pyroscope-io/pyroscope/tree/main/examples/adhoc) folder in our repository to learn more 🔥.

---

## File: docs/agent-configuration-agent.mdx

---
id: agent-configuration-agent
title: pyroscope agent
hide_title: true
sidebar_label: pyroscope agent
slug: /agent-configuration-agent
keywords: [ pyroscope, agent, targets, windows, config, configure, configuration, setup, options, arguments, cli, env, environment, variables ]
---

### `pyroscope agent`

The command continuously tracks configured `targets` and attaches profilers to them. This command is primarily supposed
to be run in the context of a service manager such as systemd or Windows Service Control Manager, or when the target
application is not known in advance.

:::note
`pyroscope agent` command is only supported on Windows.
:::

### Command line arguments


| Name | Default Value | Usage |
| :- | :- | :- |
| log-file-path |  | Log file path. |
| log-level | info | Log level: debug&#124;info&#124;warn&#124;error. |
| no-logging | false | Disables logging from pyroscope. |
| server-address | http://localhost:4040 | Address of the pyroscope server. |
| auth-token |  | Authorization token used to upload profiling data. |
| upstream-threads | 4 | Number of upload threads. |
| upstream-request-timeout | 10s | Profile upload timeout. |
| tag | {} | Tag key value pairs. |


### Configuration file options


```yaml
---
# Log file path.
log-file-path: ""

# Log level: debug|info|warn|error.
log-level: "info"

# Disables logging from pyroscope.
no-logging: "false"

# Address of the pyroscope server.
server-address: "http://localhost:4040"

# Authorization token used to upload profiling data.
auth-token: ""

# Number of upload threads.
upstream-threads: "4"

# Profile upload timeout.
upstream-request-timeout: "10s"

# List of targets to be profiled.
targets: []

# Tag key value pairs.
tags: {}

```


#### Targets

Targets describe applications to be profiled. At this moment the only supported type is `system service`.

Note that `targets` can not be specified with command line arguments or environment variables.


```yaml
---
# Name of the system service to be profiled.
service-name: ""

# Name of the profiler you want to use. Supported ones are: pyspy, rbspy, phpspy, dotnetspy, ebpfspy.
spy-name: ""

# Application name used when uploading profiling data.
application-name: ""

# Sample rate for the profiler in Hz. 100 means reading 100 times per second.
sample-rate: "100"

# Makes pyroscope keep track of and profile subprocesses of the main process.
detect-subprocesses: "true"

# Enables blocking mode for pyspy.
pyspy-blocking: "false"

# Enables blocking mode for rbspy.
rbspy-blocking: "false"

```


:::note
**application-name** may be specified in the fully qualified notation as described in [the specification](/docs/flameql#notation). For example:
```
my.awesome.app{env=staging,region=us-west-1}
```
Explicitly specified tags take precedence.
:::

### Environment variables

Environment variables **MUST** have `PYROSCOPE_` prefix and be in `UPPER_SNAKE_CASE` format, for example:
```shell
PYROSCOPE_APPLICATION_NAME=my.awesome.app
```

### Example

This example shows how a system service with name `MyService` may be profiled:

```yaml
---
log-level: "debug"
server-address: http://pyroscope-server:4040
targets:
 - application-name: my.dotnet.svc
   spy-name: dotnetspy
   service-name: MyService
```

---

## File: docs/agent-configuration-connect.mdx

---
id: agent-configuration-connect
title: pyroscope connect
hide_title: true
sidebar_label: pyroscope connect
slug: /agent-configuration-connect
keywords: [ pyroscope, agent, connect, attach, pid, config, configure, configuration, setup, options, arguments, cli, env, environment, variables ]
---

### `pyroscope connect`

The command attaches profiler to already running process specified by PID or operating system, if applicable (for example, `ebpf` integration).

### Command line arguments

The arguments are the same as for `pyroscope exec` except that `pyroscope connect` requires `-pid` to be specified:


| Name | Default Value | Usage |
| :- | :- | :- |
| spy-name | auto | Name of the profiler you want to use. Supported ones are: pyspy, rbspy, phpspy, dotnetspy, ebpfspy. |
| application-name |  | Application name used when uploading profiling data. |
| sample-rate | 100 | Sample rate for the profiler in Hz. 100 means reading 100 times per second. |
| detect-subprocesses | true | Makes pyroscope keep track of and profile subprocesses of the main process. |
| log-level | info | Log level: debug&#124;info&#124;warn&#124;error. |
| server-address | http://localhost:4040 | Address of the pyroscope server. |
| auth-token |  | Authorization token used to upload profiling data. |
| upstream-threads | 4 | Number of upload threads. |
| upstream-request-timeout | 10s | Profile upload timeout. |
| no-logging | false | Disables logging from pyroscope. |
| pid | 0 | PID of the process you want to profile. Pass -1 to profile the whole system (only supported by ebpfspy). |
| pyspy-blocking | false | Enables blocking mode for pyspy. |
| rbspy-blocking | false | Enables blocking mode for rbspy. |
| tag | {} | Tag in key=value form. The flag may be specified multiple times. |


:::note
**application-name** may be specified in the fully qualified notation as described in [the specification](/docs/flameql#notation). For example:
```
my.awesome.app{env=staging,region=us-west-1}
```
Explicitly specified tags take precedence.
:::

### Environment variables

Environment variables **MUST** have `PYROSCOPE_` prefix and be in `UPPER_SNAKE_CASE` format, for example:
```shell
PYROSCOPE_APPLICATION_NAME=my.awesome.app
```

---

## File: docs/agent-configuration-exec.mdx

---
id: agent-configuration-exec
title: pyroscope exec
hide_title: true
sidebar_label: pyroscope exec
slug: /agent-configuration-exec
keywords: [ pyroscope, exec, start, launch, config, configure, configuration, setup, options, arguments, cli, env, environment, variables ]
---

### `pyroscope exec`

The command spawns a new process and attaches configured profiler. Once `pyroscope exec` exits, the child process exits
as well and vice-versa. This command may be used for testing, as a docker entrypoint, or as a systemd service unit command.

### Command line arguments


| Name | Default Value | Usage |
| :- | :- | :- |
| spy-name | auto | Name of the profiler you want to use. Supported ones are: pyspy, rbspy, phpspy, dotnetspy, ebpfspy. |
| application-name |  | Application name used when uploading profiling data. |
| sample-rate | 100 | Sample rate for the profiler in Hz. 100 means reading 100 times per second. |
| detect-subprocesses | true | Makes pyroscope keep track of and profile subprocesses of the main process. |
| log-level | info | Log level: debug&#124;info&#124;warn&#124;error. |
| server-address | http://localhost:4040 | Address of the pyroscope server. |
| auth-token |  | Authorization token used to upload profiling data. |
| upstream-threads | 4 | Number of upload threads. |
| upstream-request-timeout | 10s | Profile upload timeout. |
| no-logging | false | Disables logging from pyroscope. |
| no-root-drop | false | Disables permissions drop when ran under root. use this one if you want to run your command as root. |
| user-name |  | Starts process under specified user name. |
| group-name |  | Starts process under specified group name. |
| pyspy-blocking | false | Enables blocking mode for pyspy. |
| rbspy-blocking | false | Enables blocking mode for rbspy. |
| tag | {} | Tag in key=value form. The flag may be specified multiple times. |


:::note
**application-name** may be specified in the fully qualified notation as described in [the specification](/docs/flameql#notation). For example:
```
my.awesome.app{env=staging,region=us-west-1}
```
Explicitly specified tags take precedence.
:::

### Environment variables

Environment variables **MUST** have `PYROSCOPE_` prefix and be in `UPPER_SNAKE_CASE` format, for example:
```shell
PYROSCOPE_APPLICATION_NAME=my.awesome.app
```

---

## File: docs/agent-install-linux.mdx

---
id: agent-install-linux
title: Linux
sidebar_label: Linux
slug: /agent-install-linux
keywords: [ pyroscope, agent, install, deploy, deployment, linux, rpm, deb, package, ubuntu, debian, centos, rhel, fedora, amazon ]
---


import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import CodeBlock from '@theme/CodeBlock';
import packages from '../packages.manifest.json';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faLinux } from '@fortawesome/free-brands-svg-icons';


This guide will help you install **Pyroscope Agent** on  Linux.

## Install

Pyroscope team maintain and sign packages for the following Linux distributions:

<Tabs
  defaultValue="ubuntu"
  values={[
    {label: 'Ubuntu/Debian', value: 'ubuntu'},
    {label: 'CentOS/RHEL', value: 'centos'},
    {label: 'Fedora', value: 'fedora'},
    {label: 'Amazon Linux', value: 'amazon-linux'},
  ]}>

  <TabItem value="ubuntu">
    Download package:
    <CodeBlock className="language-shell">
      {
        `wget https://dl.pyroscope.io/release/pyroscope_${Object.keys(packages.releases)[0].substr(1)}_amd64.deb`.replace(/^\s+/mg, "")
      }
    </CodeBlock>
    Install with apt-get:
    <CodeBlock className="language-shell">
      {
        `sudo apt-get install ./pyroscope_${Object.keys(packages.releases)[0].substr(1)}_amd64.deb`.replace(/^\s+/mg, "")
      }
    </CodeBlock>
  </TabItem>

  <TabItem value="centos">
    Download package:
    <CodeBlock className="language-shell">
      {
        `wget https://dl.pyroscope.io/release/pyroscope-${Object.keys(packages.releases)[0].substr(1)}-1-x86_64.rpm`.replace(/^\s+/mg, "")
      }
    </CodeBlock>
    Install with yum:
    <CodeBlock className="language-shell">
      {
        `sudo yum localinstall pyroscope-${Object.keys(packages.releases)[0].substr(1)}-1-x86_64.rpm`.replace(/^\s+/mg, "")
      }
    </CodeBlock>
  </TabItem>

  <TabItem value="fedora">
    Download package:
    <CodeBlock className="language-shell">
      {
        `wget https://dl.pyroscope.io/release/pyroscope-${Object.keys(packages.releases)[0].substr(1)}-1-x86_64.rpm`.replace(/^\s+/mg, "")
      }
    </CodeBlock>
    Install with dnf:
    <CodeBlock className="language-shell">
      {
        `sudo dnf install pyroscope-${Object.keys(packages.releases)[0].substr(1)}-1-x86_64.rpm`.replace(/^\s+/mg, "")
      }
    </CodeBlock>
  </TabItem>

  <TabItem value="amazon-linux">
    Download package:
    <CodeBlock className="language-shell">
      {
        `wget https://dl.pyroscope.io/release/pyroscope-${Object.keys(packages.releases)[0].substr(1)}-1-x86_64.rpm`.replace(/^\s+/mg, "")
      }
    </CodeBlock>
    Install with yum:
    <CodeBlock className="language-shell">
      {
        `sudo yum localinstall pyroscope-${Object.keys(packages.releases)[0].substr(1)}-1-x86_64.rpm`.replace(/^\s+/mg, "")
      }
    </CodeBlock>
  </TabItem>

</Tabs>

:::tip
To find out about other ways of installing Pyroscope, or to find packages for other CPU architectures (e.g ARM) visit our [Downloads](/downloads) page.
:::

**Pyroscope Agent** is not installed as `systemd` service. If you need to profile a process which is running as a service,
you may wrap `ExecStart` option of the `systemd` unit with `pyroscope exec`.

## Verify the installation

To verify **Pyroscope Agent** was installed correctly, try the `pyroscope` command:
```
pyroscope
```

You should see output, similar to the following:
```
 _ __  _   _ _ __ ___  ___  ___ ___  _ __   ___
| '_ \| | | | '__/ _ \/ __|/ __/ _ \| '_ \ / _ \
| |_) | |_| | | | (_) \__ \ (_| (_) | |_) |  __/
| .__/ \__, |_|  \___/|___/\___\___/| .__/ \___|
| |     __/ |                       | |
|_|    |___/                        |_|

continuous profiling platform

USAGE
  pyroscope [flags] <subcommand>

SUBCOMMANDS
  server   starts pyroscope server. This is the database + web-based user interface
  exec     starts a new process from <args> and profiles it
  connect  connects to an existing process and profiles it

FLAGS        DEFAULT VALUES

  -version  false

Run 'pyroscope SUBCOMMAND --help' for more information on a subcommand.
```

## Next steps

Refer to [Configuration](/docs/agent-configuration-overview) and [Integrations](/docs/supported-integrations) pages to learn more about
**Pyroscop Agent** and how to configure it.

---

## File: docs/agent-install-macos.mdx

---
id: agent-install-macos
title: macOS
sidebar_label: macOS
slug: /agent-install-macos
keywords: [ pyroscope, agent, install, deploy, deployment, macos, darwin, brew, homebrew, package ]
---


import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faApple } from '@fortawesome/free-brands-svg-icons';


This guide will help you install **Pyroscope Agent** on  macOS.

## Install

Install **Pyroscope Agent** with `pyroscope-io/brew/pyroscope`:
```shell
brew install pyroscope-io/brew/pyroscope
```

:::tip
To find out about other ways of installing Pyroscope, or to find packages for other CPU architectures (e.g ARM) visit our [Downloads](/downloads) page.
:::

## Verify the installation

To verify **Pyroscope Agent** was installed correctly, try the `pyroscope` command:
```
pyroscope
```

You should see output, similar to the following:
```
 _ __  _   _ _ __ ___  ___  ___ ___  _ __   ___
| '_ \| | | | '__/ _ \/ __|/ __/ _ \| '_ \ / _ \
| |_) | |_| | | | (_) \__ \ (_| (_) | |_) |  __/
| .__/ \__, |_|  \___/|___/\___\___/| .__/ \___|
| |     __/ |                       | |
|_|    |___/                        |_|

continuous profiling platform

USAGE
  pyroscope [flags] <subcommand>

SUBCOMMANDS
  server   starts pyroscope server. This is the database + web-based user interface
  exec     starts a new process from <args> and profiles it
  connect  connects to an existing process and profiles it

FLAGS        DEFAULT VALUES

  -version  false

Run 'pyroscope SUBCOMMAND --help' for more information on a subcommand.
```

## Next steps

Refer to [Configuration](/docs/agent-configuration-overview) and [Integrations](/docs/supported-integrations) pages to learn more about
**Pyroscop Agent** and how to configure it.

---

## File: docs/agent-install-windows.mdx

---
id: agent-install-windows
title: Windows (Agent)
sidebar_label: Windows
slug: /agent-install-windows
keywords: [ pyroscope, agent, install, deploy, deployment, microsoft, windows, msi, package ]
---


import CodeBlock from '@theme/CodeBlock';
import packages from '../packages.manifest.json';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faWindows } from '@fortawesome/free-brands-svg-icons';


This guide will help you install **Pyroscope Agent** on  Windows.


:::note
Pyroscope supports **Pyroscope Agent** on Windows for those versions of Windows 10 that are still within Microsoft’s [servicing timeline](https://support.microsoft.com/en-us/help/13853/windows-lifecycle-fact-sheet).
:::

## Install

**Pyroscope Agent** for Windows is distributed as an MSI package. To install it locally, start PowerShell **as
Administrator** and run the following commands.

Download package:
<CodeBlock className="language-powershell">
  {
    `[Net.ServicePointManager]::SecurityProtocol = "tls12"\n` +
    `wget https://dl.pyroscope.io/release/pyroscope_agent_${Object.keys(packages.releases)[0].substr(1)}_amd64.msi ` +
    `-outfile pyroscope_agent_${Object.keys(packages.releases)[0].substr(1)}_amd64.msi`.replace(/^\s+/mg, "")
  }
</CodeBlock>


Install MSI package with `msiexec`:
<CodeBlock className="language-shell">
  {
    `msiexec.exe /i pyroscope_agent_${Object.keys(packages.releases)[0].substr(1)}_amd64.msi`.replace(/^\s+/mg, "")
  }
</CodeBlock>


:::tip
To find out about other ways of installing Pyroscope, or to find packages for other CPU architectures (e.g ARM) visit our [Downloads](/downloads) page.
:::

## Verify the installation

To verify **Pyroscope Agent** was installed correctly, try the `pyroscope` command:
```shell
pyroscope
```

:::tip
After installation, you may need to reload environment variables or re-open the shell:
```shell
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine")
```
:::

You should see output, similar to the following:
```
 _ __  _   _ _ __ ___  ___  ___ ___  _ __   ___
| '_ \| | | | '__/ _ \/ __|/ __/ _ \| '_ \ / _ \
| |_) | |_| | | | (_) \__ \ (_| (_) | |_) |  __/
| .__/ \__, |_|  \___/|___/\___\___/| .__/ \___|
| |     __/ |                       | |
|_|    |___/                        |_|

continuous profiling platform

USAGE
  pyroscope [flags] <subcommand>

SUBCOMMANDS
  server   starts pyroscope server. This is the database + web-based user interface
  agent    starts pyroscope agent.
  exec     starts a new process from <args> and profiles it
  connect  connects to an existing process and profiles it

FLAGS        DEFAULT VALUES

  -version  false

Run 'pyroscope SUBCOMMAND --help' for more information on a subcommand.
```

### System service

**Pyroscope Agent** is installed as a system service which is started automatically ([`pyroscope agent`](agent-configuration-agent.mdx) command). To make sure the service was
installed correctly, query its state with PowerShell:

```shell
Get-Service pyroscope
```

You should see output, similar to the following:
```
Status   Name               DisplayName
------   ----               -----------
Running  pyroscope          Pyroscope Agent
```

### Logging

When is running as a service on Windows, **Pyroscope Agent** writes logs to
`%PROGRAMDATA%\Pyroscope\Pyroscope Agent\pyroscope-agent.log` file by default.

If agent fails to initialize and start, it writes a corresponding event to Windows Event Log `Windows Logs/Application`
with `Source` field value "Pyroscope".

## Next steps

Refer to [Configuration](/docs/agent-configuration-overview) and [Integrations](/docs/supported-integrations) pages to learn more about
**Pyroscop Agent** and how to configure it.

---

## File: docs/agent-kubernetes.mdx

---
id: agent-kubernetes
title: Kubernetes Guide
sidebar_label: Kubernetes Guide
slug: /agent-kubernetes
---

---

## File: docs/agent-overview.mdx

---
id: agent-overview
title: Pyroscope Agent
sidebar_label: Overview
slug: /agent-overview
---


import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faDocker } from '@fortawesome/free-brands-svg-icons';


## Overview

**Pyroscope Agent** records and aggregates what your application has been doing, then sends that data over to the
**Pyroscope Server**.



## Supported platforms

**Pyroscope Agent** can run on [Linux](agent-install-linux.mdx), [macOS](agent-install-macos.mdx), [Windows](agent-install-windows.mdx)
and in  Docker. Note that some integrations are OS-specific.
Visit [Integrations](/docs/supported-integrations) page for details.

## Run modes

**Pyroscope Agent** may be run interactively and as a service:
 * `pyroscope exec` spawns a new process and attaches configured profiler. Once `pyroscope exec` exits, the child
process exits as well and vice-versa. This command may be used for testing, as a docker entrypoint, or as a systemd
service unit command.

 * `pyroscope connect` attaches profiler to already running process specified by PID or operating system,
if applicable (for example, `ebpf` integration).

 * `pyroscope agent` continuously tracks configured `targets` and attaches profilers to them. This command is only
supported on Windows and it's primarily supposed to be run in the context of Windows Service Control Manager.

 * `pyroscope adhoc` profiles a process and saves the result as a file that can later be analyzed with the Adhoc view.
 This command is useful for interactive or ad-hoc profiling.

Refer to [Configuration](agent-configuration.mdx) page to learn more about each mode and how to configure
**Pyroscop Agent**.