Skip to content

Commit

Permalink
Merge branch 'main' into wcf-bump-otel
Browse files Browse the repository at this point in the history
  • Loading branch information
utpilla authored Aug 9, 2022
2 parents 7db76b3 + c4ab673 commit 0785185
Show file tree
Hide file tree
Showing 7 changed files with 410 additions and 417 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,26 @@
using System.Reflection;
using OpenTelemetry.Trace;

namespace OpenTelemetry.Instrumentation.MySqlData
namespace OpenTelemetry.Instrumentation.MySqlData;

/// <summary>
/// Helper class to hold common properties used by MySqlDataDiagnosticListener.
/// </summary>
internal class MySqlActivitySourceHelper
{
/// <summary>
/// Helper class to hold common properties used by MySqlDataDiagnosticListener.
/// </summary>
internal class MySqlActivitySourceHelper
{
public const string MysqlDatabaseSystemName = "mysql";
public const string MysqlDatabaseSystemName = "mysql";

public static readonly AssemblyName AssemblyName = typeof(MySqlActivitySourceHelper).Assembly.GetName();
public static readonly string ActivitySourceName = AssemblyName.Name;
public static readonly string ActivityName = ActivitySourceName + ".Execute";
public static readonly AssemblyName AssemblyName = typeof(MySqlActivitySourceHelper).Assembly.GetName();
public static readonly string ActivitySourceName = AssemblyName.Name;
public static readonly string ActivityName = ActivitySourceName + ".Execute";

public static readonly IEnumerable<KeyValuePair<string, object>> CreationTags = new[]
{
new KeyValuePair<string, object>(SemanticConventions.AttributeDbSystem, MysqlDatabaseSystemName),
};
public static readonly IEnumerable<KeyValuePair<string, object>> CreationTags = new[]
{
new KeyValuePair<string, object>(SemanticConventions.AttributeDbSystem, MysqlDatabaseSystemName),
};

private static readonly Version Version = typeof(MySqlActivitySourceHelper).Assembly.GetName().Version;
private static readonly Version Version = typeof(MySqlActivitySourceHelper).Assembly.GetName().Version;
#pragma warning disable SA1202 // Elements should be ordered by access <- In this case, Version MUST come before ActivitySource otherwise null ref exception is thrown.
internal static readonly ActivitySource ActivitySource = new ActivitySource(ActivitySourceName, Version.ToString());
internal static readonly ActivitySource ActivitySource = new ActivitySource(ActivitySourceName, Version.ToString());
#pragma warning restore SA1202 // Elements should be ordered by access
}
}
Loading

0 comments on commit 0785185

Please sign in to comment.