Skip to content

Commit

Permalink
Merge branch 'main' into bf-typo
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin authored Jan 24, 2025
2 parents 589829e + 257772a commit 7c69229
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 54 deletions.
31 changes: 1 addition & 30 deletions docs/plugins/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from mkdocs.structure.files import Files
from mkdocs.structure.pages import Page

from logfire._internal import config_params, metrics
from logfire._internal import config_params

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

Expand All @@ -20,7 +20,6 @@ def on_page_markdown(markdown: str, page: Page, config: Config, files: Files) ->
markdown = build_environment_variables_table(markdown, page)
markdown = logfire_print_help(markdown, page)
markdown = install_logfire(markdown, page)
markdown = check_documented_system_metrics(markdown, page)
markdown = integrations_metadata(markdown, page)
markdown = footer_web_frameworks(markdown, page)
return markdown
Expand All @@ -35,34 +34,6 @@ def on_files(files: Files, config: Config) -> None:
)


def check_documented_system_metrics(markdown: str, page: Page) -> str:
"""Check that all system metrics are documented.
The system metrics are the ones defined in `logfire._metrics.DEFAULT_CONFIG`.
The documentation is in `metrics.md`. The metrics are documented in bullet points, like this:
* `system.cpu.time`: The CPU time spent in different modes.
* `system.cpu.utilization`: The CPU utilization in different modes.
This function checks that all the metrics in `DEFAULT_CONFIG` are documented.
"""
if page.file.src_uri != 'guides/onboarding-checklist/06_add-metrics.md':
return markdown

metrics_documented: set[str] = set()
for line in markdown.splitlines():
match = re.search(r'\* `(.*)`: ', line)
if match:
metrics_documented.add(match.group(1))

# Check that all the metrics are documented.
for metric in metrics.DEFAULT_CONFIG:
if metric not in metrics_documented:
raise RuntimeError(f'Metric {metric} is not documented on the metrics page.')

return markdown


def logfire_print_help(markdown: str, page: Page) -> str:
# if you don't filter to the specific route that needs this substitution, things will be very slow
if page.file.src_uri != 'reference/cli.md':
Expand Down
48 changes: 24 additions & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,30 @@ authors = [
license = "MIT"
readme = "README.md"
classifiers = [
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: MIT License',
'Operating System :: Unix',
'Operating System :: POSIX :: Linux',
'Environment :: Console',
'Environment :: MacOS X',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Internet',
'Framework :: OpenTelemetry',
'Framework :: OpenTelemetry :: Distros',
'Framework :: OpenTelemetry :: Exporters',
'Framework :: OpenTelemetry :: Instrumentations',
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: MIT License",
"Operating System :: Unix",
"Operating System :: POSIX :: Linux",
"Environment :: Console",
"Environment :: MacOS X",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Internet",
"Framework :: OpenTelemetry",
"Framework :: OpenTelemetry :: Distros",
"Framework :: OpenTelemetry :: Exporters",
"Framework :: OpenTelemetry :: Instrumentations",
]
dependencies = [
"opentelemetry-sdk >= 1.21.0",
Expand Down

0 comments on commit 7c69229

Please sign in to comment.