Skip to content

Commit 3a90287

Browse files
alanwestnotcool11pellaredcijothomasTimothy Mothra
authored
Update net7.0 branch from main (#3410)
* Added Jaeger Propagator to Opentelemetry.Extensions.Propagators (#3309) * Remove unnecessary bullet in CHANGELOG.md (#3352) Co-authored-by: Cijo Thomas <[email protected]> * Fix OTLP test (#3357) * Show that test is not doing what you might think it does * More asserts the merrier * Show this little test that it has potential * improve test coverage: InMemoryExporter & IDeferredMeterProviderBuilder (#3345) * [SDK] Circular buffer tweaks + cpu pressure test (#3349) * CircularBuffer tweaks and cpu pressure test. * Switch to Volatile.Read. * Perf tweaks. * Remove race check in debug after doing more testing. Co-authored-by: Cijo Thomas <[email protected]> * Fix event name logic + support null categoryname. (#3359) * In-memory Exporter: Buffer log scopes (#3360) * Buffer log scopes when using in-memory exporter. * CHANGELOG update. * Code review. * Tests. * CHANGELOG tweak. * SDK: Forward SetParentProvider to children of CompositeProcessor (#3368) * Examples: Fix ParentProvider not being set on MyFilteringProcessor (#3370) * Fix ParentProvider not being set on MyFilteringProcessor example. * Added XML comments. * Tweak. * Typo. * Logs: Add helper ctors & forceflush on OpenTelemetryLoggerProvider (#3364) * Add helper ctors & forceflush on OpenTelemetryLoggerProvider. * CHANGELOG update. * Unit tests. * Code review. * Code review. * Tweak. * SDK: Nullable annotations for base classes & batch + shims to enable compiler features (#3374) * Nullable annotations and shims for SDK base classes & batch. * Target updates. * Remove System.Collections.Immutable ref. * ApiCompat attribute exclusions. * ASPNETCore instrumentation to populate httpflavor tag (#3372) * improve test coverage: InMemoryExporter SnapshotMetric (#3344) * Fix AspNetCore metrics to use correct value for http.flavor (#3379) * Fix AspNetCore metrics to use correct value for http.flavor * word better * Logs: Add LogRecordData (#3378) * Add LogRecordData and hook up to LogRecord. * CHANGELOG update. * Code review. * Remove SetHttpFlavor from Http instrumentations (#3381) * Asp.Net Core trace instrumentation to populate http schema tag (#3392) * Try asp.net core tests with inproc server (#3394) * Dedupe IsPackable (#3398) * Remove AspNet and AspNet.TelemetryHttpModule instrumentation projects (#3397) * Handle possible exception when initializing the default service name (#3405) * HttpClient: Invoke Enrich when SocketException = HostNotFound (#3407) * Add & use ConfigureResource API. (#3307) Co-authored-by: tyler jago <[email protected]> Co-authored-by: Robert Pająk <[email protected]> Co-authored-by: Cijo Thomas <[email protected]> Co-authored-by: Timothy Mothra <[email protected]> Co-authored-by: Mikel Blanchard <[email protected]> Co-authored-by: Reiley Yang <[email protected]> Co-authored-by: Utkarsh Umesan Pillai <[email protected]> Co-authored-by: Christian Neumüller <[email protected]>
1 parent 0f0a96d commit 3a90287

File tree

160 files changed

+2682
-5376
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+2682
-5376
lines changed

OpenTelemetry.proj

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,8 @@
22
<ItemGroup>
33
<SolutionProjects Include="**\*.csproj" />
44

5-
<!-- Windows specific projects -->
6-
<SolutionProjects Remove="examples\AspNet\OpenTelemetry.Exporter.AspNet.csproj" Condition="'$(OS)' != 'Windows_NT'" />
7-
<SolutionProjects Remove="src\OpenTelemetry.Instrumentation.AspNet\OpenTelemetry.Instrumentation.AspNet.csproj" Condition="'$(OS)' != 'Windows_NT'" />
8-
<SolutionProjects Remove="test\OpenTelemetry.Instrumentation.AspNet.Tests\OpenTelemetry.Instrumentation.AspNet.Tests.csproj" Condition="'$(OS)' != 'Windows_NT'" />
9-
105
<PackProjects Include="src\**\*.csproj" />
116

12-
<!-- Windows specific projects -->
13-
<PackProjects Remove="src\OpenTelemetry.Instrumentation.AspNet\OpenTelemetry.Instrumentation.AspNet.csproj" Condition="'$(OS)' != 'Windows_NT'" />
147
</ItemGroup>
158

169
<Target Name="Build">

OpenTelemetry.sln

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7CB2F02E
2929
build\docker-compose.net6.0.yml = build\docker-compose.net6.0.yml
3030
build\docker-compose.netcoreapp3.1.yml = build\docker-compose.netcoreapp3.1.yml
3131
build\finalize-publicapi.ps1 = build\finalize-publicapi.ps1
32+
build\GlobalAttrExclusions.txt = build\GlobalAttrExclusions.txt
3233
build\opentelemetry-icon-color.png = build\opentelemetry-icon-color.png
3334
build\OpenTelemetry.prod.loose.ruleset = build\OpenTelemetry.prod.loose.ruleset
3435
build\OpenTelemetry.prod.ruleset = build\OpenTelemetry.prod.ruleset
@@ -72,10 +73,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Exporter.Cons
7273
EndProject
7374
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Exporter.Zipkin.Tests", "test\OpenTelemetry.Exporter.Zipkin.Tests\OpenTelemetry.Exporter.Zipkin.Tests.csproj", "{1D778D2E-9523-450E-A6E0-A36897C7E78E}"
7475
EndProject
75-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Instrumentation.AspNet", "src\OpenTelemetry.Instrumentation.AspNet\OpenTelemetry.Instrumentation.AspNet.csproj", "{B9EEACDD-CAFA-4B75-A18D-898E7DE21B17}"
76-
EndProject
77-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Instrumentation.AspNet.Tests", "test\OpenTelemetry.Instrumentation.AspNet.Tests\OpenTelemetry.Instrumentation.AspNet.Tests.csproj", "{55CBAADE-7040-46D6-A845-F207B4F0E281}"
78-
EndProject
7976
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests", "test\OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests\OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests.csproj", "{7C4026CA-6434-4762-8B77-D657EAEE1325}"
8077
EndProject
8178
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{F1D0972B-38CF-49C2-9F4B-4C5DE02FB71D}"
@@ -126,8 +123,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Instrumentati
126123
EndProject
127124
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Exporter.ZPages.Tests", "test\OpenTelemetry.Exporter.ZPages.Tests\OpenTelemetry.Exporter.ZPages.Tests.csproj", "{98F9556B-116F-49B5-9211-BB1D418446FF}"
128125
EndProject
129-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Examples.AspNet", "examples\AspNet\Examples.AspNet.csproj", "{9A4E3A68-904B-4835-A3C8-F664B73098DB}"
130-
EndProject
131126
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples.Console", "examples\Console\Examples.Console.csproj", "{FF3E6E08-E8E4-4523-B526-847CD989279F}"
132127
EndProject
133128
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples.AspNetCore", "examples\AspNetCore\Examples.AspNetCore.csproj", "{0935622B-9377-4056-8343-AE6ECDC274CF}"
@@ -200,10 +195,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "customizing-the-sdk", "docs
200195
EndProject
201196
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Exporter.Prometheus", "src\OpenTelemetry.Exporter.Prometheus\OpenTelemetry.Exporter.Prometheus.csproj", "{52158A12-E7EF-45A1-859F-06F9B17410CB}"
202197
EndProject
203-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule", "src\OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule\OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.csproj", "{F38E511B-1877-4E8A-8051-7879FC7DF8A4}"
204-
EndProject
205-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests", "test\OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests\OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests.csproj", "{4D7201BC-7124-4401-AD65-FAB58A053D45}"
206-
EndProject
207198
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "learning-more-instruments", "docs\metrics\learning-more-instruments\learning-more-instruments.csproj", "{E7F491CC-C37E-4A56-9CA7-8F77F59E0614}"
208199
EndProject
209200
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "getting-started", "docs\metrics\getting-started\getting-started.csproj", "{EA60B549-F712-4ABE-8E44-FCA83B78C06E}"
@@ -304,14 +295,6 @@ Global
304295
{1D778D2E-9523-450E-A6E0-A36897C7E78E}.Debug|Any CPU.Build.0 = Debug|Any CPU
305296
{1D778D2E-9523-450E-A6E0-A36897C7E78E}.Release|Any CPU.ActiveCfg = Release|Any CPU
306297
{1D778D2E-9523-450E-A6E0-A36897C7E78E}.Release|Any CPU.Build.0 = Release|Any CPU
307-
{B9EEACDD-CAFA-4B75-A18D-898E7DE21B17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
308-
{B9EEACDD-CAFA-4B75-A18D-898E7DE21B17}.Debug|Any CPU.Build.0 = Debug|Any CPU
309-
{B9EEACDD-CAFA-4B75-A18D-898E7DE21B17}.Release|Any CPU.ActiveCfg = Release|Any CPU
310-
{B9EEACDD-CAFA-4B75-A18D-898E7DE21B17}.Release|Any CPU.Build.0 = Release|Any CPU
311-
{55CBAADE-7040-46D6-A845-F207B4F0E281}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
312-
{55CBAADE-7040-46D6-A845-F207B4F0E281}.Debug|Any CPU.Build.0 = Debug|Any CPU
313-
{55CBAADE-7040-46D6-A845-F207B4F0E281}.Release|Any CPU.ActiveCfg = Release|Any CPU
314-
{55CBAADE-7040-46D6-A845-F207B4F0E281}.Release|Any CPU.Build.0 = Release|Any CPU
315298
{7C4026CA-6434-4762-8B77-D657EAEE1325}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
316299
{7C4026CA-6434-4762-8B77-D657EAEE1325}.Debug|Any CPU.Build.0 = Debug|Any CPU
317300
{7C4026CA-6434-4762-8B77-D657EAEE1325}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -324,10 +307,6 @@ Global
324307
{98F9556B-116F-49B5-9211-BB1D418446FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
325308
{98F9556B-116F-49B5-9211-BB1D418446FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
326309
{98F9556B-116F-49B5-9211-BB1D418446FF}.Release|Any CPU.Build.0 = Release|Any CPU
327-
{9A4E3A68-904B-4835-A3C8-F664B73098DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
328-
{9A4E3A68-904B-4835-A3C8-F664B73098DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
329-
{9A4E3A68-904B-4835-A3C8-F664B73098DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
330-
{9A4E3A68-904B-4835-A3C8-F664B73098DB}.Release|Any CPU.Build.0 = Release|Any CPU
331310
{FF3E6E08-E8E4-4523-B526-847CD989279F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
332311
{FF3E6E08-E8E4-4523-B526-847CD989279F}.Debug|Any CPU.Build.0 = Debug|Any CPU
333312
{FF3E6E08-E8E4-4523-B526-847CD989279F}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -412,14 +391,6 @@ Global
412391
{52158A12-E7EF-45A1-859F-06F9B17410CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
413392
{52158A12-E7EF-45A1-859F-06F9B17410CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
414393
{52158A12-E7EF-45A1-859F-06F9B17410CB}.Release|Any CPU.Build.0 = Release|Any CPU
415-
{F38E511B-1877-4E8A-8051-7879FC7DF8A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
416-
{F38E511B-1877-4E8A-8051-7879FC7DF8A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
417-
{F38E511B-1877-4E8A-8051-7879FC7DF8A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
418-
{F38E511B-1877-4E8A-8051-7879FC7DF8A4}.Release|Any CPU.Build.0 = Release|Any CPU
419-
{4D7201BC-7124-4401-AD65-FAB58A053D45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
420-
{4D7201BC-7124-4401-AD65-FAB58A053D45}.Debug|Any CPU.Build.0 = Debug|Any CPU
421-
{4D7201BC-7124-4401-AD65-FAB58A053D45}.Release|Any CPU.ActiveCfg = Release|Any CPU
422-
{4D7201BC-7124-4401-AD65-FAB58A053D45}.Release|Any CPU.Build.0 = Release|Any CPU
423394
{E7F491CC-C37E-4A56-9CA7-8F77F59E0614}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
424395
{E7F491CC-C37E-4A56-9CA7-8F77F59E0614}.Debug|Any CPU.Build.0 = Debug|Any CPU
425396
{E7F491CC-C37E-4A56-9CA7-8F77F59E0614}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -489,7 +460,6 @@ Global
489460
{E69578EB-B456-4062-A645-877CD964528B} = {F1D0972B-38CF-49C2-9F4B-4C5DE02FB71D}
490461
{C1542297-8763-4DF4-957C-489ED771C21D} = {7CB2F02E-03FA-4FFF-89A5-C51F107623FD}
491462
{D2E73927-5966-445C-94E9-EFE6F269C8D5} = {7CB2F02E-03FA-4FFF-89A5-C51F107623FD}
492-
{9A4E3A68-904B-4835-A3C8-F664B73098DB} = {E359BB2B-9AEC-497D-B321-7DF2450C3B8E}
493463
{FF3E6E08-E8E4-4523-B526-847CD989279F} = {E359BB2B-9AEC-497D-B321-7DF2450C3B8E}
494464
{0935622B-9377-4056-8343-AE6ECDC274CF} = {E359BB2B-9AEC-497D-B321-7DF2450C3B8E}
495465
{2C7DD1DA-C229-4D9E-9AF0-BCD5CD3E4948} = {7CB2F02E-03FA-4FFF-89A5-C51F107623FD}

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ Here are the most commonly used components:
5353
Here are the [instrumentation
5454
libraries](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/glossary.md#instrumentation-library):
5555

56-
* [ASP.NET](./src/OpenTelemetry.Instrumentation.AspNet/README.md)
5756
* [ASP.NET Core](./src/OpenTelemetry.Instrumentation.AspNetCore/README.md)
5857
* [Grpc.Net.Client](./src/OpenTelemetry.Instrumentation.GrpcNetClient/README.md)
5958
* [HTTP clients](./src/OpenTelemetry.Instrumentation.Http/README.md)

build/Common.nonprod.props

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
<GrpcAspNetCorePkgVer>[2.43.0,3.0)</GrpcAspNetCorePkgVer>
3838
<GrpcAspNetCoreServerPkgVer>[2.43.0, 3.0)</GrpcAspNetCoreServerPkgVer>
3939
<GrpcToolsPkgVer>[2.44.0,3.0)</GrpcToolsPkgVer>
40-
<MicrosoftAspNetMvcPkgVer>[5.2.7,6.0)</MicrosoftAspNetMvcPkgVer>
41-
<MicrosoftAspNetWebApiWebHostPkgVer>[5.2.7,6.0)</MicrosoftAspNetWebApiWebHostPkgVer>
42-
<MicrosoftAspNetWebPagesPkgVer>[3.2.7,4.0)</MicrosoftAspNetWebPagesPkgVer>
4340
<MicrosoftExtensionsHostingPkgVer>[3.1.6,5.0)</MicrosoftExtensionsHostingPkgVer>
4441
<MicrosoftExtensionsLoggingPkgVer>[6.0.0,)</MicrosoftExtensionsLoggingPkgVer>
4542
<MicrosoftExtensionsLoggingAbstractionsPkgVer>[6.0.0,)</MicrosoftExtensionsLoggingAbstractionsPkgVer>

build/Common.prod.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<PackageOutputPath Condition="$(Build_ArtifactStagingDirectory) != ''">$(Build_ArtifactStagingDirectory)</PackageOutputPath>
3636
<GenerateDocumentationFile>true</GenerateDocumentationFile>
3737
<!--<MinVerVerbosity>detailed</MinVerVerbosity>-->
38+
<ApiCompatExcludeAttributeList>$(RepoRoot)\build\GlobalAttrExclusions.txt</ApiCompatExcludeAttributeList>
3839
</PropertyGroup>
3940

4041
<Target Name="AssemblyVersionTarget" AfterTargets="MinVer" Condition="'$(MinVerVersion)'!='' AND '$(BuildNumber)' != ''">

build/GlobalAttrExclusions.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// These attributes should be excluded from ApiCompat checks.
2+
3+
T:System.Runtime.CompilerServices.CompilerGeneratedAttribute
4+
T:System.Runtime.CompilerServices.NullableContextAttribute

docs/logs/customizing-the-sdk/Program.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ public static void Main()
3030
builder.AddOpenTelemetry(options =>
3131
{
3232
options.IncludeScopes = true;
33-
options.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService(
34-
serviceName: "MyService",
35-
serviceVersion: "1.0.0"));
33+
options.ConfigureResource(r => r.AddService(serviceName: "MyService", serviceVersion: "1.0.0"));
3634
options.AddConsoleExporter();
3735
});
3836
});

docs/logs/customizing-the-sdk/README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,26 +52,25 @@ var loggerFactory = LoggerFactory.Create(builder =>
5252

5353
For more information on Processors, please review [Extending the SDK](../extending-the-sdk/README.md#processor)
5454

55-
### SetResourceBuilder
55+
### ConfigureResource
5656

5757
[Resource](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/sdk.md)
5858
is the immutable representation of the entity producing the telemetry.
5959
If no `Resource` is explicitly configured, the default is to use a resource
6060
indicating this [Telemetry
6161
SDK](https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/resource/semantic_conventions#telemetry-sdk).
62-
The `SetResourceBuilder` method on `OpenTelemetryLoggerOptions` can be used to
63-
set a single `ResourceBuilder`. If `SetResourceBuilder` is called multiple
64-
times, only the last is kept. It is not possible to change the resource builder
62+
The `ConfigureResource` method on `OpenTelemetryLoggerOptions` can be used to
63+
configure the `ResourceBuilder`. It is not possible to change the resources
6564
*after* creating the `LoggerFactory`.
6665

67-
The snippet below shows configuring a custom `ResourceBuilder` to the provider.
66+
The snippet below shows configuring the `ResourceBuilder` of the provider.
6867

6968
```csharp
7069
var loggerFactory = LoggerFactory.Create(builder =>
7170
{
7271
builder.AddOpenTelemetry(options =>
7372
{
74-
options.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService(
73+
options.ConfigureResource(r => r.AddService(
7574
serviceName: "MyService",
7675
serviceVersion: "1.0.0"
7776
));

docs/metrics/customizing-the-sdk/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ In a typical application, a single `MeterProvider` is created at application
3535
startup and disposed at application shutdown. It is important to ensure that the
3636
provider is not disposed too early. Actual mechanism depends on the application
3737
type. For example, in a typical ASP.NET application, `MeterProvider` is created
38-
in `Application_Start`, and disposed in `Application_End` (both methods part of
39-
Global.asax.cs file) as shown [here](../../../examples/AspNet/Global.asax.cs). In
40-
a typical ASP.NET Core application, `MeterProvider` lifetime is managed by
38+
in `Application_Start`, and disposed in `Application_End` (both methods are a
39+
part of the Global.asax.cs file) as shown
40+
[here](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/examples/AspNet/Global.asax.cs).
41+
In a typical ASP.NET Core application, `MeterProvider` lifetime is managed by
4142
leveraging the built-in Dependency Injection container as shown
4243
[here](../../../examples/AspNetCore/Program.cs).
4344

docs/trace/customizing-the-sdk/README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ processors, etc. Naturally, almost all the customizations must be done on the
1515

1616
Building a `TracerProvider` is done using `TracerProviderBuilder` which must be
1717
obtained by calling `Sdk.CreateTracerProviderBuilder()`. `TracerProviderBuilder`
18-
exposes various methods which configures the provider it is going to build. These
19-
includes methods like `SetSampler`, `AddProcessor` etc, and are explained in
20-
subsequent sections of this document. Once configuration is done, calling
18+
exposes various methods which configures the provider it is going to build.
19+
These includes methods like `SetSampler`, `AddProcessor` etc, and are explained
20+
in subsequent sections of this document. Once configuration is done, calling
2121
`Build()` on the `TracerProviderBuilder` builds the `TracerProvider` instance.
2222
Once built, changes to its configuration is not allowed, with the exception of
2323
adding more processors. In most cases, a single `TracerProvider` is created at
@@ -38,9 +38,10 @@ In a typical application, a single `TracerProvider` is created at application
3838
startup and disposed at application shutdown. It is important to ensure that the
3939
provider is not disposed too early. Actual mechanism depends on the application
4040
type. For example, in a typical ASP.NET application, `TracerProvider` is created
41-
in `Application_Start`, and disposed in `Application_End` (both methods part of
42-
Global.asax.cs file) as shown [here](../../../examples/AspNet/Global.asax.cs). In
43-
a typical ASP.NET Core application, `TracerProvider` lifetime is managed by
41+
in `Application_Start`, and disposed in `Application_End` (both methods are a
42+
part of the Global.asax.cs file) as shown
43+
[here](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/examples/AspNet/Global.asax.cs).
44+
In a typical ASP.NET Core application, `TracerProvider` lifetime is managed by
4445
leveraging the built-in Dependency Injection container as shown
4546
[here](../../../examples/AspNetCore/Program.cs).
4647

@@ -98,13 +99,12 @@ using var tracerProvider = Sdk.CreateTracerProviderBuilder()
9899

99100
See [Program.cs](./Program.cs) for complete example.
100101

101-
**Note**
102-
A common mistake while configuring `TracerProvider` is forgetting to add
103-
all `ActivitySources` to the provider. It is recommended to leverage the
102+
**Note** A common mistake while configuring `TracerProvider` is forgetting to
103+
add all `ActivitySources` to the provider. It is recommended to leverage the
104104
wild card subscription model where it makes sense. For example, if your
105-
application is expecting to enable tracing from a number of libraries
106-
from a company "Abc", the you can use `AddSource("Abc.*")` to enable
107-
all sources whose name starts with "Abc.".
105+
application is expecting to enable tracing from a number of libraries from a
106+
company "Abc", the you can use `AddSource("Abc.*")` to enable all sources whose
107+
name starts with "Abc.".
108108

109109
### Instrumentation
110110

@@ -124,5 +124,5 @@ all sources whose name starts with "Abc.".
124124

125125
## Context Propagation
126126

127-
// TODO: OpenTelemetry Sdk contents about Context.
128-
// TODO: Links to built-in instrumentations doing Propagation.
127+
// TODO: OpenTelemetry Sdk contents about Context. // TODO: Links to built-in
128+
instrumentations doing Propagation.

0 commit comments

Comments
 (0)