Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpWebRequest ActivitySource #694

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/OpenTelemetry.Api/Trace/SpanAttributeConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public static class SpanAttributeConstants

public const string HttpMethodKey = "http.method";
public const string HttpStatusCodeKey = "http.status_code";
public const string HttpStatusTextKey = "http.status_text";
public const string HttpUserAgentKey = "http.user_agent";
public const string HttpPathKey = "http.path";
public const string HttpHostKey = "http.host";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,11 @@ public DependenciesInstrumentation(TracerFactoryBase tracerFactory, HttpClientIn
var assemblyVersion = typeof(DependenciesInstrumentation).Assembly.GetName().Version;

var httpClientListener = new HttpClientInstrumentation(tracerFactory.GetTracer(nameof(HttpClientInstrumentation), "semver:" + assemblyVersion), httpOptions ?? new HttpClientInstrumentationOptions());
var httpWebRequestInstrumentation = new HttpWebRequestInstrumentation(tracerFactory.GetTracer(nameof(HttpWebRequestInstrumentation), "semver:" + assemblyVersion), httpOptions ?? new HttpClientInstrumentationOptions());
var azureClientsListener = new AzureClientsInstrumentation(tracerFactory.GetTracer(nameof(AzureClientsInstrumentation), "semver:" + assemblyVersion));
var azurePipelineListener = new AzurePipelineInstrumentation(tracerFactory.GetTracer(nameof(AzurePipelineInstrumentation), "semver:" + assemblyVersion));
var sqlClientListener = new SqlClientInstrumentation(tracerFactory.GetTracer(nameof(AzurePipelineInstrumentation), "semver:" + assemblyVersion), sqlOptions ?? new SqlClientInstrumentationOptions());

this.instrumentations.Add(httpClientListener);
this.instrumentations.Add(httpWebRequestInstrumentation);
this.instrumentations.Add(azureClientsListener);
this.instrumentations.Add(azurePipelineListener);
this.instrumentations.Add(sqlClientListener);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
// limitations under the License.
// </copyright>
using System;
using System.Net;
using System.Net.Http;
using OpenTelemetry.Context.Propagation;
using OpenTelemetry.Instrumentation.Dependencies.Implementation;

namespace OpenTelemetry.Instrumentation.Dependencies
{
Expand Down Expand Up @@ -101,18 +99,6 @@ private static bool IsHttpOutgoingPostRequest(string activityName, object arg1,
return true;
}
}
#if NET461
else if (activityName == HttpWebRequestDiagnosticSource.ActivityName)
{
if (arg1 is HttpWebRequest request &&
request.RequestUri != null &&
request.Method == "POST")
{
requestUri = request.RequestUri;
return true;
}
}
#endif

requestUri = null;
return false;
Expand Down

This file was deleted.

Loading