Skip to content

Commit 9a1d5d8

Browse files
committed
chore: Fix typo in NSwag documentation and update library version in index.html
1 parent f78d97c commit 9a1d5d8

File tree

3 files changed

+65
-55
lines changed

3 files changed

+65
-55
lines changed

content/en/dotnet-templates/tutorials/NSwag/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dotnet tool install -g NSwag.CodeGeneration
3636

3737
Into the `scripts` folder you will find `nswag-regen.ps1`. This script will generate the necessary files for you. You can run the script by executing the following command:
3838

39-
Before run be shure the API is running, you can run the API by executing the following command:
39+
Before run be sure the API is running, you can run the API by executing the following command:
4040

4141
```ps
4242
# Run your API locally

content/en/library/distributed-tracing/index.md

Lines changed: 63 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ dotnet add package Genocs.Tracing
2424

2525
> **Open Tracing migration to Open Telemetry**
2626
>
27-
> We are committed to move forward from former Open Tracing to the [Open Telemetry](https://opentelemetry.io/)
27+
> We have removed are Open Tracing and are complaint to the [Open Telemetry](https://opentelemetry.io/)
28+
> Library. We are in the process of upgrade naming convention of our library to Open Telemetry. Please stay tuned for the updates.
2829
>
2930
3031
## Dependencies
@@ -45,8 +46,11 @@ Inside your *Program.cs* extend `IGenocsBuilder` with `AddOpenTelemetry()` then
4546

4647
var builder = services
4748
.AddGenocs()
48-
.AddOpenTelemetry()
49-
.AddJaeger();
49+
.AddOpenTelemetry();
50+
51+
// No need to register ITracer as it is already registered by AddJaeger() method
52+
// .AddJaeger();
53+
5054

5155
//other registrations
5256
return builder.Build();
@@ -58,42 +62,45 @@ Once your application produces spans needed for Jaeger, you need to enable repor
5862

5963
### Creating custom spans
6064

61-
Once the `ITracer` got registered in Startup.cs file, you can inject it to any class you want to create custom spans (not provided by Open Tracing) as follows:
62-
63-
``` cs
64-
public class MyClass
65-
{
66-
private readonly ITracer _tracer;
67-
68-
public MyClass(ITracer tracer)
69-
{
70-
_tracer = tracer;
71-
}
72-
73-
public void MyMethod()
74-
{
75-
using(var scope = BuildScope())
76-
{
77-
var span = scope.Span;
78-
79-
try
80-
{
81-
span.Log("Starting the execution of the code");
82-
///some code
83-
}
84-
catch(Exception ex)
85-
{
86-
span.Log(ex.Message);
87-
span.SetTag(Tags.Error, true);
88-
}
89-
}
90-
}
91-
92-
private IScope BuildScope()
93-
=> _tracer
94-
.BuildSpan("Executing important code")
95-
.StartActive(true);
96-
}
65+
> **Note:**
66+
> Obsolate: This method is obsolate and will be removed in future versions. Please use the new method to create custom spans.
67+
68+
> Once the `ITracer` got registered in Startup.cs file, you can inject it to any class you want to create custom spans (not provided by Open > Tracing) as follows:
69+
>
70+
> ``` cs
71+
> public class MyClass
72+
> {
73+
> private readonly ITracer _tracer;
74+
>
75+
> public MyClass(ITracer tracer)
76+
> {
77+
> _tracer = tracer;
78+
> }
79+
>
80+
> public void MyMethod()
81+
> {
82+
> using(var scope = BuildScope())
83+
> {
84+
> var span = scope.Span;
85+
>
86+
> try
87+
> {
88+
> span.Log("Starting the execution of the code");
89+
> ///some code
90+
> }
91+
> catch(Exception ex)
92+
> {
93+
> span.Log(ex.Message);
94+
> span.SetTag(Tags.Error, true);
95+
> }
96+
> }
97+
> }
98+
>
99+
> private IScope BuildScope()
100+
> => _tracer
101+
> .BuildSpan("Executing important code")
102+
> .StartActive(true);
103+
> }
97104
```
98105
99106
## Options
@@ -102,32 +109,35 @@ public class MyClass
102109

103110
`serviceName` - The name of the application that’s going to be used in Jaeger query engine.
104111

105-
`udpHost` - The host part of the Jaeger endpoint (UDP).
112+
`endpoint` - The host part of the Jaeger endpoint.
113+
114+
`protocol` - The protocol used to communicate with Jaeger engine. Default is `Grpc`. The allowed values are: `and` or `HttpProtobuf`.
106115

107-
`udpPort` - The port of the Jaeger endpoint (UDP).
116+
`processorType` - The type of the processor used to send spans to Jaeger. Default is `Batch`. The allowed values are: `Batch` and `Simple`.
108117

109-
`maxPacketSize` - Then maximum size of the UDP header packet (by default 0). This is not required.
118+
`maxQueueSize` - The maximum number of spans that can be stored in the queue before they are sent to Jaeger. Default is `2048`.
110119

111-
`sampler` - The allowed values are: const, rate and probabilistic. For more details about sampling check the official Jaeger Docs.
120+
`scheduledDelayMilliseconds` - The time in milliseconds between each attempt to send spans to Jaeger. Default is `5000`.
112121

113-
`maxTracesPerSecond` - It determines maximum number of reported traces per second. Required only for rate sampler.
122+
`exporterTimeoutMilliseconds` - The time in milliseconds after which the exporter will stop trying to send spans to Jaeger. Default is `30000`.
114123

115-
`samplingRate` - It determines the percentage of spans to report. Required only for probabilistic sampler.
124+
`maxExportBatchSize` - The maximum number of spans that can be sent to Jaeger in a single batch. Default is `512`.
116125

117126
## Settings
118127

119128
Following settings are required to be set in your **appsettings.json**
120129

121130
``` json
122131
"jaeger": {
123-
"enabled": true,
124-
"serviceName": "users",
125-
"udpHost": "localhost",
126-
"udpPort": 6831,
127-
"maxPacketSize": 65000,
128-
"sampler": "const",
129-
"maxTracesPerSecond": 10,
130-
"excludePaths": ["/", "/ping", "/metrics"]
132+
"enabled": true,
133+
"serviceName": "orders",
134+
"endpoint": "http://localhost:4317",
135+
"protocol": "Grpc",
136+
"processorType": "Batch",
137+
"maxQueueSize": 2048,
138+
"scheduledDelayMilliseconds": 5000,
139+
"exporterTimeoutMilliseconds": 30000,
140+
"maxExportBatchSize": 512
131141
}
132142
```
133143

layouts/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ <h1 class="mt-10"><b style="font-weight: 900; font-size: 4em;">Genocs</b></h1>
66
<p class="gradient-banner">{{ .Params.sub }}</p>
77
<h2 style="font-weight: 900; font-size: 4em;">
88
✔️ <b class="code-green">
9-
<a href="https://github.com/Genocs/genocs-library/releases/tag/v6.0.0">v6.0.0</a>
9+
<a href="https://github.com/Genocs/genocs-library/releases/tag/v6.1.0">v6.1.0</a>
1010
</b>
1111
</h2>
1212
<div class="justify-content-center text-center">

0 commit comments

Comments
 (0)