From 0f22e37db4a599c86af726ee8699375d3eb8fe12 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 22:17:27 -0700 Subject: [PATCH 01/14] Bump codecov/codecov-action from 3.0.0 to 3.1.0 (#324) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v3.0.0...v3.1.0) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dotnet-core-cov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet-core-cov.yml b/.github/workflows/dotnet-core-cov.yml index bd30ca8327..82a78f4a4a 100644 --- a/.github/workflows/dotnet-core-cov.yml +++ b/.github/workflows/dotnet-core-cov.yml @@ -43,7 +43,7 @@ jobs: - name: Merging test results run: reportgenerator -reports:TestResults/**/*.xml -targetdir:TestResults -reporttypes:Cobertura - - uses: codecov/codecov-action@v3.0.0 + - uses: codecov/codecov-action@v3.1.0 with: file: TestResults/Cobertura.xml env_vars: OS From d4f94cc9e8e8c1020806855f5e9e0a850020caac Mon Sep 17 00:00:00 2001 From: Oleksiy Dubinin <88040756+rypdal@users.noreply.github.com> Date: Fri, 22 Apr 2022 07:45:42 +0200 Subject: [PATCH 02/14] Auto flush activity processor implementation and tests (#296). (#297) --- .../.publicApi/net461/PublicAPI.Unshipped.txt | 2 + .../.publicApi/net5.0/PublicAPI.Unshipped.txt | 2 + .../netstandard2.0/PublicAPI.Unshipped.txt | 2 + src/OpenTelemetry.Extensions/CHANGELOG.md | 3 + src/OpenTelemetry.Extensions/README.md | 26 +++- .../Trace/AutoFlushActivityProcessor.cs | 111 ++++++++++++++++++ .../TracerProviderBuilderExtensions.cs | 60 ++++++++++ .../Trace/AutoFlushActivityProcessorTests.cs | 82 +++++++++++++ 8 files changed, 287 insertions(+), 1 deletion(-) create mode 100644 src/OpenTelemetry.Extensions/Trace/AutoFlushActivityProcessor.cs create mode 100644 src/OpenTelemetry.Extensions/TracerProviderBuilderExtensions.cs create mode 100644 test/OpenTelemetry.Extensions.Tests/Trace/AutoFlushActivityProcessorTests.cs diff --git a/src/OpenTelemetry.Extensions/.publicApi/net461/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Extensions/.publicApi/net461/PublicAPI.Unshipped.txt index c654303a3a..7104e3f8ec 100644 --- a/src/OpenTelemetry.Extensions/.publicApi/net461/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Extensions/.publicApi/net461/PublicAPI.Unshipped.txt @@ -6,4 +6,6 @@ OpenTelemetry.Logs.LogToActivityEventConversionOptions.ScopeConverter.get -> Sys OpenTelemetry.Logs.LogToActivityEventConversionOptions.ScopeConverter.set -> void OpenTelemetry.Logs.LogToActivityEventConversionOptions.StateConverter.get -> System.Action>!>! OpenTelemetry.Logs.LogToActivityEventConversionOptions.StateConverter.set -> void +OpenTelemetry.Trace.TracerProviderBuilderExtensions static Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions.AttachLogsToActivityEvent(this OpenTelemetry.Logs.OpenTelemetryLoggerOptions! loggerOptions, System.Action? configure = null) -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions! +static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddAutoFlushActivityProcessor(this OpenTelemetry.Trace.TracerProviderBuilder! builder, System.Func! predicate, int timeoutMilliseconds = 10000) -> OpenTelemetry.Trace.TracerProviderBuilder! diff --git a/src/OpenTelemetry.Extensions/.publicApi/net5.0/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Extensions/.publicApi/net5.0/PublicAPI.Unshipped.txt index c654303a3a..7104e3f8ec 100644 --- a/src/OpenTelemetry.Extensions/.publicApi/net5.0/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Extensions/.publicApi/net5.0/PublicAPI.Unshipped.txt @@ -6,4 +6,6 @@ OpenTelemetry.Logs.LogToActivityEventConversionOptions.ScopeConverter.get -> Sys OpenTelemetry.Logs.LogToActivityEventConversionOptions.ScopeConverter.set -> void OpenTelemetry.Logs.LogToActivityEventConversionOptions.StateConverter.get -> System.Action>!>! OpenTelemetry.Logs.LogToActivityEventConversionOptions.StateConverter.set -> void +OpenTelemetry.Trace.TracerProviderBuilderExtensions static Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions.AttachLogsToActivityEvent(this OpenTelemetry.Logs.OpenTelemetryLoggerOptions! loggerOptions, System.Action? configure = null) -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions! +static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddAutoFlushActivityProcessor(this OpenTelemetry.Trace.TracerProviderBuilder! builder, System.Func! predicate, int timeoutMilliseconds = 10000) -> OpenTelemetry.Trace.TracerProviderBuilder! diff --git a/src/OpenTelemetry.Extensions/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Extensions/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt index c654303a3a..7104e3f8ec 100644 --- a/src/OpenTelemetry.Extensions/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Extensions/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt @@ -6,4 +6,6 @@ OpenTelemetry.Logs.LogToActivityEventConversionOptions.ScopeConverter.get -> Sys OpenTelemetry.Logs.LogToActivityEventConversionOptions.ScopeConverter.set -> void OpenTelemetry.Logs.LogToActivityEventConversionOptions.StateConverter.get -> System.Action>!>! OpenTelemetry.Logs.LogToActivityEventConversionOptions.StateConverter.set -> void +OpenTelemetry.Trace.TracerProviderBuilderExtensions static Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions.AttachLogsToActivityEvent(this OpenTelemetry.Logs.OpenTelemetryLoggerOptions! loggerOptions, System.Action? configure = null) -> OpenTelemetry.Logs.OpenTelemetryLoggerOptions! +static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddAutoFlushActivityProcessor(this OpenTelemetry.Trace.TracerProviderBuilder! builder, System.Func! predicate, int timeoutMilliseconds = 10000) -> OpenTelemetry.Trace.TracerProviderBuilder! diff --git a/src/OpenTelemetry.Extensions/CHANGELOG.md b/src/OpenTelemetry.Extensions/CHANGELOG.md index 048b8e45e8..acdf9bb081 100644 --- a/src/OpenTelemetry.Extensions/CHANGELOG.md +++ b/src/OpenTelemetry.Extensions/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +* Implemented auto flush activity processor + ([#297](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/297)) + ## 1.0.0-beta.3 * Going forward the NuGet package will be diff --git a/src/OpenTelemetry.Extensions/README.md b/src/OpenTelemetry.Extensions/README.md index f48b095b49..f58476e242 100644 --- a/src/OpenTelemetry.Extensions/README.md +++ b/src/OpenTelemetry.Extensions/README.md @@ -12,4 +12,28 @@ future. ### AttachLogsToActivityEvent Adds a log processor which will convert log messages into events and attach them -to the currently running Activity. +to the currently running `Activity`. + +## Traces + +### AutoFlushActivityProcessor + +Processor that flushes its containing `TracerProvider` if an ended `Activity` +matches a predicate. Note that this processor must be added *after* exporter +related `Activity` processors. + +Example of AutoFlushActivityProcessor usage: + +```cs +public static TracerProviderBuilder AddMyExporter(this TracerProviderBuilder builder, MyExporterOptions options) +{ + return builder + .AddProcessor(new BatchActivityExportProcessor( + new MyExporter(options), + options.BatchExportProcessorOptions.MaxQueueSize, + options.BatchExportProcessorOptions.ScheduledDelayMilliseconds, + options.BatchExportProcessorOptions.ExporterTimeoutMilliseconds, + options.BatchExportProcessorOptions.MaxExportBatchSize)) + .AddAutoFlushActivityProcessor(a => a.Parent == null && (a.Kind == ActivityKind.Server || a.Kind == ActivityKind.Consumer), 5000); +} +``` diff --git a/src/OpenTelemetry.Extensions/Trace/AutoFlushActivityProcessor.cs b/src/OpenTelemetry.Extensions/Trace/AutoFlushActivityProcessor.cs new file mode 100644 index 0000000000..02fc015f74 --- /dev/null +++ b/src/OpenTelemetry.Extensions/Trace/AutoFlushActivityProcessor.cs @@ -0,0 +1,111 @@ +// +// 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. +// + +using System; +using System.Diagnostics; +using System.Threading; + +namespace OpenTelemetry.Trace +{ + /// + /// Activity processor that flushes its containing if an ended + /// Activity matches a predicate. + /// + /// + /// Add this processor *after* exporter related Activity processors. + /// + internal sealed class AutoFlushActivityProcessor : BaseProcessor + { + private readonly Func predicate; + private readonly int timeoutMilliseconds; + + private TracerProvider? tracerProvider; + private bool canForceFlush = true; + + /// + /// Initializes a new instance of the class. + /// + /// Predicate that should return true to initiate a flush. + /// Timeout (in milliseconds) to use for flushing. Specify + /// to wait indefinitely. + /// + /// + /// Thrown when the timeoutMilliseconds is smaller than -1. + /// + /// + /// It's assumed that the predicate is defined as a lambda expression which is executed quite fast and + /// doesn't contain more complex code. The predicate must not create new Activity instances, + /// otherwise the behavior is undefined. Any exception thrown by the predicate will be swallowed and logged. + /// In case of an exception the predicate is treated as false which means flush will not be applied. + /// + internal AutoFlushActivityProcessor(Func predicate, int timeoutMilliseconds) + { + this.predicate = predicate ?? throw new ArgumentNullException(nameof(predicate)); + if (timeoutMilliseconds < Timeout.Infinite) + { + throw new ArgumentOutOfRangeException(nameof(timeoutMilliseconds)); + } + + this.timeoutMilliseconds = timeoutMilliseconds; + } + + /// + public override void OnEnd(Activity data) + { + if (!this.canForceFlush) + { + return; + } + + if (this.tracerProvider == null && this.ParentProvider != null) + { + this.tracerProvider = this.ParentProvider as TracerProvider; + this.canForceFlush = this.tracerProvider != null; + if (!this.canForceFlush) + { + return; + } + } + else if (this.ParentProvider == null) + { + return; + } + + var shouldFlush = this.RunPredicate(data); + if (shouldFlush) + { + this.tracerProvider.ForceFlush(this.timeoutMilliseconds); + } + } + + private bool RunPredicate(Activity data) + { + var shouldFlush = false; + try + { + shouldFlush = this.predicate(data); + } +#pragma warning disable CA1031 // Do not catch general exception types + catch (Exception ex) +#pragma warning restore CA1031 // Do not catch general exception types + { + OpenTelemetryExtensionsEventSource.Log.LogProcessorException($"Flushing predicate threw an exception. Flush of {typeof(TracerProvider)} was skipped.", ex); + } + + return shouldFlush; + } + } +} diff --git a/src/OpenTelemetry.Extensions/TracerProviderBuilderExtensions.cs b/src/OpenTelemetry.Extensions/TracerProviderBuilderExtensions.cs new file mode 100644 index 0000000000..5ae2437f52 --- /dev/null +++ b/src/OpenTelemetry.Extensions/TracerProviderBuilderExtensions.cs @@ -0,0 +1,60 @@ +// +// 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. +// + +using System; +using System.Diagnostics; +using System.Threading; + +namespace OpenTelemetry.Trace +{ + /// + /// Extension methods to simplify registering of auto flush Activity processor. + /// + public static class TracerProviderBuilderExtensions + { + /// + /// Adds auto flush Activity processor. + /// + /// being configured. + /// Predicate that should return true to initiate a flush. + /// Timeout (in milliseconds) to use for flushing. Specify + /// to wait indefinitely. + /// + /// Thrown when the builder is null. + /// The instance of to chain the calls. + /// + /// Add this processor *after* exporter related Activity processors. + /// It's assumed that the predicate is defined as a lambda expression which is executed quite fast and + /// doesn't contain more complex code. The predicate must not create new Activity instances, + /// otherwise the behavior is undefined. Any exception thrown by the predicate will be swallowed and logged. + /// In case of an exception the predicate is treated as false which means flush will not be applied. + /// + public static TracerProviderBuilder AddAutoFlushActivityProcessor( + this TracerProviderBuilder builder, + Func predicate, + int timeoutMilliseconds = 10000) + { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + +#pragma warning disable CA2000 // Dispose objects before losing scope + return builder.AddProcessor(new AutoFlushActivityProcessor(predicate, timeoutMilliseconds)); +#pragma warning restore CA2000 // Dispose objects before losing scope + } + } +} diff --git a/test/OpenTelemetry.Extensions.Tests/Trace/AutoFlushActivityProcessorTests.cs b/test/OpenTelemetry.Extensions.Tests/Trace/AutoFlushActivityProcessorTests.cs new file mode 100644 index 0000000000..fc4af7e797 --- /dev/null +++ b/test/OpenTelemetry.Extensions.Tests/Trace/AutoFlushActivityProcessorTests.cs @@ -0,0 +1,82 @@ +// +// 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. +// + +using System; +using System.Diagnostics; +using Moq; +using Moq.Protected; +using OpenTelemetry.Trace; +using Xunit; + +namespace OpenTelemetry.Extensions.Tests.Trace +{ + public class AutoFlushActivityProcessorTests + { + [Fact] + public void AutoFlushActivityProcessor_FlushAfterLocalServerSideRootSpans_EndMatchingSpan_Flush() + { + var mockExporting = new Mock>(); + + using var provider = Sdk.CreateTracerProviderBuilder() + .AddProcessor(mockExporting.Object) + .AddAutoFlushActivityProcessor(a => a.Parent == null && (a.Kind == ActivityKind.Server || a.Kind == ActivityKind.Consumer), 5000) + .AddSource("foo") + .Build(); + + using var source = new ActivitySource("foo"); + using var activity = source.StartActivity("name", ActivityKind.Server); + activity.Dispose(); + + mockExporting.Protected().Verify("OnForceFlush", Times.Once(), 5_000); + } + + [Fact] + public void AutoFlushActivityProcessor_FlushAfterLocalServerSideRootSpans_EndNonMatchingSpan_DoesNothing() + { + var mockExporting = new Mock>(); + + using var provider = Sdk.CreateTracerProviderBuilder() + .AddProcessor(mockExporting.Object) + .AddAutoFlushActivityProcessor(a => a.Parent == null && (a.Kind == ActivityKind.Server || a.Kind == ActivityKind.Consumer)) + .AddSource("foo") + .Build(); + + using var source = new ActivitySource("foo"); + using var activity = source.StartActivity("name", ActivityKind.Client); + activity.Dispose(); + + mockExporting.Protected().Verify("OnForceFlush", Times.Never(), It.IsAny()); + } + + [Fact] + public void AutoFlushActivityProcessor_PredicateThrows_DoesNothing() + { + var mockExporting = new Mock>(); + + using var provider = Sdk.CreateTracerProviderBuilder() + .AddProcessor(mockExporting.Object) + .AddAutoFlushActivityProcessor(_ => throw new Exception("Predicate throws an exception.")) + .AddSource("foo") + .Build(); + + using var source = new ActivitySource("foo"); + using var activity = source.StartActivity("name", ActivityKind.Server); + activity.Dispose(); + + mockExporting.Protected().Verify("OnForceFlush", Times.Never(), 5_000); + } + } +} From 9b526793768cd8b807becee8af9083797959cf67 Mon Sep 17 00:00:00 2001 From: Reiley Yang Date: Mon, 25 Apr 2022 06:57:29 -0700 Subject: [PATCH 03/14] add nuget badges for OpenTelemetry.Exporter.Geneva (#327) --- src/OpenTelemetry.Exporter.Geneva/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/OpenTelemetry.Exporter.Geneva/README.md b/src/OpenTelemetry.Exporter.Geneva/README.md index eb7729a83c..23ffb6bcf0 100644 --- a/src/OpenTelemetry.Exporter.Geneva/README.md +++ b/src/OpenTelemetry.Exporter.Geneva/README.md @@ -1,3 +1,6 @@ # Geneva Exporters for OpenTelemetry .NET +[![NuGet](https://img.shields.io/nuget/v/OpenTelemetry.Exporter.Geneva.svg)](https://www.nuget.org/packages/OpenTelemetry.Exporter.Geneva) +[![NuGet](https://img.shields.io/nuget/dt/OpenTelemetry.Exporter.Geneva.svg)](https://www.nuget.org/packages/OpenTelemetry.Exporter.Geneva) + TBD From fd4968edc0a0aa9254eadfd42fa276c117c66641 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Apr 2022 19:31:40 -0700 Subject: [PATCH 04/14] Bump github/codeql-action from 1 to 2 (#328) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v1...v2) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 307766987b..db3592479e 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -37,7 +37,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -48,7 +48,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v2 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -62,4 +62,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 From 5732bf396347e2c9242782641f35c6b4119abf88 Mon Sep 17 00:00:00 2001 From: Reiley Yang Date: Tue, 26 Apr 2022 18:27:56 -0700 Subject: [PATCH 05/14] Add issue/pr templates (#330) --- .../ISSUE_TEMPLATE/comp_exporter_geneva.md | 42 +++++++++++++++++++ .github/ISSUE_TEMPLATE/miscellaneous.md | 15 +++++++ .github/PULL_REQUEST_TEMPLATE.md | 10 +++++ 3 files changed, 67 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/comp_exporter_geneva.md create mode 100644 .github/ISSUE_TEMPLATE/miscellaneous.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE/comp_exporter_geneva.md b/.github/ISSUE_TEMPLATE/comp_exporter_geneva.md new file mode 100644 index 0000000000..f54d5bfc4b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/comp_exporter_geneva.md @@ -0,0 +1,42 @@ +--- +name: OpenTelemetry.Exporter.Geneva +about: Issue with OpenTelemetry.Exporter.Geneva +labels: comp:exporter.geneva +--- + +# Issue with OpenTelemetry.Exporter.Geneva + +List of [all OpenTelemetry NuGet +packages](https://www.nuget.org/profiles/OpenTelemetry) and version that you are +using (e.g. `OpenTelemetry 1.0.2`): + +* [OpenTelemetry.Exporter.Geneva + 1.2.6](https://www.nuget.org/packages/OpenTelemetry.Exporter.Geneva/1.2.6) + +Runtime version (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can +find this information from the `*.csproj` file): + +* TBD + +**Is this a feature request or a bug?** + +* [ ] Feature Request +* [ ] Bug + +**What is the expected behavior?** + +What do you expect to see? + +**What is the actual behavior?** + +What did you see instead? If you are reporting a bug, create a self-contained +project using the template of your choice and apply the minimum required code to +result in the issue you're observing. We will close this issue if: + +* The repro project you share with us is complex. We can't investigate custom + projects, so don't point us to such, please. +* If we can not reproduce the behavior you're reporting. + +## Additional Context + +Add any other context about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/miscellaneous.md b/.github/ISSUE_TEMPLATE/miscellaneous.md new file mode 100644 index 0000000000..d48762effb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/miscellaneous.md @@ -0,0 +1,15 @@ +--- +name: Miscellaneous (anything else) +about: Issue that does not fit into other categories +--- + +# Issue that does not fit into other categories + +**What are you trying to achieve?** + +What do you expect to see? + +**Additional context.** + +Add any other context about the problem here. If you followed an existing +documentation, please share the link to it. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..b5fc738afc --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,10 @@ +Fixes #. + +## Changes + +Please provide a brief description of the changes here. + +For significant contributions please make sure you have completed the following items: + +* [ ] Appropriate `CHANGELOG.md` updated for non-trivial changes +* [ ] Design discussion issue # From 4bde914f087a2452ba3d35f0c89a463c16de5ed5 Mon Sep 17 00:00:00 2001 From: Reiley Yang Date: Wed, 27 Apr 2022 19:08:11 -0700 Subject: [PATCH 06/14] Add more issue templates and update contributing.md (#331) * add more templates * update contributing.md doc --- .../comp_contrib_extensions_awsxray.md | 41 +++++++++++++++++++ .../comp_contrib_instrumentation_aws.md | 41 +++++++++++++++++++ .../comp_contrib_instrumentation_awslambda.md | 41 +++++++++++++++++++ .../comp_exporter_stackdriver.md | 41 +++++++++++++++++++ .github/ISSUE_TEMPLATE/comp_extensions.md | 41 +++++++++++++++++++ .../comp_extensions_azuremonitor.md | 41 +++++++++++++++++++ .../comp_extensions_persistentstorage.md | 41 +++++++++++++++++++ ...omp_instrumentation_elasticsearchclient.md | 41 +++++++++++++++++++ ...omp_instrumentation_entityframeworkcore.md | 41 +++++++++++++++++++ .../comp_instrumentation_grpccore.md | 41 +++++++++++++++++++ .../comp_instrumentation_hangfire.md | 41 +++++++++++++++++++ .../comp_instrumentation_masstransit.md | 41 +++++++++++++++++++ .../comp_instrumentation_mysqldata.md | 41 +++++++++++++++++++ .../comp_instrumentation_owin.md | 41 +++++++++++++++++++ .../comp_instrumentation_quartz.md | 41 +++++++++++++++++++ .../comp_instrumentation_runtime.md | 41 +++++++++++++++++++ .../comp_instrumentation_wcf.md | 41 +++++++++++++++++++ CONTRIBUTING.md | 10 ++++- 18 files changed, 705 insertions(+), 2 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/comp_contrib_extensions_awsxray.md create mode 100644 .github/ISSUE_TEMPLATE/comp_contrib_instrumentation_aws.md create mode 100644 .github/ISSUE_TEMPLATE/comp_contrib_instrumentation_awslambda.md create mode 100644 .github/ISSUE_TEMPLATE/comp_exporter_stackdriver.md create mode 100644 .github/ISSUE_TEMPLATE/comp_extensions.md create mode 100644 .github/ISSUE_TEMPLATE/comp_extensions_azuremonitor.md create mode 100644 .github/ISSUE_TEMPLATE/comp_extensions_persistentstorage.md create mode 100644 .github/ISSUE_TEMPLATE/comp_instrumentation_elasticsearchclient.md create mode 100644 .github/ISSUE_TEMPLATE/comp_instrumentation_entityframeworkcore.md create mode 100644 .github/ISSUE_TEMPLATE/comp_instrumentation_grpccore.md create mode 100644 .github/ISSUE_TEMPLATE/comp_instrumentation_hangfire.md create mode 100644 .github/ISSUE_TEMPLATE/comp_instrumentation_masstransit.md create mode 100644 .github/ISSUE_TEMPLATE/comp_instrumentation_mysqldata.md create mode 100644 .github/ISSUE_TEMPLATE/comp_instrumentation_owin.md create mode 100644 .github/ISSUE_TEMPLATE/comp_instrumentation_quartz.md create mode 100644 .github/ISSUE_TEMPLATE/comp_instrumentation_runtime.md create mode 100644 .github/ISSUE_TEMPLATE/comp_instrumentation_wcf.md diff --git a/.github/ISSUE_TEMPLATE/comp_contrib_extensions_awsxray.md b/.github/ISSUE_TEMPLATE/comp_contrib_extensions_awsxray.md new file mode 100644 index 0000000000..e1c5b43942 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/comp_contrib_extensions_awsxray.md @@ -0,0 +1,41 @@ +--- +name: OpenTelemetry.Contrib.Extensions.AWSXRay +about: Issue with OpenTelemetry.Contrib.Extensions.AWSXRay +labels: comp:contrib.extensions.awsxray +--- + +# Issue with OpenTelemetry.Contrib.Extensions.AWSXRay + +List of [all OpenTelemetry NuGet +packages](https://www.nuget.org/profiles/OpenTelemetry) and version that you are +using (e.g. `OpenTelemetry 1.0.2`): + +* TBD + +Runtime version (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can +find this information from the `*.csproj` file): + +* TBD + +**Is this a feature request or a bug?** + +* [ ] Feature Request +* [ ] Bug + +**What is the expected behavior?** + +What do you expect to see? + +**What is the actual behavior?** + +What did you see instead? If you are reporting a bug, create a self-contained +project using the template of your choice and apply the minimum required code to +result in the issue you're observing. We will close this issue if: + +* The repro project you share with us is complex. We can't investigate custom + projects, so don't point us to such, please. +* If we can not reproduce the behavior you're reporting. + +## Additional Context + +Add any other context about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/comp_contrib_instrumentation_aws.md b/.github/ISSUE_TEMPLATE/comp_contrib_instrumentation_aws.md new file mode 100644 index 0000000000..af4c13a952 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/comp_contrib_instrumentation_aws.md @@ -0,0 +1,41 @@ +--- +name: OpenTelemetry.Contrib.Instrumentation.AWS +about: Issue with OpenTelemetry.Contrib.Instrumentation.AWS +labels: comp:contrib.instrumentation.aws +--- + +# Issue with OpenTelemetry.Contrib.Instrumentation.AWS + +List of [all OpenTelemetry NuGet +packages](https://www.nuget.org/profiles/OpenTelemetry) and version that you are +using (e.g. `OpenTelemetry 1.0.2`): + +* TBD + +Runtime version (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can +find this information from the `*.csproj` file): + +* TBD + +**Is this a feature request or a bug?** + +* [ ] Feature Request +* [ ] Bug + +**What is the expected behavior?** + +What do you expect to see? + +**What is the actual behavior?** + +What did you see instead? If you are reporting a bug, create a self-contained +project using the template of your choice and apply the minimum required code to +result in the issue you're observing. We will close this issue if: + +* The repro project you share with us is complex. We can't investigate custom + projects, so don't point us to such, please. +* If we can not reproduce the behavior you're reporting. + +## Additional Context + +Add any other context about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/comp_contrib_instrumentation_awslambda.md b/.github/ISSUE_TEMPLATE/comp_contrib_instrumentation_awslambda.md new file mode 100644 index 0000000000..dcb46e3c44 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/comp_contrib_instrumentation_awslambda.md @@ -0,0 +1,41 @@ +--- +name: OpenTelemetry.Contrib.Instrumentation.AWSLambda +about: Issue with OpenTelemetry.Contrib.Instrumentation.AWSLambda +labels: comp:contrib.instrumentation.awslambda +--- + +# Issue with OpenTelemetry.Contrib.Instrumentation.AWSLambda + +List of [all OpenTelemetry NuGet +packages](https://www.nuget.org/profiles/OpenTelemetry) and version that you are +using (e.g. `OpenTelemetry 1.0.2`): + +* TBD + +Runtime version (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can +find this information from the `*.csproj` file): + +* TBD + +**Is this a feature request or a bug?** + +* [ ] Feature Request +* [ ] Bug + +**What is the expected behavior?** + +What do you expect to see? + +**What is the actual behavior?** + +What did you see instead? If you are reporting a bug, create a self-contained +project using the template of your choice and apply the minimum required code to +result in the issue you're observing. We will close this issue if: + +* The repro project you share with us is complex. We can't investigate custom + projects, so don't point us to such, please. +* If we can not reproduce the behavior you're reporting. + +## Additional Context + +Add any other context about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/comp_exporter_stackdriver.md b/.github/ISSUE_TEMPLATE/comp_exporter_stackdriver.md new file mode 100644 index 0000000000..6afeebd9c6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/comp_exporter_stackdriver.md @@ -0,0 +1,41 @@ +--- +name: OpenTelemetry.Exporter.Stackdriver +about: Issue with OpenTelemetry.Exporter.Stackdriver +labels: comp:exporter.stackdriver +--- + +# Issue with OpenTelemetry.Exporter.Stackdriver + +List of [all OpenTelemetry NuGet +packages](https://www.nuget.org/profiles/OpenTelemetry) and version that you are +using (e.g. `OpenTelemetry 1.0.2`): + +* TBD + +Runtime version (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can +find this information from the `*.csproj` file): + +* TBD + +**Is this a feature request or a bug?** + +* [ ] Feature Request +* [ ] Bug + +**What is the expected behavior?** + +What do you expect to see? + +**What is the actual behavior?** + +What did you see instead? If you are reporting a bug, create a self-contained +project using the template of your choice and apply the minimum required code to +result in the issue you're observing. We will close this issue if: + +* The repro project you share with us is complex. We can't investigate custom + projects, so don't point us to such, please. +* If we can not reproduce the behavior you're reporting. + +## Additional Context + +Add any other context about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/comp_extensions.md b/.github/ISSUE_TEMPLATE/comp_extensions.md new file mode 100644 index 0000000000..89fb00ecf1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/comp_extensions.md @@ -0,0 +1,41 @@ +--- +name: OpenTelemetry.Extensions +about: Issue with OpenTelemetry.Extensions +labels: comp:extensions +--- + +# Issue with OpenTelemetry.Extensions + +List of [all OpenTelemetry NuGet +packages](https://www.nuget.org/profiles/OpenTelemetry) and version that you are +using (e.g. `OpenTelemetry 1.0.2`): + +* TBD + +Runtime version (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can +find this information from the `*.csproj` file): + +* TBD + +**Is this a feature request or a bug?** + +* [ ] Feature Request +* [ ] Bug + +**What is the expected behavior?** + +What do you expect to see? + +**What is the actual behavior?** + +What did you see instead? If you are reporting a bug, create a self-contained +project using the template of your choice and apply the minimum required code to +result in the issue you're observing. We will close this issue if: + +* The repro project you share with us is complex. We can't investigate custom + projects, so don't point us to such, please. +* If we can not reproduce the behavior you're reporting. + +## Additional Context + +Add any other context about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/comp_extensions_azuremonitor.md b/.github/ISSUE_TEMPLATE/comp_extensions_azuremonitor.md new file mode 100644 index 0000000000..50f63a6386 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/comp_extensions_azuremonitor.md @@ -0,0 +1,41 @@ +--- +name: OpenTelemetry.Extensions.AzureMonitor +about: Issue with OpenTelemetry.Extensions.AzureMonitor +labels: comp:extensions.azuremonitor +--- + +# Issue with OpenTelemetry.Extensions.AzureMonitor + +List of [all OpenTelemetry NuGet +packages](https://www.nuget.org/profiles/OpenTelemetry) and version that you are +using (e.g. `OpenTelemetry 1.0.2`): + +* TBD + +Runtime version (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can +find this information from the `*.csproj` file): + +* TBD + +**Is this a feature request or a bug?** + +* [ ] Feature Request +* [ ] Bug + +**What is the expected behavior?** + +What do you expect to see? + +**What is the actual behavior?** + +What did you see instead? If you are reporting a bug, create a self-contained +project using the template of your choice and apply the minimum required code to +result in the issue you're observing. We will close this issue if: + +* The repro project you share with us is complex. We can't investigate custom + projects, so don't point us to such, please. +* If we can not reproduce the behavior you're reporting. + +## Additional Context + +Add any other context about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/comp_extensions_persistentstorage.md b/.github/ISSUE_TEMPLATE/comp_extensions_persistentstorage.md new file mode 100644 index 0000000000..4c069cd0bb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/comp_extensions_persistentstorage.md @@ -0,0 +1,41 @@ +--- +name: OpenTelemetry.Extensions.PersistentStorage +about: Issue with OpenTelemetry.Extensions.PersistentStorage +labels: comp:extensions.persistentstorage +--- + +# Issue with OpenTelemetry.Extensions.PersistentStorage + +List of [all OpenTelemetry NuGet +packages](https://www.nuget.org/profiles/OpenTelemetry) and version that you are +using (e.g. `OpenTelemetry 1.0.2`): + +* TBD + +Runtime version (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can +find this information from the `*.csproj` file): + +* TBD + +**Is this a feature request or a bug?** + +* [ ] Feature Request +* [ ] Bug + +**What is the expected behavior?** + +What do you expect to see? + +**What is the actual behavior?** + +What did you see instead? If you are reporting a bug, create a self-contained +project using the template of your choice and apply the minimum required code to +result in the issue you're observing. We will close this issue if: + +* The repro project you share with us is complex. We can't investigate custom + projects, so don't point us to such, please. +* If we can not reproduce the behavior you're reporting. + +## Additional Context + +Add any other context about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/comp_instrumentation_elasticsearchclient.md b/.github/ISSUE_TEMPLATE/comp_instrumentation_elasticsearchclient.md new file mode 100644 index 0000000000..9d534eae7e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/comp_instrumentation_elasticsearchclient.md @@ -0,0 +1,41 @@ +--- +name: OpenTelemetry.Instrumentation.ElasticsearchClient +about: Issue with OpenTelemetry.Instrumentation.ElasticsearchClient +labels: comp:instrumentation.elasticsearchclient +--- + +# Issue with OpenTelemetry.Instrumentation.ElasticsearchClient + +List of [all OpenTelemetry NuGet +packages](https://www.nuget.org/profiles/OpenTelemetry) and version that you are +using (e.g. `OpenTelemetry 1.0.2`): + +* TBD + +Runtime version (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can +find this information from the `*.csproj` file): + +* TBD + +**Is this a feature request or a bug?** + +* [ ] Feature Request +* [ ] Bug + +**What is the expected behavior?** + +What do you expect to see? + +**What is the actual behavior?** + +What did you see instead? If you are reporting a bug, create a self-contained +project using the template of your choice and apply the minimum required code to +result in the issue you're observing. We will close this issue if: + +* The repro project you share with us is complex. We can't investigate custom + projects, so don't point us to such, please. +* If we can not reproduce the behavior you're reporting. + +## Additional Context + +Add any other context about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/comp_instrumentation_entityframeworkcore.md b/.github/ISSUE_TEMPLATE/comp_instrumentation_entityframeworkcore.md new file mode 100644 index 0000000000..9113cb62a4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/comp_instrumentation_entityframeworkcore.md @@ -0,0 +1,41 @@ +--- +name: OpenTelemetry.Instrumentation.EntityFrameworkCore +about: Issue with OpenTelemetry.Instrumentation.EntityFrameworkCore +labels: comp:instrumentation.entityframeworkcore +--- + +# Issue with OpenTelemetry.Instrumentation.EntityFrameworkCore + +List of [all OpenTelemetry NuGet +packages](https://www.nuget.org/profiles/OpenTelemetry) and version that you are +using (e.g. `OpenTelemetry 1.0.2`): + +* TBD + +Runtime version (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can +find this information from the `*.csproj` file): + +* TBD + +**Is this a feature request or a bug?** + +* [ ] Feature Request +* [ ] Bug + +**What is the expected behavior?** + +What do you expect to see? + +**What is the actual behavior?** + +What did you see instead? If you are reporting a bug, create a self-contained +project using the template of your choice and apply the minimum required code to +result in the issue you're observing. We will close this issue if: + +* The repro project you share with us is complex. We can't investigate custom + projects, so don't point us to such, please. +* If we can not reproduce the behavior you're reporting. + +## Additional Context + +Add any other context about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/comp_instrumentation_grpccore.md b/.github/ISSUE_TEMPLATE/comp_instrumentation_grpccore.md new file mode 100644 index 0000000000..467441e7b3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/comp_instrumentation_grpccore.md @@ -0,0 +1,41 @@ +--- +name: OpenTelemetry.Instrumentation.GrpcCore +about: Issue with OpenTelemetry.Instrumentation.GrpcCore +labels: comp:instrumentation.grpccore +--- + +# Issue with OpenTelemetry.Instrumentation.GrpcCore + +List of [all OpenTelemetry NuGet +packages](https://www.nuget.org/profiles/OpenTelemetry) and version that you are +using (e.g. `OpenTelemetry 1.0.2`): + +* TBD + +Runtime version (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can +find this information from the `*.csproj` file): + +* TBD + +**Is this a feature request or a bug?** + +* [ ] Feature Request +* [ ] Bug + +**What is the expected behavior?** + +What do you expect to see? + +**What is the actual behavior?** + +What did you see instead? If you are reporting a bug, create a self-contained +project using the template of your choice and apply the minimum required code to +result in the issue you're observing. We will close this issue if: + +* The repro project you share with us is complex. We can't investigate custom + projects, so don't point us to such, please. +* If we can not reproduce the behavior you're reporting. + +## Additional Context + +Add any other context about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/comp_instrumentation_hangfire.md b/.github/ISSUE_TEMPLATE/comp_instrumentation_hangfire.md new file mode 100644 index 0000000000..745d1427c1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/comp_instrumentation_hangfire.md @@ -0,0 +1,41 @@ +--- +name: OpenTelemetry.Instrumentation.Hangfire +about: Issue with OpenTelemetry.Instrumentation.Hangfire +labels: comp:instrumentation.hangfire +--- + +# Issue with OpenTelemetry.Instrumentation.Hangfire + +List of [all OpenTelemetry NuGet +packages](https://www.nuget.org/profiles/OpenTelemetry) and version that you are +using (e.g. `OpenTelemetry 1.0.2`): + +* TBD + +Runtime version (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can +find this information from the `*.csproj` file): + +* TBD + +**Is this a feature request or a bug?** + +* [ ] Feature Request +* [ ] Bug + +**What is the expected behavior?** + +What do you expect to see? + +**What is the actual behavior?** + +What did you see instead? If you are reporting a bug, create a self-contained +project using the template of your choice and apply the minimum required code to +result in the issue you're observing. We will close this issue if: + +* The repro project you share with us is complex. We can't investigate custom + projects, so don't point us to such, please. +* If we can not reproduce the behavior you're reporting. + +## Additional Context + +Add any other context about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/comp_instrumentation_masstransit.md b/.github/ISSUE_TEMPLATE/comp_instrumentation_masstransit.md new file mode 100644 index 0000000000..720b590fb8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/comp_instrumentation_masstransit.md @@ -0,0 +1,41 @@ +--- +name: OpenTelemetry.Instrumentation.MassTransit +about: Issue with OpenTelemetry.Instrumentation.MassTransit +labels: comp:instrumentation.masstransit +--- + +# Issue with OpenTelemetry.Instrumentation.MassTransit + +List of [all OpenTelemetry NuGet +packages](https://www.nuget.org/profiles/OpenTelemetry) and version that you are +using (e.g. `OpenTelemetry 1.0.2`): + +* TBD + +Runtime version (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can +find this information from the `*.csproj` file): + +* TBD + +**Is this a feature request or a bug?** + +* [ ] Feature Request +* [ ] Bug + +**What is the expected behavior?** + +What do you expect to see? + +**What is the actual behavior?** + +What did you see instead? If you are reporting a bug, create a self-contained +project using the template of your choice and apply the minimum required code to +result in the issue you're observing. We will close this issue if: + +* The repro project you share with us is complex. We can't investigate custom + projects, so don't point us to such, please. +* If we can not reproduce the behavior you're reporting. + +## Additional Context + +Add any other context about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/comp_instrumentation_mysqldata.md b/.github/ISSUE_TEMPLATE/comp_instrumentation_mysqldata.md new file mode 100644 index 0000000000..cd0c9b600a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/comp_instrumentation_mysqldata.md @@ -0,0 +1,41 @@ +--- +name: OpenTelemetry.Instrumentation.MySqlData +about: Issue with OpenTelemetry.Instrumentation.MySqlData +labels: comp:instrumentation.mysqldata +--- + +# Issue with OpenTelemetry.Instrumentation.MySqlData + +List of [all OpenTelemetry NuGet +packages](https://www.nuget.org/profiles/OpenTelemetry) and version that you are +using (e.g. `OpenTelemetry 1.0.2`): + +* TBD + +Runtime version (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can +find this information from the `*.csproj` file): + +* TBD + +**Is this a feature request or a bug?** + +* [ ] Feature Request +* [ ] Bug + +**What is the expected behavior?** + +What do you expect to see? + +**What is the actual behavior?** + +What did you see instead? If you are reporting a bug, create a self-contained +project using the template of your choice and apply the minimum required code to +result in the issue you're observing. We will close this issue if: + +* The repro project you share with us is complex. We can't investigate custom + projects, so don't point us to such, please. +* If we can not reproduce the behavior you're reporting. + +## Additional Context + +Add any other context about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/comp_instrumentation_owin.md b/.github/ISSUE_TEMPLATE/comp_instrumentation_owin.md new file mode 100644 index 0000000000..9557899b12 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/comp_instrumentation_owin.md @@ -0,0 +1,41 @@ +--- +name: OpenTelemetry.Instrumentation.Owin +about: Issue with OpenTelemetry.Instrumentation.Owin +labels: comp:instrumentation.owin +--- + +# Issue with OpenTelemetry.Instrumentation.Owin + +List of [all OpenTelemetry NuGet +packages](https://www.nuget.org/profiles/OpenTelemetry) and version that you are +using (e.g. `OpenTelemetry 1.0.2`): + +* TBD + +Runtime version (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can +find this information from the `*.csproj` file): + +* TBD + +**Is this a feature request or a bug?** + +* [ ] Feature Request +* [ ] Bug + +**What is the expected behavior?** + +What do you expect to see? + +**What is the actual behavior?** + +What did you see instead? If you are reporting a bug, create a self-contained +project using the template of your choice and apply the minimum required code to +result in the issue you're observing. We will close this issue if: + +* The repro project you share with us is complex. We can't investigate custom + projects, so don't point us to such, please. +* If we can not reproduce the behavior you're reporting. + +## Additional Context + +Add any other context about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/comp_instrumentation_quartz.md b/.github/ISSUE_TEMPLATE/comp_instrumentation_quartz.md new file mode 100644 index 0000000000..d58aa6d1cc --- /dev/null +++ b/.github/ISSUE_TEMPLATE/comp_instrumentation_quartz.md @@ -0,0 +1,41 @@ +--- +name: OpenTelemetry.Instrumentation.Quartz +about: Issue with OpenTelemetry.Instrumentation.Quartz +labels: comp:instrumentation.quartz +--- + +# Issue with OpenTelemetry.Instrumentation.Quartz + +List of [all OpenTelemetry NuGet +packages](https://www.nuget.org/profiles/OpenTelemetry) and version that you are +using (e.g. `OpenTelemetry 1.0.2`): + +* TBD + +Runtime version (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can +find this information from the `*.csproj` file): + +* TBD + +**Is this a feature request or a bug?** + +* [ ] Feature Request +* [ ] Bug + +**What is the expected behavior?** + +What do you expect to see? + +**What is the actual behavior?** + +What did you see instead? If you are reporting a bug, create a self-contained +project using the template of your choice and apply the minimum required code to +result in the issue you're observing. We will close this issue if: + +* The repro project you share with us is complex. We can't investigate custom + projects, so don't point us to such, please. +* If we can not reproduce the behavior you're reporting. + +## Additional Context + +Add any other context about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/comp_instrumentation_runtime.md b/.github/ISSUE_TEMPLATE/comp_instrumentation_runtime.md new file mode 100644 index 0000000000..9c0edab241 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/comp_instrumentation_runtime.md @@ -0,0 +1,41 @@ +--- +name: OpenTelemetry.Instrumentation.Runtime +about: Issue with OpenTelemetry.Instrumentation.Runtime +labels: comp:instrumentation.runtime +--- + +# Issue with OpenTelemetry.Instrumentation.Runtime + +List of [all OpenTelemetry NuGet +packages](https://www.nuget.org/profiles/OpenTelemetry) and version that you are +using (e.g. `OpenTelemetry 1.0.2`): + +* TBD + +Runtime version (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can +find this information from the `*.csproj` file): + +* TBD + +**Is this a feature request or a bug?** + +* [ ] Feature Request +* [ ] Bug + +**What is the expected behavior?** + +What do you expect to see? + +**What is the actual behavior?** + +What did you see instead? If you are reporting a bug, create a self-contained +project using the template of your choice and apply the minimum required code to +result in the issue you're observing. We will close this issue if: + +* The repro project you share with us is complex. We can't investigate custom + projects, so don't point us to such, please. +* If we can not reproduce the behavior you're reporting. + +## Additional Context + +Add any other context about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/comp_instrumentation_wcf.md b/.github/ISSUE_TEMPLATE/comp_instrumentation_wcf.md new file mode 100644 index 0000000000..baa913280c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/comp_instrumentation_wcf.md @@ -0,0 +1,41 @@ +--- +name: OpenTelemetry.Instrumentation.Wcf +about: Issue with OpenTelemetry.Instrumentation.Wcf +labels: comp:instrumentation.wcf +--- + +# Issue with OpenTelemetry.Instrumentation.Wcf + +List of [all OpenTelemetry NuGet +packages](https://www.nuget.org/profiles/OpenTelemetry) and version that you are +using (e.g. `OpenTelemetry 1.0.2`): + +* TBD + +Runtime version (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can +find this information from the `*.csproj` file): + +* TBD + +**Is this a feature request or a bug?** + +* [ ] Feature Request +* [ ] Bug + +**What is the expected behavior?** + +What do you expect to see? + +**What is the actual behavior?** + +What did you see instead? If you are reporting a bug, create a self-contained +project using the template of your choice and apply the minimum required code to +result in the issue you're observing. We will close this issue if: + +* The repro project you share with us is complex. We can't investigate custom + projects, so don't point us to such, please. +* If we can not reproduce the behavior you're reporting. + +## Additional Context + +Add any other context about the feature request here. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1a9746fc6b..f47506eb8d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -171,7 +171,7 @@ Usually it is a good idea to use the latest version. Example: ```xml - + ``` @@ -202,6 +202,12 @@ the `.github/workflows/` folder. [`PROJECT`](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/.github/workflows/package-Extensions.AWSXRay.yml#L18) value to "OpenTelemetry.Contrib.Foo.Bar". +* Add an issue template in your PR. You can follow the existing issue templates, + e.g. [comp_extensions](./.github/ISSUE_TEMPLATE/comp_extensions.md). The + maintainer will help to create a new ["comp:" + label](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/labels?q=comp%3A) + once the PR is merged. + * Add a README file for your project describing how to install and use your package. Every project's README file needs to have a link to the Nuget package. You can use the below snippet for reference: @@ -215,5 +221,5 @@ the `.github/workflows/` folder. * When contributing a new project you are expected to assign either yourself or someone else who would take ownership for the component you are contributing. -Please add the right onwer for your project in the +Please add the right owner for your project in the [component_owners](./.github/component_owners.yml) file. From d12619224040d065a9c3f69412f420295836f463 Mon Sep 17 00:00:00 2001 From: Michael Maxwell Date: Thu, 28 Apr 2022 21:02:13 -0700 Subject: [PATCH 07/14] fix nullable warnings in guard class (#332) Co-authored-by: Cijo Thomas --- src/OpenTelemetry.Internal/Guard.cs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/OpenTelemetry.Internal/Guard.cs b/src/OpenTelemetry.Internal/Guard.cs index 0f67354d8f..aefa4cb7b2 100644 --- a/src/OpenTelemetry.Internal/Guard.cs +++ b/src/OpenTelemetry.Internal/Guard.cs @@ -49,6 +49,8 @@ public CallerArgumentExpressionAttribute(string parameterName) } #endif +#nullable enable + #pragma warning disable SA1403 // File may only contain a single namespace namespace OpenTelemetry.Internal #pragma warning restore SA1403 // File may only contain a single namespace @@ -65,7 +67,7 @@ internal static class Guard /// The parameter name to use in the thrown exception. [DebuggerHidden] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void ThrowIfNull(object value, [CallerArgumentExpression("value")] string paramName = null) + public static void ThrowIfNull(object value, [CallerArgumentExpression("value")] string? paramName = null) { if (value is null) { @@ -80,7 +82,7 @@ public static void ThrowIfNull(object value, [CallerArgumentExpression("value")] /// The parameter name to use in the thrown exception. [DebuggerHidden] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void ThrowIfNullOrEmpty(string value, [CallerArgumentExpression("value")] string paramName = null) + public static void ThrowIfNullOrEmpty(string value, [CallerArgumentExpression("value")] string? paramName = null) { if (string.IsNullOrEmpty(value)) { @@ -95,7 +97,7 @@ public static void ThrowIfNullOrEmpty(string value, [CallerArgumentExpression("v /// The parameter name to use in the thrown exception. [DebuggerHidden] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void ThrowIfNullOrWhitespace(string value, [CallerArgumentExpression("value")] string paramName = null) + public static void ThrowIfNullOrWhitespace(string value, [CallerArgumentExpression("value")] string? paramName = null) { if (string.IsNullOrWhiteSpace(value)) { @@ -111,7 +113,7 @@ public static void ThrowIfNullOrWhitespace(string value, [CallerArgumentExpressi /// The parameter name to use in the thrown exception. [DebuggerHidden] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void ThrowIfZero(int value, string message = "Must not be zero", [CallerArgumentExpression("value")] string paramName = null) + public static void ThrowIfZero(int value, string message = "Must not be zero", [CallerArgumentExpression("value")] string? paramName = null) { if (value == 0) { @@ -126,7 +128,7 @@ public static void ThrowIfZero(int value, string message = "Must not be zero", [ /// The parameter name to use in the thrown exception. [DebuggerHidden] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void ThrowIfInvalidTimeout(int value, [CallerArgumentExpression("value")] string paramName = null) + public static void ThrowIfInvalidTimeout(int value, [CallerArgumentExpression("value")] string? paramName = null) { ThrowIfOutOfRange(value, paramName, min: Timeout.Infinite, message: $"Must be non-negative or '{nameof(Timeout)}.{nameof(Timeout.Infinite)}'"); } @@ -143,7 +145,7 @@ public static void ThrowIfInvalidTimeout(int value, [CallerArgumentExpression("v /// An optional custom message to use in the thrown exception. [DebuggerHidden] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void ThrowIfOutOfRange(int value, [CallerArgumentExpression("value")] string paramName = null, int min = int.MinValue, int max = int.MaxValue, string minName = null, string maxName = null, string message = null) + public static void ThrowIfOutOfRange(int value, [CallerArgumentExpression("value")] string? paramName = null, int min = int.MinValue, int max = int.MaxValue, string? minName = null, string? maxName = null, string? message = null) { Range(value, paramName, min, max, minName, maxName, message); } @@ -160,7 +162,7 @@ public static void ThrowIfOutOfRange(int value, [CallerArgumentExpression("value /// An optional custom message to use in the thrown exception. [DebuggerHidden] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void ThrowIfOutOfRange(double value, [CallerArgumentExpression("value")] string paramName = null, double min = double.MinValue, double max = double.MaxValue, string minName = null, string maxName = null, string message = null) + public static void ThrowIfOutOfRange(double value, [CallerArgumentExpression("value")] string? paramName = null, double min = double.MinValue, double max = double.MaxValue, string? minName = null, string? maxName = null, string? message = null) { Range(value, paramName, min, max, minName, maxName, message); } @@ -174,7 +176,7 @@ public static void ThrowIfOutOfRange(double value, [CallerArgumentExpression("va /// The value casted to the specified type. [DebuggerHidden] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static T ThrowIfNotOfType(object value, [CallerArgumentExpression("value")] string paramName = null) + public static T ThrowIfNotOfType(object value, [CallerArgumentExpression("value")] string? paramName = null) { if (value is not T result) { @@ -186,7 +188,7 @@ public static T ThrowIfNotOfType(object value, [CallerArgumentExpression("val [DebuggerHidden] [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static void Range(T value, string paramName, T min, T max, string minName, string maxName, string message) + private static void Range(T value, string? paramName, T min, T max, string? minName, string? maxName, string? message) where T : IComparable { if (value.CompareTo(min) < 0 || value.CompareTo(max) > 0) From b2460e215cb704454ea96e53ea8cdf545cfa7f3a Mon Sep 17 00:00:00 2001 From: xiang17 Date: Thu, 28 Apr 2022 21:08:21 -0700 Subject: [PATCH 08/14] Add OpenTelemetry.Instrumentation.Runtime component (#325) --- .github/component_owners.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/component_owners.yml b/.github/component_owners.yml index 256d608bbe..2ce122bf2d 100644 --- a/.github/component_owners.yml +++ b/.github/component_owners.yml @@ -32,6 +32,9 @@ components: - codeblanch src/OpenTelemetry.Instrumentation.Quartz/: - maldago + src/OpenTelemetry.Instrumentation.Runtime/: + - twenzel + - xiang17 src/OpenTelemetry.Instrumentation.Wcf/: - codeblanch @@ -79,5 +82,8 @@ components: - codeblanch test/OpenTelemetry.Instrumentation.Quartz.Tests/: - maldago + test/OpenTelemetry.Instrumentation.Runtime.Tests/: + - twenzel + - xiang17 test/OpenTelemetry.Instrumentation.Wcf.Tests/: - codeblanch From 09cf306f43cfd5d55e0e07f5e3d2d00d59d621df Mon Sep 17 00:00:00 2001 From: Reiley Yang Date: Thu, 28 Apr 2022 21:55:29 -0700 Subject: [PATCH 09/14] tweak codecov.yml (#333) --- .github/codecov.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/codecov.yml b/.github/codecov.yml index cf7b065a15..df54634a71 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -5,6 +5,9 @@ coverage: precision: 2 round: down range: "70...100" + status: + project: off + patch: off parsers: gcov: @@ -20,6 +23,6 @@ comment: require_changes: no ignore: - - "test/**/*" # ignore test folder - - "**.md" # ignore md files + - "**.md" - "src/OpenTelemetry.Contrib.Shared" # copied from main OTel project and has code coverage there + - "test/**/*" From ba084736316ef5afb6398f95d637ac132b63c257 Mon Sep 17 00:00:00 2001 From: Vishwesh Bankwar Date: Fri, 29 Apr 2022 13:38:40 -0700 Subject: [PATCH 10/14] Separate persistent storage api (#221) * spearate persistent storage api * indent * fix md error * remove contrib * add to sln * codeowners update * fix namespace * add api proj * change name to abstractions * reoslve PR comments * remove interfaces * remove contrib * fix comments * remove unnecessary usings * minor fix * resolve PR comments * resolve PR comment --- opentelemetry-dotnet-contrib.sln | 7 + .../CHANGELOG.md | 9 ++ ...ions.PersistentStorage.Abstractions.csproj | 13 ++ .../PersistentBlob.cs | 123 ++++++++++++++++ .../PersistentBlobProvider.cs | 133 ++++++++++++++++++ .../README.md | 10 ++ 6 files changed, 295 insertions(+) create mode 100644 src/OpenTelemetry.Extensions.PersistentStorage.Abstractions/CHANGELOG.md create mode 100644 src/OpenTelemetry.Extensions.PersistentStorage.Abstractions/OpenTelemetry.Extensions.PersistentStorage.Abstractions.csproj create mode 100644 src/OpenTelemetry.Extensions.PersistentStorage.Abstractions/PersistentBlob.cs create mode 100644 src/OpenTelemetry.Extensions.PersistentStorage.Abstractions/PersistentBlobProvider.cs create mode 100644 src/OpenTelemetry.Extensions.PersistentStorage.Abstractions/README.md diff --git a/opentelemetry-dotnet-contrib.sln b/opentelemetry-dotnet-contrib.sln index 9546ca8ca5..8e34330f7d 100644 --- a/opentelemetry-dotnet-contrib.sln +++ b/opentelemetry-dotnet-contrib.sln @@ -182,6 +182,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Instrumentati EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Instrumentation.Hangfire.Tests", "test\OpenTelemetry.Instrumentation.Hangfire.Tests\OpenTelemetry.Instrumentation.Hangfire.Tests.csproj", "{ED774FC3-C1C0-44CD-BA41-686C04BEB3E5}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Extensions.PersistentStorage.Abstractions", "src\OpenTelemetry.Extensions.PersistentStorage.Abstractions\OpenTelemetry.Extensions.PersistentStorage.Abstractions.csproj", "{17E3936A-265A-4C9F-9DD5-4568F80E6D91}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -372,6 +374,10 @@ Global {ED774FC3-C1C0-44CD-BA41-686C04BEB3E5}.Debug|Any CPU.Build.0 = Debug|Any CPU {ED774FC3-C1C0-44CD-BA41-686C04BEB3E5}.Release|Any CPU.ActiveCfg = Release|Any CPU {ED774FC3-C1C0-44CD-BA41-686C04BEB3E5}.Release|Any CPU.Build.0 = Release|Any CPU + {17E3936A-265A-4C9F-9DD5-4568F80E6D91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {17E3936A-265A-4C9F-9DD5-4568F80E6D91}.Debug|Any CPU.Build.0 = Debug|Any CPU + {17E3936A-265A-4C9F-9DD5-4568F80E6D91}.Release|Any CPU.ActiveCfg = Release|Any CPU + {17E3936A-265A-4C9F-9DD5-4568F80E6D91}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -429,6 +435,7 @@ Global {A3EB4E60-256C-45EC-92EE-68FD035CAD11} = {2097345F-4DD3-477D-BC54-A922F9B2B402} {BE5FFBBB-D73F-4071-92F4-F1694881604F} = {22DF5DC0-1290-4E83-A9D8-6BB7DE3B3E63} {ED774FC3-C1C0-44CD-BA41-686C04BEB3E5} = {2097345F-4DD3-477D-BC54-A922F9B2B402} + {17E3936A-265A-4C9F-9DD5-4568F80E6D91} = {22DF5DC0-1290-4E83-A9D8-6BB7DE3B3E63} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {B0816796-CDB3-47D7-8C3C-946434DE3B66} diff --git a/src/OpenTelemetry.Extensions.PersistentStorage.Abstractions/CHANGELOG.md b/src/OpenTelemetry.Extensions.PersistentStorage.Abstractions/CHANGELOG.md new file mode 100644 index 0000000000..7f84dab7e5 --- /dev/null +++ b/src/OpenTelemetry.Extensions.PersistentStorage.Abstractions/CHANGELOG.md @@ -0,0 +1,9 @@ +# Changelog + +## Unreleased + +This is the first release for the `OpenTelemetry.Extensions.PersistentStorage.Abstractions` +project. + +For more details, please refer to the +[README](README.md) diff --git a/src/OpenTelemetry.Extensions.PersistentStorage.Abstractions/OpenTelemetry.Extensions.PersistentStorage.Abstractions.csproj b/src/OpenTelemetry.Extensions.PersistentStorage.Abstractions/OpenTelemetry.Extensions.PersistentStorage.Abstractions.csproj new file mode 100644 index 0000000000..7590f91c89 --- /dev/null +++ b/src/OpenTelemetry.Extensions.PersistentStorage.Abstractions/OpenTelemetry.Extensions.PersistentStorage.Abstractions.csproj @@ -0,0 +1,13 @@ + + + + netstandard2.0;net462 + OpenTelemetry Persistent Storage Abstractions + Extensions.PersistentStorage.Abstractions- + + + + $(NoWarn),1591 + + + diff --git a/src/OpenTelemetry.Extensions.PersistentStorage.Abstractions/PersistentBlob.cs b/src/OpenTelemetry.Extensions.PersistentStorage.Abstractions/PersistentBlob.cs new file mode 100644 index 0000000000..82467df7cf --- /dev/null +++ b/src/OpenTelemetry.Extensions.PersistentStorage.Abstractions/PersistentBlob.cs @@ -0,0 +1,123 @@ +// +// 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. +// + +using System; + +namespace OpenTelemetry.Extensions.PersistentStorage.Abstractions +{ + /// + /// Represents a persistent blob. + /// + public abstract class PersistentBlob + { + /// + /// Attempts to read the content from the blob. + /// + /// + /// The content to be read. + /// + /// + /// True if read was successful or else false. + /// + public bool TryRead(out byte[] buffer) + { + try + { + return this.OnTryRead(out buffer); + } + catch (Exception) + { + // TODO: log exception. + buffer = null; + return false; + } + } + + /// + /// Attempts to write the given content to the blob. + /// + /// + /// The content to be written. + /// + /// + /// The number of milliseconds to lease after the write operation finished. + /// + /// + /// True if the write operation succeeded or else false. + /// + public bool TryWrite(byte[] buffer, int leasePeriodMilliseconds = 0) + { + try + { + return this.OnTryWrite(buffer, leasePeriodMilliseconds); + } + catch (Exception) + { + // TODO: log exception. + return false; + } + } + + /// + /// Attempts to acquire lease on the blob. + /// + /// + /// The number of milliseconds to lease. + /// + /// + /// true if lease is acquired or else false. + /// + public bool TryLease(int leasePeriodMilliseconds) + { + try + { + return this.OnTryLease(leasePeriodMilliseconds); + } + catch (Exception) + { + // TODO: log exception. + return false; + } + } + + /// + /// Attempts to delete the blob. + /// + /// + /// True if delete was successful else false. + /// + public bool TryDelete() + { + try + { + return this.OnTryDelete(); + } + catch (Exception) + { + // TODO: log exception. + return false; + } + } + + protected abstract bool OnTryRead(out byte[] buffer); + + protected abstract bool OnTryWrite(byte[] buffer, int leasePeriodMilliseconds = 0); + + protected abstract bool OnTryLease(int leasePeriodMilliseconds); + + protected abstract bool OnTryDelete(); + } +} diff --git a/src/OpenTelemetry.Extensions.PersistentStorage.Abstractions/PersistentBlobProvider.cs b/src/OpenTelemetry.Extensions.PersistentStorage.Abstractions/PersistentBlobProvider.cs new file mode 100644 index 0000000000..be35939d5b --- /dev/null +++ b/src/OpenTelemetry.Extensions.PersistentStorage.Abstractions/PersistentBlobProvider.cs @@ -0,0 +1,133 @@ +// +// 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. +// + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace OpenTelemetry.Extensions.PersistentStorage.Abstractions +{ + /// + /// Represents persistent blob provider. + /// + public abstract class PersistentBlobProvider + { + /// + /// Attempts to create a new blob with the provided data and lease it. + /// + /// + /// The content to be written. + /// + /// + /// The number of milliseconds to lease after the blob is created. + /// + /// + /// Blob if it is created. + /// + /// + /// True if the blob was created or else false. + /// + public bool TryCreateBlob(byte[] buffer, int leasePeriodMilliseconds, out PersistentBlob blob) + { + try + { + return this.OnTryCreateBlob(buffer, leasePeriodMilliseconds, out blob); + } + catch (Exception) + { + // TODO: log exception. + blob = null; + return false; + } + } + + /// + /// Attempts to create a new blob with the provided data. + /// + /// + /// The content to be written. + /// + /// + /// Blob if it is created. + /// + /// + /// True if the blob was created or else false. + /// + public bool TryCreateBlob(byte[] buffer, out PersistentBlob blob) + { + try + { + return this.OnTryCreateBlob(buffer, out blob); + } + catch (Exception) + { + // TODO: log exception; + blob = null; + return false; + } + } + + /// + /// Attempts to get a single blob from storage. + /// + /// + /// Blob object if found. + /// + /// + /// True if blob is present or else false. + /// + public bool TryGetBlob(out PersistentBlob blob) + { + try + { + return this.OnTryGetBlob(out blob); + } + catch (Exception) + { + // TODO: log exception. + blob = null; + return false; + } + } + + /// + /// Reads a sequence of blobs from storage. + /// + /// + /// List of blobs if present in storage or else empty collection. + /// + public IEnumerable GetBlobs() + { + try + { + return this.OnGetBlobs() ?? Enumerable.Empty(); + } + catch (Exception) + { + // TODO: log exception + return Enumerable.Empty(); + } + } + + protected abstract IEnumerable OnGetBlobs(); + + protected abstract bool OnTryCreateBlob(byte[] buffer, int leasePeriodMilliseconds, out PersistentBlob blob); + + protected abstract bool OnTryCreateBlob(byte[] buffer, out PersistentBlob blob); + + protected abstract bool OnTryGetBlob(out PersistentBlob blob); + } +} diff --git a/src/OpenTelemetry.Extensions.PersistentStorage.Abstractions/README.md b/src/OpenTelemetry.Extensions.PersistentStorage.Abstractions/README.md new file mode 100644 index 0000000000..adbb4a187e --- /dev/null +++ b/src/OpenTelemetry.Extensions.PersistentStorage.Abstractions/README.md @@ -0,0 +1,10 @@ +# Persistent Storage Interface + +This package includes APIs which can be extended by exporter owners to implement +persistent storage. + +## Installation + +```shell +dotnet add package OpenTelemetry.Extensions.PersistentStorage.Abstractions +``` From 65a07cad4fe75a458435bd91877c8da1a0f7da95 Mon Sep 17 00:00:00 2001 From: Michael Maxwell Date: Mon, 2 May 2022 11:02:53 -0700 Subject: [PATCH 11/14] dotnet format CI skipped when no `.md` files modified (#336) --- .github/workflows/dotnet-format-md.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/dotnet-format-md.yml diff --git a/.github/workflows/dotnet-format-md.yml b/.github/workflows/dotnet-format-md.yml new file mode 100644 index 0000000000..45be5b05fb --- /dev/null +++ b/.github/workflows/dotnet-format-md.yml @@ -0,0 +1,21 @@ +# Syntax: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions +# See also: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks + +# Description: This workflow exists to unblock documentation-only PRs. + +# IMPORTANT: This workflow MUST use the same 'name' and 'matrix' as the non -md workflow. + +name: dotnet format + +on: + pull_request: + branches: [ main ] + paths: + - '**.md' + +jobs: + check-format: + runs-on: ubuntu-latest + + steps: + run: 'echo "No build required"' From 73415fcb03fe815868ca04b3ebd88370313d9c26 Mon Sep 17 00:00:00 2001 From: Michael Maxwell Date: Mon, 2 May 2022 11:09:20 -0700 Subject: [PATCH 12/14] Create windows-ci-md.yml (#339) Co-authored-by: Cijo Thomas --- .github/workflows/windows-ci-md.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/windows-ci-md.yml diff --git a/.github/workflows/windows-ci-md.yml b/.github/workflows/windows-ci-md.yml new file mode 100644 index 0000000000..dce6fa9c72 --- /dev/null +++ b/.github/workflows/windows-ci-md.yml @@ -0,0 +1,25 @@ +# Syntax: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions +# See also: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks + +# Description: This workflow exists to unblock documentation-only PRs. + +# IMPORTANT: This workflow MUST use the same 'name' as the non -md workflow. + +name: Windows + +on: + pull_request: + branches: [ main ] + paths: + - '**.md' + +jobs: + build-test: + runs-on: ubuntu-latest + + strategy: + matrix: + version: [net461,netcoreapp3.1,net5.0,net6.0] + + steps: + - run: 'echo "No build required"' From 584654cb967bc8f6a65d9e9055f486ab7c2efe93 Mon Sep 17 00:00:00 2001 From: Michael Maxwell Date: Mon, 2 May 2022 11:38:21 -0700 Subject: [PATCH 13/14] Create linux-ci-md.yml (#338) Co-authored-by: Cijo Thomas --- .github/workflows/linux-ci-md.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/linux-ci-md.yml diff --git a/.github/workflows/linux-ci-md.yml b/.github/workflows/linux-ci-md.yml new file mode 100644 index 0000000000..b55ee6c7ed --- /dev/null +++ b/.github/workflows/linux-ci-md.yml @@ -0,0 +1,25 @@ +# Syntax: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions +# See also: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks + +# Description: This workflow exists to unblock documentation-only PRs. + +# IMPORTANT: This workflow MUST use the same 'name' as the non -md workflow. + +name: Linux + +on: + pull_request: + branches: [ main ] + paths: + - '**.md' + +jobs: + build-test: + runs-on: ubuntu-latest + + strategy: + matrix: + version: [netcoreapp3.1,net5.0,net6.0] + + steps: + - run: 'echo "No build required"' From fe42963cf05aa65d1eb58b7b32f0857245f4e50a Mon Sep 17 00:00:00 2001 From: Reiley Yang Date: Mon, 2 May 2022 18:50:51 -0700 Subject: [PATCH 14/14] Editorial changes to the README.md (#340) --- README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0966cc38d9..eb87548c5a 100644 --- a/README.md +++ b/README.md @@ -4,18 +4,17 @@ [![Linux](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/actions/workflows/linux-ci.yml/badge.svg?branch=main)](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/actions/workflows/linux-ci.yml) [![Windows](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/actions/workflows/windows-ci.yml/badge.svg?branch=main)](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/actions/workflows/windows-ci.yml) -This repository contains set of components extending functionality of the -OpenTelemetry SDK. Instrumentation libraries, exporters, and other components -can find their home here. - -Packages in this repository are prefixed with `OpenTelemetry.Contrib` to -highlight that they are different from the packages produced by the primary .NET -SDK repository. +This project is intended to provide helpful libraries and standalone +OpenTelemetry-based utilities that don't fit the express scope of the +[OpenTelemetry .NET](https://github.com/open-telemetry/opentelemetry-dotnet) or +[OpenTelemetry .NET Automatic +Instrumentation](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation) +projects. ## Contributing For information on how to contribute, consult [the contributing -guidelines](./CONTRIBUTING.md) +guidelines](./CONTRIBUTING.md). ## Support