SigNoz / signoz

SigNoz is an open-source observability platform native to OpenTelemetry with logs, traces and metrics in a single application. An open-source alternative to DataDog, NewRelic, etc. 🔥 🖥. 👉 Open source Application Performance Monitoring (APM) & Observability tool
https://signoz.io
Other
19.43k stars 1.31k forks source link

feat: add feature flag to clickhouse migration #6444

Open ANU7MADHAV opened 1 week ago

ANU7MADHAV commented 1 week ago

Summary

The issue was that ClickHouse migrations were starting automatically when the server launched. To address this, I implemented a flag feature for conditional migrations. An environment variable, CLICKHOUSE_MIGRATION_ENABLED, was introduced with a default value of false. When set to false, migrations do not run; if changed to true, migrations will execute. This allows for an optimized, dynamic approach to managing migrations.

Related Issues / PR's

resolves #5678

Screenshots

NA

Affected Areas and Manually Tested Areas


[!IMPORTANT] Adds a feature flag to conditionally execute ClickHouse migrations based on an environment variable.

  • Behavior:
    • Introduces CLICKHOUSE_MIGRATION_ENABLED environment variable to control ClickHouse migrations.
    • If false (default), migrations are skipped; if true, migrations are executed.
  • Functions:
    • Adds IsClickhouseMigrationEnable() in constants.go to check the environment variable.
    • Updates ClickHouseMigrate() in migrate.go to accept a config parameter and conditionally execute migrations.
  • Server Initialization:
    • Modifies NewServer() in server.go in both ee/query-service/app and pkg/query-service/app to use the new feature flag for migrations.

This description was created by Ellipsis for aae23725e0113e1ed7997ebc8ef2fdf97a9e551e. It will automatically update as commits are pushed.

welcome[bot] commented 1 week ago

Welcome to the SigNoz community! Thank you for your first pull request and making this project better. 🤗

CLAassistant commented 1 week ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.