Skip to content

Commit

Permalink
Merge branch 'main' into xiang17/FixBugInSelfDiagnostics_FileShareStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
xiang17 authored Jan 28, 2021
2 parents 87acec2 + 4f39a58 commit fe51233
Show file tree
Hide file tree
Showing 46 changed files with 379 additions and 116 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docfx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: docfx

on:
pull_request:
branches: [ master ]
branches: [ main ]

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dotnet-core-cov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Code Coverage

on:
push:
branches: [ master ]
branches: [ main ]
paths-ignore:
- '**.md'
pull_request:
branches: [ master ]
branches: [ main ]
paths-ignore:
- '**.md'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-core-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Linux

on:
pull_request:
branches: [ master ]
branches: [ main ]
paths-ignore:
- '**.md'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dotnet-core-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Windows

on:
pull_request:
branches: [ master ]
branches: [ main ]
paths-ignore:
- '**.md'

Expand All @@ -16,7 +16,7 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Setup .NET Core 2.1
uses: actions/setup-dotnet@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: dotnet format

on:
pull_request:
branches: [ master ]
branches: [ main ]
paths:
- '**.cs'
- '.editorconfig'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Integration Tests

on:
push:
branches: [ master ]
branches: [ main ]
paths-ignore:
- '**.md'
pull_request:
branches: [ master ]
branches: [ main ]
paths-ignore:
- '**.md'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/markdownlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: markdownlint

on:
pull_request:
branches: [ master ]
branches: [ main ]
paths:
- '**.md'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sanitycheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: sanitycheck

on:
pull_request:
branches: [ master ]
branches: [ main ]

jobs:
misspell:
Expand Down
10 changes: 4 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,10 @@ issue](https://github.com/open-telemetry/opentelemetry-specification/issues/165)

## Style Guide

This project includes a
[`.editorconfig`](https://github.com/open-telemetry/opentelemetry-dotnet/blob/master/.editorconfig)
file which is supported by all the IDEs/editor mentioned above. It works with
the IDE/editor only and does not affect the actual build of the project.
This project includes a [`.editorconfig`](./.editorconfig) file which is
supported by all the IDEs/editor mentioned above. It works with the IDE/editor
only and does not affect the actual build of the project.

This repository also includes [stylecop ruleset
files](https://github.com/open-telemetry/opentelemetry-dotnet/tree/master/build).
This repository also includes stylecop ruleset files under the `./build` folder.
These files are used to configure the _StyleCop.Analyzers_ which runs during
build. Breaking the rules will result in a build failure.
5 changes: 3 additions & 2 deletions OpenTelemetry.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
NuGet.config = NuGet.config
OpenTelemetry.proj = OpenTelemetry.proj
README.md = README.md
RELEASING.md = RELEASING.md
tool_FinalizePublicApi.ps1 = tool_FinalizePublicApi.ps1
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7CB2F02E-03FA-4FFF-89A5-C51F107623FD}"
Expand All @@ -29,10 +27,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7CB2F02E
build\docfx.cmd = build\docfx.cmd
build\docker-compose.netcoreapp2.1.yml = build\docker-compose.netcoreapp2.1.yml
build\docker-compose.netcoreapp3.1.yml = build\docker-compose.netcoreapp3.1.yml
build\finalize-publicapi.ps1 = build\finalize-publicapi.ps1
build\opentelemetry-icon-color.png = build\opentelemetry-icon-color.png
build\OpenTelemetry.prod.loose.ruleset = build\OpenTelemetry.prod.loose.ruleset
build\OpenTelemetry.prod.ruleset = build\OpenTelemetry.prod.ruleset
build\OpenTelemetry.test.ruleset = build\OpenTelemetry.test.ruleset
build\process-codecoverage.ps1 = build\process-codecoverage.ps1
build\RELEASING.md = build\RELEASING.md
build\stylecop.json = build\stylecop.json
build\xunit.runner.json = build\xunit.runner.json
EndProjectSection
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions tool_FinalizePublicApi.ps1 → build/finalize-publicapi.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# After every stable release, all PublicApi text files (Shipped & Unshipped) should be merged.
$path = "src\*\.publicApi\**\";
$directory = $PSScriptRoot;
$directory = Split-Path -Path $PSScriptRoot -Parent;

$searchPath = Join-Path -Path $directory -ChildPath $path;
Write-Host "Search Directory: $searchPath";
Expand Down Expand Up @@ -28,4 +28,4 @@ Get-ChildItem -Path $searchPath -Recurse -Filter *.Shipped.txt |
}

Write-Host "";
}
}
1 change: 1 addition & 0 deletions docs/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"resource": [
{
"files": [
".editorconfig",
"docs/**.cs",
"examples/**.cs",
"src/**.cs"
Expand Down
7 changes: 7 additions & 0 deletions src/OpenTelemetry.Exporter.Zipkin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
`True`/`False`.
([#1609](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1609))

* Span tags will no longer be populated with Resource Attributes.
([#1663](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1663))

* Spans will no longer be held in memory indefinitely when `ZipkinExporter`
cannot connect to the configured endpoint.
([#1726](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1726))

## 1.0.0-rc1.1

Released 2020-Nov-17
Expand Down
19 changes: 4 additions & 15 deletions src/OpenTelemetry.Exporter.Zipkin/ZipkinExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,24 +108,13 @@ internal void SetLocalEndpointFromResource(Resource resource)
}

string serviceName = null;
Dictionary<string, object> tags = null;
foreach (var label in resource.Attributes)
{
string key = label.Key;

switch (key)
if (label.Key == ResourceSemanticConventions.AttributeServiceName)
{
case ResourceSemanticConventions.AttributeServiceName:
serviceName = label.Value as string;
continue;
serviceName = label.Value as string;
break;
}

if (tags == null)
{
tags = new Dictionary<string, object>();
}

tags[key] = label.Value;
}

if (string.IsNullOrEmpty(serviceName))
Expand All @@ -138,7 +127,7 @@ internal void SetLocalEndpointFromResource(Resource resource)
ipv4,
ipv6,
port: null,
tags);
tags: null);
}

private static string ResolveHostAddress(string hostName, AddressFamily family)
Expand Down
6 changes: 6 additions & 0 deletions src/OpenTelemetry.Instrumentation.Http/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
description/reason phrase for outgoing http spans.
([#1579](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1579))

* Moved the DiagnosticListener filtering logic from HttpClientInstrumentation
ctor to OnStartActivity method of HttpHandlerDiagnosticListener.cs; Updated
the logic of OnStartActivity to inject propagation data into Headers for
filtered out events as well.
([#1707](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1707))

## 1.0.0-rc1.1

Released 2020-Nov-17
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ internal class HttpClientInstrumentation : IDisposable
/// <param name="options">Configuration options for HTTP client instrumentation.</param>
public HttpClientInstrumentation(ActivitySourceAdapter activitySourceAdapter, HttpClientInstrumentationOptions options)
{
this.diagnosticSourceSubscriber = new DiagnosticSourceSubscriber(new HttpHandlerDiagnosticListener(options, activitySourceAdapter), (activityName, arg1, arg2) => options?.EventFilter(activityName, arg1) ?? true);
this.diagnosticSourceSubscriber = new DiagnosticSourceSubscriber(new HttpHandlerDiagnosticListener(options, activitySourceAdapter), null);
this.diagnosticSourceSubscriber.Subscribe();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,29 @@ public override void OnStartActivity(Activity activity, object payload)
return;
}

var textMapPropagator = Propagators.DefaultTextMapPropagator;

if (!(this.httpClientSupportsW3C && textMapPropagator is TraceContextPropagator))
{
textMapPropagator.Inject(new PropagationContext(activity.Context, Baggage.Current), request, HttpRequestMessageContextPropagation.HeaderValueSetter);
}

try
{
if (this.options.EventFilter(activity.OperationName, request) == false)
{
HttpInstrumentationEventSource.Log.RequestIsFilteredOut(activity.OperationName);
activity.IsAllDataRequested = false;
return;
}
}
catch (Exception ex)
{
HttpInstrumentationEventSource.Log.RequestFilterException(ex);
activity.IsAllDataRequested = false;
return;
}

activity.DisplayName = HttpTagHelper.GetOperationNameForHttpMethod(request.Method);

this.activitySource.Start(activity, ActivityKind.Client, ActivitySource);
Expand All @@ -106,13 +129,6 @@ public override void OnStartActivity(Activity activity, object payload)
HttpInstrumentationEventSource.Log.EnrichmentException(ex);
}
}

var textMapPropagator = Propagators.DefaultTextMapPropagator;

if (!(this.httpClientSupportsW3C && textMapPropagator is TraceContextPropagator))
{
textMapPropagator.Inject(new PropagationContext(activity.Context, Baggage.Current), request, HttpRequestMessageContextPropagation.HeaderValueSetter);
}
}

public override void OnStopActivity(Activity activity, object payload)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,11 @@ public void EnrichmentException(string exception)
{
this.WriteEvent(5, exception);
}

[Event(6, Message = "Request is filtered out.", Level = EventLevel.Verbose)]
public void RequestIsFilteredOut(string eventName)
{
this.WriteEvent(6, eventName);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public class SqlClientInstrumentationOptions
/// <para><see cref="Activity"/>: the activity being enriched.</para>
/// <para>string: the name of the event.</para>
/// <para>object: the raw <c>SqlCommand</c> object from which additional information can be extracted to enrich the activity.</para>
/// <para>See also: <a href="https://github.com/open-telemetry/opentelemetry-dotnet/tree/master/src/OpenTelemetry.Instrumentation.SqlClient#Enrich">example</a>.</para>
/// <para>See also: <a href="https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.SqlClient#Enrich">example</a>.</para>
/// </remarks>
/// <example>
/// <code>
Expand Down
4 changes: 3 additions & 1 deletion src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ OpenTelemetry.BaseProcessor<T>.ParentProvider.get -> OpenTelemetry.BaseProvider
OpenTelemetry.BaseProcessor<T>.Shutdown(int timeoutMilliseconds = -1) -> bool
OpenTelemetry.Batch<T>
OpenTelemetry.Batch<T>.Batch() -> void
OpenTelemetry.Batch<T>.Dispose() -> void
OpenTelemetry.Batch<T>.Enumerator
OpenTelemetry.Batch<T>.Enumerator.Current.get -> T
OpenTelemetry.Batch<T>.Enumerator.Dispose() -> void
Expand Down Expand Up @@ -176,7 +177,6 @@ OpenTelemetry.Trace.TracerProviderExtensions
abstract OpenTelemetry.BaseExporter<T>.Export(in OpenTelemetry.Batch<T> batch) -> OpenTelemetry.ExportResult
abstract OpenTelemetry.Metrics.Aggregators.Aggregator<T>.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
abstract OpenTelemetry.Metrics.Aggregators.Aggregator<T>.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
abstract OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Update(T value) -> void
abstract OpenTelemetry.Metrics.BoundCounterMetricSdkBase<T>.GetAggregator() -> OpenTelemetry.Metrics.Aggregators.Aggregator<T>
abstract OpenTelemetry.Metrics.Export.MetricExporter.ExportAsync(System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task<OpenTelemetry.Metrics.Export.MetricExporter.ExportResult>
abstract OpenTelemetry.Metrics.Export.MetricProcessor.FinishCollectionCycle(out System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics) -> void
Expand Down Expand Up @@ -261,3 +261,5 @@ virtual OpenTelemetry.BaseProcessor<T>.OnForceFlush(int timeoutMilliseconds) ->
virtual OpenTelemetry.BaseProcessor<T>.OnShutdown(int timeoutMilliseconds) -> bool
virtual OpenTelemetry.BaseProcessor<T>.OnStart(T data) -> void
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Checkpoint() -> void
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.HasCheckpointData() -> bool
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Update(T value) -> void
4 changes: 3 additions & 1 deletion src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ OpenTelemetry.BaseProcessor<T>.ParentProvider.get -> OpenTelemetry.BaseProvider
OpenTelemetry.BaseProcessor<T>.Shutdown(int timeoutMilliseconds = -1) -> bool
OpenTelemetry.Batch<T>
OpenTelemetry.Batch<T>.Batch() -> void
OpenTelemetry.Batch<T>.Dispose() -> void
OpenTelemetry.Batch<T>.Enumerator
OpenTelemetry.Batch<T>.Enumerator.Current.get -> T
OpenTelemetry.Batch<T>.Enumerator.Dispose() -> void
Expand Down Expand Up @@ -176,7 +177,6 @@ OpenTelemetry.Trace.TracerProviderExtensions
abstract OpenTelemetry.BaseExporter<T>.Export(in OpenTelemetry.Batch<T> batch) -> OpenTelemetry.ExportResult
abstract OpenTelemetry.Metrics.Aggregators.Aggregator<T>.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
abstract OpenTelemetry.Metrics.Aggregators.Aggregator<T>.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
abstract OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Update(T value) -> void
abstract OpenTelemetry.Metrics.BoundCounterMetricSdkBase<T>.GetAggregator() -> OpenTelemetry.Metrics.Aggregators.Aggregator<T>
abstract OpenTelemetry.Metrics.Export.MetricExporter.ExportAsync(System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task<OpenTelemetry.Metrics.Export.MetricExporter.ExportResult>
abstract OpenTelemetry.Metrics.Export.MetricProcessor.FinishCollectionCycle(out System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics) -> void
Expand Down Expand Up @@ -261,3 +261,5 @@ virtual OpenTelemetry.BaseProcessor<T>.OnForceFlush(int timeoutMilliseconds) ->
virtual OpenTelemetry.BaseProcessor<T>.OnShutdown(int timeoutMilliseconds) -> bool
virtual OpenTelemetry.BaseProcessor<T>.OnStart(T data) -> void
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Checkpoint() -> void
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.HasCheckpointData() -> bool
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Update(T value) -> void
4 changes: 3 additions & 1 deletion src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ OpenTelemetry.BaseProcessor<T>.ParentProvider.get -> OpenTelemetry.BaseProvider
OpenTelemetry.BaseProcessor<T>.Shutdown(int timeoutMilliseconds = -1) -> bool
OpenTelemetry.Batch<T>
OpenTelemetry.Batch<T>.Batch() -> void
OpenTelemetry.Batch<T>.Dispose() -> void
OpenTelemetry.Batch<T>.Enumerator
OpenTelemetry.Batch<T>.Enumerator.Current.get -> T
OpenTelemetry.Batch<T>.Enumerator.Dispose() -> void
Expand Down Expand Up @@ -199,7 +200,6 @@ OpenTelemetry.Trace.TracerProviderExtensions
abstract OpenTelemetry.BaseExporter<T>.Export(in OpenTelemetry.Batch<T> batch) -> OpenTelemetry.ExportResult
abstract OpenTelemetry.Metrics.Aggregators.Aggregator<T>.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
abstract OpenTelemetry.Metrics.Aggregators.Aggregator<T>.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
abstract OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Update(T value) -> void
abstract OpenTelemetry.Metrics.BoundCounterMetricSdkBase<T>.GetAggregator() -> OpenTelemetry.Metrics.Aggregators.Aggregator<T>
abstract OpenTelemetry.Metrics.Export.MetricExporter.ExportAsync(System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task<OpenTelemetry.Metrics.Export.MetricExporter.ExportResult>
abstract OpenTelemetry.Metrics.Export.MetricProcessor.FinishCollectionCycle(out System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics) -> void
Expand Down Expand Up @@ -286,3 +286,5 @@ virtual OpenTelemetry.BaseProcessor<T>.OnShutdown(int timeoutMilliseconds) -> bo
virtual OpenTelemetry.BaseProcessor<T>.OnStart(T data) -> void
virtual OpenTelemetry.Logs.OpenTelemetryLoggerProvider.Dispose(bool disposing) -> void
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Checkpoint() -> void
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.HasCheckpointData() -> bool
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Update(T value) -> void
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ OpenTelemetry.BaseProcessor<T>.ParentProvider.get -> OpenTelemetry.BaseProvider
OpenTelemetry.BaseProcessor<T>.Shutdown(int timeoutMilliseconds = -1) -> bool
OpenTelemetry.Batch<T>
OpenTelemetry.Batch<T>.Batch() -> void
OpenTelemetry.Batch<T>.Dispose() -> void
OpenTelemetry.Batch<T>.Enumerator
OpenTelemetry.Batch<T>.Enumerator.Current.get -> T
OpenTelemetry.Batch<T>.Enumerator.Dispose() -> void
Expand Down Expand Up @@ -199,7 +200,6 @@ OpenTelemetry.Trace.TracerProviderExtensions
abstract OpenTelemetry.BaseExporter<T>.Export(in OpenTelemetry.Batch<T> batch) -> OpenTelemetry.ExportResult
abstract OpenTelemetry.Metrics.Aggregators.Aggregator<T>.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
abstract OpenTelemetry.Metrics.Aggregators.Aggregator<T>.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
abstract OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Update(T value) -> void
abstract OpenTelemetry.Metrics.BoundCounterMetricSdkBase<T>.GetAggregator() -> OpenTelemetry.Metrics.Aggregators.Aggregator<T>
abstract OpenTelemetry.Metrics.Export.MetricExporter.ExportAsync(System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task<OpenTelemetry.Metrics.Export.MetricExporter.ExportResult>
abstract OpenTelemetry.Metrics.Export.MetricProcessor.FinishCollectionCycle(out System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics) -> void
Expand Down Expand Up @@ -286,3 +286,5 @@ virtual OpenTelemetry.BaseProcessor<T>.OnShutdown(int timeoutMilliseconds) -> bo
virtual OpenTelemetry.BaseProcessor<T>.OnStart(T data) -> void
virtual OpenTelemetry.Logs.OpenTelemetryLoggerProvider.Dispose(bool disposing) -> void
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Checkpoint() -> void
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.HasCheckpointData() -> bool
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Update(T value) -> void
Loading

0 comments on commit fe51233

Please sign in to comment.