diff --git a/src/SkyApm.Diagnostics.EntityFrameworkCore.Npgsql/NpgsqlEntityFrameworkCoreSpanMetadataProvider.cs b/src/SkyApm.Diagnostics.EntityFrameworkCore.Npgsql/NpgsqlEntityFrameworkCoreSpanMetadataProvider.cs index 872ae8ab..3edefeb6 100644 --- a/src/SkyApm.Diagnostics.EntityFrameworkCore.Npgsql/NpgsqlEntityFrameworkCoreSpanMetadataProvider.cs +++ b/src/SkyApm.Diagnostics.EntityFrameworkCore.Npgsql/NpgsqlEntityFrameworkCoreSpanMetadataProvider.cs @@ -16,13 +16,14 @@ * */ +using SkyApm.Common; using System.Data.Common; namespace SkyApm.Diagnostics.EntityFrameworkCore { public class NpgsqlEntityFrameworkCoreSpanMetadataProvider : IEntityFrameworkCoreSpanMetadataProvider { - public string Component { get; } = Common.Components.NPGSQL_ENTITYFRAMEWORKCORE_POSTGRESQL.GetStringValue(); + public StringOrIntValue Component { get; } = Common.Components.NPGSQL_ENTITYFRAMEWORKCORE_POSTGRESQL; public bool Match(DbConnection connection) { diff --git a/src/SkyApm.Diagnostics.EntityFrameworkCore.Pomelo.MySql/MySqlEntityFrameworkCoreSpanMetadataProvider.cs b/src/SkyApm.Diagnostics.EntityFrameworkCore.Pomelo.MySql/MySqlEntityFrameworkCoreSpanMetadataProvider.cs index 72dc9da8..be750753 100644 --- a/src/SkyApm.Diagnostics.EntityFrameworkCore.Pomelo.MySql/MySqlEntityFrameworkCoreSpanMetadataProvider.cs +++ b/src/SkyApm.Diagnostics.EntityFrameworkCore.Pomelo.MySql/MySqlEntityFrameworkCoreSpanMetadataProvider.cs @@ -16,13 +16,14 @@ * */ +using SkyApm.Common; using System.Data.Common; namespace SkyApm.Diagnostics.EntityFrameworkCore { public class MySqlEntityFrameworkCoreSpanMetadataProvider : IEntityFrameworkCoreSpanMetadataProvider { - public string Component { get; } = Common.Components.POMELO_ENTITYFRAMEWORKCORE_MYSQL.GetStringValue(); + public StringOrIntValue Component { get; } = Common.Components.POMELO_ENTITYFRAMEWORKCORE_MYSQL; public bool Match(DbConnection connection) { diff --git a/src/SkyApm.Diagnostics.EntityFrameworkCore.Sqlite/SqliteEntityFrameworkCoreSpanMetadataProvider.cs b/src/SkyApm.Diagnostics.EntityFrameworkCore.Sqlite/SqliteEntityFrameworkCoreSpanMetadataProvider.cs index c19f9012..e8c7a718 100644 --- a/src/SkyApm.Diagnostics.EntityFrameworkCore.Sqlite/SqliteEntityFrameworkCoreSpanMetadataProvider.cs +++ b/src/SkyApm.Diagnostics.EntityFrameworkCore.Sqlite/SqliteEntityFrameworkCoreSpanMetadataProvider.cs @@ -16,13 +16,14 @@ * */ +using SkyApm.Common; using System.Data.Common; namespace SkyApm.Diagnostics.EntityFrameworkCore { public class SqliteEntityFrameworkCoreSpanMetadataProvider : IEntityFrameworkCoreSpanMetadataProvider { - public string Component { get; } = Common.Components.ENTITYFRAMEWORKCORE_SQLITE.GetStringValue(); + public StringOrIntValue Component { get; } = Common.Components.ENTITYFRAMEWORKCORE_SQLITE; public bool Match(DbConnection connection) { diff --git a/src/SkyApm.Diagnostics.EntityFrameworkCore/EntityFrameworkCoreSegmentContextFactory.cs b/src/SkyApm.Diagnostics.EntityFrameworkCore/EntityFrameworkCoreSegmentContextFactory.cs index 20179cb9..675ae299 100644 --- a/src/SkyApm.Diagnostics.EntityFrameworkCore/EntityFrameworkCoreSegmentContextFactory.cs +++ b/src/SkyApm.Diagnostics.EntityFrameworkCore/EntityFrameworkCoreSegmentContextFactory.cs @@ -70,7 +70,7 @@ private SegmentContext CreateExitSegment(string operationName, DbCommand dbComma { var context = _tracingContext.CreateExitSegmentContext(operationName, metadataProvider.GetPeer(dbCommand.Connection)); - context.Span.Component = new StringOrIntValue(metadataProvider.Component); + context.Span.Component = metadataProvider.Component; return context; } diff --git a/src/SkyApm.Diagnostics.EntityFrameworkCore/IEntityFrameworkCoreSpanMetadataProvider.cs b/src/SkyApm.Diagnostics.EntityFrameworkCore/IEntityFrameworkCoreSpanMetadataProvider.cs index 45f3b336..ac4b765f 100644 --- a/src/SkyApm.Diagnostics.EntityFrameworkCore/IEntityFrameworkCoreSpanMetadataProvider.cs +++ b/src/SkyApm.Diagnostics.EntityFrameworkCore/IEntityFrameworkCoreSpanMetadataProvider.cs @@ -16,13 +16,14 @@ * */ +using SkyApm.Common; using System.Data.Common; namespace SkyApm.Diagnostics.EntityFrameworkCore { public interface IEntityFrameworkCoreSpanMetadataProvider { - string Component { get; } + StringOrIntValue Component { get; } bool Match(DbConnection connection);