Skip to content

GraphQL instrumentation adds non-OTel compliant error attributes #1485

Description

@pellared

Actual

GraphQL (and possibly other bytecode instrumentations) use

/// <summary>
/// The error message of an exception
/// </summary>
public const string ErrorMsg = "error.msg";
/// <summary>
/// The type of an exception
/// </summary>
public const string ErrorType = "error.type";
/// <summary>
/// The stack trace of an exception
/// </summary>
public const string ErrorStack = "error.stack";
/// <summary>
/// The status of a span
/// </summary>
public const string Status = "status";

Expected

For setting the status we probably should use: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.activity.setstatus?view=net-6.0#system-diagnostics-activity-setstatus(system-diagnostics-activitystatuscode-system-string)

For marking the exception we should rather use OTel API: https://github.com/open-telemetry/opentelemetry-dotnet/blob/16e0758c148c6bac26cf4a31a6b405482a798d84/src/OpenTelemetry.Api/Trace/ActivityExtensions.cs#L89

References in spec:

See also:

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done/Cut

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions