Skip to content

Commit 257772a

Browse files
authored
docs: remove unused plugin for system metrics (#817)
1 parent 1e96bff commit 257772a

File tree

1 file changed

+1
-30
lines changed

1 file changed

+1
-30
lines changed

docs/plugins/main.py

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from mkdocs.structure.files import Files
99
from mkdocs.structure.pages import Page
1010

11-
from logfire._internal import config_params, metrics
11+
from logfire._internal import config_params
1212

1313
LOGFIRE_DIR = Path(__file__).parent.parent.parent
1414

@@ -20,7 +20,6 @@ def on_page_markdown(markdown: str, page: Page, config: Config, files: Files) ->
2020
markdown = build_environment_variables_table(markdown, page)
2121
markdown = logfire_print_help(markdown, page)
2222
markdown = install_logfire(markdown, page)
23-
markdown = check_documented_system_metrics(markdown, page)
2423
markdown = integrations_metadata(markdown, page)
2524
markdown = footer_web_frameworks(markdown, page)
2625
return markdown
@@ -35,34 +34,6 @@ def on_files(files: Files, config: Config) -> None:
3534
)
3635

3736

38-
def check_documented_system_metrics(markdown: str, page: Page) -> str:
39-
"""Check that all system metrics are documented.
40-
41-
The system metrics are the ones defined in `logfire._metrics.DEFAULT_CONFIG`.
42-
43-
The documentation is in `metrics.md`. The metrics are documented in bullet points, like this:
44-
* `system.cpu.time`: The CPU time spent in different modes.
45-
* `system.cpu.utilization`: The CPU utilization in different modes.
46-
47-
This function checks that all the metrics in `DEFAULT_CONFIG` are documented.
48-
"""
49-
if page.file.src_uri != 'guides/onboarding-checklist/06_add-metrics.md':
50-
return markdown
51-
52-
metrics_documented: set[str] = set()
53-
for line in markdown.splitlines():
54-
match = re.search(r'\* `(.*)`: ', line)
55-
if match:
56-
metrics_documented.add(match.group(1))
57-
58-
# Check that all the metrics are documented.
59-
for metric in metrics.DEFAULT_CONFIG:
60-
if metric not in metrics_documented:
61-
raise RuntimeError(f'Metric {metric} is not documented on the metrics page.')
62-
63-
return markdown
64-
65-
6637
def logfire_print_help(markdown: str, page: Page) -> str:
6738
# if you don't filter to the specific route that needs this substitution, things will be very slow
6839
if page.file.src_uri != 'reference/cli.md':

0 commit comments

Comments
 (0)