chore: remove ingestion experiment (#21583)

This commit is contained in:
David Newell
2024-04-17 15:12:59 +01:00
committed by GitHub
parent dc514fb213
commit 33d13aff4d
9 changed files with 4 additions and 44 deletions

3
.vscode/launch.json vendored
View File

@@ -72,8 +72,7 @@
"DATABASE_URL": "postgres://posthog:posthog@localhost:5432/posthog",
"SKIP_SERVICE_VERSION_REQUIREMENTS": "1",
"PRINT_SQL": "1",
"BILLING_SERVICE_URL": "https://billing.dev.posthog.dev",
"RECORDINGS_INGESTER_URL": "http://localhost:6738"
"BILLING_SERVICE_URL": "https://billing.dev.posthog.dev"
},
"console": "integratedTerminal",
"python": "${workspaceFolder}/env/bin/python",

View File

@@ -7,7 +7,6 @@ trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
export DEBUG=${DEBUG:-1}
export SKIP_SERVICE_VERSION_REQUIREMENTS=1
export BILLING_SERVICE_URL=${BILLING_SERVICE_URL:-https://billing.dev.posthog.dev}
export RECORDINGS_INGESTER_URL=${RECORDINGS_INGESTER_URL:-http://localhost:6738}
service_warning() {
echo -e "\033[0;31m$1 isn't ready. You can run the stack with:\ndocker compose -f docker-compose.dev.yml up\nIf you have already ran that, just make sure that services are starting properly, and sit back.\nWaiting for $1 to start...\033[0m"

View File

@@ -76,7 +76,6 @@ services:
SENTRY_DSN: $SENTRY_DSN
SITE_URL: https://$DOMAIN
SECRET_KEY: $POSTHOG_SECRET
RECORDINGS_INGESTER_URL: http://plugins:6738
depends_on:
- db
- redis

View File

@@ -200,7 +200,6 @@ export const FEATURE_FLAGS = {
SAVED_NOT_PINNED: 'saved-not-pinned', // owner: #team-replay
BILLING_UPGRADE_LANGUAGE: 'billing-upgrade-language', // owner: @biancayang
NEW_EXPERIMENTS_UI: 'new-experiments-ui', // owner: @jurajmajerik #team-feature-success
SESSION_REPLAY_V3_INGESTION_PLAYBACK: 'session-replay-v3-ingestion-playback', // owner: @benjackwhite
SESSION_REPLAY_FILTER_ORDERING: 'session-replay-filter-ordering', // owner: #team-replay
SESSION_REPLAY_LINKED_VARIANTS: 'session-replay-linked-variants', // owner: #team-replay
REPLAY_ERROR_CLUSTERING: 'session-replay-error-clustering', // owner: #team-replay

View File

@@ -337,11 +337,7 @@ export const sessionRecordingDataLogic = kea<sessionRecordingDataLogicType>([
null as SessionRecordingSnapshotSource[] | null,
{
loadSnapshotSources: async () => {
const params = {
version: values.featureFlags[FEATURE_FLAGS.SESSION_REPLAY_V3_INGESTION_PLAYBACK] ? '3' : '2',
}
const response = await api.recordings.listSnapshots(props.sessionRecordingId, params)
const response = await api.recordings.listSnapshots(props.sessionRecordingId)
return response.sources ?? []
},
},
@@ -353,7 +349,6 @@ export const sessionRecordingDataLogic = kea<sessionRecordingDataLogicType>([
const params = {
source: source.source,
blob_key: source.blob_key,
version: values.featureFlags[FEATURE_FLAGS.SESSION_REPLAY_V3_INGESTION_PLAYBACK] ? '3' : '2',
}
const snapshotLoadingStartTime = performance.now()
@@ -368,7 +363,7 @@ export const sessionRecordingDataLogic = kea<sessionRecordingDataLogicType>([
throw new Error('Missing key')
}
const blobResponseType = source.source === SnapshotSourceType.blob || params.version === '3'
const blobResponseType = source.source === SnapshotSourceType.blob
const response = blobResponseType
? await api.recordings.getBlobSnapshots(props.sessionRecordingId, params).catch((e) => {

View File

@@ -8,7 +8,6 @@ INACTIVE_FLAGS = [
"cloud-announcement",
"session-reset-on-load",
"posthog-3000-nav",
"session-replay-v3-ingestion-playback",
]

View File

@@ -321,8 +321,6 @@ class SessionRecordingViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
might_have_realtime = True
newest_timestamp = None
use_v3_storage = request.GET.get("version", None) == "3"
event_properties = {
"team_id": self.team.pk,
"request_source": source,
@@ -362,13 +360,6 @@ class SessionRecordingViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
might_have_realtime = False
else:
blob_prefix = recording.build_blob_ingestion_storage_path()
if use_v3_storage and settings.OBJECT_STORAGE_SESSION_RECORDING_BLOB_INGESTION_V3_FOLDER:
blob_prefix = blob_prefix.replace(
settings.OBJECT_STORAGE_SESSION_RECORDING_BLOB_INGESTION_FOLDER,
settings.OBJECT_STORAGE_SESSION_RECORDING_BLOB_INGESTION_V3_FOLDER,
)
blob_keys = object_storage.list_objects(blob_prefix)
if blob_keys:
@@ -414,19 +405,7 @@ class SessionRecordingViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
response_data["sources"] = sources
elif source == "realtime":
if request.GET.get("version", None) == "3" and settings.RECORDINGS_INGESTER_URL:
with requests.get(
url=f"{settings.RECORDINGS_INGESTER_URL}/api/projects/{self.team.pk}/session_recordings/{str(recording.session_id)}/snapshots",
stream=True,
) as r:
if r.status_code == 404:
return Response({"snapshots": []})
response = HttpResponse(content=r.raw, content_type="application/json")
response["Content-Disposition"] = "inline"
return response
else:
snapshots = get_realtime_snapshots(team_id=self.team.pk, session_id=str(recording.session_id)) or []
snapshots = get_realtime_snapshots(team_id=self.team.pk, session_id=str(recording.session_id)) or []
event_properties["source"] = "realtime"
event_properties["snapshots_length"] = len(snapshots)
@@ -451,9 +430,6 @@ class SessionRecordingViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
file_key = convert_original_version_lts_recording(recording)
else:
blob_prefix = settings.OBJECT_STORAGE_SESSION_RECORDING_BLOB_INGESTION_FOLDER
if use_v3_storage and settings.OBJECT_STORAGE_SESSION_RECORDING_BLOB_INGESTION_V3_FOLDER:
blob_prefix = settings.OBJECT_STORAGE_SESSION_RECORDING_BLOB_INGESTION_V3_FOLDER
file_key = f"{blob_prefix}/team_id/{self.team.pk}/session_id/{recording.session_id}/data/{blob_key}"
url = object_storage.get_presigned_url(file_key, expiration=60)
if not url:

View File

@@ -28,8 +28,5 @@ OBJECT_STORAGE_SESSION_RECORDING_BLOB_INGESTION_FOLDER = os.getenv(
OBJECT_STORAGE_SESSION_RECORDING_LTS_FOLDER = os.getenv(
"OBJECT_STORAGE_SESSION_RECORDING_LTS_FOLDER", "session_recordings_lts"
)
OBJECT_STORAGE_SESSION_RECORDING_BLOB_INGESTION_V3_FOLDER = os.getenv(
"OBJECT_STORAGE_SESSION_RECORDING_BLOB_INGESTION_V3_FOLDER", ""
)
OBJECT_STORAGE_EXPORTS_FOLDER = os.getenv("OBJECT_STORAGE_EXPORTS_FOLDER", "exports")
OBJECT_STORAGE_MEDIA_UPLOADS_FOLDER = os.getenv("OBJECT_STORAGE_MEDIA_UPLOADS_FOLDER", "media_uploads")

View File

@@ -18,9 +18,6 @@ REALTIME_SNAPSHOTS_FROM_REDIS_ATTEMPT_TIMEOUT_SECONDS = get_from_env(
"REALTIME_SNAPSHOTS_FROM_REDIS_ATTEMPT_TIMEOUT_SECONDS", 0.2, type_cast=float
)
RECORDINGS_INGESTER_URL = get_from_env("RECORDINGS_INGESTER_URL", "")
REPLAY_EMBEDDINGS_ALLOWED_TEAMS: List[str] = get_list(get_from_env("REPLAY_EMBEDDINGS_ALLOWED_TEAM", "", type_cast=str))
REPLAY_EMBEDDINGS_BATCH_SIZE = get_from_env("REPLAY_EMBEDDINGS_BATCH_SIZE", 10, type_cast=int)
REPLAY_EMBEDDINGS_MIN_DURATION_SECONDS = get_from_env("REPLAY_EMBEDDINGS_MIN_DURATION_SECONDS", 30, type_cast=int)