Remove vendor specific instrumention from main repo. (#737)

This commit is contained in:
Cijo Thomas 2020-06-17 14:09:59 -07:00 committed by GitHub
parent ea70fece4f
commit 10f870ebe5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 115 deletions

View File

@ -1,49 +0,0 @@
// <copyright file="AzureClientsInstrumentation.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
namespace OpenTelemetry.Instrumentation.Dependencies
{
/// <summary>
/// AzureClients instrumentation.
/// TODO: Azure specific listeners would be moved out of this repo.
/// I believe this was initially put here for quick validation.
/// There were no unit tests covering this feature, so
/// cannot validate after Span is replaced with Activity.
/// </summary>
public class AzureClientsInstrumentation : IDisposable
{
private readonly DiagnosticSourceSubscriber diagnosticSourceSubscriber;
/// <summary>
/// Initializes a new instance of the <see cref="AzureClientsInstrumentation"/> class.
/// </summary>
public AzureClientsInstrumentation()
{
this.diagnosticSourceSubscriber = new DiagnosticSourceSubscriber(
name => new AzureSdkDiagnosticListener(name),
listener => listener.Name.StartsWith("Azure."),
null);
this.diagnosticSourceSubscriber.Subscribe();
}
/// <inheritdoc/>
public void Dispose()
{
this.diagnosticSourceSubscriber?.Dispose();
}
}
}

View File

@ -1,46 +0,0 @@
// <copyright file="AzurePipelineInstrumentation.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
namespace OpenTelemetry.Instrumentation.Dependencies
{
/// <summary>
/// AzurePipeline instrumentation.
/// TODO: Azure specific listeners would be moved out of this repo.
/// I believe this was initially put here for quick validation.
/// There were no unit tests covering this feature, so
/// cannot validate after Span is replaced with Activity.
/// </summary>
public class AzurePipelineInstrumentation : IDisposable
{
private readonly DiagnosticSourceSubscriber diagnosticSourceSubscriber;
/// <summary>
/// Initializes a new instance of the <see cref="AzurePipelineInstrumentation"/> class.
/// </summary>
public AzurePipelineInstrumentation()
{
this.diagnosticSourceSubscriber = new DiagnosticSourceSubscriber(new AzureSdkDiagnosticListener("Azure.Pipeline"), null);
this.diagnosticSourceSubscriber.Subscribe();
}
/// <inheritdoc/>
public void Dispose()
{
this.diagnosticSourceSubscriber?.Dispose();
}
}
}

View File

@ -39,7 +39,6 @@ namespace OpenTelemetry.Trace.Configuration
builder.AddHttpClientDependencyInstrumentation();
builder.AddSqlClientDependencyInstrumentation();
builder.AddAzureClientsDependencyInstrumentation();
#if NETFRAMEWORK
builder.AddHttpWebRequestDependencyInstrumentation();
#endif
@ -65,7 +64,6 @@ namespace OpenTelemetry.Trace.Configuration
builder.AddHttpClientDependencyInstrumentation(configureHttpClientInstrumentationOptions);
builder.AddSqlClientDependencyInstrumentation(configureSqlClientInstrumentationOptions);
builder.AddAzureClientsDependencyInstrumentation();
#if NETFRAMEWORK
builder.AddHttpWebRequestDependencyInstrumentation();
#endif
@ -139,24 +137,6 @@ namespace OpenTelemetry.Trace.Configuration
return builder;
}
/// <summary>
/// Enables instrumentation for Azure clients.
/// </summary>
/// <param name="builder"><see cref="OpenTelemetryBuilder"/> being configured.</param>
/// <returns>The instance of <see cref="OpenTelemetryBuilder"/> to chain the calls.</returns>
public static OpenTelemetryBuilder AddAzureClientsDependencyInstrumentation(
this OpenTelemetryBuilder builder)
{
if (builder == null)
{
throw new ArgumentNullException(nameof(builder));
}
builder.AddActivitySource(AzureSdkDiagnosticListener.ActivitySourceName);
builder.AddInstrumentation((activitySource) => new AzureClientsInstrumentation());
return builder;
}
#if NETFRAMEWORK
/// <summary>
/// Enables the outgoing requests automatic data collection for .NET Framework HttpWebRequest activity source.