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

feat(metrics): Forward received_at field to Kafka #3561

Merged
merged 24 commits into from
May 22, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update tests
  • Loading branch information
iambriccardo committed May 7, 2024
commit 298c9fa0f396d920b76be141d41c767253a27347
11 changes: 11 additions & 0 deletions tests/integration/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ def test_metrics_with_processing(mini_sentry, relay_with_processing, metrics_con
"value": 42.0,
"type": "c",
"timestamp": timestamp,
"received_at": timestamp,
}

assert metrics["headers"]["c:custom/bar@second"] == [("namespace", b"custom")]
Expand All @@ -521,6 +522,7 @@ def test_metrics_with_processing(mini_sentry, relay_with_processing, metrics_con
"value": 17.0,
"type": "c",
"timestamp": timestamp,
"received_at": timestamp,
}


Expand Down Expand Up @@ -560,6 +562,7 @@ def test_global_metrics_with_processing(
"value": 42.0,
"type": "c",
"timestamp": timestamp,
"received_at": timestamp,
}

assert metrics["headers"]["c:custom/bar@second"] == [("namespace", b"custom")]
Expand All @@ -572,6 +575,7 @@ def test_global_metrics_with_processing(
"value": 17.0,
"type": "c",
"timestamp": timestamp,
"received_at": timestamp,
}


Expand Down Expand Up @@ -603,6 +607,7 @@ def test_metrics_full(mini_sentry, relay, relay_with_processing, metrics_consume

metric, _ = metrics_consumer.get_metric(timeout=6)
metric.pop("timestamp")
metric.pop("received_at")
assert metric == {
"org_id": 1,
"project_id": project_id,
Expand Down Expand Up @@ -703,6 +708,7 @@ def test_session_metrics_processing(
"release": "sentry-test@1.0.0",
"session.status": "init",
},
"received_at": int(timestamp.timestamp()),
}

assert metrics["s:sessions/user@none"] == {
Expand All @@ -718,6 +724,7 @@ def test_session_metrics_processing(
"environment": "production",
"release": "sentry-test@1.0.0",
},
"received_at": int(timestamp.timestamp()),
}


Expand Down Expand Up @@ -852,6 +859,7 @@ def test_transaction_metrics(
"platform": "other",
"transaction.status": "unknown",
},
"received_at": int(timestamp.timestamp()),
}

assert metrics["c:spans/usage@none"]["value"] == 2
Expand Down Expand Up @@ -899,6 +907,7 @@ def test_transaction_metrics(
"name": "c:transactions/count_per_root_project@none",
"type": "c",
"value": 2.0,
"received_at": int(timestamp.timestamp()),
}


Expand Down Expand Up @@ -964,6 +973,7 @@ def test_transaction_metrics_count_per_root_project(
"name": "c:transactions/count_per_root_project@none",
"type": "c",
"value": 1.0,
"received_at": int(timestamp.timestamp()),
}
assert metrics_by_project[42]["c:transactions/count_per_root_project@none"] == {
"timestamp": int(timestamp.timestamp()),
Expand All @@ -974,6 +984,7 @@ def test_transaction_metrics_count_per_root_project(
"name": "c:transactions/count_per_root_project@none",
"type": "c",
"value": 2.0,
"received_at": int(timestamp.timestamp()),
}


Expand Down