Commit graph

34 commits

Author SHA1 Message Date
Yussif Mohammed
ab10f8d191 update effectful postgres tag 2025-12-24 20:16:33 +00:00
Anthony Alaribe
64b3a8bc88
refactor: migrate from pg-transact to effectful-postgresql to support postgres open telemetry instrumentation (#236)
* refactor: migrate from pg-transact to effectful-postgresql

Replace pg-transact and pg-transact-effectful with effectful-postgresql for database operations. Key changes: replace DB effect with WithConnection, remove dbtToEff wrappers, use direct PG.query/PG.execute calls, update runDB to runWithConnectionPool, keep pg-entity for query building, add IOE constraint alongside WithConnection where needed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

* Auto-format code with fourmolu

* chore: use effectful-postgresql fork with OpenTelemetry support

Switch to tonyalaribe/effectful-postgresql fork (instrument-pg branch) and
enable the +enable-otel flag for OpenTelemetry instrumentation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

* fix: improve connection usage and error handling in BackgroundJobs

- Use PG.execute directly instead of multiple withConnection calls for
  CleanupDemoProject (more efficient connection usage)
- Handle missing project gracefully in ATRuntimeException processing
  instead of crashing with error
- Clean up unused imports (PGS, withConnection)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

* fix: correct effectful-postgresql subdir path

🤖 Generated with [Claude Code](https://claude.com/claude-code)

* fix: add proper error handling and logging for critical operations

- Log advisory lock release failures instead of silently ignoring
- Log when error update doesn't match any span (potential data issue)
- Log when span hash update count mismatches expected (data integrity)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

* Auto-format code with fourmolu

* refactor: simplify single-row query handling in BackgroundJobs

* refactor: return lists from model query functions instead of Vectors

PostgreSQL-simple returns lists naturally, so wrapping results with V.fromList was wasteful. Model query functions now return lists directly, with Vector conversion happening at call sites that actually need Vectors.

* Auto-format code with fourmolu

* perf: fix N+1 query pattern and improve advisory lock handling

- Replace individual UPDATE queries in forM_ loop with batched UPDATE
  using SQL unnest to reduce O(n) DB round-trips to O(1)
- Add 5-minute statement timeout to advisory lock to prevent hangs
- Add timeout reset in finally block for cleanup
- Improve comments explaining session-level lock auto-release behavior

* refactor: replace verbose Only unwrapping with coerce

- Use coerce @[Only T] @[T] instead of map (\(Only x) -> x)
- Use coerce @(Maybe (Only T)) @(Maybe T) instead of fmap (\(Only x) -> x)
- Update GenerateOtelFacetsBatch to use Projects.ProjectId instead of Text

* Auto-format code with fourmolu

* fix: advisory lock release and remove unnecessary vector conversion

- Use query instead of execute for pg_advisory_unlock (SELECT returns result)
- Add validation for unexpected unlock results
- Remove unnecessary V.fromList/V.toList round-trip in runHourlyJob

* refactor: simplify COUNT(*) query result handling

Use inline maybe/listToMaybe instead of case expression for cleaner code.

* Auto-format code with fourmolu

* refactor: use catch instead of try/case for advisory lock cleanup

Cleaner error handling with catch pattern instead of explicit try + case Left/Right.

* Auto-format code with fourmolu

* perf: use V.mapMaybe and V.unzip3 to avoid list conversions

Direct Vector operations for batch error updates instead of
list mapMaybe + V.fromList.

* refactor: introduce DB type alias and switch to pg-transact

* Auto-format code with fourmolu

* fix errors in specs

* fix: remove duplicate import in Dashboards.hs

* fix: resolve integration test failures

- BusinessFlowsSpec: fix column names for apis.subscriptions table

- TestUtils: add test user as admin to nil UUID project

- System/Types: increase static UUID pool to prevent collisions

- AnomaliesSpec: fix test assertions for correct filter views

* fix aroundAll

* fix: resolve integration test failures

- Fix insertProjectMembers to handle empty list (prevents 'no rows supplied' error)

- Fix DashboardsSpec UUID collisions by grouping creations and adding cleanup

- Fix ManageMembersSpec: correct userID to UUID 1, update expected member count and email

- Fix ProjectsSpec: update expected project count to include demo project

* remove PG_EFFECT_MIGRATION.md

* fix: use unique team handles in bulk add teams test to avoid conflicts

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-12-22 22:32:43 +01:00
Anthony Alaribe
d2ed18574a Upgrade to GHC 9.12.2 and update dependencies
- Switch from GHC 9.10.3 to 9.12.2
- Use Stackage nightly-2025-11-17
- Update proto-lens to custom fork
- Add ghc-source-gen dependency
- Comment out opentelemetry dependencies
2025-11-17 21:12:54 +01:00
Anthony Alaribe
0ef74a098f Upgrade GHC to 9.10.3 and update dependencies
- Update GHC from 9.10.2 to 9.10.3
- Update stackage resolver to lts-24.19
- Update grapesy to commit 411b3e173575275cb2c745992dfe6782d2d87115
- Update odd-jobs, langchain-hs, ollama-haskell, and openai dependencies
2025-11-15 20:02:58 +00:00
Anthony Alaribe
a063abe679 upgrade to latest lts version for ghc 9.10.2 2025-09-08 20:47:04 +02:00
Anthony Alaribe
d7d3411899 slowly update deps 2025-09-08 20:47:04 +02:00
Anthony Alaribe
a4706a09f5 fix issue preventing compilation of some yamls in dashboards 2025-09-04 02:28:20 +02:00
Yussif Mohammed
ec6c20a228
Replay sessions (#183)
* replay events and publish/receive from/to pubsub

* pubsub for rrweb events works

* allowing CORS for all origins in OpenTelemetry

* fix: allow messages with project IDs

* session ui

* session replay modal

* towards fixing hls

* revert

* feat: save session files

* remove unused save file variants

* fetch and serve replay events in ui

* use background ctx

* remove amazonka dependency

* update yamr loc

* format
2025-07-31 09:46:49 +00:00
dawkaka
b270c841ac fix open ai error 2025-07-17 21:23:30 +00:00
Anthony Alaribe
55bd8b07bd checkpoint towards functioning and passing doctests 2025-07-02 01:41:14 +02:00
Anthony Alaribe
b116f98152 nitpicks 2025-07-01 11:33:52 +02:00
Anthony Alaribe
7226b55b48 remove the prod flag from CI 2025-05-25 10:11:38 -07:00
Anthony Alaribe
71a3048a66 flag for pg-enitty 2025-05-25 10:11:38 -07:00
Anthony Alaribe
edc52d11bf upgrade pg-entity 2025-05-25 00:23:59 -07:00
Mahmud Bello
0aad242242
fix : ffi linker issue for linux resolved in ghc 9.10.22 (#166)
* fix : ffi linker issue for linux resolved in ghc 9.10.22

* fix : stack resolver updated for workflow

* Revert "fix : ffi linker issue for linux resolved in ghc 9.10.22"

This reverts commit c2ef849d93.

* fix : stack resolver updated for workflow

* fix : corrected mistakes in versioning

* add libkafka to workflow

* fix: correct workflow error

* fix: correct workflow error

* add hs otel to tests

---------

Co-authored-by: = <=>
Co-authored-by: Anthony Alaribe <anthonyalaribe@gmail.com>
2025-05-15 04:32:14 +02:00
dawkaka
10817ade4c Revert "ghc 9.10.2 checkpoint"
This reverts commit 33d09c38d3.
2025-05-12 12:42:09 +00:00
Anthony Alaribe
33d09c38d3 ghc 9.10.2 checkpoint 2025-05-06 15:28:50 -07:00
Anthony Alaribe
be5d33ea64 improve calculation of facets so its hourly as expected 2025-04-25 01:04:21 +02:00
Anthony Alaribe
b2fd256c26 ghcid works with 9.10 atm 2025-04-22 00:27:23 +02:00
Anthony Alaribe
b7e3249f43 gogol updated and now broken. brought back facets filter 2025-04-21 23:34:28 +02:00
Anthony Alaribe
b7dddf8082 self host inter and jetbrains mono to prevent cdn issues 2025-04-21 01:15:56 +02:00
Anthony Alaribe
9cf74e123b streamly deps 2025-04-15 00:44:03 +02:00
Anthony Alaribe
9dbbe8d995 prepare for deployment 2025-04-14 21:05:16 +02:00
Anthony Alaribe
59c60a6a44 revert to 9.8.4 2025-02-12 12:00:47 +01:00
Anthony Alaribe
212039a144 custom dashboards checkpoint 2025-01-28 16:16:20 +01:00
Anthony Alaribe
ef7c9efd89 preliminary implementation of history and saved queries 2024-11-25 06:11:15 +01:00
Anthony Alaribe
f26cc45d4f checkpoint 2024-11-22 19:24:47 +01:00
Anthony Alaribe
904bba2837 Revert to c7e1f1a0d5 2024-11-21 18:03:59 +01:00
Anthony Alaribe
af992d5513 another test 2024-11-21 17:35:38 +01:00
Anthony Alaribe
ac0c03b794 disable hiedb to allow compling 2024-11-21 12:17:49 +01:00
Anthony Alaribe
9d397217d9 revert to old stack version 2024-11-21 03:25:08 +01:00
Anthony Alaribe
a6c4cb891c 9.8.3 2024-11-18 22:49:24 +01:00
Anthony Alaribe
240eca5e63 api monitoring changes 2024-09-17 20:01:58 +02:00
Anthony Alaribe
54434ba3a8 application compiles with cabal at this point 2024-07-17 02:04:33 +02:00