forked from open-telemetry/opentelemetry-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add StackExchangeRedis Instrumentation to contrib repo (open-telemetr…
…y#366) * Add StackExchangeRedis Instrumentation
- Loading branch information
Showing
23 changed files
with
1,604 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/OpenTelemetry.Contrib.Shared/ServiceProviderExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// <copyright file="ServiceProviderExtensions.cs" company="OpenTelemetry Authors"> | ||
// Copyright The OpenTelemetry Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// </copyright> | ||
|
||
#if NETFRAMEWORK || NETSTANDARD2_0_OR_GREATER || NETCOREAPP3_1_OR_GREATER | ||
using Microsoft.Extensions.Options; | ||
#endif | ||
|
||
namespace System | ||
{ | ||
/// <summary> | ||
/// Extension methods for OpenTelemetry dependency injection support. | ||
/// </summary> | ||
internal static class ServiceProviderExtensions | ||
{ | ||
/// <summary> | ||
/// Get options from the supplied <see cref="IServiceProvider"/>. | ||
/// </summary> | ||
/// <typeparam name="T">Options type.</typeparam> | ||
/// <param name="serviceProvider"><see cref="IServiceProvider"/>.</param> | ||
/// <returns>Options instance.</returns> | ||
public static T GetOptions<T>(this IServiceProvider serviceProvider) | ||
where T : class, new() | ||
{ | ||
#if NETFRAMEWORK || NETSTANDARD2_0_OR_GREATER || NETCOREAPP3_1_OR_GREATER | ||
IOptions<T> options = (IOptions<T>)serviceProvider.GetService(typeof(IOptions<T>)); | ||
|
||
// Note: options could be null if user never invoked services.AddOptions(). | ||
return options?.Value ?? new T(); | ||
#else | ||
return new T(); | ||
#endif | ||
} | ||
} | ||
} |
Empty file.
13 changes: 13 additions & 0 deletions
13
...penTelemetry.Instrumentation.StackExchangeRedis/.publicApi/net462/PublicAPI.Unshipped.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
OpenTelemetry.Instrumentation.MultiTypePropertyFetcher<T> | ||
OpenTelemetry.Instrumentation.MultiTypePropertyFetcher<T>.Fetch(object obj) -> T | ||
OpenTelemetry.Instrumentation.MultiTypePropertyFetcher<T>.MultiTypePropertyFetcher(string propertyName) -> void | ||
OpenTelemetry.Instrumentation.StackExchangeRedis.StackExchangeRedisCallsInstrumentationOptions | ||
OpenTelemetry.Instrumentation.StackExchangeRedis.StackExchangeRedisCallsInstrumentationOptions.Enrich.get -> System.Action<System.Diagnostics.Activity, StackExchange.Redis.Profiling.IProfiledCommand> | ||
OpenTelemetry.Instrumentation.StackExchangeRedis.StackExchangeRedisCallsInstrumentationOptions.Enrich.set -> void | ||
OpenTelemetry.Instrumentation.StackExchangeRedis.StackExchangeRedisCallsInstrumentationOptions.FlushInterval.get -> System.TimeSpan | ||
OpenTelemetry.Instrumentation.StackExchangeRedis.StackExchangeRedisCallsInstrumentationOptions.FlushInterval.set -> void | ||
OpenTelemetry.Instrumentation.StackExchangeRedis.StackExchangeRedisCallsInstrumentationOptions.SetVerboseDatabaseStatements.get -> bool | ||
OpenTelemetry.Instrumentation.StackExchangeRedis.StackExchangeRedisCallsInstrumentationOptions.SetVerboseDatabaseStatements.set -> void | ||
OpenTelemetry.Instrumentation.StackExchangeRedis.StackExchangeRedisCallsInstrumentationOptions.StackExchangeRedisCallsInstrumentationOptions() -> void | ||
OpenTelemetry.Trace.TracerProviderBuilderExtensions | ||
static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddRedisInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder, StackExchange.Redis.IConnectionMultiplexer connection = null, System.Action<OpenTelemetry.Instrumentation.StackExchangeRedis.StackExchangeRedisCallsInstrumentationOptions> configure = null) -> OpenTelemetry.Trace.TracerProviderBuilder |
Empty file.
13 changes: 13 additions & 0 deletions
13
...etry.Instrumentation.StackExchangeRedis/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
OpenTelemetry.Instrumentation.MultiTypePropertyFetcher<T> | ||
OpenTelemetry.Instrumentation.MultiTypePropertyFetcher<T>.Fetch(object obj) -> T | ||
OpenTelemetry.Instrumentation.MultiTypePropertyFetcher<T>.MultiTypePropertyFetcher(string propertyName) -> void | ||
OpenTelemetry.Instrumentation.StackExchangeRedis.StackExchangeRedisCallsInstrumentationOptions | ||
OpenTelemetry.Instrumentation.StackExchangeRedis.StackExchangeRedisCallsInstrumentationOptions.Enrich.get -> System.Action<System.Diagnostics.Activity, StackExchange.Redis.Profiling.IProfiledCommand> | ||
OpenTelemetry.Instrumentation.StackExchangeRedis.StackExchangeRedisCallsInstrumentationOptions.Enrich.set -> void | ||
OpenTelemetry.Instrumentation.StackExchangeRedis.StackExchangeRedisCallsInstrumentationOptions.FlushInterval.get -> System.TimeSpan | ||
OpenTelemetry.Instrumentation.StackExchangeRedis.StackExchangeRedisCallsInstrumentationOptions.FlushInterval.set -> void | ||
OpenTelemetry.Instrumentation.StackExchangeRedis.StackExchangeRedisCallsInstrumentationOptions.SetVerboseDatabaseStatements.get -> bool | ||
OpenTelemetry.Instrumentation.StackExchangeRedis.StackExchangeRedisCallsInstrumentationOptions.SetVerboseDatabaseStatements.set -> void | ||
OpenTelemetry.Instrumentation.StackExchangeRedis.StackExchangeRedisCallsInstrumentationOptions.StackExchangeRedisCallsInstrumentationOptions() -> void | ||
OpenTelemetry.Trace.TracerProviderBuilderExtensions | ||
static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddRedisInstrumentation(this OpenTelemetry.Trace.TracerProviderBuilder builder, StackExchange.Redis.IConnectionMultiplexer connection = null, System.Action<OpenTelemetry.Instrumentation.StackExchangeRedis.StackExchangeRedisCallsInstrumentationOptions> configure = null) -> OpenTelemetry.Trace.TracerProviderBuilder |
34 changes: 34 additions & 0 deletions
34
src/OpenTelemetry.Instrumentation.StackExchangeRedis/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// <copyright file="AssemblyInfo.cs" company="OpenTelemetry Authors"> | ||
// Copyright The OpenTelemetry Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// </copyright> | ||
|
||
using System.Runtime.CompilerServices; | ||
|
||
[assembly: InternalsVisibleTo("OpenTelemetry.Instrumentation.StackExchangeRedis.Tests" + AssemblyInfo.PublicKey)] | ||
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2" + AssemblyInfo.MoqPublicKey)] | ||
|
||
#if SIGNED | ||
internal static class AssemblyInfo | ||
{ | ||
public const string PublicKey = ", PublicKey=002400000480000094000000060200000024000052534131000400000100010051C1562A090FB0C9F391012A32198B5E5D9A60E9B80FA2D7B434C9E5CCB7259BD606E66F9660676AFC6692B8CDC6793D190904551D2103B7B22FA636DCBB8208839785BA402EA08FC00C8F1500CCEF28BBF599AA64FFB1E1D5DC1BF3420A3777BADFE697856E9D52070A50C3EA5821C80BEF17CA3ACFFA28F89DD413F096F898"; | ||
public const string MoqPublicKey = ", PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7"; | ||
} | ||
#else | ||
internal static class AssemblyInfo | ||
{ | ||
public const string PublicKey = ""; | ||
public const string MoqPublicKey = ""; | ||
} | ||
#endif |
109 changes: 109 additions & 0 deletions
109
src/OpenTelemetry.Instrumentation.StackExchangeRedis/CHANGELOG.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# Changelog | ||
|
||
## Unreleased | ||
|
||
## 1.0.0-rc9.3 | ||
|
||
Released 2022-Apr-15 | ||
|
||
* Removes .NET Framework 4.6.1. The minimum .NET Framework version supported is | ||
.NET 4.6.2. | ||
([#3190](https://github.com/open-telemetry/opentelemetry-dotnet/issues/3190)) | ||
|
||
* Bumped minimum required version of `Microsoft.Extensions.Options` to 3.1.0. | ||
([#2582](https://github.com/open-telemetry/opentelemetry-dotnet/pull/3196)) | ||
|
||
## 1.0.0-rc9.2 | ||
|
||
Released 2022-Apr-12 | ||
|
||
## 1.0.0-rc9.1 | ||
|
||
Released 2022-Mar-30 | ||
|
||
## 1.0.0-rc10 (broken. use 1.0.0-rc9.1 and newer) | ||
|
||
Released 2022-Mar-04 | ||
|
||
## 1.0.0-rc9 | ||
|
||
Released 2022-Feb-02 | ||
|
||
## 1.0.0-rc8 | ||
|
||
Released 2021-Oct-08 | ||
|
||
* Adds SetVerboseDatabaseStatements option to allow setting more detailed | ||
database statement tag values. | ||
* Adds Enrich option to allow enriching activities from the source profiled | ||
command objects. | ||
* Removes upper constraint for Microsoft.Extensions.Options dependency. | ||
([#2179](https://github.com/open-telemetry/opentelemetry-dotnet/pull/2179)) | ||
|
||
## 1.0.0-rc7 | ||
|
||
Released 2021-Jul-12 | ||
|
||
## 1.0.0-rc6 | ||
|
||
Released 2021-Jun-25 | ||
|
||
* `AddRedisInstrumentation` extension will now resolve `IConnectionMultiplexer` | ||
& `StackExchangeRedisCallsInstrumentationOptions` through DI when | ||
OpenTelemetry.Extensions.Hosting is in use. | ||
([#2110](https://github.com/open-telemetry/opentelemetry-dotnet/pull/2110)) | ||
|
||
## 1.0.0-rc5 | ||
|
||
Released 2021-Jun-09 | ||
|
||
## 1.0.0-rc4 | ||
|
||
Released 2021-Apr-23 | ||
|
||
* Activities are now created with the `db.system` attribute set for usage during | ||
sampling. | ||
([#1984](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1984)) | ||
|
||
## 1.0.0-rc3 | ||
|
||
Released 2021-Mar-19 | ||
|
||
## 1.0.0-rc2 | ||
|
||
Released 2021-Jan-29 | ||
|
||
## 1.0.0-rc1.1 | ||
|
||
Released 2020-Nov-17 | ||
|
||
## 0.8.0-beta.1 | ||
|
||
Released 2020-Nov-5 | ||
|
||
## 0.7.0-beta.1 | ||
|
||
Released 2020-Oct-16 | ||
|
||
* Span Status is populated as per new spec | ||
([#1313](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1313)) | ||
|
||
## 0.6.0-beta.1 | ||
|
||
Released 2020-Sep-15 | ||
|
||
## 0.5.0-beta.2 | ||
|
||
Released 2020-08-28 | ||
|
||
## 0.4.0-beta.2 | ||
|
||
Released 2020-07-24 | ||
|
||
* First beta release | ||
|
||
## 0.3.0-beta | ||
|
||
Released 2020-07-23 | ||
|
||
* Initial release |
Oops, something went wrong.