You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
38
38
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:
> 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.
28
29
>
29
30
30
31
## Dependencies
@@ -45,8 +46,11 @@ Inside your *Program.cs* extend `IGenocsBuilder` with `AddOpenTelemetry()` then
45
46
46
47
varbuilder=services
47
48
.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
+
50
54
51
55
//other registrations
52
56
returnbuilder.Build();
@@ -58,42 +62,45 @@ Once your application produces spans needed for Jaeger, you need to enable repor
58
62
59
63
### Creating custom spans
60
64
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
-
publicclassMyClass
65
-
{
66
-
privatereadonlyITracer_tracer;
67
-
68
-
publicMyClass(ITracertracer)
69
-
{
70
-
_tracer=tracer;
71
-
}
72
-
73
-
publicvoidMyMethod()
74
-
{
75
-
using(varscope=BuildScope())
76
-
{
77
-
varspan=scope.Span;
78
-
79
-
try
80
-
{
81
-
span.Log("Starting the execution of the code");
82
-
///some code
83
-
}
84
-
catch(Exceptionex)
85
-
{
86
-
span.Log(ex.Message);
87
-
span.SetTag(Tags.Error, true);
88
-
}
89
-
}
90
-
}
91
-
92
-
privateIScopeBuildScope()
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
+
>publicclassMyClass
72
+
> {
73
+
> privatereadonlyITracer_tracer;
74
+
>
75
+
> publicMyClass(ITracertracer)
76
+
> {
77
+
>_tracer=tracer;
78
+
> }
79
+
>
80
+
> publicvoidMyMethod()
81
+
> {
82
+
>using(varscope=BuildScope())
83
+
> {
84
+
>varspan=scope.Span;
85
+
>
86
+
>try
87
+
> {
88
+
>span.Log("Starting the execution of the code");
89
+
>///some code
90
+
> }
91
+
>catch(Exceptionex)
92
+
> {
93
+
>span.Log(ex.Message);
94
+
>span.SetTag(Tags.Error, true);
95
+
> }
96
+
> }
97
+
> }
98
+
>
99
+
> privateIScopeBuildScope()
100
+
> =>_tracer
101
+
> .BuildSpan("Executing important code")
102
+
> .StartActive(true);
103
+
> }
97
104
```
98
105
99
106
## Options
@@ -102,32 +109,35 @@ public class MyClass
102
109
103
110
`serviceName` - The name of the application that’s going to be used in Jaeger query engine.
104
111
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`.
106
115
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`.
108
117
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`.
110
119
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`.
112
121
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`.
114
123
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`.
116
125
117
126
## Settings
118
127
119
128
Following settings are required to be set in your **appsettings.json**
0 commit comments