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

fix: Update EAP search config to override default #87342

Merged
merged 1 commit into from
Mar 19, 2025
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
6 changes: 4 additions & 2 deletions src/sentry/search/eap/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
)

from sentry.api import event_search
from sentry.api.event_search import SearchConfig
from sentry.exceptions import InvalidSearchQuery
from sentry.search.eap import constants
from sentry.search.eap.columns import (
Expand Down Expand Up @@ -164,7 +163,10 @@ def __resolve_query(
try:
parsed_terms = event_search.parse_search_query(
querystring,
config=SearchConfig(wildcard_free_text=True),
config=event_search.SearchConfig.create_from(
event_search.default_config,
wildcard_free_text=True,
),
params=self.params.filter_params,
get_field_type=self.get_field_type,
get_function_result_type=self.get_field_type,
Expand Down
13 changes: 13 additions & 0 deletions tests/sentry/search/eap/test_spans.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from sentry.search.eap.types import SearchResolverConfig
from sentry.search.events.types import SnubaParams
from sentry.testutils.cases import TestCase
from sentry.testutils.helpers.datetime import freeze_time


class SearchResolverQueryTest(TestCase):
Expand Down Expand Up @@ -128,6 +129,18 @@ def test_greater_than_numeric_filter(self):
)
assert having is None

def test_timestamp_relative_filter(self):
with freeze_time("2018-12-11 10:20:00"):
where, having, _ = self.resolver.resolve_query("timestamp:-24h")
assert where == TraceItemFilter(
comparison_filter=ComparisonFilter(
key=AttributeKey(name="sentry.timestamp", type=AttributeKey.Type.TYPE_STRING),
op=ComparisonFilter.OP_GREATER_THAN_OR_EQUALS,
value=AttributeValue(val_str="2018-12-10 10:20:00+00:00"),
)
)
assert having is None

def test_query_with_and(self):
where, having, _ = self.resolver.resolve_query("span.description:foo span.op:bar")
assert where == TraceItemFilter(
Expand Down
Loading