Skip to content

feat: add OLake version information to log output#897

Closed
officialasishkumar wants to merge 2 commits intodatazip-inc:stagingfrom
officialasishkumar:feat/version-logging
Closed

feat: add OLake version information to log output#897
officialasishkumar wants to merge 2 commits intodatazip-inc:stagingfrom
officialasishkumar:feat/version-logging

Conversation

@officialasishkumar
Copy link
Copy Markdown

Description

Add build-time version information (version, commit SHA, release channel) to the OLake log output. In Kubernetes environments with multiple OLake jobs running concurrently, it can be difficult to determine which OLake version was used for a particular job. This change logs the version as the first informational message after logger initialization, making it easy to identify the OLake version from log files.

Changes:

  • Add version, commitSHA, and releaseChannel variables to the constants package, populated via ldflags during build
  • Add GetVersion(), GetCommitSHA(), and GetReleaseChannel() getter functions for accessing version info
  • Log version on startup in protocol/root.go after logger initialization
  • Fix ldflags paths in build.sh to use the full Go import path (github.com/datazip-inc/olake/constants)
  • Update telemetry to use the centralized constants.GetVersion() function, removing duplicated env var lookup

The version resolution follows a priority order:

  1. Build-time injected ldflags variable
  2. DRIVER_VERSION environment variable (set in Docker images)
  3. Default "dev" for local development

Fixes #861

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Verified all modified packages compile successfully with go vet
  • Verified existing tests pass (go test ./types/..., go test ./constants/...)
  • Verified version defaults to "dev" when no ldflags or env vars are set
  • Verified DRIVER_VERSION env var fallback works when ldflags are not injected

Screenshots or Recordings

N/A - log output change

Documentation

  • N/A (new feature adds informational log line, no user-facing API changes)

Related PR's (If Any):

Add build-time version variables (version, commitSHA, releaseChannel) to
the constants package, populated via ldflags during build. On startup,
the OLake version, commit SHA, and release channel are logged as the
first informational message after logger initialization.

The version resolution checks the build-time injected variable first,
then falls back to the DRIVER_VERSION environment variable (set in
Docker images), and defaults to "dev" for local development.

Also fixes the ldflags paths in build.sh to use the full Go import path
(github.com/datazip-inc/olake/constants) and updates the telemetry
package to use the centralized version function from constants, removing
the duplicated environment variable lookup.

Closes datazip-inc#861
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 28, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ vaibhav-datazip
❌ officialasishkumar
You have signed the CLA already but the status is still pending? Let us recheck it.

@nayanj98
Copy link
Copy Markdown
Collaborator

@officialasishkumar We usually do not consider the PR until unless you have requested first for getting the issue assigned to you. Since the issue is not requested yet can you please go ahead and request for the issue to be assigned to you so that I can do the same.

Also can you please sign the CLA as well.

@nayanj98
Copy link
Copy Markdown
Collaborator

Closing the PR as no further response was received.

@nayanj98 nayanj98 closed this Apr 15, 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.

4 participants