In the SigNoz version >=v0.36 i.e. SigNoz chart version >=v0.32.0 , we have added support for dot(.) in attribute names.
Ex:- Previously service.name was stored and queried as service_name , after this upgrade service.name will be supported.
Steps to run migration script:
First upgrade to v0.36
Follow the platform specific instructions to upgrade to 0.36 and above.
Note that the past exceptions/error data will not be visible on the new application until you run the migration script.
For Docker
docker run --name signoz-migrate --network clickhouse-setup_default \
-it -d signoz/migrate:0.36 -host=clickhouse -port=9000Steps to check logs:
docker logs -f signoz-migrateIn case of failure and have to run again, make sure to cleanup the container before running the migration script again.
docker stop signoz-migrate
docker rm signoz-migrateFor Docker Swarm
For Swarm, you could follow similar step to that of Docker. However,
you would need to expose clickhouse container ports to host machine and use
host machine IP i.e. 172.17.0.17 for -host flag instead of clickhouse.
If you do not want to change anything in the current signoz deployment or to expose clickhouse ports even temporarily, you can go through following steps.
-
To download
migrate-v0.36binary:wget https://github.com/SigNoz/signoz-db-migrations/releases/download/v0.36/migrate-v0.36-linux-amd64 chmod +x migrate-v0.36-linux-amd64 -
To copy the binary in persistent volume path
/var/lib/clickhouseinclickhousecontainer:docker cp migration-v0.36-linux-amd64 $(docker ps -q -f name=signoz_clickhouse):/var/lib/clickhouse/migrate-0.36 -
To exec into the
clickhousecontainer:docker exec -it $(docker ps -q -f name=signoz_clickhouse) bash -
Now, change directory to the
/var/lib/clickhouseand run the migration script:cd /var/lib/clickhouse ./migration-0.36 -
At last, clean up the binary:
rm migration-0.36
For Kubernetes
RELEASE=my-release
ADMIN_PASSWORD=$(
kubectl -n platform get clickhouseinstallations.clickhouse.altinity.com $RELEASE-clickhouse \
-o jsonpath --template '{.spec.configuration.users.admin/password}'
)
kubectl -n platform run -i -t signoz-migrate --image=signoz/migrate:0.36 --restart='Never' \
-- -host=$RELEASE-clickhouse -port=9000 -userName=admin -password=$ADMIN_PASSWORDSteps to check logs:
kubectl -n platform logs -f signoz-migrateIn case of failure and have to run again, make sure to cleanup the pod before running the migration script again.
kubectl -n platform delete pod signoz-migrateIn case of Upgrade Failure
- Note the names of fields which were not migrated. ex:-
telemetry.sdk.name - Exec into the clickhouse container and run
clickhouse client. - Check the schema of the logs table
show create table signoz_logs.logs - If
telemetry_sdk_namecolumn ortelemetry_sdk_name_idxindex is present you can delete them
For deleting index
alter table signoz_logs.logs on cluster cluster drop index telemetry_sdk_name_idx
For deleting column
alter table signoz_logs.logs on cluster cluster drop column telemetry_sdk_namealter table signoz_logs.distributed_logs on cluster cluster drop column telemetry_sdk_name
- Now from the UI, you can convert
telemetry.sdk.nameto selected field. - If you still face issue, reach out to us at Slack.
Command-Line Interface (CLI) Flags
There are some custom flags which can be enabled based on different use-cases.
All the flags below are optional.
Flags:
-port: Specify port of clickhouse.default=9000-host: Specify host of clickhouse.default=127.0.0.1-userName: Specify user name of clickhouse.default=default-password: Specify password of clickhouse.default=""
Updating Query Payload, Dashboards and Alerts
If you've been using the SigNoz Query API, Dashboards, or Alerts with attributes that included a dot (.) but were converted to an underscore (_), they will continue to function for the next 45 days. However, it's essential to update these attributes to reflect the new format.
Ex:-
service.namewas previously shown and stored asservice_name. Now you can update it to useservice.namek8s.namespace.namewas previously shown and stored ask8s_namespace_name. Now you can update it to usek8s.namespace.name
For assistance in making these updates, please reach out to us via chat support or at cloud-support@signoz.io