Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ComponentId instead of ComponentName #498

Merged
merged 1 commit into from
Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down