|
| 1 | +--- |
| 2 | +aliases: |
| 3 | + - /docs/phlare/latest/operators-guide/configure-agent/ |
| 4 | +title: "Sending profiles from your application" |
| 5 | +menuTitle: "Configure the Client" |
| 6 | +description: "" |
| 7 | +weight: 30 |
| 8 | +--- |
| 9 | + |
| 10 | +# Sending profiles from your application |
| 11 | + |
| 12 | +Phlare is a continuous profiling database that allows you to analyze the performance of your applications. When sending profiles to Phlare, you have two options: using the Grafana agent in pull mode or utilizing the Phlare SDKs in push mode. This document will provide an overview of these two methods and guide you on when to choose each option. |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | +## Grafana Agent (Pull Mode) |
| 17 | + |
| 18 | +The Grafana agent is a component that runs alongside your application and periodically pulls the profiles from it. This mode is suitable when you want to collect profiles from existing applications without modifying their source code. Here's how it works: |
| 19 | + |
| 20 | +1. Install and configure the Grafana agent on the same machine or container where your application is running. |
| 21 | +2. The agent will periodically query your application's performance profiling endpoints, such as pprof endpoints in Go applications. |
| 22 | +3. The retrieved profiles are then sent to the Phlare server for storage and analysis. |
| 23 | + |
| 24 | +Using the Grafana agent is a convenient option when you have multiple applications or microservices, as you can centralize the profiling process without making any changes to your application's codebase. |
| 25 | + |
| 26 | +## Phlare SDKs (Push Mode) |
| 27 | + |
| 28 | +Alternatively, you can use the Phlare SDKs to push profiles from your application directly to the Phlare server. This mode is suitable when you want to have more control over the profiling process or when the application you are profiling is written in a language supported by the SDKs (e.g., Ruby, Python, etc.). Follow these steps to use the Phlare SDKs: |
| 29 | + |
| 30 | +1. Install the relevant Phlare SDK for your application's programming language (e.g., Ruby gem, pip package, etc.) |
| 31 | +2. Instrument your application's code using the SDK to capture the necessary profiling data |
| 32 | +3. Periodically push the captured profiles to the Phlare server for storage and analysis |
| 33 | + |
| 34 | +By using the Phlare SDKs, you have the flexibility to customize the profiling process according to your application's specific requirements. You can selectively profile specific sections of code or send profiles at different intervals, depending on your needs. |
| 35 | + |
| 36 | +## Choosing the Grafana agent or Phlare SDK to send profiles |
| 37 | + |
| 38 | +The decision of which mode to use depends on your specific use case and requirements. Here are some factors to consider when making the choice: |
| 39 | + |
| 40 | +- Ease of setup: If you want a quick and straightforward setup without modifying your application's code, the Grafana agent in pull mode is a good choice |
| 41 | +- Language support: If your application is written in a language supported by the Phlare SDKs and you want more control over the profiling process, using the SDKs in push mode is recommended |
| 42 | +- Flexibility: The Phlare SDKs provide more flexibility in terms of customizing the profiling process and capturing specific sections of code with labels. If you have specific profiling needs or want to fine-tune the data collection process, the SDKs offer greater flexibility |
| 43 | + |
| 44 | +To get started choose one of the integrations below: |
| 45 | +<table> |
| 46 | + <tr> |
| 47 | + <td align="center"><a href="https://pyroscope.io/docs/golang"><img src="https://user-images.githubusercontent.com/23323466/178160549-2d69a325-56ec-4e19-bca7-d460d400b163.png" width="100px;" alt=""/><br /> |
| 48 | + <b>Golang</b></a><br /> |
| 49 | + <a href="https://pyroscope.io/docs/golang" title="Documentation">Documentation</a><br /> |
| 50 | + <a href="https://github.com/grafana/pyroscope/tree/main/examples/golang-push" title="golang-examples">Examples</a> |
| 51 | + </td> |
| 52 | + <td align="center"><a href="https://pyroscope.io/docs/java"><img src="https://user-images.githubusercontent.com/23323466/178160550-2b5a623a-0f4c-4911-923f-2c825784d45d.png" width="100px;" alt=""/><br /> |
| 53 | + <b>Java</b></a><br /> |
| 54 | + <a href="https://pyroscope.io/docs/java" title="Documentation">Documentation</a><br /> |
| 55 | + <a href="https://github.com/grafana/pyroscope/tree/main/examples/java-jfr/rideshare" title="java-examples">Examples</a> |
| 56 | + </td> |
| 57 | + <td align="center"><a href="https://pyroscope.io/docs/python"><img src="https://user-images.githubusercontent.com/23323466/178160553-c78b8c15-99b4-43f3-a2a0-252b6c4862b1.png" width="100px;" alt=""/><br /> |
| 58 | + <b>Python</b></a><br /> |
| 59 | + <a href="https://pyroscope.io/docs/python" title="Documentation">Documentation</a><br /> |
| 60 | + <a href="https://github.com/grafana/pyroscope/tree/main/examples/python" title="python-examples">Examples</a> |
| 61 | + </td> |
| 62 | + <td align="center"><a href="https://pyroscope.io/docs/ruby"><img src="https://user-images.githubusercontent.com/23323466/178160554-b0be2bc5-8574-4881-ac4c-7977c0b2c195.png" width="100px;" alt=""/><br /> |
| 63 | + <b>Ruby</b></a><br /> |
| 64 | + <a href="https://pyroscope.io/docs/ruby" title="Documentation">Documentation</a><br /> |
| 65 | + <a href="https://github.com/grafana/pyroscope/tree/main/examples/ruby" title="ruby-examples">Examples</a> |
| 66 | + </td> |
| 67 | + <td align="center"><a href="https://pyroscope.io/docs/rust"><img src="https://user-images.githubusercontent.com/23323466/178160555-fb6aeee7-5d31-4bcb-9e3e-41e9f2f7d5b4.png" width="100px;" alt=""/><br /> |
| 68 | + <b>Rust</b></a><br /> |
| 69 | + <a href="https://pyroscope.io/docs/rust" title="Documentation">Documentation</a><br /> |
| 70 | + <a href="https://github.com/grafana/pyroscope/tree/main/examples/rust/rideshare" title="examples">Examples</a> |
| 71 | + </td> |
| 72 | + </tr> |
| 73 | + <tr> |
| 74 | + <td align="center"><a href="https://pyroscope.io/docs/nodejs"><img src="https://user-images.githubusercontent.com/23323466/178160551-a79ee6ff-a5d6-419e-89e6-39047cb08126.png" width="100px;" alt=""/><br /> |
| 75 | + <b>NodeJS</b></a><br /> |
| 76 | + <a href="https://pyroscope.io/docs/nodejs" title="Documentation">Documentation</a><br /> |
| 77 | + <a href="https://github.com/grafana/pyroscope/tree/main/examples/nodejs/express" title="examples">Examples</a> |
| 78 | + </td> |
| 79 | + <td align="center"><a href="https://pyroscope.io/docs/dotnet"><img src="https://user-images.githubusercontent.com/23323466/178160544-d2e189c6-a521-482c-a7dc-5375c1985e24.png" width="100px;" alt=""/><br /> |
| 80 | + <b>Dotnet</b></a><br /> |
| 81 | + <a href="https://pyroscope.io/docs/dotnet" title="Documentation">Documentation</a><br /> |
| 82 | + <a href="https://github.com/grafana/pyroscope/tree/main/examples/dotnet" title="examples">Examples</a> |
| 83 | + </td> |
| 84 | + <td align="center"><a href="https://pyroscope.io/docs/ebpf"><img src="https://user-images.githubusercontent.com/23323466/178160548-e974c080-808d-4c5d-be9b-c983a319b037.png" width="100px;" alt=""/><br /> |
| 85 | + <b>eBPF</b></a><br /> |
| 86 | + <a href="https://pyroscope.io/docs/ebpf" title="Documentation">Documentation</a><br /> |
| 87 | + <a href="https://github.com/grafana/pyroscope/tree/main/examples/ebpf" title="examples">Examples</a> |
| 88 | + </td> |
| 89 | + <td align="center"><a href="https://pyroscope.io/docs/php"><img src="https://user-images.githubusercontent.com/23323466/178160552-7aabf63a-b129-404d-8c62-16dedfefe32c.png" width="100px;" alt=""/><br /> |
| 90 | + <b>PHP</b></a><br /> |
| 91 | + <a href="https://pyroscope.io/docs/php" title="Documentation">Documentation</a><br /> |
| 92 | + <a href="https://github.com/grafana/pyroscope/tree/main/examples/php" title="examples">Examples</a> |
| 93 | + </td> |
| 94 | + </tr> |
| 95 | +</table> |
| 96 | + |
| 97 | + |
| 98 | +If you have more questions feel free to reach out in our Slack channel or create an issue on github and the Phlare team will help! |
| 99 | + |
0 commit comments