Skip to content
Draft
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
8 changes: 4 additions & 4 deletions bases/renku_data_services/data_tasks/task_defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async def send_metrics_to_posthog(dm: DependencyManager) -> None:
from posthog import Posthog

posthog = Posthog(
api_key=dm.config.posthog.api_key,
project_api_key=dm.config.posthog.api_key,
host=dm.config.posthog.host,
sync_mode=True,
super_properties={"environment": dm.config.posthog.environment},
Expand All @@ -59,14 +59,14 @@ async def send_metrics_to_posthog(dm: DependencyManager) -> None:
async for metric in metrics:
try:
if metric.event == MetricsEvent.identify_user.value:
posthog.identify(
posthog.set(
distinct_id=metric.anonymous_user_id,
timestamp=metric.timestamp,
properties=metric.metadata_ or {},
# This is sent to avoid duplicate events if multiple instances of data service are running.
# Posthog deduplicates events with the same timestamp, distinct_id, event, and uuid fields:
# https://github.com/PostHog/posthog/issues/17211#issuecomment-1723136534
uuid=metric.id.to_uuid4(),
uuid=str(metric.id.to_uuid4()),
)
else:
posthog.capture(
Expand All @@ -77,7 +77,7 @@ async def send_metrics_to_posthog(dm: DependencyManager) -> None:
# This is sent to avoid duplicate events if multiple instances of data service are running.
# Posthog deduplicates events with the same timestamp, distinct_id, event, and uuid fields:
# https://github.com/PostHog/posthog/issues/17211#issuecomment-1723136534
uuid=metric.id.to_uuid4(),
uuid=str(metric.id.to_uuid4()),
)
except Exception as e:
logger.error(f"Failed to process metrics event {metric.id}: {e}")
Expand Down
37 changes: 12 additions & 25 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 9 additions & 22 deletions projects/renku_data_service/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion projects/renku_data_service/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ werkzeug = "^3.1.3"
toml = "^0.10.2"
parsy = "^2.1"
sanic-ext = "^24.12.0"
posthog = "^3.21.0"
posthog = "^7.0.1"
markdown-code-runner = "^2.2.0"

[tool.poetry.group.dev.dependencies]
Expand Down
31 changes: 9 additions & 22 deletions projects/renku_data_tasks/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion projects/renku_data_tasks/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ werkzeug = "^3.1.3"
toml = "^0.10.2"
parsy = "^2.1"
sanic-ext = "^23.12.0"
posthog = "^3.21.0"
posthog = "^7.0.1"
markdown-code-runner = "^2.2.0"

[tool.poetry.group.dev.dependencies]
Expand Down
31 changes: 9 additions & 22 deletions projects/secrets_storage/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion projects/secrets_storage/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ toml = "^0.10.2"
werkzeug = "^3.1.3"
parsy = "^2.1"
sanic-ext = "^24.12.0"
posthog = "^3.21.0"
posthog = "^7.0.1"
markdown-code-runner = "^2.2.0"

[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protobuf = "^5.29.3"
poetry = "^2.1.1"
parsy = "^2.1"
sanic-ext = "^24.12.0"
posthog = "^3.21.0"
posthog = "^7.0.1"
markdown-code-runner = "^2.2.0"

[tool.poetry.group.dev.dependencies]
Expand Down