Skip to content

feat: time-series download analytics backed by TimescaleDB - #2027

Closed
gnugomez wants to merge 21 commits into
eclipse-openvsx:mainfrom
gnugomez:feat/download-analytics-timescale
Closed

gnugomez wants to merge 21 commits into
eclipse-openvsx:mainfrom
gnugomez:feat/download-analytics-timescale

Conversation

@gnugomez

@gnugomez gnugomez commented Jul 31, 2026 •

Copy link
Copy Markdown
Member

Related to #2025

Adds opt-in download analytics to the registry: per-extension download counts over time, ingested from CDN access logs into a TimescaleDB hypertable, exposed through a public API and surfaced as a weekly-downloads card on the extension detail page.

Disabled by default (ovsx.analytics.enabled, default false).

Screen.Recording.2026-08-24.at.11.08.49.mov

@gnugomez
gnugomez force-pushed the feat/download-analytics-timescale branch 2 times, most recently from fcae59e to d66b01f Compare August 24, 2026 09:06
@gnugomez
gnugomez marked this pull request as ready for review August 24, 2026 09:11
@gnugomez
gnugomez force-pushed the feat/download-analytics-timescale branch from d66b01f to 35e5126 Compare August 26, 2026 09:12
@gnugomez
gnugomez requested a balanced review from Copilot August 31, 2026 08:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds opt-in TimescaleDB-backed download analytics, CDN log ingestion, a public time-series API, and weekly download statistics in the web UI.

Changes:

  • Introduces analytics storage, ingestion, API, metrics, and tests.
  • Adds the weekly-downloads extension card and frontend service types.
  • Expands frontend extension points and shared UI infrastructure.

Reviewed changes

Copilot reviewed 111 out of 114 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
webui/vite.config.mts Inlines MUI test dependencies
webui/test/unit/support/test-providers.tsx Extends provider test helpers
webui/test/unit/support/menu-queries.ts Adds menu query helper
webui/test/unit/pages/user/avatar.spec.tsx Tests desktop menu contributions
webui/test/unit/pages/admin-dashboard/admin-dashboard.spec.tsx Tests contributed admin pages
webui/test/unit/main.spec.tsx Tests user-loading context
webui/test/unit/default/menu-content.spec.tsx Tests mobile menu contributions
webui/test/unit/components/weekly-downloads.spec.tsx Tests weekly downloads card
webui/src/pages/user/avatar.tsx Supports contributed menu entries
webui/src/pages/search/search-header.tsx Reuses compact control styling
webui/src/pages/extension-detail/weekly-downloads.tsx Implements analytics card
webui/src/pages/extension-detail/use-extension-download-series.ts Fetches annual download series
webui/src/pages/extension-detail/extension-detail.tsx Updates chrome context reference
webui/src/pages/extension-detail/extension-detail-overview.tsx Mounts weekly downloads
webui/src/pages/admin-dashboard/nav-types.ts Defines contributed admin pages
webui/src/pages/admin-dashboard/admin-dashboard.tsx Integrates contributed pages
webui/src/page-settings.ts Adds consumer extension points
webui/src/main.tsx Exposes user-loading state
webui/src/layout/scroll-restoration.tsx Renames scroll helper
webui/src/layout/app-navbar.tsx Supports extended navbar blur
webui/src/layout/app-layout.tsx Uses navbar chrome provider
webui/src/index.ts Expands public frontend exports
webui/src/extension-registry-types.ts Adds analytics response types
webui/src/extension-registry-service.ts Adds analytics API client
webui/src/default/theme.tsx Updates popup styling
webui/src/default/menu-content.tsx Supports mobile menu contributions
webui/src/context/navbar-chrome-context.tsx Consolidates navbar chrome state
webui/src/context/extension-tint-context.tsx Removes superseded context
webui/src/context.ts Adds userLoading
webui/src/components/pill.tsx Adds reusable pill primitive
webui/src/components/page-primitives.tsx Adds shared style primitives
webui/src/components/extension-searchfield.tsx Reuses slash primitive
webui/src/components/category-pill.tsx Reuses generic pill
webui/src/app-providers.tsx Updates provider documentation
webui/CHANGELOG.md Documents frontend changes
server/src/test/resources/org/eclipse/openvsx/storage/log/fastly.log Removes obsolete fixture
server/src/test/resources/org/eclipse/openvsx/analytics/ingestion/aws/fastly.log Adds Fastly ingestion fixture
server/src/test/resources/org/eclipse/openvsx/analytics/ingestion/aws/cloudfront.log Extends CloudFront fixture
server/src/test/resources/application.yml Limits test connection pools
server/src/test/java/org/eclipse/openvsx/storage/StorageUtilServiceUploadFileTest.java Updates ingestion dependencies
server/src/test/java/org/eclipse/openvsx/storage/StorageUtilServiceTest.java Tests ingestion-aware counting
server/src/test/java/org/eclipse/openvsx/storage/log/FastlyLogFileParserTest.java Removes obsolete parser tests
server/src/test/java/org/eclipse/openvsx/storage/log/CloudFrontLogFileParserTest.java Removes obsolete parser tests
server/src/test/java/org/eclipse/openvsx/repositories/RepositoryServiceSmokeTest.java Covers renamed queries
server/src/test/java/org/eclipse/openvsx/RegistryAPITest.java Updates test wiring
server/src/test/java/org/eclipse/openvsx/eclipse/EclipseServiceTest.java Updates test wiring
server/src/test/java/org/eclipse/openvsx/analytics/ingestion/RawDownloadRecordTest.java Tests raw records
server/src/test/java/org/eclipse/openvsx/analytics/ingestion/jobs/IngestionJobsTest.java Tests job scheduling
server/src/test/java/org/eclipse/openvsx/analytics/ingestion/DownloadIngestionMetricsTest.java Tests ingestion metrics
server/src/test/java/org/eclipse/openvsx/analytics/ingestion/CountryCodesTest.java Tests country normalization
server/src/test/java/org/eclipse/openvsx/analytics/ingestion/aws/FastlyLogFileParserTest.java Tests Fastly parsing
server/src/test/java/org/eclipse/openvsx/analytics/ingestion/aws/CloudFrontLogFileParserTest.java Tests CloudFront parsing
server/src/test/java/org/eclipse/openvsx/analytics/ingestion/aws/AccessLogRecordTest.java Tests download extraction
server/src/test/java/org/eclipse/openvsx/analytics/DownloadEventTest.java Tests event validation
server/src/test/java/org/eclipse/openvsx/analytics/DownloadAnalyticsServiceTest.java Tests series aggregation
server/src/test/java/org/eclipse/openvsx/analytics/DownloadAnalyticsEndpointTest.java Tests end-to-end analytics
server/src/test/java/org/eclipse/openvsx/analytics/DownloadAnalyticsDisabledTest.java Tests disabled configuration
server/src/test/java/org/eclipse/openvsx/analytics/DownloadAnalyticsAPITest.java Tests public endpoint
server/src/test/java/org/eclipse/openvsx/admin/AdminAPITest.java Updates test wiring
server/src/test/java/org/eclipse/openvsx/adapter/VSCodeAPITest.java Updates test wiring
server/src/test/java/org/eclipse/openvsx/AbstractTimeseriesContainerTest.java Adds Timescale test base
server/src/test/java/org/eclipse/openvsx/AbstractPostgresContainerTest.java Makes image configurable
server/src/main/resources/db/migration-timeseries/V1__Download_Analytics.sql.conf Configures Flyway transaction mode
server/src/main/resources/db/migration-timeseries/V1__Download_Analytics.sql Creates analytics schema
server/src/main/java/org/eclipse/openvsx/storage/StorageUtilService.java Captures request-path events
server/src/main/java/org/eclipse/openvsx/storage/log/FastlyLogFileParser.java Removes legacy parser
server/src/main/java/org/eclipse/openvsx/storage/log/DownloadCountService.java Removes legacy scheduler
server/src/main/java/org/eclipse/openvsx/storage/log/DownloadCountProcessor.java Removes legacy processor
server/src/main/java/org/eclipse/openvsx/storage/log/CloudFrontLogFileParser.java Removes legacy parser
server/src/main/java/org/eclipse/openvsx/repositories/RepositoryService.java Renames ingestion queries
server/src/main/java/org/eclipse/openvsx/repositories/DownloadIngestionRepository.java Provides ingestion-state queries
server/src/main/java/org/eclipse/openvsx/mirror/aop/DownloadCountServiceAspect.java Removes obsolete mirror aspect
server/src/main/java/org/eclipse/openvsx/LocalRegistryService.java Reports analytics availability
server/src/main/java/org/eclipse/openvsx/json/RegistryVersionJson.java Adds analytics feature flag
server/src/main/java/org/eclipse/openvsx/entities/DownloadIngestion.java Renames ingestion entity
server/src/main/java/org/eclipse/openvsx/analytics/timescale/TimeseriesDatabaseConfiguration.java Configures TimescaleDB
server/src/main/java/org/eclipse/openvsx/analytics/timescale/TimescaleDownloadAnalyticsRepository.java Implements Timescale repository
server/src/main/java/org/eclipse/openvsx/analytics/ingestion/RawDownloadRecord.java Defines raw record
server/src/main/java/org/eclipse/openvsx/analytics/ingestion/jobs/LogIngestionJob.java Schedules ingestion jobs
server/src/main/java/org/eclipse/openvsx/analytics/ingestion/jobs/IngestionJobRequest.java Defines job request
server/src/main/java/org/eclipse/openvsx/analytics/ingestion/DownloadRecordSource.java Defines source contract
server/src/main/java/org/eclipse/openvsx/analytics/ingestion/DownloadIngestionRunner.java Orchestrates ingestion
server/src/main/java/org/eclipse/openvsx/analytics/ingestion/DownloadIngestionMetrics.java Adds operational metrics
server/src/main/java/org/eclipse/openvsx/analytics/ingestion/CountryCodes.java Normalizes countries
server/src/main/java/org/eclipse/openvsx/analytics/ingestion/aws/LogFileParser.java Defines parser contract
server/src/main/java/org/eclipse/openvsx/analytics/ingestion/aws/FastlyLogFileParser.java Parses Fastly logs
server/src/main/java/org/eclipse/openvsx/analytics/ingestion/aws/CloudFrontLogFileParser.java Parses CloudFront logs
server/src/main/java/org/eclipse/openvsx/analytics/ingestion/aws/AwsDownloadRecordSource.java Reads S3 access logs
server/src/main/java/org/eclipse/openvsx/analytics/ingestion/aws/AccessLogRecord.java Converts access records
server/src/main/java/org/eclipse/openvsx/analytics/DownloadSeriesRow.java Defines repository row
server/src/main/java/org/eclipse/openvsx/analytics/DownloadSeriesRequest.java Defines series query
server/src/main/java/org/eclipse/openvsx/analytics/DownloadSeriesPoint.java Defines series point
server/src/main/java/org/eclipse/openvsx/analytics/DownloadSeriesJson.java Defines API payload
server/src/main/java/org/eclipse/openvsx/analytics/DownloadSeriesInterval.java Defines bucket intervals
server/src/main/java/org/eclipse/openvsx/analytics/DownloadSeriesGroupBy.java Defines grouping dimensions
server/src/main/java/org/eclipse/openvsx/analytics/DownloadEvent.java Defines analytics event
server/src/main/java/org/eclipse/openvsx/analytics/DownloadAnalyticsService.java Builds and caches series
server/src/main/java/org/eclipse/openvsx/analytics/DownloadAnalyticsRepository.java Defines storage interface
server/src/main/java/org/eclipse/openvsx/analytics/DownloadAnalyticsConfiguration.java Wires analytics services
server/src/main/java/org/eclipse/openvsx/analytics/DownloadAnalyticsAPI.java Exposes public endpoint
server/src/dev/resources/application.yml Enables development analytics
server/scripts/generate-properties.sh Generates Timescale properties
server/build.gradle Supports test image overrides
docker-compose.yml Adds TimescaleDB service
doc/development.md Documents development databases
deploy/openshift/application.yml Documents OpenShift settings
deploy/kubernetes/configmap.yaml Documents Kubernetes settings
deploy/docker/configuration/application.yml Documents Docker settings

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@netomi

netomi commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

This PR changes too many things at the same time. It is not clear to me what happens when ovsx.analytics.enabled is set to false. Does then the original download log processing still work?

Need to split this PR into smaller pieces to make the change manageable without introducing a regression for the existing functionality or when ovsx.analytics.enabled is set to false. Will create separate PRs based on that one.

netomi added a commit that referenced this pull request Sep 3, 2026
Adds the second datasource the download analytics need, and nothing that reads
or writes it. Gated on ovsx.analytics.enabled, which no deployment sets, so by
default not a single bean of it is created.

TimeseriesDatabaseConfiguration builds a Hikari pool, a Flyway chain and a jOOQ
DSLContext against a separate PostgreSQL database carrying the timescaledb
extension. All three are defaultCandidate = false, so Boot still auto-configures
the primary datasource, the registry's Flyway chain and the primary DSLContext,
and only an explicit @qualifier reaches the time-series ones.

The migration set lives in db/migration-timeseries, a sibling of db/migration
rather than a child: Flyway scans locations recursively, so a child would be
pulled into the registry's own chain and make the registry require the
timescaledb extension. It creates the download_event hypertable and the
download_stats_daily continuous aggregate, with the executeInTransaction=false
sidecar those statements need.

Its connection timeout defaults to 2 seconds rather than Hikari's 30, because a
download will record its event on the request path: an unreachable time-series
database has to fail fast enough for the caller to swallow it.

docker-compose gains a postgres-timeseries service on 5433, the dev config points
at it and enables analytics, and the deployment configs carry the settings
commented out. Test containers can be overridden with -Dovsx.test.postgres.image
and -Dovsx.test.timeseries.image.

TimeseriesDatabaseTest is not from #2027. Without it AbstractTimeseriesContainerTest
would be an abstract base with no subclass, and nothing would exercise the
migration until the analytics land. It asserts the hypertable and the aggregate
exist, and that the registry database does not gain them.

Co-Authored-By: gnugomez <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
netomi added a commit that referenced this pull request Sep 13, 2026
Reworks the log-based download ingestion that PR #2027 needs, with no analytics
behaviour attached, so that the restructuring of live download counting can be
reviewed on its own.

A log handler per storage backend becomes a DownloadRecordSource that yields
RawDownloadRecords, and DownloadCountProcessor becomes DownloadIngestionProcessor,
which resolves records to extensions (with a Caffeine cache), aggregates them and
applies the download counts. Scheduling moves out of the handlers into
DownloadIngestionRunner and the jobs package. AwsDownloadCountHandler splits into
AwsDownloadRecordSource plus the CloudFront and Fastly parsers, and LogRecord
becomes AccessLogRecord.

StorageUtilService no longer asks a DownloadCountService whether a resource is
covered; it asks the sources themselves. DownloadCountServiceAspect goes with the
service it wrapped.

DownloadCountProcessedItem is renamed to DownloadIngestion, keeping its table
name, so there is no migration. Its repository gains countFailedDownloadIngestions.

The analytics seam is present but inert: DownloadAnalyticsRepository is an
interface with no implementation in this change, so the ObjectProvider the
processor holds is never satisfied and only the download counts are written. The
implementation, and the findSeries half of that interface, come with the analytics
work.

The test datasource pool is capped at 4. The new processor test adds another
cached Spring context, and each one holds an idle pool of 10 against the single
shared container, which exhausts its max_connections mid-suite - it surfaced as
unrelated failures in RepositoryServiceSmokeTest and the recovery-lock test.

Co-Authored-By: gnugomez <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
netomi added a commit that referenced this pull request Sep 13, 2026
Reworks the log-based download ingestion that PR #2027 needs, with no analytics
behaviour attached, so that the restructuring of live download counting can be
reviewed on its own.

A log handler per storage backend becomes a DownloadRecordSource that yields
RawDownloadRecords, and DownloadCountProcessor becomes DownloadIngestionProcessor,
which resolves records to extensions (with a Caffeine cache), aggregates them and
applies the download counts. Scheduling moves out of the handlers into
DownloadIngestionRunner and the jobs package. AwsDownloadCountHandler splits into
AwsDownloadRecordSource plus the CloudFront and Fastly parsers, and LogRecord
becomes AccessLogRecord.

StorageUtilService no longer asks a DownloadCountService whether a resource is
covered; it asks the sources themselves. DownloadCountServiceAspect goes with the
service it wrapped.

DownloadCountProcessedItem is renamed to DownloadIngestion, keeping its table
name, so there is no migration. Its repository gains countFailedDownloadIngestions.

The analytics seam is present but inert: DownloadAnalyticsRepository is an
interface with no implementation in this change, so the ObjectProvider the
processor holds is never satisfied and only the download counts are written. The
implementation, and the findSeries half of that interface, come with the analytics
work.

The test datasource pool is capped at 4. The new processor test adds another
cached Spring context, and each one holds an idle pool of 10 against the single
shared container, which exhausts its max_connections mid-suite - it surfaced as
unrelated failures in RepositoryServiceSmokeTest and the recovery-lock test.

Co-Authored-By: gnugomez <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
netomi added a commit that referenced this pull request Sep 13, 2026
Reworks the log-based download ingestion that PR #2027 needs, with no analytics
behaviour attached, so that the restructuring of live download counting can be
reviewed on its own.

A log handler per storage backend becomes a DownloadRecordSource that yields
RawDownloadRecords, and DownloadCountProcessor becomes DownloadIngestionProcessor,
which resolves records to extensions (with a Caffeine cache), aggregates them and
applies the download counts. Scheduling moves out of the handlers into
DownloadIngestionRunner and the jobs package. AwsDownloadCountHandler splits into
AwsDownloadRecordSource plus the CloudFront and Fastly parsers, and LogRecord
becomes AccessLogRecord.

StorageUtilService no longer asks a DownloadCountService whether a resource is
covered; it asks the sources themselves. DownloadCountServiceAspect goes with the
service it wrapped.

DownloadCountProcessedItem is renamed to DownloadIngestion, keeping its table
name, so there is no migration. Its repository gains countFailedDownloadIngestions.

The analytics seam is present but inert: DownloadAnalyticsRepository is an
interface with no implementation in this change, so the ObjectProvider the
processor holds is never satisfied and only the download counts are written. The
implementation, and the findSeries half of that interface, come with the analytics
work.

The test datasource pool is capped at 4. The new processor test adds another
cached Spring context, and each one holds an idle pool of 10 against the single
shared container, which exhausts its max_connections mid-suite - it surfaced as
unrelated failures in RepositoryServiceSmokeTest and the recovery-lock test.

Co-Authored-By: gnugomez <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
netomi added a commit that referenced this pull request Sep 13, 2026
* refactor: rework the download ingestion pipeline

Reworks the log-based download ingestion that PR #2027 needs, with no analytics
behaviour attached, so that the restructuring of live download counting can be
reviewed on its own.

A log handler per storage backend becomes a DownloadRecordSource that yields
RawDownloadRecords, and DownloadCountProcessor becomes DownloadIngestionProcessor,
which resolves records to extensions (with a Caffeine cache), aggregates them and
applies the download counts. Scheduling moves out of the handlers into
DownloadIngestionRunner and the jobs package. AwsDownloadCountHandler splits into
AwsDownloadRecordSource plus the CloudFront and Fastly parsers, and LogRecord
becomes AccessLogRecord.

StorageUtilService no longer asks a DownloadCountService whether a resource is
covered; it asks the sources themselves. DownloadCountServiceAspect goes with the
service it wrapped.

DownloadCountProcessedItem is renamed to DownloadIngestion, keeping its table
name, so there is no migration. Its repository gains countFailedDownloadIngestions.

The analytics seam is present but inert: DownloadAnalyticsRepository is an
interface with no implementation in this change, so the ObjectProvider the
processor holds is never satisfied and only the download counts are written. The
implementation, and the findSeries half of that interface, come with the analytics
work.

The test datasource pool is capped at 4. The new processor test adds another
cached Spring context, and each one holds an idle pool of 10 against the single
shared container, which exhausts its max_connections mid-suite - it surfaced as
unrelated failures in RepositoryServiceSmokeTest and the recovery-lock test.

Co-Authored-By: gnugomez <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* refactor: rename the download ingestion table to match its entity

The DownloadCountProcessedItem -> DownloadIngestion rename kept @table(name =
"download_count_processed_item"), so the schema still carried a name that only
makes sense against a class that no longer exists. V1_75 completes it.

Everything in the migration is a catalog-only rename - the table, its primary
key constraint, both indexes and the sequence. No data is copied and no column
changes type, so there is no table rewrite; the ACCESS EXCLUSIVE lock is held
only for as long as it takes to update the catalog rows. The indexes, the
constraint and the sequence are renamed explicitly because renaming a table
leaves them behind under their original names, which is precisely the
half-renamed schema the migration exists to avoid.

The sequence keeps its OWNED BY link across the rename, and its INCREMENT 50
still matches the entity's default allocationSize.

src/main/jooq-gen is regenerated, which is where the rest of the diff comes
from. Nothing referenced the generated table: it is reached only through JPA,
via DownloadIngestionRepository and JPQL naming the entity.

What this is not safe against is an older server instance still running after
the migration - its queries name the old table and will fail until it is
replaced. The failure is loud and confined to the hourly ingestion job, and
this table is a ledger of which log files have been processed, so a failed run
neither loses nor double-counts downloads, it retries on the next tick.
Deployments running more than one server instance should expect errors in that
window.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* perf: resolve download ingestion sources once, by storage type

Two call sites each scanned the ingestion sources to answer "which source, if
any, handles this storage type":

  StorageUtilService  sources.stream().anyMatch(source -> source.covers(resource))
  LogIngestionJob     sources.stream().filter(s -> s.getStorageType().equals(t) && s.isEnabled())

Both now share a DownloadRecordSourceIndex, built once per holder in a
@PostConstruct and keyed by storage type. It is a plain object rather than a
bean so that neither constructor signature changes, which keeps the six test
configurations that wire StorageUtilService untouched.

The scan mattered most in StorageUtilService, which runs on every download:
ObjectProvider.stream() resolves matching beans from the bean factory on each
call, so the registry's hottest endpoint paid a bean lookup plus a covers() call
per source to answer a question with two possible answers. It is now a map
lookup.

Asking isEnabled() once at startup is safe - every input to it is a
configuration property, fixed once the bean is initialized - and it fixes a
logging bug. AzureDownloadRecordSource warns from inside isEnabled() when its
logs endpoint is set but its storage endpoint is not, and covers() called
isEnabled(), so a half-configured Azure deployment emitted that warning on every
single download.

Enablement is no longer part of the covers() contract. Both implementations
ended with "&& isEnabled()", which was correct but left every future source one
forgotten conjunct away from suppressing downloads that nothing ingests - the
request path would skip them and the disabled job would never pick them up. A
source that is not enabled is now absent from the index altogether, so covers()
answers coverage only, as its name says, and the guarantee holds for
implementations that have not been written yet.

Two enabled sources for one storage type would each claim the same downloads,
with bean ordering deciding which answered. LogIngestionJob previously took the
first via findFirst(); that now fails at startup instead.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: gnugomez <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
netomi added a commit that referenced this pull request Sep 13, 2026
Adds the second datasource the download analytics need, and nothing that reads
or writes it. Gated on ovsx.analytics.enabled, which no deployment sets, so by
default not a single bean of it is created.

TimeseriesDatabaseConfiguration builds a Hikari pool, a Flyway chain and a jOOQ
DSLContext against a separate PostgreSQL database carrying the timescaledb
extension. All three are defaultCandidate = false, so Boot still auto-configures
the primary datasource, the registry's Flyway chain and the primary DSLContext,
and only an explicit @qualifier reaches the time-series ones.

The migration set lives in db/migration-timeseries, a sibling of db/migration
rather than a child: Flyway scans locations recursively, so a child would be
pulled into the registry's own chain and make the registry require the
timescaledb extension. It creates the download_event hypertable and the
download_stats_daily continuous aggregate, with the executeInTransaction=false
sidecar those statements need.

Its connection timeout defaults to 2 seconds rather than Hikari's 30, because a
download will record its event on the request path: an unreachable time-series
database has to fail fast enough for the caller to swallow it.

docker-compose gains a postgres-timeseries service on 5433, with the same
pg_isready healthcheck the registry database has so the server can wait on it the
way it waits on the others. The dev config points at it and enables analytics, and
all four deployment descriptors - docker, openshift, kubernetes and dev - carry the
settings commented out. Test containers can be overridden with
-Dovsx.test.postgres.image and -Dovsx.test.timeseries.image.

doc/configuration.md gains a Download Analytics section. ovsx.analytics.enabled is
documented as a property; the ovsx.analytics.datasource.* settings are read through
Environment rather than bound one by one, so the reference describes them in prose
instead - listing them as properties would claim bindings the source does not have.

TimeseriesDatabaseTest is not from #2027. Without it AbstractTimeseriesContainerTest
would be an abstract base with no subclass, and nothing would exercise the
migration until the analytics land. It asserts the hypertable and the aggregate
exist, and that the registry database does not gain them.

Co-Authored-By: gnugomez <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
netomi added a commit that referenced this pull request Sep 13, 2026
Adds the second datasource the download analytics need, and nothing that reads
or writes it. Gated on ovsx.analytics.enabled, which no deployment sets, so by
default not a single bean of it is created.

TimeseriesDatabaseConfiguration builds a Hikari pool, a Flyway chain and a jOOQ
DSLContext against a separate PostgreSQL database carrying the timescaledb
extension. All three are defaultCandidate = false, so Boot still auto-configures
the primary datasource, the registry's Flyway chain and the primary DSLContext,
and only an explicit @qualifier reaches the time-series ones.

The migration set lives in db/migration-timeseries, a sibling of db/migration
rather than a child: Flyway scans locations recursively, so a child would be
pulled into the registry's own chain and make the registry require the
timescaledb extension. It creates the download_event hypertable and the
download_stats_daily continuous aggregate, with the executeInTransaction=false
sidecar those statements need.

Its connection timeout defaults to 2 seconds rather than Hikari's 30, because a
download will record its event on the request path: an unreachable time-series
database has to fail fast enough for the caller to swallow it.

docker-compose gains a postgres-timeseries service on 5433, with the same
pg_isready healthcheck the registry database has so the server can wait on it the
way it waits on the others. The dev config points at it and enables analytics, and
all four deployment descriptors - docker, openshift, kubernetes and dev - carry the
settings commented out. Test containers can be overridden with
-Dovsx.test.postgres.image and -Dovsx.test.timeseries.image.

doc/configuration.md gains a Download Analytics section. ovsx.analytics.enabled is
documented as a property; the ovsx.analytics.datasource.* settings are read through
Environment rather than bound one by one, so the reference describes them in prose
instead - listing them as properties would claim bindings the source does not have.

TimeseriesDatabaseTest is not from #2027. Without it AbstractTimeseriesContainerTest
would be an abstract base with no subclass, and nothing would exercise the
migration until the analytics land. It asserts the hypertable and the aggregate
exist, and that the registry database does not gain them.

Co-Authored-By: gnugomez <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
netomi added a commit that referenced this pull request Sep 13, 2026
Adds the second datasource the download analytics need, and nothing that reads
or writes it. Gated on ovsx.analytics.enabled, which no deployment sets, so by
default not a single bean of it is created.

TimeseriesDatabaseConfiguration builds a Hikari pool, a Flyway chain and a jOOQ
DSLContext against a separate PostgreSQL database carrying the timescaledb
extension. All three are defaultCandidate = false, so Boot still auto-configures
the primary datasource, the registry's Flyway chain and the primary DSLContext,
and only an explicit @qualifier reaches the time-series ones.

The migration set lives in db/migration-timeseries, a sibling of db/migration
rather than a child: Flyway scans locations recursively, so a child would be
pulled into the registry's own chain and make the registry require the
timescaledb extension. It creates the download_event hypertable and the
download_stats_daily continuous aggregate, with the executeInTransaction=false
sidecar those statements need.

Its connection timeout defaults to 2 seconds rather than Hikari's 30, because a
download will record its event on the request path: an unreachable time-series
database has to fail fast enough for the caller to swallow it.

docker-compose gains a postgres-timeseries service on 5433, with the same
pg_isready healthcheck the registry database has so the server can wait on it the
way it waits on the others. The dev config points at it and enables analytics, and
all four deployment descriptors - docker, openshift, kubernetes and dev - carry the
settings commented out. Test containers can be overridden with
-Dovsx.test.postgres.image and -Dovsx.test.timeseries.image.

The ovsx.analytics.datasource.* settings are bound with @value and validated in a
@PostConstruct, as server/AGENTS.md asks of configuration properties, rather than
read from the Environment inside the @bean method. Reaching that validation at all
means the operator set ovsx.analytics.enabled, so a missing url is a mistake rather
than a way to opt out and startup fails instead of the first download. The pool size
must be at least 1, and the connection timeout must exceed 250ms because the
validation timeout is derived at half of it with a 250ms floor and Hikari rejects a
validation timeout that is not below the connection timeout.

The credentials stay optional and still reach Hikari as null rather than "" when
unset, so the driver can resolve them from a URL parameter, .pgpass or IAM as before.
Their @value defaults are empty strings rather than #{null} because the config
properties check cannot parse a SpEL default, and a property it cannot see cannot be
documented as one.

doc/configuration.md gains a Download Analytics section covering all six properties.

TimeseriesDatabaseTest is not from #2027. Without it AbstractTimeseriesContainerTest
would be an abstract base with no subclass, and nothing would exercise the
migration until the analytics land. It asserts the hypertable and the aggregate
exist, and that the registry database does not gain them.

Co-Authored-By: gnugomez <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
netomi added a commit that referenced this pull request Sep 13, 2026
Adds the second datasource the download analytics need, and nothing that reads
or writes it. Gated on ovsx.analytics.enabled, which no deployment sets, so by
default not a single bean of it is created.

TimeseriesDatabaseConfiguration builds a Hikari pool, a Flyway chain and a jOOQ
DSLContext against a separate PostgreSQL database carrying the timescaledb
extension. All three are defaultCandidate = false, so Boot still auto-configures
the primary datasource, the registry's Flyway chain and the primary DSLContext,
and only an explicit @qualifier reaches the time-series ones.

The migration set lives in db/migration-timeseries, a sibling of db/migration
rather than a child: Flyway scans locations recursively, so a child would be
pulled into the registry's own chain and make the registry require the
timescaledb extension. It creates the download_event hypertable and the
download_stats_daily continuous aggregate, with the executeInTransaction=false
sidecar those statements need.

Its connection timeout defaults to 2 seconds rather than Hikari's 30, because a
download will record its event on the request path: an unreachable time-series
database has to fail fast enough for the caller to swallow it.

docker-compose gains a postgres-timeseries service on 5433, with the same
pg_isready healthcheck the registry database has so the server can wait on it the
way it waits on the others. It sits in its own analytics profile rather than in db
and debug: analytics are off by default, so the ordinary local setup should not pay
for a second database it will never connect to. The server depends on it with
required: false, so selecting a profile without it stays valid.

The dev config points at that service but leaves ovsx.analytics.enabled false,
matching every other deployment; working on analytics locally means setting it and
selecting the analytics profile together. All four deployment descriptors - docker,
openshift, kubernetes and dev - carry the settings. Test containers can be overridden with
-Dovsx.test.postgres.image and -Dovsx.test.timeseries.image.

The ovsx.analytics.datasource.* settings are bound with @value and validated in a
@PostConstruct, as server/AGENTS.md asks of configuration properties, rather than
read from the Environment inside the @bean method. Reaching that validation at all
means the operator set ovsx.analytics.enabled, so a missing url is a mistake rather
than a way to opt out and startup fails instead of the first download. The pool size
must be at least 1, and the connection timeout must exceed 250ms because the
validation timeout is derived at half of it with a 250ms floor and Hikari rejects a
validation timeout that is not below the connection timeout.

The credentials stay optional and still reach Hikari as null rather than "" when
unset, so the driver can resolve them from a URL parameter, .pgpass or IAM as before.
Their @value defaults are empty strings rather than #{null} because the config
properties check cannot parse a SpEL default, and a property it cannot see cannot be
documented as one.

doc/configuration.md gains a Download Analytics section covering all six properties.

TimeseriesDatabaseTest is not from #2027. Without it AbstractTimeseriesContainerTest
would be an abstract base with no subclass, and nothing would exercise the
migration until the analytics land. It asserts the hypertable and the aggregate
exist, and that the registry database does not gain them.

Co-Authored-By: gnugomez <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
netomi added a commit that referenced this pull request Sep 13, 2026
Adds the second datasource the download analytics need, and nothing that reads
or writes it. Gated on ovsx.analytics.enabled, which no deployment sets, so by
default not a single bean of it is created.

TimeseriesDatabaseConfiguration builds a Hikari pool, a Flyway chain and a jOOQ
DSLContext against a separate PostgreSQL database carrying the timescaledb
extension. All three are defaultCandidate = false, so Boot still auto-configures
the primary datasource, the registry's Flyway chain and the primary DSLContext,
and only an explicit @qualifier reaches the time-series ones.

The migration set lives in db/migration-timeseries, a sibling of db/migration
rather than a child: Flyway scans locations recursively, so a child would be
pulled into the registry's own chain and make the registry require the
timescaledb extension. It creates the download_event hypertable and the
download_stats_daily continuous aggregate, with the executeInTransaction=false
sidecar those statements need.

Its connection timeout defaults to 2 seconds rather than Hikari's 30, because a
download will record its event on the request path: an unreachable time-series
database has to fail fast enough for the caller to swallow it.

docker-compose gains a postgres-timeseries service on 5433, with the same
pg_isready healthcheck the registry database has so the server can wait on it the
way it waits on the others. It sits in its own analytics profile rather than in db
and debug: analytics are off by default, so the ordinary local setup should not pay
for a second database it will never connect to. The server depends on it with
required: false, so selecting a profile without it stays valid.

The dev config points at that service but leaves ovsx.analytics.enabled false,
matching every other deployment; working on analytics locally means setting it and
selecting the analytics profile together. All four deployment descriptors - docker,
openshift, kubernetes and dev - carry the settings. Test containers can be overridden with
-Dovsx.test.postgres.image and -Dovsx.test.timeseries.image.

The ovsx.analytics.datasource.* settings are bound with @value and validated in a
@PostConstruct, as server/AGENTS.md asks of configuration properties, rather than
read from the Environment inside the @bean method. Reaching that validation at all
means the operator set ovsx.analytics.enabled, so a missing url is a mistake rather
than a way to opt out and startup fails instead of the first download. The pool size
must be at least 1, and the connection timeout must exceed 250ms because the
validation timeout is derived at half of it with a 250ms floor and Hikari rejects a
validation timeout that is not below the connection timeout.

The credentials stay optional and still reach Hikari as null rather than "" when
unset, so the driver can resolve them from a URL parameter, .pgpass or IAM as before.
Their @value defaults are empty strings rather than #{null} because the config
properties check cannot parse a SpEL default, and a property it cannot see cannot be
documented as one.

doc/configuration.md gains a Download Analytics section covering all six properties.

TimeseriesDatabaseTest is not from #2027. Without it AbstractTimeseriesContainerTest
would be an abstract base with no subclass, and nothing would exercise the
migration until the analytics land. It asserts the hypertable and the aggregate
exist, and that the registry database does not gain them.

Co-authored-by: gnugomez <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
@gnugomez gnugomez closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants