Skip to content

Commit 6b7573b

Browse files
committed
Address Manu's comments
1 parent bc0cf6e commit 6b7573b

File tree

1 file changed

+9
-38
lines changed

1 file changed

+9
-38
lines changed

README.md

Lines changed: 9 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -91,31 +91,19 @@ instrument your code and should be accessed exclusively through the
9191
`Tracer` created with the default settings but you may instantiate a new one
9292
with customized values with the `Tracer.Create` method.
9393

94-
To get a tracer with default parameters (i.e. the agent endpoint set to
95-
`http://localhost:8126`, and the default service name set to the name of the
96-
AppDomain):
94+
`Tracer.Create` takes a number of optional parameters that can be used to
95+
customize the returned `Tracer`:
9796

98-
```csharp
99-
Tracer.Instance = Tracer.Create();
100-
```
97+
- agentEndpoint: the agent endpoint where the traces will be sent (default is http://localhost:8126)
98+
- defaultServiceName: default name of the service (default is the name of the executing assembly)
99+
- isDebugEnabled: turns on all debug logging, this may have an impact on application performance (default is false)
101100

102-
Customize your tracer object by adding optional parameters to the
103-
`Tracer.Create` call:
104-
105-
By default the service name is set to the name of the AppDomain, choose a
106-
custom name with the defaultServiceName parameter:
101+
For example to set a custom service name:
107102

108103
```csharp
109104
Tracer.Instance = Tracer.Create(defaultServiceName: "YourServiceName")
110105
```
111106

112-
By default, the trace endpoint is set to `http://localhost:8126`, send traces
113-
to a different endpoint with the agentEndpoint parameter:
114-
115-
```csharp
116-
Tracer.Instance = Tracer.Create(agentEndpoint: new Uri("http://myendpoint:port"));
117-
```
118-
119107
#### In process propagation
120108

121109
We want to keep track of the dependencies between spans created inside a
@@ -183,8 +171,8 @@ scope.Span = "ResourceName";
183171
Thread.Sleep(1000);
184172

185173

186-
// Dispose closes the underlying span, this sets its duration and sends it to the agent (if you don't call Dispose the data will never be sent to Datadog)
187-
scope.Dispose();
174+
// Close closes the underlying span, this sets its duration and sends it to the agent (if you don't call Close the data will never be sent to Datadog)
175+
scope.Close();
188176
```
189177

190178
You may add custom tags by calling `Span.SetTag`:
@@ -198,24 +186,7 @@ You should not have to explicitly declare parent/children relationship between y
198186

199187
```csharp
200188
Span parent = tracer.StartSpan("Parent");
201-
Span child = tracer.StartSpan("Child", parent: parent.Context);
202-
```
203-
204-
#### Advanced Usage
205-
206-
When creating a tracer, add some metadata to your services to customize how they will appear in your Datadog application:
207-
208-
```csharp
209-
var serviceInfoList = new List<ServiceInfo>
210-
{
211-
new ServiceInfo
212-
{
213-
App = "MyAppName",
214-
AppType = "web",
215-
ServiceName = "MyServiceName"
216-
}
217-
};
218-
Tracer tracer = Tracer.CreateTracer(serviceInfoList: serviceInfoList);
189+
Span child = tracer.StartSpan("Child", childOf: parent.Context);
219190
```
220191

221192
## Development

0 commit comments

Comments
 (0)