Skip to content

Commit

Permalink
[DOC] Update links for new examples folder (#3027)
Browse files Browse the repository at this point in the history
  • Loading branch information
knylander-grafana committed Feb 27, 2024
1 parent e10b32c commit 75db8b0
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 54 deletions.
18 changes: 9 additions & 9 deletions docs/sources/configure-client/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,49 +48,49 @@ To get started choose one of the integrations below:
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-agent/go_pull"><img src="https://github-production-user-asset-6210df.s3.amazonaws.com/223048/257522425-48683963-91ae-4caf-8c52-ce131e25bd65.png" width="100px;" alt=""/><br />
<b>Grafana Agent</b></a><br />
<a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-agent/go_pull/" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/grafana-agent" title="examples">Examples</a>
<a href="https://github.com/grafana/pyroscope/tree/main/examples/grafana-agent-auto-instrumentation" title="examples">Examples</a>
</td>
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/go_push/"><img src="https://user-images.githubusercontent.com/23323466/178160549-2d69a325-56ec-4e19-bca7-d460d400b163.png" width="100px;" alt=""/><br />
<b>Golang</b></a><br />
<a href="https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/go_push/" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/golang-push" title="golang-examples">Examples</a>
<a href="https://github.com/grafana/pyroscope/tree/main/examples/language-sdk-instrumentation/golang-push" title="golang-examples">Examples</a>
</td>
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/java/"><img src="https://user-images.githubusercontent.com/23323466/178160550-2b5a623a-0f4c-4911-923f-2c825784d45d.png" width="100px;" alt=""/><br />
<b>Java</b></a><br />
<a href="https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/java/">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/java/rideshare" title="java-examples">Examples</a>
<a href="https://github.com/grafana/pyroscope/tree/main/examples/language-sdk-instrumentation/java/rideshare" title="java-examples">Examples</a>
</td>
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-agent/ebpf"><img src="https://user-images.githubusercontent.com/23323466/178160548-e974c080-808d-4c5d-be9b-c983a319b037.png" width="100px;" alt=""/><br />
<b>eBPF</b></a><br />
<a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-agent/ebpf" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/ebpf" title="examples">Examples</a>
<a href="https://github.com/grafana/pyroscope/tree/main/examples/grafana-agent-auto-instrumentation/ebpf" title="examples">Examples</a>
</td>
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/python/"><img src="https://user-images.githubusercontent.com/23323466/178160553-c78b8c15-99b4-43f3-a2a0-252b6c4862b1.png" width="100px;" alt=""/><br />
<b>Python</b></a><br />
<a href="https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/python/" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/python" title="python-examples">Examples</a>
<a href="https://github.com/grafana/pyroscope/tree/main/examples/language-sdk-instrumentation/python" title="python-examples">Examples</a>
</td>
</tr>
<tr>
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/dotnet/"><img src="https://user-images.githubusercontent.com/23323466/178160544-d2e189c6-a521-482c-a7dc-5375c1985e24.png" width="100px;" alt=""/><br />
<b>Dotnet</b></a><br />
<a href="https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/dotnet/" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/dotnet" title="examples">Examples</a>
<a href="https://github.com/grafana/pyroscope/tree/main/examples/language-sdk-instrumentation/dotnet" title="examples">Examples</a>
</td>
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/ruby/"><img src="https://user-images.githubusercontent.com/23323466/178160554-b0be2bc5-8574-4881-ac4c-7977c0b2c195.png" width="100px;" alt=""/><br />
<b>Ruby</b></a><br />
<a href="https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/ruby/" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/ruby" title="ruby-examples">Examples</a>
<a href="https://github.com/grafana/pyroscope/tree/main/examples/language-sdk-instrumentation/ruby" title="ruby-examples">Examples</a>
</td>
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/nodejs/"><img src="https://user-images.githubusercontent.com/23323466/178160551-a79ee6ff-a5d6-419e-89e6-39047cb08126.png" width="100px;" alt=""/><br />
<b>NodeJS</b></a><br />
<a href="https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/nodejs/" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/nodejs/express" title="examples">Examples</a>
<a href="https://github.com/grafana/pyroscope/tree/main/examples/language-sdk-instrumentation/nodejs/express" title="examples">Examples</a>
</td>
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/rust/"><img src="https://user-images.githubusercontent.com/23323466/178160555-fb6aeee7-5d31-4bcb-9e3e-41e9f2f7d5b4.png" width="100px;" alt=""/><br />
<b>Rust</b></a><br />
<a href="https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/rust/" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/rust/rideshare" title="examples">Examples</a>
<a href="https://github.com/grafana/pyroscope/tree/main/examples/language-sdk-instrumentation/rust/rideshare" title="examples">Examples</a>
</td>
</tr>
</table>
Expand Down
52 changes: 26 additions & 26 deletions docs/sources/configure-client/grafana-agent/go_pull.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Ensure your Golang application exposes pprof endpoints.

[//]: # (TODO&#40;korniltsev&#41; What should go here?)

This procedure uses Grafana Agent to send data to Pyroscope using an example River configuration file for the Grafana Agent in Flow mode.
Make sure you have [Grafana Agent in Flow mode](/docs/agent/latest/flow/setup/install/) installed.
This procedure uses Grafana Agent to send data to Pyroscope using an example River configuration file for the Grafana Agent in Flow mode.
Make sure you have [Grafana Agent in Flow mode](/docs/agent/latest/flow/setup/install/) installed.

### Prepare Grafana Agent Flow configuration file

Expand All @@ -61,55 +61,55 @@ and `pyroscope.scrape`.
pyroscope.scrape "scrape_job_name" {
targets = [{"__address__" = "localhost:4040", "service_name" = "example_service"}]
forward_to = [pyroscope.write.write_job_name.receiver]
profiling_config {
profile.process_cpu {
enabled = true
}
profile.godeltaprof_memory {
enabled = true
}
profile.memory { // disable memory, use godeltaprof_memory instead
enabled = false
}
profile.godeltaprof_mutex {
enabled = true
}
profile.mutex { // disable mutex, use godeltaprof_mutex instead
enabled = false
}
profile.godeltaprof_block {
enabled = true
}
profile.block { // disable block, use godeltaprof_block instead
enabled = false
}
profile.goroutine {
enabled = true
}
}
}
```
3. Save the changes to the file.
3. Save the changes to the file.
### Start Grafana Agent Flow

1. Start a local Pyroscope instance for testing purposes
```bash
docker run -p 4040:4040 grafana/pyroscope
docker run -p 4040:4040 grafana/pyroscope
```
2. Start Grafana Agent
```bash
grafana-agent-flow run conifguration.river
```
3. Open a browser to http://localhost:4040. The page should list profiles.
3. Open a browser to http://localhost:4040. The page should list profiles.

## Examples

Expand All @@ -128,56 +128,56 @@ pyroscope.write "write_job_name" {
password = "<Grafana Cloud Password>"
}
}
}
```

### Discover Kubernetes targets

1. Select all pods
1. Select all pods
```river
discovery.kubernetes "all_pods" {
role = "pod"
}
```
2. Drop not running pods, create `namespace`, `pod`, `node` and `container` labels.
2. Drop not running pods, create `namespace`, `pod`, `node` and `container` labels.
Compose `service_name` label based on `namespace` and `container` labels.
Select only services matching regex pattern `(ns1/.*)|(ns2/container-.*0)`.
```river

discovery.relabel "specific_pods" {
targets = discovery.kubernetes.all_pods.targets

rule {
action = "drop"
regex = "Succeeded|Failed|Completed"
source_labels = ["__meta_kubernetes_pod_phase"]
}

rule {
action = "replace"
source_labels = ["__meta_kubernetes_namespace"]
target_label = "namespace"
}

rule {
action = "replace"
source_labels = ["__meta_kubernetes_pod_name"]
target_label = "pod"
}

rule {
action = "replace"
source_labels = ["__meta_kubernetes_node_name"]
target_label = "node"
}

rule {
action = "replace"
source_labels = ["__meta_kubernetes_pod_container_name"]
target_label = "container"
}

rule {
action = "replace"
regex = "(.*)@(.*)"
Expand All @@ -186,8 +186,8 @@ pyroscope.write "write_job_name" {
source_labels = ["__meta_kubernetes_namespace", "__meta_kubernetes_pod_container_name"]
target_label = "service_name"
}
rule {

rule {
action = "keep"
regex = "(ns1/.*)|(ns2/container-.*0)"
source_labels = ["service_name"]
Expand Down Expand Up @@ -218,7 +218,7 @@ router.PathPrefix("/debug/pprof").Handler(http.DefaultServeMux)
```

## References
[Example using grafana-agent](https://github.com/grafana/pyroscope/tree/main/examples/grafana-agent).
[Example using grafana-agent](https://github.com/grafana/pyroscope/tree/main/examples/grafana-agent-auto-instrumentation).
[pyroscope.scrape](/docs/agent/latest/flow/reference/components/pyroscope.scrape/)
[pyroscope.write](/docs/agent/latest/flow/reference/components/pyroscope.write/)
[discovery.kubernetes](/docs/agent/latest/flow/reference/components/discovery.kubernetes/)
Expand Down
7 changes: 4 additions & 3 deletions docs/sources/configure-client/grafana-agent/java/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ and `discover.process` components to work.

### Send data to Grafana Cloud Profiles

When sending to Grafana Cloud Profiles, you can use the following `pyroscope.write` component configuration which uses environment variables.
When sending to Grafana Cloud Profiles, you can use the following `pyroscope.write` component configuration which uses environment variables.

Ensure that you have appropriately configured the `GC_URL`, `GC_USER`, and `GC_PASSWORD` environment variables.

Expand Down Expand Up @@ -258,9 +258,10 @@ pyroscope.write "example" {
```

## References
For more information:

* [Examples](https://github.com/grafana/pyroscope/tree/main/examples/grafana-agent/java)
For more information:

* [Examples](https://github.com/grafana/pyroscope/tree/main/examples/grafana-agent-auto-instrumentation/java)
* [`pyroscope.java`](/docs/agent/next/flow/reference/components/pyroscope.java/)
* [`discovery.process`](/docs/agent/next/flow/reference/components/discovery.process/)
* [`discovery.kubernetes`](/docs/agent/next/flow/reference/components/discovery.kubernetes/)
16 changes: 8 additions & 8 deletions docs/sources/configure-client/language-sdks/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,44 @@ The following languages SDKs provide support for sending profiles from your appl
<td align="center"><a href="./go_push"><img src="https://user-images.githubusercontent.com/23323466/178160549-2d69a325-56ec-4e19-bca7-d460d400b163.png" width="100px;" alt=""/><br />
<b>Golang</b></a><br />
<a href="./go_push" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/golang-push" title="golang-examples">Examples</a>
<a href="https://github.com/grafana/pyroscope/tree/main/examples/language-sdk-instrumentation/golang-push" title="golang-examples">Examples</a>
</td>
<td align="center"><a href="./java"><img src="https://user-images.githubusercontent.com/23323466/178160550-2b5a623a-0f4c-4911-923f-2c825784d45d.png" width="100px;" alt=""/><br />
<b>Java</b></a><br />
<a href="./java" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/java/rideshare" title="java-examples">Examples</a>
<a href="https://github.com/grafana/pyroscope/tree/main/examples/language-sdk-instrumentation/java/rideshare" title="java-examples">Examples</a>
</td>
<td align="center"><a href="./python"><img src="https://user-images.githubusercontent.com/23323466/178160553-c78b8c15-99b4-43f3-a2a0-252b6c4862b1.png" width="100px;" alt=""/><br />
<b>Python</b></a><br />
<a href="./python" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/python" title="python-examples">Examples</a>
<a href="https://github.com/grafana/pyroscope/tree/main/examples/language-sdk-instrumentation/python" title="python-examples">Examples</a>
</td>
<td align="center"><a href="./ruby"><img src="https://user-images.githubusercontent.com/23323466/178160554-b0be2bc5-8574-4881-ac4c-7977c0b2c195.png" width="100px;" alt=""/><br />
<b>Ruby</b></a><br />
<a href="./ruby" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/ruby" title="ruby-examples">Examples</a>
<a href="https://github.com/grafana/pyroscope/tree/main/examples/language-sdk-instrumentation/ruby" title="ruby-examples">Examples</a>
</td>
</tr>
<tr>
<td align="center"><a href="./nodejs"><img src="https://user-images.githubusercontent.com/23323466/178160551-a79ee6ff-a5d6-419e-89e6-39047cb08126.png" width="100px;" alt=""/><br />
<b>NodeJS</b></a><br />
<a href="./nodejs" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/nodejs/express" title="examples">Examples</a>
<a href="https://github.com/grafana/pyroscope/tree/main/examples/language-sdk-instrumentation/nodejs/express" title="examples">Examples</a>
</td>
<td align="center"><a href="./dotnet"><img src="https://user-images.githubusercontent.com/23323466/178160544-d2e189c6-a521-482c-a7dc-5375c1985e24.png" width="100px;" alt=""/><br />
<b>Dotnet</b></a><br />
<a href="./dotnet" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/dotnet" title="examples">Examples</a>
<a href="https://github.com/grafana/pyroscope/tree/main/examples/language-sdk-instrumentation/dotnet" title="examples">Examples</a>
</td>
<td align="center"><a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-agent/ebpf/"><img src="https://user-images.githubusercontent.com/23323466/178160548-e974c080-808d-4c5d-be9b-c983a319b037.png" width="100px;" alt=""/><br />
<b>eBPF</b></a><br />
<a href="https://grafana.com/docs/pyroscope/latest/configure-client/grafana-agent/ebpf/" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/ebpf" title="examples">Examples</a>
<a href="https://github.com/grafana/pyroscope/tree/main/examples/grafana-agent-auto-instrumentation/ebpf" title="examples">Examples</a>
</td>
<td align="center"><a href="./rust"><img src="https://user-images.githubusercontent.com/23323466/178160555-fb6aeee7-5d31-4bcb-9e3e-41e9f2f7d5b4.png" width="100px;" alt=""/><br />
<b>Rust</b></a><br />
<a href="./rust" title="Documentation">Documentation</a><br />
<a href="https://github.com/grafana/pyroscope/tree/main/examples/rust/rideshare" title="examples">Examples</a>
<a href="https://github.com/grafana/pyroscope/tree/main/examples/language-sdk-instrumentation/rust/rideshare" title="examples">Examples</a>
</td>
</tr>
</table>
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/configure-client/language-sdks/dotnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ It is possible to dynamically change authorization credentials:
Pyroscope.Profiler.Instance.SetBasicAuth(basicAuthUser, BasicAuthPassword);
```

Here is a simple [example](https://github.com/grafana/pyroscope/blob/main/examples/dotnet/rideshare/example/Program.cs) exposing this APIs as an http endpoint.
Here is a simple [example](https://github.com/grafana/pyroscope/blob/main/examples/language-sdk-instrumentation/dotnet/rideshare/example/Program.cs) exposing this APIs as an http endpoint.

### Configuration options

Expand Down
4 changes: 2 additions & 2 deletions docs/sources/configure-client/language-sdks/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,6 @@ If your Pyroscope server has multi-tenancy enabled, you'll need to configure a t
## Java profiling examples

Check out the following resources to learn more about Java profiling:
- [Java examples](https://github.com/grafana/pyroscope/tree/main/examples/java/rideshare)
- [Java examples](https://github.com/grafana/pyroscope/tree/main/examples/language-sdk-instrumentaiton/java/rideshare)
- [Java Demo](https://demo.pyroscope.io/?query=rideshare-app-java.itimer%7B%7D) showing Java example with tags
- [Java blog post](https://github.com/grafana/pyroscope/tree/main/examples/java/rideshare#readme)
- [Java blog post](https://github.com/grafana/pyroscope/tree/main/examples/language-sdk-instrumentation/java/rideshare#readme)
2 changes: 1 addition & 1 deletion docs/sources/configure-client/language-sdks/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,5 @@ If your Pyroscope server has multi-tenancy enabled, you'll need to configure a t
## Python profiling examples

Check out the following resources to learn more about Python profiling:
- [Python examples](https://github.com/pyroscope-io/pyroscope/tree/main/examples/python)
- [Python examples](https://github.com/pyroscope-io/pyroscope/tree/main/examples/language-sdk-instrumentation/python)
- [Python demo](https://demo.pyroscope.io/?query=rideshare-app-python.cpu%7B%7D) showing Python example with tags
Loading

0 comments on commit 75db8b0

Please sign in to comment.