diff --git a/server/expression/executor.go b/server/expression/executor.go index 8874178b55..36edd730c3 100644 --- a/server/expression/executor.go +++ b/server/expression/executor.go @@ -243,7 +243,8 @@ func (e Executor) resolveAttribute(attribute *Attribute) (value.Value, error) { return value.Nil, resolutionError(err) } - return value.NewFromString(attributeValue), nil + str := value.NewFromString(attributeValue) + return value.NewFromString(str.UnescappedString()), nil } func (e Executor) resolveEnvironment(environment *Environment) (value.Value, error) { diff --git a/server/expression/executor_test.go b/server/expression/executor_test.go index f78247ade4..7fdb0c00fc 100644 --- a/server/expression/executor_test.go +++ b/server/expression/executor_test.go @@ -63,6 +63,19 @@ func TestBasicExpressionExecution(t *testing.T) { Query: `'This should be workin\'' = "This should be workin'"`, ShouldPass: true, }, + { + Name: "escaped_strings_must_be_equal_to_unescaped_strings_when_escaping_is_not_required", + Query: `attr:response = '"text \"quoted\" and another \"quote\"",'`, + ShouldPass: true, + AttributeDataStore: expression.AttributeDataStore{ + Span: traces.Span{ + ID: id.NewRandGenerator().SpanID(), + Attributes: traces.NewAttributes(map[string]string{ + "response": `"text \"quoted\" and another \"quote\"",`, + }), + }, + }, + }, } executeTestCases(t, testCases)