Skip to content

Commit

Permalink
migration: migrate agent and no-tracing to otlp tracing backend (#3469)
Browse files Browse the repository at this point in the history
* migration: migrate agent and no-tracing to otlp tracing backend

* use "tracing backend" instead of "datastore"
  • Loading branch information
mathnogueira committed Dec 20, 2023
1 parent 53c8990 commit 534cd42
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions server/migrations/36_migrate_users_to_opentelemetry.sql
@@ -0,0 +1,22 @@
-- We are going to deprecate "no tracing mode" and "agent" tracing backends
-- So we need to migrate all users to a valid trace backend.
--
-- This means that all users using "no tracing mode" and "agent" tracing backends will become
-- "otlp" tracing backends

-- If there's an "agent" tracing backend, replace it with an "otlp" tracing backend instead
UPDATE data_stores
SET "name" = 'otlp', "type" = 'otlp', "values" = '{}'::jsonb
from (
SELECT id, "type" FROM data_stores WHERE "type" = 'agent'
) migration_target
WHERE data_stores.id = migration_target.id;

-- If there's no "current" tracing backend, add one for otlp. This ensures that if user is on
-- "No tracing mode", it will be migrated to "OpenTelemetry".
INSERT INTO
data_stores (id, "name", "type", is_default, "values", created_at, tenant_id)
VALUES ('current', 'otlp', 'otlp', true, '{}'::jsonb, now(), '')
ON CONFLICT DO NOTHING;


0 comments on commit 534cd42

Please sign in to comment.