Skip to content

Commit 7a7784e

Browse files
authored
update readme with info from docs repo
1 parent 52a8fc3 commit 7a7784e

File tree

1 file changed

+82
-24
lines changed

1 file changed

+82
-24
lines changed

docs/README.md

Lines changed: 82 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,84 @@
1-
# Datadog APM .NET Client Libraries
2-
3-
This repository contains the sources for the client-side components of the Datadog product suite for Application Telemetry Collection and Application Performance Monitoring for .NET Applications.
4-
5-
**[Datadog .NET Tracer](https://github.com/DataDog/dd-trace-dotnet/tree/master/tracer)**: A set of .NET libraries that let you trace any piece of your .NET code. It automatically instruments supported libraries out-of-the-box and also supports custom instrumentation to instrument your own code.
6-
7-
**[Datadog .NET Continuous Profiler](https://github.com/DataDog/dd-trace-dotnet/tree/master/profiler)**: Libraries that automatically profile your application.
8-
9-
## Downloads
10-
11-
| Package | Download |
12-
|------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
13-
| Windows and Linux Installers | [![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/DataDog/dd-trace-dotnet)](https://github.com/DataDog/dd-trace-dotnet/releases) |
14-
| `Datadog.Trace` | [![Datadog.Trace](https://img.shields.io/nuget/vpre/Datadog.Trace.svg)](https://www.nuget.org/packages/Datadog.Trace) |
15-
| `Datadog.Trace.OpenTracing` | [![Datadog.Trace.OpenTracing](https://img.shields.io/nuget/vpre/Datadog.Trace.OpenTracing.svg)](https://www.nuget.org/packages/Datadog.Trace.OpenTracing) |
16-
17-
## Build status
18-
19-
Build status on `master`: [![Build](https://dev.azure.com/datadoghq/dd-trace-dotnet/_apis/build/status/consolidated-pipeline?branchName=master&stageName=build_windows_tracer)](https://dev.azure.com/datadoghq/dd-trace-dotnet/_build/latest?definitionId=54&branchName=master)
1+
# Pyroscope .NET Agent
2+
3+
The Java profiling agent for Pyroscope.io. Based on [dd-trace-dotnet](https://github.com/DataDog/dd-trace-dotnet) with some key improvements:
4+
- support for memory profiling
5+
- support for wall (wall-clock) time profiling
6+
- support for exceptions profiling
7+
- support for dynamic tags
8+
9+
## Supported .NET versions:
10+
- .NET 6.0
11+
12+
## Supported platforms
13+
14+
| Spy Name | Type | Linux | macOS | Windows | Docker |
15+
|:------------:|:------------:|:-----:|:-----:|:-------:|:------:|
16+
| dotnetspy | `embedded` || | | |
17+
18+
## Running the .NET profiler
19+
20+
1. Download `Pyroscope.Profiler.Native.so` and `Pyroscope.Linux.ApiWrapper.x64.so` from [latest release](https://github.com/pyroscope-io/pyroscope-dotnet/releases/)
21+
22+
2. Set the following required environment variables to enable profiler
23+
```shell
24+
PYROSCOPE_APPLICATION_NAME=rideshare.dotnet.app
25+
PYROSCOPE_SERVER_ADDRESS=http://localhost:4040
26+
PYROSCOPE_AUTH_TOKEN="psx-..." # optional auth token
27+
PYROSCOPE_PROFILING_ENABLED=1
28+
CORECLR_ENABLE_PROFILING=1
29+
CORECLR_PROFILER={BD1A650D-AC5D-4896-B64F-D6FA25D6B26A}
30+
CORECLR_PROFILER_PATH=Pyroscope.Profiler.Native.so
31+
LD_PRELOAD=Pyroscope.Linux.ApiWrapper.x64.so
32+
```
33+
34+
### Dynamic labels
35+
It is possible to add labels to the profiling data. These labels can be used to filter the data in the UI.
36+
37+
1. Add dependency
38+
```shell
39+
dotnet add package Pyroscope
40+
````
41+
2. Create a LabelSet and wrap a piece of code with Pyroscope.LabelsWrapper
42+
```java
43+
var labels = Pyroscope.LabelSet.Empty.BuildUpon()
44+
.Add("key1", "value1")
45+
.Build();
46+
Pyroscope.LabelsWrapper.Do(labels, () =>
47+
{
48+
SlowCode();
49+
});
50+
```
51+
52+
Labels can be nested. For nesting LabelSets use `LabelSet.BuildUpon` on non-empty set.
53+
```java
54+
var labels = Pyroscope.LabelSet.Empty.BuildUpon()
55+
.Add("key1", "value1")
56+
.Build();
57+
Pyroscope.LabelsWrapper.Do(labels, () =>
58+
{
59+
var labels2 = labels.BuildUpon()
60+
.Add("key2", "value2")
61+
.Build();
62+
Pyroscope.LabelsWrapper.Do(labels2, () =>
63+
{
64+
SlowCode();
65+
});
66+
FastCode();
67+
});
68+
```
69+
70+
## Configuration
71+
72+
| ENVIRONMENT VARIABLE | Type | DESCRIPTION |
73+
|---------------------------------|------------|-----------|
74+
| PYROSCOPE_PROFILING_LOG_DIR | String | Sets the directory for .NET Profiler logs. Defaults to /var/log/pyroscope/ . |
75+
| PYROSCOPE_LABELS | String | Static labels to apply to an uploaded profile. Must be a list of key:value separated by commas such as: layer:api,team:intake. |
76+
| PYROSCOPE_PROFILING_ENABLED | Boolean | If set to true, enables the .NET Profiler. Defaults to false. |
77+
| PYROSCOPE_PROFILING_WALLTIME_ENABLED | Boolean | If set to false, disables the Wall time profiling. Defaults to true. |
78+
| PYROSCOPE_PROFILING_CPU_ENABLED | Boolean | If set to false, disables the CPU profiling. Defaults to true. |
79+
| PYROSCOPE_PROFILING_EXCEPTION_ENABLED | Boolean | If set to true, enables the Exceptions profiling (beta). Defaults to false. |
80+
| PYROSCOPE_PROFILING_ALLOCATION_ENABLED | Boolean | If set to true, enables the Allocations profiling (beta). Defaults to false. |
81+
| PYROSCOPE_PROFILING_LOCK_ENABLED | Boolean | If set to true, enables the Lock Contention profiling (beta). Defaults to false. |
2082

2183
## Copyright
2284

@@ -33,8 +95,4 @@ See [license information](../LICENSE).
3395

3496
### Security Vulnerabilities
3597

36-
If you have found a security issue, please contact the security team directly at [[email protected]](mailto:[email protected]).
37-
38-
### Other feedback
39-
40-
If you have questions, feedback, or feature requests, reach our [support](https://docs.datadoghq.com/help).
98+
If you have found a security issue, please contact the security team directly at [[email protected]](mailto:[email protected]).

0 commit comments

Comments
 (0)