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

Telemetry: track extensions and html_theme Sphinx variables #9627

Closed
humitos opened this issue Sep 27, 2022 · 1 comment · Fixed by #9639
Closed

Telemetry: track extensions and html_theme Sphinx variables #9627

humitos opened this issue Sep 27, 2022 · 1 comment · Fixed by #9639
Labels
Needed: design decision A core team decision is required

Comments

@humitos
Copy link
Member

humitos commented Sep 27, 2022

While working on sphinx-doc/sphinx#10070, @AA-Turner ask for the content of extensions and html_theme and I think it could be useful to store in the Telemetry database somehow. Considering these values may be dynamically populated, we should find a way to execute this code and grab the final value of them.

@humitos humitos added the Needed: design decision A core team decision is required label Sep 27, 2022
@AA-Turner
Copy link

If your metrics are able to work with Sphinx extensions, this could be read as app.extensions and app.config.html_theme by hooking into the config-inited event.

A

humitos added a commit that referenced this issue Oct 4, 2022
Pretty simple implementation to track Sphinx's extensions and theme.
This is not the best implementation, but I think it could be good as a first
start.

The new `doctool` key added will have this shape:

```
  "doctool": {
    "extensions": [
      "readthedocs_ext.readthedocs",
      "notfound.extension",
      "autoapi.extension",
      "sphinx_tabs.tabs",
      "sphinx-prompt",
      "sphinxemoji.sphinxemoji"
    ],
    "name": "sphinx",
    "theme": "sphinx_rtd_theme"
  },
```

Closes #9627
humitos added a commit that referenced this issue Oct 17, 2022
* Telemetry: track Sphinx `extensions` and `html_theme` variables

Pretty simple implementation to track Sphinx's extensions and theme.
This is not the best implementation, but I think it could be good as a first
start.

The new `doctool` key added will have this shape:

```
  "doctool": {
    "extensions": [
      "readthedocs_ext.readthedocs",
      "notfound.extension",
      "autoapi.extension",
      "sphinx_tabs.tabs",
      "sphinx-prompt",
      "sphinxemoji.sphinxemoji"
    ],
    "name": "sphinx",
    "theme": "sphinx_rtd_theme"
  },
```

Closes #9627

* Lint

* Lint

* Use `Version.is___type()` to know if it's Sphinx/MkDocs or generic

* Telemetry: use `readthedocs-sphinx-ext`'s dump to load the data

Our extension is now dumping the data we want to consume here. So, we are just
reading that file and saving it as part of the `BuildData` object.

* These are properties, not functions

* Missing `return`

* Return `doctool` data even if the file does not exist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: design decision A core team decision is required
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants