feat: basic telemetry collection/submission feature

This commit is contained in:
Lance Edgar 2025-08-09 12:05:18 -05:00
commit 53f599fa79
29 changed files with 1710 additions and 0 deletions

20
docs/Makefile Normal file
View file

@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

0
docs/_static/.keepme vendored Normal file
View file

View file

@ -0,0 +1,6 @@
``wuttatell.app``
=================
.. automodule:: wuttatell.app
:members:

View file

@ -0,0 +1,6 @@
``wuttatell.cli``
=================
.. automodule:: wuttatell.cli
:members:

View file

@ -0,0 +1,6 @@
``wuttatell.cli.tell``
======================
.. automodule:: wuttatell.cli.tell
:members:

6
docs/api/wuttatell.rst Normal file
View file

@ -0,0 +1,6 @@
``wuttatell``
=============
.. automodule:: wuttatell
:members:

View file

@ -0,0 +1,6 @@
``wuttatell.telemetry``
=======================
.. automodule:: wuttatell.telemetry
:members:

39
docs/conf.py Normal file
View file

@ -0,0 +1,39 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
from importlib.metadata import version as get_version
project = 'WuttaTell'
copyright = '2025, Lance Edgar'
author = 'Lance Edgar'
release = get_version('WuttaTell')
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.todo',
'sphinxcontrib.programoutput',
]
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
intersphinx_mapping = {
'wuttjamaican': ('https://docs.wuttaproject.org/wuttjamaican/', None),
}
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = 'furo'
html_static_path = ['_static']

28
docs/index.rst Normal file
View file

@ -0,0 +1,28 @@
WuttaTell
=========
This package adds simple telemetry submission features for the Wutta Framework.
Good documentation and 100% `test coverage`_ are priorities for this
project.
.. _test coverage: https://buildbot.wuttaproject.org/coverage/wuttatell/
.. toctree::
:maxdepth: 2
:caption: Documentation
narr/install
narr/cli/index
.. toctree::
:maxdepth: 1
:caption: API
api/wuttatell
api/wuttatell.app
api/wuttatell.cli
api/wuttatell.cli.tell
api/wuttatell.telemetry

35
docs/make.bat Normal file
View file

@ -0,0 +1,35 @@
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)
if "%1" == "" goto help
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd

19
docs/narr/cli/builtin.rst Normal file
View file

@ -0,0 +1,19 @@
===================
Built-in Commands
===================
Below are the :term:`subcommands <subcommand>` which come with
WuttaTell.
.. _wutta-tell:
``wutta tell``
--------------
Collect and submit telemetry data.
Defined in: :mod:`wuttatell.cli.tell`
.. program-output:: wutta tell --help

18
docs/narr/cli/index.rst Normal file
View file

@ -0,0 +1,18 @@
========================
Command Line Interface
========================
The primary way of using the telemetry framework day to day is via the
command line.
WuttJamaican defines the ``wutta`` :term:`command` and WuttaTell comes
with an extra :term:`subcommand` for submitting telemetry data.
For more general info about CLI see
:doc:`wuttjamaican:narr/cli/index`.
.. toctree::
:maxdepth: 2
builtin

28
docs/narr/install.rst Normal file
View file

@ -0,0 +1,28 @@
Installation
============
This assumes you already have a :doc:`WuttJamaican app
<wuttjamaican:narr/install/index>` setup and working.
Install the WuttaTell package to your virtual environment:
.. code-block:: sh
pip install WuttaTell
Edit your :term:`config file` to add telemetry submission info, and
related settings. Please note, the following example is just that -
and will not work as-is:
.. code-block:: ini
[wutta.telemetry]
default.collect_keys = os, python
default.submit_url = /nodes/telemetry
default.submit_uuid = 06897767-eb70-7790-8000-13f368a40ea3
.. note::
The built-in logic can collect some "minimal" telemetry info, but
there is no built-in logic for the submission.