Fix double backslashes in observability setup curl example

What does this MR do and why?

The Test your endpoints section on the Observability setup page displayed the sample curl command with \\ line continuations instead of \.

The displayed lines are built in a :ruby filter in app/views/shared/observability/setup/_endpoint_configuration.html.haml. The strings used "\\\\", which Ruby evaluates to two backslashes. This was introduced when the code moved into the shared partial in 5db1d22a; the original implementation used "\\".

This MR changes the two continuation strings back to "\\" so each displayed line ends in a single backslash.

Copy behavior is unchanged. The copy button uses curl_command_single_line, which has no line continuations, for example:

curl -X POST https://<id>.otel.gitlab-o11y.com:14318/v1/traces -H 'Content-Type: application/json' -d '{"resourceSpans":[...]}'

Tests

Added a regression spec in spec/requests/groups/observability/setup_spec.rb (the partial is shared by the group and project setup pages) that verifies:

  • The displayed command uses single-backslash continuations and never contains \\.
  • The copy button's data-clipboard-text is the single-line command with no backslashes.

The new spec fails on the old code and passes with the fix. spec/requests/groups/observability/setup_spec.rb and spec/requests/projects/observability/setup_spec.rb both pass (32 examples, 0 failures).

How to set up and validate locally

  1. Open the Observability setup page for a group or project with observability settings.
  2. Expand Test your endpoints and confirm each line ends in a single \.
  3. Click the copy button, paste into a shell, and confirm the command runs.

Screenshots

Screenshot_2026-10-07_at_9.29.16_PM

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist.

Edited by Dakota Dux

Merge request reports

Loading
Loading