Skip to content

Add service for updating o11y settings

What does this MR do and why?

Add a service for updating o11y settings. This will be used to update database records used to configure connections to the o11y service. These settings can be seen in use in !197536 (merged)

References

UI for O11y settings Add a UI for updating the connection settings to the o11y service.

There are three MRs related to this issue:

  1. !198194 (merged) <- you are here
  2. !198201 (merged)
  3. !198221 (merged) <- full functionality here

Database

Insert

INSERT INTO "observability_group_o11y_settings" ("group_id", "o11y_service_url", "o11y_service_user_email", "o11y_service_password", "o11y_service_post_message_encryption_key", "created_at", "updated_at")
    VALUES (22, 'http://localhost:8080/', 'ddux@gitlab.com', '{"p":"IqBul1jV34RfErM=","h":{"iv":"4iGVBgs2fkiXqWB2","at":"vqjHPWZ4DJ0N92eB6bFnSQ==","i":"Njc0OQ=="}}', '{"p":"+KPCxw7/wwyFthbIT2bdLSAy/z1hwIl+Wcjpki6bp4Sc6BFayVk9/bHuVqDsVnB8qKHHbV57","h":{"iv":"lNtHI0KsFKc+CzPB","at":"D3TH7IxsiqLKwrTII2DC6Q==","i":"Njc0OQ=="}}', '2025-07-17 20:22:59.405840', '2025-07-17 20:22:59.405840')
RETURNING
    "id";

Query plan: https://console.postgres.ai/gitlab/gitlab-production-main/sessions/41630/commands/127795

Update

UPDATE
    "observability_group_o11y_settings"
SET
    "o11y_service_user_email" = 'ddux+updated@gitlab.com',
    "updated_at" = '2025-07-17 20:24:09.426583'
WHERE
    "observability_group_o11y_settings"."id" = 5;

Query plan: https://console.postgres.ai/gitlab/gitlab-production-main/sessions/41630/commands/127797 There are no records for this table in the database yet. Since this is accessing by the primary key ID, it should be ok. Please let me know if I can do anything to provide more data for this.

Delete

DELETE FROM "observability_group_o11y_settings"
WHERE "observability_group_o11y_settings"."id" = 1

Query plan: https://console.postgres.ai/gitlab/gitlab-production-main/sessions/41630/commands/127796 There are no records for this table in the database yet. Since this is accessing by the primary key ID, it should be ok. Please let me know if I can do anything to provide more data for this.

Screenshots or screen recordings

No UI changes

How to set up and validate locally

  1. In a rails console:
group = Group.find_by_path('toolbox')
settings = group.create_observability_group_o11y_setting!(
   o11y_service_url: "http://localhost:8080",
   o11y_service_user_email: "totallyfakeemail@fakeemail.com",
   o11y_service_password: "passwordmcpasswordface",
   o11y_service_post_message_encryption_key: "your-super-secret-encryption-key-here-32-chars-minimum",
)
service = Observability::GroupO11ySettingsUpdateService.new(settings)
updated_settings = {
  o11y_service_url: "http://localhost:8081",
  o11y_service_user_email: "",
  o11y_service_password: nil
}
service.execute(updated_settings)
settings.reload

This should have a successful response and the O11y Settings should have the new port in the URL.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Dakota Dux

Merge request reports

Loading