elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.61k stars 8.22k forks source link

[APM] Service names with spaces are not being URL encoded properly for `{{context.viewInAppUrl}}` #184381

Open simianhacker opened 5 months ago

simianhacker commented 5 months ago

Kibana version:

8.13.2

Elasticsearch version:

8.13.2

Describe the bug:

When an APM service name contains a space, the {{context.viewInAppUrl}} is not properly encoded.

Steps to reproduce:

  1. Create an APM service with a space in it
  2. Create an APM specific alert that will trigger
  3. Create an action that uses {{context.viewInAppUrl}}

Expected behavior:

The space in the service.name should be encoded.

Any additional context:

service.name in this file should be wrapped with encodeURIComponent:

https://github.com/elastic/kibana/blob/5a74376da0acd05388ddde264ab3409dd939051f/x-pack/plugins/observability_solution/apm/common/utils/formatters/alert_url.ts#L16

and here:

https://github.com/elastic/kibana/blob/5a74376da0acd05388ddde264ab3409dd939051f/x-pack/plugins/observability_solution/apm/common/utils/formatters/alert_url.ts#L28

elasticmachine commented 5 months ago

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)