Skip to content

Commit 7c38df2

Browse files
authored
fix(spans-migration): add platform.name to translation layer (#96676)
EAP doesn't support `platform.name` and `platform` tags like discover does, it only supports `platform`, so we're mapping all instances of `platform.name` to `platform` in EAP. It pretty much has the same functionality so there shouldn't be issues with the mapping.
1 parent 2f94b13 commit 7c38df2

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/sentry/discover/translation/mep_to_eap.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ def column_switcheroo(term):
101101
"geo.subregion": "user.geo.subregion",
102102
"timestamp.to_day": "timestamp",
103103
"timestamp.to_hour": "timestamp",
104+
"platform.name": "platform",
104105
}
105106

106107
swapped_term = column_swap_map.get(term, term)

tests/sentry/discover/translation/test_mep_to_eap.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@
6262
"apdex(1000):>0.5 OR user_misery(1000):>0.5",
6363
"(apdex(span.duration,1000):>0.5 OR user_misery(span.duration,1000):>0.5) AND is_transaction:1",
6464
),
65+
pytest.param(
66+
"platform.name:python",
67+
"(platform:python) AND is_transaction:1",
68+
),
6569
],
6670
)
6771
def test_mep_to_eap_simple_query(input: str, expected: str):
@@ -123,6 +127,10 @@ def test_mep_to_eap_simple_query(input: str, expected: str):
123127
["any(transaction.duration)", "count_miserable(user,300)", "transaction", "count()"],
124128
["transaction", "count(span.duration)"],
125129
),
130+
pytest.param(
131+
["platform.name", "count()"],
132+
["platform", "count(span.duration)"],
133+
),
126134
],
127135
)
128136
def test_mep_to_eap_simple_selected_columns(input: list[str], expected: list[str]):

0 commit comments

Comments
 (0)