Skip to content

Commit e2a867f

Browse files
authored
[Instrumentation.Http] Move to contrib repository (#5574)
1 parent e25d128 commit e2a867f

File tree

47 files changed

+24
-6788
lines changed

Some content is hidden

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

47 files changed

+24
-6788
lines changed

Directory.Packages.props

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="[17.8.0,18.0.0)" />
8787
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="[1.1.1,2.0)" />
8888
<PackageVersion Include="MinVer" Version="[5.0.0,6.0)" />
89+
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="[1.8.1,2.0)" />
8990
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="[1.5.1,2.0)" />
9091
<PackageVersion Include="RabbitMQ.Client" Version="[6.6.0,7.0)" />
9192
<PackageVersion Include="StyleCop.Analyzers" Version="[1.2.0-beta.556,2.0)" />

OpenTelemetry.sln

-12
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples.AspNetCore", "exam
130130
EndProject
131131
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benchmarks", "test\Benchmarks\Benchmarks.csproj", "{DE9130A4-F30A-49D7-8834-41DE3021218B}"
132132
EndProject
133-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Instrumentation.Http.Tests", "test\OpenTelemetry.Instrumentation.Http.Tests\OpenTelemetry.Instrumentation.Http.Tests.csproj", "{DE9EB7D8-9CC5-4073-90B3-9FBF685B3305}"
134-
EndProject
135-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Instrumentation.Http", "src\OpenTelemetry.Instrumentation.Http\OpenTelemetry.Instrumentation.Http.csproj", "{412C64D1-43D6-4E4C-8AD8-E20E63B415BD}"
136-
EndProject
137133
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Instrumentation.GrpcNetClient", "src\OpenTelemetry.Instrumentation.GrpcNetClient\OpenTelemetry.Instrumentation.GrpcNetClient.csproj", "{0246BFC4-8AAF-45E1-A127-DB43D6E345BB}"
138134
EndProject
139135
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{7C87CAF9-79D7-4C26-9FFB-F3F1FB6911F1}"
@@ -432,14 +428,6 @@ Global
432428
{DE9130A4-F30A-49D7-8834-41DE3021218B}.Debug|Any CPU.Build.0 = Debug|Any CPU
433429
{DE9130A4-F30A-49D7-8834-41DE3021218B}.Release|Any CPU.ActiveCfg = Release|Any CPU
434430
{DE9130A4-F30A-49D7-8834-41DE3021218B}.Release|Any CPU.Build.0 = Release|Any CPU
435-
{DE9EB7D8-9CC5-4073-90B3-9FBF685B3305}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
436-
{DE9EB7D8-9CC5-4073-90B3-9FBF685B3305}.Debug|Any CPU.Build.0 = Debug|Any CPU
437-
{DE9EB7D8-9CC5-4073-90B3-9FBF685B3305}.Release|Any CPU.ActiveCfg = Release|Any CPU
438-
{DE9EB7D8-9CC5-4073-90B3-9FBF685B3305}.Release|Any CPU.Build.0 = Release|Any CPU
439-
{412C64D1-43D6-4E4C-8AD8-E20E63B415BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
440-
{412C64D1-43D6-4E4C-8AD8-E20E63B415BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
441-
{412C64D1-43D6-4E4C-8AD8-E20E63B415BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
442-
{412C64D1-43D6-4E4C-8AD8-E20E63B415BD}.Release|Any CPU.Build.0 = Release|Any CPU
443431
{0246BFC4-8AAF-45E1-A127-DB43D6E345BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
444432
{0246BFC4-8AAF-45E1-A127-DB43D6E345BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
445433
{0246BFC4-8AAF-45E1-A127-DB43D6E345BB}.Release|Any CPU.ActiveCfg = Release|Any CPU

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ libraries](https://github.com/open-telemetry/opentelemetry-specification/blob/ma
5151
* [ASP.NET Core](./src/OpenTelemetry.Instrumentation.AspNetCore/README.md)
5252
* gRPC client:
5353
[Grpc.Net.Client](./src/OpenTelemetry.Instrumentation.GrpcNetClient/README.md)
54-
* HTTP clients: [System.Net.Http.HttpClient and
55-
System.Net.HttpWebRequest](./src/OpenTelemetry.Instrumentation.Http/README.md)
5654

5755
Here are the [exporter
5856
libraries](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/glossary.md#exporter-library):

build/RELEASING.md

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545

4646
* Stable:
4747
* `OpenTelemetry.Instrumentation.AspNetCore` (`Instrumentation.AspNetCore-`)
48-
* `OpenTelemetry.Instrumentation.Http` (`Instrumentation.Http-`)
4948

5049
* Unstable:
5150
* `OpenTelemetry.Instrumentation.GrpcNetClient` (`Instrumentation.GrpcNetClient-`)

docs/trace/README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,12 @@ expensive, excessive activities can also make trace visualization harder.
164164
Instead of manually creating `Activity`, check if you can leverage
165165
instrumentation libraries, such as [ASP.NET
166166
Core](../../src/OpenTelemetry.Instrumentation.AspNetCore/README.md),
167-
[HttpClient](../../src/OpenTelemetry.Instrumentation.Http/README.md) which will
168-
not only create and populate `Activity` with tags(attributes), but also take
169-
care of propagating/restoring the context across process boundaries. If the
170-
`Activity` produced by the instrumentation library is missing some information
171-
you need, it is generally recommended to enrich the existing Activity with that
172-
information, as opposed to creating a new one.
167+
[HttpClient](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/src/OpenTelemetry.Instrumentation.Http/README.md)
168+
which will not only create and populate `Activity` with tags(attributes),
169+
but also take care of propagating/restoring the context across process
170+
boundaries. If the `Activity` produced by the instrumentation library is missing
171+
some information you need, it is generally recommended to enrich the existing
172+
Activity with that information, as opposed to creating a new one.
173173

174174
### Modelling static tags as Resource
175175

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

+3-4
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ the library they instrument, and steps for enabling them.
113113
Core](../../../src/OpenTelemetry.Instrumentation.AspNetCore/README.md)
114114
* [gRPC
115115
client](../../../src/OpenTelemetry.Instrumentation.GrpcNetClient/README.md)
116-
* [HTTP clients](../../../src/OpenTelemetry.Instrumentation.Http/README.md)
117116

118117
More community contributed instrumentations are available in [OpenTelemetry .NET
119118
Contrib](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/src).
@@ -147,7 +146,7 @@ Writing an instrumentation library typically involves 3 steps.
147146
library](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlEventSourceListener.netfx.cs)
148147
listens to in order to trigger code as Sql commands are executed. The [.NET
149148
Framework HttpWebRequest
150-
instrumentation](../../../src/OpenTelemetry.Instrumentation.Http/Implementation/HttpWebRequestActivitySource.netfx.cs)
149+
instrumentation](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpWebRequestActivitySource.netfx.cs)
151150
patches the runtime code (using reflection) and swaps a static reference that
152151
gets invoked as requests are processed for custom code. Every library will be
153152
different.
@@ -227,13 +226,13 @@ activities does not by default runs through the sampler, and will have their
227226
with it.
228227

229228
Some common examples of such libraries include [ASP.NET
230-
Core](../../../src/OpenTelemetry.Instrumentation.AspNetCore/README.md), [HTTP
231-
client .NET Core](../../../src/OpenTelemetry.Instrumentation.Http/README.md) .
229+
Core](../../../src/OpenTelemetry.Instrumentation.AspNetCore/README.md).
232230
Instrumentation libraries for these are already provided in this repo. The
233231
[OpenTelemetry .NET
234232
Contrib](https://github.com/open-telemetry/opentelemetry-dotnet-contrib)
235233
repository also has instrumentations for libraries like
236234
[ElasticSearchClient](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/src/OpenTelemetry.Instrumentation.ElasticsearchClient)
235+
and [HTTP client .NET Core](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/src/OpenTelemetry.Instrumentation.Http/README.md)
237236
etc. which fall in this category.
238237

239238
If you are writing instrumentation for such library, it is recommended to refer

docs/trace/getting-started-jaeger/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ dotnet run
2525
Add reference to [Console
2626
Exporter](../../../src/OpenTelemetry.Exporter.Console/README.md), [OTLP
2727
Exporter](../../../src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md) and
28-
[HttpClient Instrumentation](../../../src/OpenTelemetry.Instrumentation.Http/README.md):
28+
[HttpClient Instrumentation](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/src/OpenTelemetry.Instrumentation.Http/README.md):
2929

3030
```sh
3131
dotnet add package OpenTelemetry.Exporter.Console
3232
dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol
33-
dotnet add package OpenTelemetry.Instrumentation.Http --prerelease
33+
dotnet add package OpenTelemetry.Instrumentation.Http
3434
```
3535

3636
Now copy the code from [Program.cs](./Program.cs).
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<ItemGroup>
33
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Console\OpenTelemetry.Exporter.Console.csproj" />
44
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.OpenTelemetryProtocol\OpenTelemetry.Exporter.OpenTelemetryProtocol.csproj" />
5-
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.Http\OpenTelemetry.Instrumentation.Http.csproj" />
65
</ItemGroup>
76

87
<ItemGroup>
98
<Reference Include="System.Net.Http" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
9+
<PackageReference Include="OpenTelemetry.Instrumentation.Http" />
1010
</ItemGroup>
1111
</Project>

examples/AspNetCore/Examples.AspNetCore.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
<ItemGroup>
88
<PackageReference Include="Swashbuckle.AspNetCore" />
9+
<PackageReference Include="OpenTelemetry.Instrumentation.Http" />
910
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" />
1011
</ItemGroup>
1112

@@ -14,7 +15,6 @@
1415
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Console\OpenTelemetry.Exporter.Console.csproj" />
1516
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.OpenTelemetryProtocol\OpenTelemetry.Exporter.OpenTelemetryProtocol.csproj" />
1617
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.AspNetCore\OpenTelemetry.Instrumentation.AspNetCore.csproj" />
17-
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.Http\OpenTelemetry.Instrumentation.Http.csproj" />
1818
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Prometheus.AspNetCore\OpenTelemetry.Exporter.Prometheus.AspNetCore.csproj" />
1919
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Zipkin\OpenTelemetry.Exporter.Zipkin.csproj" />
2020
</ItemGroup>

examples/Console/Examples.Console.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
<PackageReference Include="Grpc.Tools" PrivateAssets="All">
2121
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2222
</PackageReference>
23+
<PackageReference Include="OpenTelemetry.Instrumentation.Http" />
2324

2425
<Compile Include="$(RepoRoot)\src\Shared\SpanAttributeConstants.cs" Link="Includes\SpanAttributeConstants.cs" />
2526
</ItemGroup>
2627

2728
<ItemGroup>
2829
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.GrpcNetClient\OpenTelemetry.Instrumentation.GrpcNetClient.csproj" />
29-
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.Http\OpenTelemetry.Instrumentation.Http.csproj" />
3030
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Console\OpenTelemetry.Exporter.Console.csproj" />
3131
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.OpenTelemetryProtocol\OpenTelemetry.Exporter.OpenTelemetryProtocol.csproj" />
3232
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Shims.OpenTracing\OpenTelemetry.Shims.OpenTracing.csproj" />

src/OpenTelemetry.Api/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,11 @@ required only for the following scenarios:
153153
[Propagators](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/context/api-propagators.md),
154154
to inject and extract context data. Some of the most common libraries
155155
requiring this include
156-
[HttpClient](../OpenTelemetry.Instrumentation.Http/README.md), [ASP.NET
157-
Core](../OpenTelemetry.Instrumentation.AspNetCore/README.md). This repo
158-
already provides instrumentation for these common libraries. If your library
159-
is not built on top of these, and want to leverage propagators, follow the
160-
[Context propagation](#context-propagation) section.
156+
[HttpClient](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/src/OpenTelemetry.Instrumentation.Http/README.md),
157+
[ASP.NET Core](../OpenTelemetry.Instrumentation.AspNetCore/README.md).
158+
This or contrib repository already provides instrumentation for these common
159+
libraries. If your library is not built on top of these, and want to leverage
160+
propagators, follow the [Context propagation](#context-propagation) section.
161161

162162
3. You want to leverage
163163
[Baggage](#baggage-api)

src/OpenTelemetry.Instrumentation.GrpcNetClient/OpenTelemetry.Instrumentation.GrpcNetClient.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
</PropertyGroup>
1919

2020
<ItemGroup>
21-
<Compile Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.Http\HttpRequestMessageContextPropagation.cs" Link="Includes\HttpRequestMessageContextPropagation.cs" />
2221
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
2322
<Compile Include="$(RepoRoot)\src\Shared\AssemblyVersionExtensions.cs" Link="Includes\AssemblyVersionExtensions.cs" />
2423
<Compile Include="$(RepoRoot)\src\Shared\Options\*.cs" Link="Includes\Options\%(Filename).cs" />

src/OpenTelemetry.Instrumentation.GrpcNetClient/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ exporter and adds instrumentation for HttpClient, which requires adding the
4646
packages
4747
[`OpenTelemetry.Exporter.Console`](../OpenTelemetry.Exporter.Console/README.md)
4848
and
49-
[`OpenTelemetry.Instrumentation.Http`](../OpenTelemetry.Instrumentation.Http/README.md)
49+
[`OpenTelemetry.Instrumentation.Http`](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/src/OpenTelemetry.Instrumentation.Http/README.md)
5050
to the application. As Grpc.Net.Client uses HttpClient underneath, it is
5151
recommended to enable HttpClient instrumentation as well to ensure proper
5252
context propagation. This would cause an activity being produced for both a gRPC

src/OpenTelemetry.Instrumentation.Http/.publicApi/PublicAPI.Shipped.txt

-24
This file was deleted.

src/OpenTelemetry.Instrumentation.Http/.publicApi/PublicAPI.Unshipped.txt

Whitespace-only changes.

src/OpenTelemetry.Instrumentation.Http/AssemblyInfo.cs

-10
This file was deleted.

0 commit comments

Comments
 (0)