Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rendering of metrics with special characters #1449

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

knedlsepp
Copy link
Member

@knedlsepp knedlsepp commented Feb 27, 2025

My main motivation here is to get metrics with brackets to work in order
to support "pytest" test names:

  • test_foo.py::test_bar[1]
  • test_foo.py::test_bar[2]

I couldn't find an "HTML escape"-style function that would generate
valid html id attribute names from arbitrary strings, so I went with a
hash digest instead.

(See also the previous fix for metrics with dots)

@knedlsepp knedlsepp force-pushed the fix-metrics-rendering-with-special-characters branch from f7b6fed to 3c9564a Compare February 27, 2025 08:09
@knedlsepp knedlsepp marked this pull request as draft February 27, 2025 08:19
My main motivation here is to get metrics with brackets to work in order
to support "pytest" test names:

- test_foo.py::test_bar[1]
- test_foo.py::test_bar[2]

I couldn't find an "HTML escape"-style function that would generate
valid html `id` attribute names from random strings, so I went with a
hash digest instead.
@knedlsepp knedlsepp force-pushed the fix-metrics-rendering-with-special-characters branch from 3c9564a to d22d030 Compare February 27, 2025 08:25
@knedlsepp knedlsepp marked this pull request as ready for review February 27, 2025 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant