├── .circleci └── config.yml ├── .coveragerc ├── .github └── workflows │ └── github-pages.yaml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── MAINTAINERS.md ├── NOTICE ├── README.md ├── SECURITY.md ├── docs ├── .gitignore ├── README.md ├── archetypes │ └── default.md ├── content │ ├── _index.md │ ├── bridges │ │ ├── _index.md │ │ └── graphite.md │ ├── collector │ │ ├── _index.md │ │ └── custom.md │ ├── exporting │ │ ├── _index.md │ │ ├── http │ │ │ ├── _index.md │ │ │ ├── asgi.md │ │ │ ├── fastapi-gunicorn.md │ │ │ ├── flask.md │ │ │ ├── twisted.md │ │ │ └── wsgi.md │ │ ├── pushgateway.md │ │ └── textfile.md │ ├── instrumenting │ │ ├── _index.md │ │ ├── counter.md │ │ ├── enum.md │ │ ├── exemplars.md │ │ ├── gauge.md │ │ ├── histogram.md │ │ ├── info.md │ │ ├── labels.md │ │ └── summary.md │ ├── multiprocess │ │ └── _index.md │ ├── parser │ │ └── _index.md │ └── restricted-registry │ │ └── _index.md ├── data │ └── menu │ │ ├── extra.yaml │ │ └── more.yaml ├── hugo.toml ├── static │ ├── .gitignore │ ├── brand.svg │ ├── custom.css │ └── favicon │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon.ico │ │ └── favicon.svg └── themes │ └── hugo-geekdoc │ ├── .nvmrc │ ├── LICENSE │ ├── README.md │ ├── VERSION │ ├── archetypes │ ├── docs.md │ └── posts.md │ ├── assets │ ├── search │ │ ├── config.json │ │ └── data.json │ └── sprites │ │ └── geekdoc.svg │ ├── data │ └── assets.json │ ├── eslint.config.js │ ├── i18n │ ├── am.yaml │ ├── cs.yaml │ ├── da.yaml │ ├── de.yaml │ ├── en.yaml │ ├── es.yaml │ ├── fr.yaml │ ├── it.yaml │ ├── ja.yaml │ ├── nl.yaml │ ├── oc.yaml │ └── zh-cn.yaml │ ├── images │ ├── readme.png │ ├── screenshot.png │ └── tn.png │ ├── layouts │ ├── 404.html │ ├── _default │ │ ├── _markup │ │ │ ├── render-codeblock-mermaid.html │ │ │ ├── render-heading.html │ │ │ ├── render-image.html │ │ │ └── render-link.html │ │ ├── baseof.html │ │ ├── list.html │ │ ├── single.html │ │ ├── taxonomy.html │ │ └── terms.html │ ├── partials │ │ ├── foot.html │ │ ├── head │ │ │ ├── custom.html │ │ │ ├── favicons.html │ │ │ ├── meta.html │ │ │ ├── microformats.html │ │ │ ├── others.html │ │ │ └── rel-me.html │ │ ├── language.html │ │ ├── menu-bundle-np.html │ │ ├── menu-bundle.html │ │ ├── menu-extra.html │ │ ├── menu-filetree-np.html │ │ ├── menu-filetree.html │ │ ├── menu.html │ │ ├── microformats │ │ │ ├── opengraph.html │ │ │ ├── schema.html │ │ │ └── twitter_cards.html │ │ ├── page-header.html │ │ ├── page-metadata.html │ │ ├── pagination.html │ │ ├── posts │ │ │ └── metadata.html │ │ ├── search.html │ │ ├── site-footer.html │ │ ├── site-header.html │ │ ├── svg-icon-symbols.html │ │ └── utils │ │ │ ├── content.html │ │ │ ├── description.html │ │ │ ├── featured.html │ │ │ └── title.html │ ├── posts │ │ ├── list.html │ │ └── single.html │ ├── robots.txt │ └── shortcodes │ │ ├── audio.html │ │ ├── avatar.html │ │ ├── button.html │ │ ├── columns.html │ │ ├── expand.html │ │ ├── gist.html │ │ ├── hint.html │ │ ├── icon.html │ │ ├── img.html │ │ ├── include.html │ │ ├── katex.html │ │ ├── mermaid.html │ │ ├── progress.html │ │ ├── propertylist.html │ │ ├── tab.html │ │ ├── tabs.html │ │ ├── toc-tree.html │ │ └── toc.html │ ├── static │ ├── brand.svg │ ├── custom.css │ ├── favicon │ │ ├── android-chrome-144x144.png │ │ ├── android-chrome-192x192.png │ │ ├── android-chrome-256x256.png │ │ ├── android-chrome-36x36.png │ │ ├── android-chrome-384x384.png │ │ ├── android-chrome-48x48.png │ │ ├── android-chrome-512x512.png │ │ ├── android-chrome-72x72.png │ │ ├── android-chrome-96x96.png │ │ ├── apple-touch-icon-1024x1024.png │ │ ├── apple-touch-icon-114x114.png │ │ ├── apple-touch-icon-120x120.png │ │ ├── apple-touch-icon-144x144.png │ │ ├── apple-touch-icon-152x152.png │ │ ├── apple-touch-icon-167x167.png │ │ ├── apple-touch-icon-180x180.png │ │ ├── apple-touch-icon-57x57.png │ │ ├── apple-touch-icon-60x60.png │ │ ├── apple-touch-icon-72x72.png │ │ ├── apple-touch-icon-76x76.png │ │ ├── apple-touch-icon-precomposed.png │ │ ├── apple-touch-icon.png │ │ ├── apple-touch-startup-image-1125x2436.png │ │ ├── apple-touch-startup-image-1136x640.png │ │ ├── apple-touch-startup-image-1170x2532.png │ │ ├── apple-touch-startup-image-1179x2556.png │ │ ├── apple-touch-startup-image-1242x2208.png │ │ ├── apple-touch-startup-image-1242x2688.png │ │ ├── apple-touch-startup-image-1284x2778.png │ │ ├── apple-touch-startup-image-1290x2796.png │ │ ├── apple-touch-startup-image-1334x750.png │ │ ├── apple-touch-startup-image-1488x2266.png │ │ ├── apple-touch-startup-image-1536x2048.png │ │ ├── apple-touch-startup-image-1620x2160.png │ │ ├── apple-touch-startup-image-1640x2160.png │ │ ├── apple-touch-startup-image-1668x2224.png │ │ ├── apple-touch-startup-image-1668x2388.png │ │ ├── apple-touch-startup-image-1792x828.png │ │ ├── apple-touch-startup-image-2048x1536.png │ │ ├── apple-touch-startup-image-2048x2732.png │ │ ├── apple-touch-startup-image-2160x1620.png │ │ ├── apple-touch-startup-image-2160x1640.png │ │ ├── apple-touch-startup-image-2208x1242.png │ │ ├── apple-touch-startup-image-2224x1668.png │ │ ├── apple-touch-startup-image-2266x1488.png │ │ ├── apple-touch-startup-image-2388x1668.png │ │ ├── apple-touch-startup-image-2436x1125.png │ │ ├── apple-touch-startup-image-2532x1170.png │ │ ├── apple-touch-startup-image-2556x1179.png │ │ ├── apple-touch-startup-image-2688x1242.png │ │ ├── apple-touch-startup-image-2732x2048.png │ │ ├── apple-touch-startup-image-2778x1284.png │ │ ├── apple-touch-startup-image-2796x1290.png │ │ ├── apple-touch-startup-image-640x1136.png │ │ ├── apple-touch-startup-image-750x1334.png │ │ ├── apple-touch-startup-image-828x1792.png │ │ ├── browserconfig.xml │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon-48x48.png │ │ ├── favicon.ico │ │ ├── favicon.svg │ │ ├── manifest.webmanifest │ │ ├── mstile-144x144.png │ │ ├── mstile-150x150.png │ │ ├── mstile-310x150.png │ │ ├── mstile-310x310.png │ │ └── mstile-70x70.png │ ├── fonts │ │ ├── GeekdocIcons.woff │ │ ├── GeekdocIcons.woff2 │ │ ├── KaTeX_AMS-Regular.woff │ │ ├── KaTeX_AMS-Regular.woff2 │ │ ├── KaTeX_Caligraphic-Bold.woff │ │ ├── KaTeX_Caligraphic-Bold.woff2 │ │ ├── KaTeX_Caligraphic-Regular.woff │ │ ├── KaTeX_Caligraphic-Regular.woff2 │ │ ├── KaTeX_Fraktur-Bold.woff │ │ ├── KaTeX_Fraktur-Bold.woff2 │ │ ├── KaTeX_Fraktur-Regular.woff │ │ ├── KaTeX_Fraktur-Regular.woff2 │ │ ├── KaTeX_Main-Bold.woff │ │ ├── KaTeX_Main-Bold.woff2 │ │ ├── KaTeX_Main-BoldItalic.woff │ │ ├── KaTeX_Main-BoldItalic.woff2 │ │ ├── KaTeX_Main-Italic.woff │ │ ├── KaTeX_Main-Italic.woff2 │ │ ├── KaTeX_Main-Regular.woff │ │ ├── KaTeX_Main-Regular.woff2 │ │ ├── KaTeX_Math-BoldItalic.woff │ │ ├── KaTeX_Math-BoldItalic.woff2 │ │ ├── KaTeX_Math-Italic.woff │ │ ├── KaTeX_Math-Italic.woff2 │ │ ├── KaTeX_SansSerif-Bold.woff │ │ ├── KaTeX_SansSerif-Bold.woff2 │ │ ├── KaTeX_SansSerif-Italic.woff │ │ ├── KaTeX_SansSerif-Italic.woff2 │ │ ├── KaTeX_SansSerif-Regular.woff │ │ ├── KaTeX_SansSerif-Regular.woff2 │ │ ├── KaTeX_Script-Regular.woff │ │ ├── KaTeX_Script-Regular.woff2 │ │ ├── KaTeX_Size1-Regular.woff │ │ ├── KaTeX_Size1-Regular.woff2 │ │ ├── KaTeX_Size2-Regular.woff │ │ ├── KaTeX_Size2-Regular.woff2 │ │ ├── KaTeX_Size3-Regular.woff │ │ ├── KaTeX_Size3-Regular.woff2 │ │ ├── KaTeX_Size4-Regular.woff │ │ ├── KaTeX_Size4-Regular.woff2 │ │ ├── KaTeX_Typewriter-Regular.woff │ │ ├── KaTeX_Typewriter-Regular.woff2 │ │ ├── LiberationMono.woff │ │ ├── LiberationMono.woff2 │ │ ├── LiberationSans-Bold.woff │ │ ├── LiberationSans-Bold.woff2 │ │ ├── LiberationSans-BoldItalic.woff │ │ ├── LiberationSans-BoldItalic.woff2 │ │ ├── LiberationSans-Italic.woff │ │ ├── LiberationSans-Italic.woff2 │ │ ├── LiberationSans.woff │ │ ├── LiberationSans.woff2 │ │ ├── Metropolis.woff │ │ └── Metropolis.woff2 │ ├── img │ │ └── geekdoc-stack.svg │ ├── js │ │ ├── 110-f4b990d9.chunk.min.js │ │ ├── 12-0b8427d1.chunk.min.js │ │ ├── 130-3b252fb9.chunk.min.js │ │ ├── 164-f339d58d.chunk.min.js │ │ ├── 165-06872da1.chunk.min.js │ │ ├── 165-06872da1.chunk.min.js.LICENSE.txt │ │ ├── 175-405e6b1c.chunk.min.js │ │ ├── 237-c0a3f3fe.chunk.min.js │ │ ├── 240-cd383fa4.chunk.min.js │ │ ├── 244-c41eb325.chunk.min.js │ │ ├── 354-5c1850f7.chunk.min.js │ │ ├── 355-ef4f96e9.chunk.min.js │ │ ├── 357-e9bfa102.chunk.min.js │ │ ├── 383-e450e912.chunk.min.js │ │ ├── 387-3546ecdc.chunk.min.js │ │ ├── 391-549a9d24.chunk.min.js │ │ ├── 410-ec3f5ed1.chunk.min.js │ │ ├── 413-c02a8543.chunk.min.js │ │ ├── 417-65958f5a.chunk.min.js │ │ ├── 452-e65d6d68.chunk.min.js │ │ ├── 485-3b9fa0c4.chunk.min.js │ │ ├── 540-ae28fd42.chunk.min.js │ │ ├── 545-bfa2b46e.chunk.min.js │ │ ├── 56-09931933.chunk.min.js │ │ ├── 567-6c3220fd.chunk.min.js │ │ ├── 632-7a25d3c6.chunk.min.js │ │ ├── 648-b5ba4bb4.chunk.min.js │ │ ├── 664-ed5252a5.chunk.min.js │ │ ├── 691-2a6930fd.chunk.min.js │ │ ├── 720-970f726e.chunk.min.js │ │ ├── 723-47eb515a.chunk.min.js │ │ ├── 731-6d56a3c0.chunk.min.js │ │ ├── 732-8e5770e7.chunk.min.js │ │ ├── 758-5696af5a.chunk.min.js │ │ ├── 825-445b5bd5.chunk.min.js │ │ ├── 890-c9907c95.chunk.min.js │ │ ├── 978-382bed37.chunk.min.js │ │ ├── colortheme-01ea3db1.bundle.min.js │ │ ├── katex-13a419d8.bundle.min.js │ │ ├── main-2e274343.bundle.min.js │ │ ├── main-2e274343.bundle.min.js.LICENSE.txt │ │ ├── mermaid-c274c389.bundle.min.js │ │ ├── mermaid-c274c389.bundle.min.js.LICENSE.txt │ │ ├── search-16a110ff.bundle.min.js │ │ └── search-16a110ff.bundle.min.js.LICENSE.txt │ ├── katex-a0da2a32.min.css │ ├── main-b53472e8.min.css │ ├── mobile-79ddc617.min.css │ └── print-72068949.min.css │ └── theme.toml ├── mypy.ini ├── prometheus_client ├── __init__.py ├── asgi.py ├── bridge │ ├── __init__.py │ └── graphite.py ├── context_managers.py ├── core.py ├── decorator.py ├── exposition.py ├── gc_collector.py ├── metrics.py ├── metrics_core.py ├── mmap_dict.py ├── multiprocess.py ├── openmetrics │ ├── __init__.py │ ├── exposition.py │ └── parser.py ├── parser.py ├── platform_collector.py ├── process_collector.py ├── py.typed ├── registry.py ├── samples.py ├── twisted │ ├── __init__.py │ └── _exposition.py ├── utils.py ├── validation.py └── values.py ├── pyproject.toml ├── tests ├── __init__.py ├── certs │ ├── cert.pem │ └── key.pem ├── openmetrics │ ├── __init__.py │ ├── test_exposition.py │ └── test_parser.py ├── proc │ ├── 584 │ │ └── stat │ ├── 26231 │ │ ├── fd │ │ │ ├── 0 │ │ │ ├── 1 │ │ │ ├── 2 │ │ │ ├── 3 │ │ │ └── 4 │ │ ├── limits │ │ └── stat │ └── stat ├── test_asgi.py ├── test_core.py ├── test_exposition.py ├── test_gc_collector.py ├── test_graphite_bridge.py ├── test_multiprocess.py ├── test_parser.py ├── test_platform_collector.py ├── test_process_collector.py ├── test_samples.py ├── test_twisted.py └── test_wsgi.py └── tox.ini /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 2.1 3 | 4 | executors: 5 | python: 6 | docker: 7 | - image: cimg/python:3.9 8 | 9 | jobs: 10 | flake8_lint: 11 | executor: python 12 | steps: 13 | - checkout 14 | - run: pip install tox 15 | - run: tox -e flake8 16 | isort_lint: 17 | executor: python 18 | steps: 19 | - checkout 20 | - run: pip install tox 21 | - run: tox -e isort 22 | mypy_lint: 23 | executor: python 24 | steps: 25 | - checkout 26 | - run: pip install tox 27 | - run: tox -e mypy 28 | test: 29 | parameters: 30 | python: 31 | type: string 32 | docker: 33 | - image: cimg/python:<< parameters.python >> 34 | environment: 35 | TOXENV: "py<< parameters.python >>" 36 | steps: 37 | - checkout 38 | - run: echo 'export PATH=$HOME/.local/bin:$PATH' >> $BASH_ENV 39 | - run: pip install --user tox "virtualenv<20.22.0" 40 | - run: tox 41 | test_nooptionals: 42 | parameters: 43 | python: 44 | type: string 45 | docker: 46 | - image: cimg/python:<< parameters.python >> 47 | environment: 48 | TOXENV: "py<< parameters.python >>-nooptionals" 49 | steps: 50 | - checkout 51 | - run: pip install tox 52 | - run: tox 53 | test_pypy: 54 | parameters: 55 | python: 56 | type: string 57 | docker: 58 | - image: pypy:<< parameters.python >> 59 | environment: 60 | TOXENV: "pypy<< parameters.python >>" 61 | steps: 62 | - checkout 63 | - run: pip install tox 64 | - run: tox 65 | 66 | 67 | workflows: 68 | version: 2 69 | client_python: 70 | jobs: 71 | - flake8_lint 72 | - isort_lint 73 | - mypy_lint 74 | - test: 75 | matrix: 76 | parameters: 77 | python: 78 | - "3.9.18" 79 | - "3.10" 80 | - "3.11" 81 | - "3.12" 82 | - "3.13" 83 | - test_nooptionals: 84 | matrix: 85 | parameters: 86 | python: 87 | - "3.9" 88 | - test_pypy: 89 | matrix: 90 | parameters: 91 | python: 92 | - "3.9" 93 | -------------------------------------------------------------------------------- /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | branch = True 3 | source = prometheus_client 4 | omit = 5 | prometheus_client/decorator.py 6 | 7 | [paths] 8 | source = 9 | prometheus_client 10 | .tox/*/lib/python*/site-packages/prometheus_client 11 | .tox/pypy/site-packages/prometheus_client 12 | 13 | [report] 14 | show_missing = True -------------------------------------------------------------------------------- /.github/workflows/github-pages.yaml: -------------------------------------------------------------------------------- 1 | name: Deploy Documentation to Github Pages 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | # Allows you to run this workflow manually from the Actions tab 9 | workflow_dispatch: 10 | 11 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 12 | permissions: 13 | contents: read 14 | pages: write 15 | id-token: write 16 | actions: read 17 | 18 | # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. 19 | # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. 20 | concurrency: 21 | group: "pages" 22 | cancel-in-progress: false 23 | 24 | # Default to bash 25 | defaults: 26 | run: 27 | shell: bash 28 | 29 | jobs: 30 | # Build job 31 | build: 32 | runs-on: ubuntu-latest 33 | env: 34 | HUGO_VERSION: 0.145.0 35 | steps: 36 | - name: Install Hugo CLI 37 | run: | 38 | wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ 39 | && sudo dpkg -i ${{ runner.temp }}/hugo.deb 40 | #- name: Install Dart Sass 41 | # run: sudo snap install dart-sass 42 | - name: Checkout 43 | uses: actions/checkout@v4 44 | with: 45 | submodules: recursive 46 | fetch-depth: 0 47 | - name: Setup Pages 48 | id: pages 49 | uses: actions/configure-pages@v5 50 | - name: Install Node.js dependencies 51 | run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" 52 | working-directory: ./docs 53 | - name: Build with Hugo 54 | env: 55 | # For maximum backward compatibility with Hugo modules 56 | HUGO_ENVIRONMENT: production 57 | HUGO_ENV: production 58 | run: | 59 | hugo \ 60 | --gc \ 61 | --minify \ 62 | --baseURL "${{ steps.pages.outputs.base_url }}/" 63 | working-directory: ./docs 64 | - name: Upload artifact 65 | uses: actions/upload-pages-artifact@v3 66 | with: 67 | path: ./docs/public 68 | 69 | # Deployment job 70 | deploy: 71 | environment: 72 | name: github-pages 73 | url: ${{ steps.deployment.outputs.page_url }} 74 | runs-on: ubuntu-latest 75 | needs: build 76 | steps: 77 | - name: Deploy to GitHub Pages 78 | id: deployment 79 | uses: actions/deploy-pages@v4 80 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | dist 3 | *.egg-info 4 | *.pyc 5 | *.swp 6 | .coverage.* 7 | .coverage 8 | .tox 9 | .*cache 10 | htmlcov -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Prometheus Community Code of Conduct 2 | 3 | Prometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md). 4 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Prometheus uses GitHub to manage reviews of pull requests. 4 | 5 | * If you have a trivial fix or improvement, go ahead and create a pull request, 6 | addressing (with `@...`) the maintainer of this repository (see 7 | [MAINTAINERS.md](MAINTAINERS.md)) in the description of the pull request. 8 | 9 | * If you plan to do something more involved, first discuss your ideas on 10 | [our mailing list]. This will avoid unnecessary work and surely give you and 11 | us a good deal of inspiration. 12 | 13 | * Before your contributions can be landed, they must be signed off under the 14 | [Developer Certificate of Origin] which asserts you own and have the right to 15 | submit the change under the open source licence used by the project. 16 | 17 | ## Testing 18 | 19 | Submitted changes should pass the current tests, and be covered by new test 20 | cases when adding functionality. 21 | 22 | * Run the tests locally using [tox] which executes the full suite on all 23 | supported Python versions installed. 24 | 25 | * Each pull request is gated using [Travis CI] with the results linked on the 26 | github page. This must pass before the change can land, note pushing a new 27 | change will trigger a retest. 28 | 29 | ## Style 30 | 31 | * Code style should follow [PEP 8] generally, and can be checked by running: 32 | ``tox -e flake8``. 33 | 34 | * Import statements can be automatically formatted using [isort]. 35 | 36 | 37 | [our mailing list]: https://groups.google.com/forum/?fromgroups#!forum/prometheus-developers 38 | [Developer Certificate of Origin]: https://github.com/prometheus/prometheus/wiki/DCO-signing 39 | [isort]: https://pypi.org/project/isort/ 40 | [PEP 8]: https://www.python.org/dev/peps/pep-0008/ 41 | [tox]: https://tox.readthedocs.io/en/latest/ 42 | [Travis CI]: https://docs.travis-ci.com/ 43 | -------------------------------------------------------------------------------- /MAINTAINERS.md: -------------------------------------------------------------------------------- 1 | * Chris Marchbanks @csmarchbanks 2 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Prometheus instrumentation library for Python applications 2 | Copyright 2015 The Prometheus Authors 3 | 4 | This product bundles decorator 4.0.10 which is available under a "2-clause BSD" 5 | license. For details, see prometheus_client/decorator.py. 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Prometheus Python Client 2 | 3 | The official Python client for [Prometheus](https://prometheus.io). 4 | 5 | ## Installation 6 | 7 | ``` 8 | pip install prometheus-client 9 | ``` 10 | 11 | This package can be found on [PyPI](https://pypi.python.org/pypi/prometheus_client). 12 | 13 | ## Documentation 14 | 15 | Documentation is available on https://prometheus.github.io/client_python 16 | 17 | ## Links 18 | 19 | * [Releases](https://github.com/prometheus/client_python/releases): The releases page shows the history of the project and acts as a changelog. 20 | * [PyPI](https://pypi.python.org/pypi/prometheus_client) 21 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Reporting a security issue 2 | 3 | The Prometheus security policy, including how to report vulnerabilities, can be 4 | found here: 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | .hugo_build.lock -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Docs 2 | 3 | This directory contains [hugo](https://gohugo.io) documentation to be published in Github pages. 4 | 5 | ## Dependencies 6 | 7 | - [Geekdocs v1.5.0](https://github.com/thegeeklab/hugo-geekdoc/releases/tag/v1.5.0) 8 | - [Hugo v0.145.0](https://github.com/gohugoio/hugo/releases/tag/v0.145.0) 9 | 10 | ## Run Locally 11 | 12 | To serve the documentation locally, run the following command: 13 | 14 | ```shell 15 | hugo server -D 16 | ``` 17 | 18 | This will serve the docs on [http://localhost:1313](http://localhost:1313). 19 | 20 | ## Update Geekdocs 21 | 22 | The docs use the [Geekdocs](https://geekdocs.de/) theme. The theme is checked in to Github in the `./docs/themes/hugo-geekdoc/` folder. To update [Geekdocs](https://geekdocs.de/), remove the current folder and create a new one with the latest [release](https://github.com/thegeeklab/hugo-geekdoc/releases). There are no local modifications in `./docs/themes/hugo-geekdoc/`. 23 | 24 | ```shell 25 | rm -rf ./docs/themes/hugo-geekdoc 26 | mkdir -p themes/hugo-geekdoc/ 27 | curl -L https://github.com/thegeeklab/hugo-geekdoc/releases/latest/download/hugo-geekdoc.tar.gz | tar -xz -C themes/hugo-geekdoc/ --strip-components=1 28 | ``` 29 | 30 | ## Deploy to Github Pages 31 | 32 | Changes to the `master` branch will be deployed automatically with Github actions. 33 | -------------------------------------------------------------------------------- /docs/archetypes/default.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = '{{ replace .File.ContentBaseName "-" " " | title }}' 3 | date = {{ .Date }} 4 | draft = true 5 | +++ 6 | -------------------------------------------------------------------------------- /docs/content/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: client_python 3 | weight: 1 4 | --- 5 | 6 | This tutorial shows the quickest way to get started with the Prometheus Python library. 7 | 8 | **One**: Install the client: 9 | 10 | ```shell 11 | pip install prometheus-client 12 | ``` 13 | 14 | **Two**: Paste the following into a Python interpreter: 15 | 16 | ```python 17 | from prometheus_client import start_http_server, Summary 18 | import random 19 | import time 20 | 21 | # Create a metric to track time spent and requests made. 22 | REQUEST_TIME = Summary('request_processing_seconds', 'Time spent processing request') 23 | 24 | # Decorate function with metric. 25 | @REQUEST_TIME.time() 26 | def process_request(t): 27 | """A dummy function that takes some time.""" 28 | time.sleep(t) 29 | 30 | if __name__ == '__main__': 31 | # Start up the server to expose the metrics. 32 | start_http_server(8000) 33 | # Generate some requests. 34 | while True: 35 | process_request(random.random()) 36 | ``` 37 | 38 | **Three**: Visit [http://localhost:8000/](http://localhost:8000/) to view the metrics. 39 | 40 | From one easy to use decorator you get: 41 | 42 | * `request_processing_seconds_count`: Number of times this function was called. 43 | * `request_processing_seconds_sum`: Total amount of time spent in this function. 44 | 45 | Prometheus's `rate` function allows calculation of both requests per second, 46 | and latency over time from this data. 47 | 48 | In addition if you're on Linux the `process` metrics expose CPU, memory and 49 | other information about the process for free! 50 | -------------------------------------------------------------------------------- /docs/content/bridges/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Bridges 3 | weight: 5 4 | --- 5 | 6 | It is also possible to expose metrics to systems other than Prometheus. 7 | This allows you to take advantage of Prometheus instrumentation even 8 | if you are not quite ready to fully transition to Prometheus yet. -------------------------------------------------------------------------------- /docs/content/bridges/graphite.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Graphite 3 | weight: 1 4 | --- 5 | 6 | Metrics are pushed over TCP in the Graphite plaintext format. 7 | 8 | ```python 9 | from prometheus_client.bridge.graphite import GraphiteBridge 10 | 11 | gb = GraphiteBridge(('graphite.your.org', 2003)) 12 | # Push once. 13 | gb.push() 14 | # Push every 10 seconds in a daemon thread. 15 | gb.start(10.0) 16 | ``` 17 | 18 | Graphite [tags](https://grafana.com/blog/2018/01/11/graphite-1.1-teaching-an-old-dog-new-tricks/) are also supported. 19 | 20 | ```python 21 | from prometheus_client.bridge.graphite import GraphiteBridge 22 | 23 | gb = GraphiteBridge(('graphite.your.org', 2003), tags=True) 24 | c = Counter('my_requests_total', 'HTTP Failures', ['method', 'endpoint']) 25 | c.labels('get', '/').inc() 26 | gb.push() 27 | ``` -------------------------------------------------------------------------------- /docs/content/collector/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Collector 3 | weight: 3 4 | --- 5 | 6 | # Process Collector 7 | 8 | The Python client automatically exports metrics about process CPU usage, RAM, 9 | file descriptors and start time. These all have the prefix `process`, and 10 | are only currently available on Linux. 11 | 12 | The namespace and pid constructor arguments allows for exporting metrics about 13 | other processes, for example: 14 | ``` 15 | ProcessCollector(namespace='mydaemon', pid=lambda: open('/var/run/daemon.pid').read()) 16 | ``` 17 | 18 | # Platform Collector 19 | 20 | The client also automatically exports some metadata about Python. If using Jython, 21 | metadata about the JVM in use is also included. This information is available as 22 | labels on the `python_info` metric. The value of the metric is 1, since it is the 23 | labels that carry information. 24 | 25 | # Disabling Default Collector metrics 26 | 27 | By default the collected `process`, `gc`, and `platform` collector metrics are exported. 28 | If this information is not helpful, it can be disabled using the following: 29 | 30 | ```python 31 | import prometheus_client 32 | 33 | prometheus_client.REGISTRY.unregister(prometheus_client.GC_COLLECTOR) 34 | prometheus_client.REGISTRY.unregister(prometheus_client.PLATFORM_COLLECTOR) 35 | prometheus_client.REGISTRY.unregister(prometheus_client.PROCESS_COLLECTOR) 36 | ``` -------------------------------------------------------------------------------- /docs/content/collector/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Custom Collectors 3 | weight: 1 4 | --- 5 | 6 | Sometimes it is not possible to directly instrument code, as it is not 7 | in your control. This requires you to proxy metrics from other systems. 8 | 9 | To do so you need to create a custom collector, for example: 10 | 11 | ```python 12 | from prometheus_client.core import GaugeMetricFamily, CounterMetricFamily, REGISTRY 13 | from prometheus_client.registry import Collector 14 | 15 | class CustomCollector(Collector): 16 | def collect(self): 17 | yield GaugeMetricFamily('my_gauge', 'Help text', value=7) 18 | c = CounterMetricFamily('my_counter_total', 'Help text', labels=['foo']) 19 | c.add_metric(['bar'], 1.7) 20 | c.add_metric(['baz'], 3.8) 21 | yield c 22 | 23 | REGISTRY.register(CustomCollector()) 24 | ``` 25 | 26 | `SummaryMetricFamily`, `HistogramMetricFamily` and `InfoMetricFamily` work similarly. 27 | 28 | A collector may implement a `describe` method which returns metrics in the same 29 | format as `collect` (though you don't have to include the samples). This is 30 | used to predetermine the names of time series a `CollectorRegistry` exposes and 31 | thus to detect collisions and duplicate registrations. 32 | 33 | Usually custom collectors do not have to implement `describe`. If `describe` is 34 | not implemented and the CollectorRegistry was created with `auto_describe=True` 35 | (which is the case for the default registry) then `collect` will be called at 36 | registration time instead of `describe`. If this could cause problems, either 37 | implement a proper `describe`, or if that's not practical have `describe` 38 | return an empty list. -------------------------------------------------------------------------------- /docs/content/exporting/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Exporting 3 | weight: 4 4 | --- 5 | 6 | There are several options for exporting metrics. 7 | -------------------------------------------------------------------------------- /docs/content/exporting/http/asgi.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: ASGI 3 | weight: 3 4 | --- 5 | 6 | To use Prometheus with [ASGI](http://asgi.readthedocs.org/en/latest/), there is 7 | `make_asgi_app` which creates an ASGI application. 8 | 9 | ```python 10 | from prometheus_client import make_asgi_app 11 | 12 | app = make_asgi_app() 13 | ``` 14 | Such an application can be useful when integrating Prometheus metrics with ASGI 15 | apps. 16 | 17 | By default, the ASGI application will respect `Accept-Encoding:gzip` headers used by Prometheus 18 | and compress the response if such a header is present. This behaviour can be disabled by passing 19 | `disable_compression=True` when creating the app, like this: 20 | 21 | ```python 22 | app = make_asgi_app(disable_compression=True) 23 | ``` 24 | -------------------------------------------------------------------------------- /docs/content/exporting/http/fastapi-gunicorn.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: FastAPI + Gunicorn 3 | weight: 5 4 | --- 5 | 6 | To use Prometheus with [FastAPI](https://fastapi.tiangolo.com/) and [Gunicorn](https://gunicorn.org/) we need to serve metrics through a Prometheus ASGI application. 7 | 8 | Save the snippet below in a `myapp.py` file 9 | 10 | ```python 11 | from fastapi import FastAPI 12 | from prometheus_client import make_asgi_app 13 | 14 | # Create app 15 | app = FastAPI(debug=False) 16 | 17 | # Add prometheus asgi middleware to route /metrics requests 18 | metrics_app = make_asgi_app() 19 | app.mount("/metrics", metrics_app) 20 | ``` 21 | 22 | For Multiprocessing support, use this modified code snippet. Full multiprocessing instructions are provided [here]({{< ref "/multiprocess" >}}). 23 | 24 | ```python 25 | from fastapi import FastAPI 26 | from prometheus_client import make_asgi_app 27 | 28 | app = FastAPI(debug=False) 29 | 30 | # Using multiprocess collector for registry 31 | def make_metrics_app(): 32 | registry = CollectorRegistry() 33 | multiprocess.MultiProcessCollector(registry) 34 | return make_asgi_app(registry=registry) 35 | 36 | 37 | metrics_app = make_metrics_app() 38 | app.mount("/metrics", metrics_app) 39 | ``` 40 | 41 | Run the example web application like this 42 | 43 | ```bash 44 | # Install gunicorn if you do not have it 45 | pip install gunicorn 46 | # If using multiple workers, add `--workers n` parameter to the line below 47 | gunicorn -b 127.0.0.1:8000 myapp:app -k uvicorn.workers.UvicornWorker 48 | ``` 49 | 50 | Visit http://localhost:8000/metrics to see the metrics 51 | -------------------------------------------------------------------------------- /docs/content/exporting/http/flask.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Flask 3 | weight: 4 4 | --- 5 | 6 | To use Prometheus with [Flask](http://flask.pocoo.org/) we need to serve metrics through a Prometheus WSGI application. This can be achieved using [Flask's application dispatching](http://flask.pocoo.org/docs/latest/patterns/appdispatch/). Below is a working example. 7 | 8 | Save the snippet below in a `myapp.py` file 9 | 10 | ```python 11 | from flask import Flask 12 | from werkzeug.middleware.dispatcher import DispatcherMiddleware 13 | from prometheus_client import make_wsgi_app 14 | 15 | # Create my app 16 | app = Flask(__name__) 17 | 18 | # Add prometheus wsgi middleware to route /metrics requests 19 | app.wsgi_app = DispatcherMiddleware(app.wsgi_app, { 20 | '/metrics': make_wsgi_app() 21 | }) 22 | ``` 23 | 24 | Run the example web application like this 25 | 26 | ```bash 27 | # Install uwsgi if you do not have it 28 | pip install uwsgi 29 | uwsgi --http 127.0.0.1:8000 --wsgi-file myapp.py --callable app 30 | ``` 31 | 32 | Visit http://localhost:8000/metrics to see the metrics -------------------------------------------------------------------------------- /docs/content/exporting/http/twisted.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Twisted 3 | weight: 1 4 | --- 5 | 6 | To use prometheus with [twisted](https://twistedmatrix.com/), there is `MetricsResource` which exposes metrics as a twisted resource. 7 | 8 | ```python 9 | from prometheus_client.twisted import MetricsResource 10 | from twisted.web.server import Site 11 | from twisted.web.resource import Resource 12 | from twisted.internet import reactor 13 | 14 | root = Resource() 15 | root.putChild(b'metrics', MetricsResource()) 16 | 17 | factory = Site(root) 18 | reactor.listenTCP(8000, factory) 19 | reactor.run() 20 | ``` -------------------------------------------------------------------------------- /docs/content/exporting/http/wsgi.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: WSGI 3 | weight: 2 4 | --- 5 | 6 | To use Prometheus with [WSGI](http://wsgi.readthedocs.org/en/latest/), there is 7 | `make_wsgi_app` which creates a WSGI application. 8 | 9 | ```python 10 | from prometheus_client import make_wsgi_app 11 | from wsgiref.simple_server import make_server 12 | 13 | app = make_wsgi_app() 14 | httpd = make_server('', 8000, app) 15 | httpd.serve_forever() 16 | ``` 17 | 18 | Such an application can be useful when integrating Prometheus metrics with WSGI 19 | apps. 20 | 21 | The method `start_wsgi_server` can be used to serve the metrics through the 22 | WSGI reference implementation in a new thread. 23 | 24 | ```python 25 | from prometheus_client import start_wsgi_server 26 | 27 | start_wsgi_server(8000) 28 | ``` 29 | 30 | By default, the WSGI application will respect `Accept-Encoding:gzip` headers used by Prometheus 31 | and compress the response if such a header is present. This behaviour can be disabled by passing 32 | `disable_compression=True` when creating the app, like this: 33 | 34 | ```python 35 | app = make_wsgi_app(disable_compression=True) 36 | ``` -------------------------------------------------------------------------------- /docs/content/exporting/textfile.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Node exporter textfile collector 3 | weight: 2 4 | --- 5 | 6 | The [textfile collector](https://github.com/prometheus/node_exporter#textfile-collector) 7 | allows machine-level statistics to be exported out via the Node exporter. 8 | 9 | This is useful for monitoring cronjobs, or for writing cronjobs to expose metrics 10 | about a machine system that the Node exporter does not support or would not make sense 11 | to perform at every scrape (for example, anything involving subprocesses). 12 | 13 | ```python 14 | from prometheus_client import CollectorRegistry, Gauge, write_to_textfile 15 | 16 | registry = CollectorRegistry() 17 | g = Gauge('raid_status', '1 if raid array is okay', registry=registry) 18 | g.set(1) 19 | write_to_textfile('/configured/textfile/path/raid.prom', registry) 20 | ``` 21 | 22 | A separate registry is used, as the default registry may contain other metrics 23 | such as those from the Process Collector. -------------------------------------------------------------------------------- /docs/content/instrumenting/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Instrumenting 3 | weight: 2 4 | --- 5 | 6 | Four types of metric are offered: Counter, Gauge, Summary and Histogram. 7 | See the documentation on [metric types](http://prometheus.io/docs/concepts/metric_types/) 8 | and [instrumentation best practices](https://prometheus.io/docs/practices/instrumentation/#counter-vs-gauge-summary-vs-histogram) 9 | on how to use them. 10 | 11 | ## Disabling `_created` metrics 12 | 13 | By default counters, histograms, and summaries export an additional series 14 | suffixed with `_created` and a value of the unix timestamp for when the metric 15 | was created. If this information is not helpful, it can be disabled by setting 16 | the environment variable `PROMETHEUS_DISABLE_CREATED_SERIES=True` or in code: 17 | ```python 18 | from prometheus_client import disable_created_metrics 19 | disable_created_metrics() 20 | ``` 21 | -------------------------------------------------------------------------------- /docs/content/instrumenting/counter.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Counter 3 | weight: 1 4 | --- 5 | 6 | Counters go up, and reset when the process restarts. 7 | 8 | 9 | ```python 10 | from prometheus_client import Counter 11 | c = Counter('my_failures', 'Description of counter') 12 | c.inc() # Increment by 1 13 | c.inc(1.6) # Increment by given value 14 | ``` 15 | 16 | If there is a suffix of `_total` on the metric name, it will be removed. When 17 | exposing the time series for counter, a `_total` suffix will be added. This is 18 | for compatibility between OpenMetrics and the Prometheus text format, as OpenMetrics 19 | requires the `_total` suffix. 20 | 21 | There are utilities to count exceptions raised: 22 | 23 | ```python 24 | @c.count_exceptions() 25 | def f(): 26 | pass 27 | 28 | with c.count_exceptions(): 29 | pass 30 | 31 | # Count only one type of exception 32 | with c.count_exceptions(ValueError): 33 | pass 34 | ``` -------------------------------------------------------------------------------- /docs/content/instrumenting/enum.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Enum 3 | weight: 6 4 | --- 5 | 6 | Enum tracks which of a set of states something is currently in. 7 | 8 | ```python 9 | from prometheus_client import Enum 10 | e = Enum('my_task_state', 'Description of enum', 11 | states=['starting', 'running', 'stopped']) 12 | e.state('running') 13 | ``` -------------------------------------------------------------------------------- /docs/content/instrumenting/exemplars.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Exemplars 3 | weight: 8 4 | --- 5 | 6 | Exemplars can be added to counter and histogram metrics. Exemplars can be 7 | specified by passing a dict of label value pairs to be exposed as the exemplar. 8 | For example with a counter: 9 | 10 | ```python 11 | from prometheus_client import Counter 12 | c = Counter('my_requests_total', 'HTTP Failures', ['method', 'endpoint']) 13 | c.labels('get', '/').inc(exemplar={'trace_id': 'abc123'}) 14 | c.labels('post', '/submit').inc(1.0, {'trace_id': 'def456'}) 15 | ``` 16 | 17 | And with a histogram: 18 | 19 | ```python 20 | from prometheus_client import Histogram 21 | h = Histogram('request_latency_seconds', 'Description of histogram') 22 | h.observe(4.7, {'trace_id': 'abc123'}) 23 | ``` 24 | 25 | Exemplars are only rendered in the OpenMetrics exposition format. If using the 26 | HTTP server or apps in this library, content negotiation can be used to specify 27 | OpenMetrics (which is done by default in Prometheus). Otherwise it will be 28 | necessary to use `generate_latest` from 29 | `prometheus_client.openmetrics.exposition` to view exemplars. 30 | 31 | To view exemplars in Prometheus it is also necessary to enable the the 32 | exemplar-storage feature flag: 33 | ``` 34 | --enable-feature=exemplar-storage 35 | ``` 36 | Additional information is available in [the Prometheus 37 | documentation](https://prometheus.io/docs/prometheus/latest/feature_flags/#exemplars-storage). 38 | -------------------------------------------------------------------------------- /docs/content/instrumenting/gauge.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Gauge 3 | weight: 2 4 | --- 5 | 6 | Gauges can go up and down. 7 | 8 | ```python 9 | from prometheus_client import Gauge 10 | g = Gauge('my_inprogress_requests', 'Description of gauge') 11 | g.inc() # Increment by 1 12 | g.dec(10) # Decrement by given value 13 | g.set(4.2) # Set to a given value 14 | ``` 15 | 16 | There are utilities for common use cases: 17 | 18 | ```python 19 | g.set_to_current_time() # Set to current unixtime 20 | 21 | # Increment when entered, decrement when exited. 22 | @g.track_inprogress() 23 | def f(): 24 | pass 25 | 26 | with g.track_inprogress(): 27 | pass 28 | ``` 29 | 30 | A Gauge can also take its value from a callback: 31 | 32 | ```python 33 | d = Gauge('data_objects', 'Number of objects') 34 | my_dict = {} 35 | d.set_function(lambda: len(my_dict)) 36 | ``` -------------------------------------------------------------------------------- /docs/content/instrumenting/histogram.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Histogram 3 | weight: 4 4 | --- 5 | 6 | Histograms track the size and number of events in buckets. 7 | This allows for aggregatable calculation of quantiles. 8 | 9 | ```python 10 | from prometheus_client import Histogram 11 | h = Histogram('request_latency_seconds', 'Description of histogram') 12 | h.observe(4.7) # Observe 4.7 (seconds in this case) 13 | ``` 14 | 15 | The default buckets are intended to cover a typical web/rpc request from milliseconds to seconds. 16 | They can be overridden by passing `buckets` keyword argument to `Histogram`. 17 | 18 | There are utilities for timing code: 19 | 20 | ```python 21 | @h.time() 22 | def f(): 23 | pass 24 | 25 | with h.time(): 26 | pass 27 | ``` -------------------------------------------------------------------------------- /docs/content/instrumenting/info.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Info 3 | weight: 5 4 | --- 5 | 6 | Info tracks key-value information, usually about a whole target. 7 | 8 | ```python 9 | from prometheus_client import Info 10 | i = Info('my_build_version', 'Description of info') 11 | i.info({'version': '1.2.3', 'buildhost': 'foo@bar'}) 12 | ``` 13 | -------------------------------------------------------------------------------- /docs/content/instrumenting/labels.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Labels 3 | weight: 7 4 | --- 5 | 6 | All metrics can have labels, allowing grouping of related time series. 7 | 8 | See the best practices on [naming](http://prometheus.io/docs/practices/naming/) 9 | and [labels](http://prometheus.io/docs/practices/instrumentation/#use-labels). 10 | 11 | Taking a counter as an example: 12 | 13 | ```python 14 | from prometheus_client import Counter 15 | c = Counter('my_requests_total', 'HTTP Failures', ['method', 'endpoint']) 16 | c.labels('get', '/').inc() 17 | c.labels('post', '/submit').inc() 18 | ``` 19 | 20 | Labels can also be passed as keyword-arguments: 21 | 22 | ```python 23 | from prometheus_client import Counter 24 | c = Counter('my_requests_total', 'HTTP Failures', ['method', 'endpoint']) 25 | c.labels(method='get', endpoint='/').inc() 26 | c.labels(method='post', endpoint='/submit').inc() 27 | ``` 28 | 29 | Metrics with labels are not initialized when declared, because the client can't 30 | know what values the label can have. It is recommended to initialize the label 31 | values by calling the `.labels()` method alone: 32 | 33 | ```python 34 | from prometheus_client import Counter 35 | c = Counter('my_requests_total', 'HTTP Failures', ['method', 'endpoint']) 36 | c.labels('get', '/') 37 | c.labels('post', '/submit') 38 | ``` -------------------------------------------------------------------------------- /docs/content/instrumenting/summary.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Summary 3 | weight: 3 4 | --- 5 | 6 | Summaries track the size and number of events. 7 | 8 | ```python 9 | from prometheus_client import Summary 10 | s = Summary('request_latency_seconds', 'Description of summary') 11 | s.observe(4.7) # Observe 4.7 (seconds in this case) 12 | ``` 13 | 14 | There are utilities for timing code: 15 | 16 | ```python 17 | @s.time() 18 | def f(): 19 | pass 20 | 21 | with s.time(): 22 | pass 23 | ``` 24 | 25 | The Python client doesn't store or expose quantile information at this time. -------------------------------------------------------------------------------- /docs/content/parser/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Parser 3 | weight: 6 4 | --- 5 | 6 | The Python client supports parsing the Prometheus text format. 7 | This is intended for advanced use cases where you have servers 8 | exposing Prometheus metrics and need to get them into some other 9 | system. 10 | 11 | ```python 12 | from prometheus_client.parser import text_string_to_metric_families 13 | for family in text_string_to_metric_families(u"my_gauge 1.0\n"): 14 | for sample in family.samples: 15 | print("Name: {0} Labels: {1} Value: {2}".format(*sample)) 16 | ``` -------------------------------------------------------------------------------- /docs/content/restricted-registry/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Restricted registry 3 | weight: 7 4 | --- 5 | 6 | Registries support restriction to only return specific metrics. 7 | If you’re using the built-in HTTP server, you can use the GET parameter "name[]", since it’s an array it can be used multiple times. 8 | If you’re directly using `generate_latest`, you can use the function `restricted_registry()`. 9 | 10 | ```python 11 | curl --get --data-urlencode "name[]=python_gc_objects_collected_total" --data-urlencode "name[]=python_info" http://127.0.0.1:9200/metrics 12 | ``` 13 | 14 | ```python 15 | from prometheus_client import generate_latest 16 | 17 | generate_latest(REGISTRY.restricted_registry(['python_gc_objects_collected_total', 'python_info'])) 18 | ``` 19 | 20 | ```python 21 | # HELP python_info Python platform information 22 | # TYPE python_info gauge 23 | python_info{implementation="CPython",major="3",minor="9",patchlevel="3",version="3.9.3"} 1.0 24 | # HELP python_gc_objects_collected_total Objects collected during gc 25 | # TYPE python_gc_objects_collected_total counter 26 | python_gc_objects_collected_total{generation="0"} 73129.0 27 | python_gc_objects_collected_total{generation="1"} 8594.0 28 | python_gc_objects_collected_total{generation="2"} 296.0 29 | ``` -------------------------------------------------------------------------------- /docs/data/menu/extra.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | header: 3 | - name: GitHub 4 | ref: https://github.com/prometheus/client_python 5 | icon: gdoc_github 6 | external: true 7 | -------------------------------------------------------------------------------- /docs/data/menu/more.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | more: 3 | - name: Releases 4 | ref: "https://github.com/prometheus/client_python/releases" 5 | external: true 6 | icon: "gdoc_download" 7 | - name: GitHub 8 | ref: "https://github.com/prometheus/client_python" 9 | external: true 10 | icon: "gdoc_github" 11 | - name: PyPi 12 | ref: "https://pypi.python.org/pypi/prometheus_client" 13 | icon: "gdoc_link" 14 | external: true 15 | -------------------------------------------------------------------------------- /docs/static/.gitignore: -------------------------------------------------------------------------------- 1 | api 2 | -------------------------------------------------------------------------------- /docs/static/brand.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | image/svg+xml -------------------------------------------------------------------------------- /docs/static/custom.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Didn't find much time to create a theme yet, 3 | * so there are just a few non-default settings for now. 4 | */ 5 | :root, 6 | :root[color-theme="light"] { 7 | --header-background: #222222; 8 | --footer-background: #e6522c; 9 | --footer-link-color: #ffffff; 10 | --footer-link-color-visited: #ffffff; 11 | } 12 | 13 | @media (prefers-color-scheme: light) { 14 | :root { 15 | --header-background: #222222; 16 | --footer-background: #e6522c; 17 | --footer-link-color: #ffffff; 18 | --footer-link-color-visited: #ffffff; 19 | } 20 | } 21 | 22 | :root[color-theme="dark"] 23 | { 24 | --header-background: #111c24; 25 | --body-background: #1f1f21; 26 | --footer-background: #e6522c; 27 | --footer-link-color: #ffffff; 28 | --footer-link-color-visited: #ffffff; 29 | } 30 | 31 | @media (prefers-color-scheme: dark) { 32 | :root { 33 | --header-background: #111c24; 34 | --body-background: #1f1f21; 35 | --footer-background: #e6522c; 36 | --footer-link-color: #ffffff; 37 | --footer-link-color-visited: #ffffff; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /docs/static/favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/static/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /docs/static/favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/static/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /docs/static/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/static/favicon/favicon.ico -------------------------------------------------------------------------------- /docs/static/favicon/favicon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | image/svg+xml -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/.nvmrc: -------------------------------------------------------------------------------- 1 | lts/* 2 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Robert Kaussow 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice (including the next 13 | paragraph) shall be included in all copies or substantial portions of the 14 | Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS 19 | OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 21 | OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/VERSION: -------------------------------------------------------------------------------- 1 | v1.5.0 2 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/archetypes/docs.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ .Name | humanize | title }}" 3 | weight: 1 4 | # geekdocFlatSection: false 5 | # geekdocToc: 6 6 | # geekdocHidden: false 7 | --- 8 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/archetypes/posts.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ replace .Name "-" " " | title }}" 3 | date: {{ .Date }} 4 | --- 5 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/assets/search/config.json: -------------------------------------------------------------------------------- 1 | {{- $searchDataFile := printf "search/%s.data.json" .Language.Lang -}} 2 | {{- $searchData := resources.Get "search/data.json" | resources.ExecuteAsTemplate $searchDataFile . | resources.Minify -}} 3 | { 4 | "dataFile": {{ $searchData.RelPermalink | jsonify }}, 5 | "indexConfig": {{ .Site.Params.geekdocSearchConfig | jsonify }}, 6 | "showParent": {{ if .Site.Params.geekdocSearchShowParent }}true{{ else }}false{{ end }}, 7 | "showDescription": {{ if .Site.Params.geekdocSearchshowDescription }}true{{ else }}false{{ end }} 8 | } 9 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/assets/search/data.json: -------------------------------------------------------------------------------- 1 | [ 2 | {{ range $index, $page := (where .Site.Pages "Params.geekdocProtected" "ne" true) }} 3 | {{ if ne $index 0 }},{{ end }} 4 | { 5 | "id": {{ $index }}, 6 | "href": "{{ $page.RelPermalink }}", 7 | "title": {{ (partial "utils/title" $page) | jsonify }}, 8 | "parent": {{ with $page.Parent }}{{ (partial "utils/title" .) | jsonify }}{{ else }}""{{ end }}, 9 | "content": {{ $page.Plain | jsonify }}, 10 | "description": {{ $page.Summary | plainify | jsonify }} 11 | } 12 | {{ end }} 13 | ] 14 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/eslint.config.js: -------------------------------------------------------------------------------- 1 | import eslint from "@eslint/js"; 2 | import globals from "globals"; 3 | import babelParser from "@babel/eslint-parser"; 4 | import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"; 5 | 6 | export default [ 7 | eslint.configs.recommended, 8 | { 9 | languageOptions: { 10 | globals: { 11 | ...globals.browser, 12 | }, 13 | parser: babelParser, 14 | ecmaVersion: 2022, 15 | sourceType: "module", 16 | parserOptions: { 17 | requireConfigFile: false, 18 | }, 19 | }, 20 | }, 21 | eslintPluginPrettierRecommended, 22 | ]; 23 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/i18n/am.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | edit_page: ገጹን ማስተካከያ 3 | 4 | nav_navigation: መሄጃ 5 | nav_tags: መለያዎች 6 | nav_more: ተጨማሪ 7 | nav_top: ወደ ላይ ተመለስ 8 | 9 | form_placeholder_search: ፈልግ 10 | 11 | error_page_title: ጠፋብዎት? አይጨነቁ። 12 | error_message_title: ጠፋብዎት? 13 | error_message_code: አልተገኘም 14 | error_message_text: > 15 | ገጹን ማግኘት አልተቻለም፤ ነገር ግን አይጨነቁ፤ በዚህ ገጽ መመለስ ይችላሉ። 16 | 17 | button_toggle_dark: ብሩህ/ጨለማ መቀያየሪያ 18 | button_nav_open: መሄጃውን ክፈት 19 | button_nav_close: መሄጃውን ዝጋ 20 | button_menu_open: ምርጫዎችን ክፈት 21 | button_menu_close: ምርጫዎችን ዝጋ 22 | button_homepage: ወደ መጀመሪያ ገጽ ተመለስ 23 | 24 | title_anchor_prefix: "ማያያዣ ወደ:" 25 | 26 | posts_read_more: ሙሉውን ያንብቡ 27 | posts_read_time: 28 | one: "ለማንበብ አንድ ደቂቃ" 29 | other: "{{ . }} ደቂቃዎች ለማንበብ" 30 | posts_update_prefix: መጨረሻ የዘመነው 31 | posts_count: 32 | one: "አንድ ጽሑፍ" 33 | other: "{{ . }} ጽሑፎች" 34 | posts_tagged_with: ከ '{{ . }}' ጋር የተዛመዱ ጽሑፎች በሙሉ 35 | 36 | footer_build_with: > 37 | በ Hugo የተገነባ ከ 38 | ጋር 39 | footer_legal_notice: ሕጋዊ መረጃዎች 40 | footer_privacy_policy: ስለ መረጃዎ አያያዝ ያለን አቋም 41 | footer_content_license_prefix: > 42 | ስለ ይዘቱ ባለመብትነት መረጃ 43 | 44 | language_switch_no_tranlation_prefix: "ያልተተረጐመ ገጽ:" 45 | 46 | propertylist_required: ግድ የሚያስፈልግ 47 | propertylist_optional: ግድ ያልሆነ 48 | propertylist_default: በባዶ ፈንታ 49 | 50 | pagination_page_prev: ያለፈው 51 | pagination_page_next: ቀጣይ 52 | pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" 53 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/i18n/cs.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | edit_page: Upravit stránku 3 | 4 | nav_navigation: Navigace 5 | nav_tags: Tagy 6 | nav_more: Více 7 | nav_top: Zpět nahoru 8 | 9 | form_placeholder_search: Vyhledat 10 | 11 | error_page_title: Ztracen? Nic se neděje 12 | error_message_title: Ztracen? 13 | error_message_code: Error 404 14 | error_message_text: > 15 | Vypadá to že stránka, kterou hledáte, neexistuje. Nemějte obavy, můžete 16 | se vrátit zpět na domovskou stránku. 17 | 18 | button_toggle_dark: Přepnout tmavý/světlý/automatický režim 19 | button_nav_open: Otevřít navigaci 20 | button_nav_close: Zavřít navigaci 21 | button_menu_open: Otevřít lištu nabídky 22 | button_menu_close: Zavřít lištu nabídky 23 | button_homepage: Zpět na domovskou stránku 24 | 25 | title_anchor_prefix: "Odkaz na:" 26 | 27 | posts_read_more: Přečíst celý příspěvek 28 | posts_read_time: 29 | one: "Doba čtení: 1 minuta" 30 | other: "Doba čtení: {{ . }} minut(y)" 31 | posts_update_prefix: Naposledy upraveno 32 | posts_count: 33 | one: "Jeden příspěvek" 34 | other: "Příspěvků: {{ . }}" 35 | posts_tagged_with: Všechny příspěvky označeny '{{ . }}' 36 | 37 | footer_build_with: > 38 | Vytvořeno za pomocí Hugo a 39 | 40 | footer_legal_notice: Právní upozornění 41 | footer_privacy_policy: Zásady ochrany soukromí 42 | footer_content_license_prefix: > 43 | Obsah licencovaný pod 44 | 45 | language_switch_no_tranlation_prefix: "Stránka není přeložena:" 46 | 47 | propertylist_required: povinné 48 | propertylist_optional: volitené 49 | propertylist_default: výchozí 50 | 51 | pagination_page_prev: předchozí 52 | pagination_page_next: další 53 | pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" 54 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/i18n/da.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | edit_page: Rediger side 3 | 4 | nav_navigation: Navigation 5 | nav_tags: Tags 6 | nav_more: Mere 7 | nav_top: Til toppen 8 | 9 | form_placeholder_search: Søg 10 | 11 | error_page_title: Faret vild? Bare rolig 12 | error_message_title: Lost? 13 | error_message_code: Fejl 404 14 | error_message_text: > 15 | Det du leder efter kan ikke findes. Bare rolig, du kan komme tilbage til 16 | forsiden. 17 | 18 | button_toggle_dark: Skift Dark/Light/Auto mode 19 | button_nav_open: Åben navigation 20 | button_nav_close: Luk navigation 21 | button_menu_open: Åben menubar 22 | button_menu_close: Luk menubar 23 | button_homepage: Tilbage til forsiden 24 | 25 | title_anchor_prefix: "Link til:" 26 | 27 | posts_read_more: Læs fulde indlæg 28 | posts_read_time: 29 | one: "Et minut at gennemlæse" 30 | other: "{{ . }} minutter at gennemlæse" 31 | posts_update_prefix: Opdateret den 32 | posts_count: 33 | one: "Et indlæg" 34 | other: "{{ . }} indlæg" 35 | posts_tagged_with: Alle indslag tagget med '{{ . }}' 36 | 37 | footer_build_with: > 38 | Bygget med Hugo og 39 | 40 | footer_legal_notice: Forretningsbetingelser 41 | footer_privacy_policy: Privatlivspolitik 42 | footer_content_license_prefix: > 43 | Indhold licenseret under 44 | 45 | language_switch_no_tranlation_prefix: "Indlæg ikke oversat:" 46 | 47 | propertylist_required: påkrævet 48 | propertylist_optional: valgfri 49 | propertylist_default: udgangspunkt 50 | 51 | pagination_page_prev: forrige 52 | pagination_page_next: næste 53 | pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" 54 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/i18n/de.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | edit_page: Seite bearbeiten 3 | 4 | nav_navigation: Navigation 5 | nav_tags: Tags 6 | nav_more: Weitere 7 | nav_top: Nach oben 8 | 9 | form_placeholder_search: Suchen 10 | 11 | error_page_title: Verlaufen? Keine Sorge 12 | error_message_title: Verlaufen? 13 | error_message_code: Fehler 404 14 | error_message_text: > 15 | Wir können die Seite nach der Du gesucht hast leider nicht finden. Keine Sorge, 16 | wir bringen Dich zurück zur Startseite. 17 | 18 | button_toggle_dark: Wechsel zwischen Dunkel/Hell/Auto Modus 19 | button_nav_open: Navigation öffnen 20 | button_nav_close: Navigation schließen 21 | button_menu_open: Menüband öffnen 22 | button_menu_close: Menüband schließen 23 | button_homepage: Zurück zur Startseite 24 | 25 | title_anchor_prefix: "Link zu:" 26 | 27 | posts_read_more: Ganzen Artikel lesen 28 | posts_read_time: 29 | one: "Eine Minute Lesedauer" 30 | other: "{{ . }} Minuten Lesedauer" 31 | posts_update_prefix: Aktualisiert am 32 | posts_count: 33 | one: "Ein Artikel" 34 | other: "{{ . }} Artikel" 35 | posts_tagged_with: Alle Artikel mit dem Tag '{{ . }}' 36 | 37 | footer_build_with: > 38 | Entwickelt mit Hugo und 39 | 40 | footer_legal_notice: Impressum 41 | footer_privacy_policy: Datenschutzerklärung 42 | footer_content_license_prefix: > 43 | Inhalt lizensiert unter 44 | 45 | language_switch_no_tranlation_prefix: "Seite nicht übersetzt:" 46 | 47 | propertylist_required: erforderlich 48 | propertylist_optional: optional 49 | propertylist_default: Standardwert 50 | 51 | pagination_page_prev: vorher 52 | pagination_page_next: weiter 53 | pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" 54 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/i18n/en.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | edit_page: Edit page 3 | 4 | nav_navigation: Navigation 5 | nav_tags: Tags 6 | nav_more: More 7 | nav_top: Back to top 8 | 9 | form_placeholder_search: Search 10 | 11 | error_page_title: Lost? Don't worry 12 | error_message_title: Lost? 13 | error_message_code: Error 404 14 | error_message_text: > 15 | Seems like what you are looking for can't be found. Don't worry, we can 16 | bring you back to the homepage. 17 | 18 | button_toggle_dark: Toggle Dark/Light/Auto mode 19 | button_nav_open: Open Navigation 20 | button_nav_close: Close Navigation 21 | button_menu_open: Open Menu Bar 22 | button_menu_close: Close Menu Bar 23 | button_homepage: Back to homepage 24 | 25 | title_anchor_prefix: "Anchor to:" 26 | 27 | posts_read_more: Read full post 28 | posts_read_time: 29 | one: "One minute to read" 30 | other: "{{ . }} minutes to read" 31 | posts_update_prefix: Updated on 32 | posts_count: 33 | one: "One post" 34 | other: "{{ . }} posts" 35 | posts_tagged_with: All posts tagged with '{{ . }}' 36 | 37 | footer_build_with: > 38 | Built with Hugo and 39 | 40 | footer_legal_notice: Legal Notice 41 | footer_privacy_policy: Privacy Policy 42 | footer_content_license_prefix: > 43 | Content licensed under 44 | 45 | language_switch_no_tranlation_prefix: "Page not translated:" 46 | 47 | propertylist_required: required 48 | propertylist_optional: optional 49 | propertylist_default: default 50 | 51 | pagination_page_prev: prev 52 | pagination_page_next: next 53 | pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" 54 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/i18n/es.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | edit_page: Editar página 3 | 4 | nav_navigation: Navegación 5 | nav_tags: Etiquetas 6 | nav_more: Más 7 | nav_top: Inicio de la página 8 | 9 | form_placeholder_search: Buscar 10 | 11 | error_page_title: Perdido? No te preocupes 12 | error_message_title: Perdido? 13 | error_message_code: Error 404 14 | error_message_text: > 15 | Al parecer, lo que estás buscando no pudo ser encontrado. No te preocupes, podemos 16 | llevarte de vuelta al inicio. 17 | 18 | button_toggle_dark: Cambiar el modo Oscuro/Claro/Auto 19 | button_nav_open: Abrir la Navegación 20 | button_nav_close: Cerrar la Navegación 21 | button_menu_open: Abrir el Menú Bar 22 | button_menu_close: Cerrar el Menú Bar 23 | button_homepage: Volver al Inicio 24 | 25 | title_anchor_prefix: "Anclado a:" 26 | 27 | posts_read_more: Lee la publicación completa 28 | posts_read_time: 29 | one: "Un minuto para leer" 30 | other: "{{ . }} minutos para leer" 31 | posts_update_prefix: Actualizado en 32 | posts_count: 33 | one: "Una publicación" 34 | other: "{{ . }} publicaciones" 35 | posts_tagged_with: Todas las publicaciones etiquetadas con '{{ . }}' 36 | 37 | footer_build_with: > 38 | Creado con Hugo y 39 | 40 | footer_legal_notice: Aviso Legal 41 | footer_privacy_policy: Política de Privacidad 42 | footer_content_license_prefix: > 43 | Contenido licenciado con 44 | 45 | language_switch_no_tranlation_prefix: "Página no traducida:" 46 | 47 | propertylist_required: requerido 48 | propertylist_optional: opcional 49 | propertylist_default: estándar 50 | 51 | pagination_page_prev: previo 52 | pagination_page_next: siguiente 53 | pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" 54 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/i18n/fr.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | edit_page: Editer la page 3 | 4 | nav_navigation: Navigation 5 | nav_tags: Tags 6 | nav_more: Plus 7 | nav_top: Retour au haut de page 8 | 9 | form_placeholder_search: Chercher 10 | 11 | error_page_title: Perdu? Ne t'inquiète pas 12 | error_message_title: Perdu? 13 | error_message_code: Error 404 14 | error_message_text: > 15 | On dirait que ce que vous cherchez est introuvable. Ne vous inquiétez pas, nous pouvons 16 | vous ramèner à la page d'accueil. 17 | 18 | button_toggle_dark: Basculer le mode Sombre/Clair/Auto 19 | button_nav_open: Ouvrir la navigation 20 | button_nav_close: Fermer la navigation 21 | button_menu_open: Ouvrir la barre de menus 22 | button_menu_close: Fermer la barre de menus 23 | button_homepage: retour à la page d'accueil 24 | 25 | title_anchor_prefix: "Ancrer à :" 26 | 27 | posts_read_more: Lire l'article complet 28 | posts_read_time: 29 | one: "Une minute pour lire" 30 | other: "{{ . }} minutes à lire" 31 | posts_update_prefix: Mis à jour le 32 | posts_count: 33 | one: "Un billet" 34 | other: "{{ . }} billets" 35 | posts_tagged_with: Tous les articles marqués avec '{{ . }}' 36 | 37 | footer_build_with: > 38 | Construit avec Hugo et 39 | 40 | footer_legal_notice: Mentions légales 41 | footer_privacy_policy: Politique de confidentialité 42 | footer_content_license_prefix: > 43 | Contenu sous licence 44 | 45 | language_switch_no_tranlation_prefix: "Page non traduite:" 46 | 47 | propertylist_required: requis 48 | propertylist_optional: facultatif 49 | propertylist_default: défaut 50 | 51 | pagination_page_prev: précédent 52 | pagination_page_next: suivant 53 | pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" 54 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/i18n/it.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | edit_page: Modifica la pagina 3 | 4 | nav_navigation: Navigazione 5 | nav_tags: Etichette 6 | nav_more: Altro 7 | nav_top: Torna su 8 | 9 | form_placeholder_search: Cerca 10 | 11 | error_page_title: Perso? Non ti preoccupare 12 | error_message_title: Perso? 13 | error_message_code: Errore 404 14 | error_message_text: > 15 | Sembra che non sia possibile trovare quello che stavi cercando. Non ti preoccupare, 16 | possiamo riportarti alla pagina iniziale. 17 | 18 | button_toggle_dark: Seleziona il tema Chiaro/Scuro/Automatico 19 | button_nav_open: Apri la Navigazione 20 | button_nav_close: Chiudi la Navigazione 21 | button_menu_open: Apri la Barra del Menu 22 | button_menu_close: Chiudi la Barra del Menu 23 | button_homepage: Torna alla pagina iniziale 24 | 25 | title_anchor_prefix: "Ancora a:" 26 | 27 | posts_read_more: Leggi tutto il post 28 | posts_read_time: 29 | one: "Tempo di lettura: un minuto" 30 | other: "Tempo di lettura: {{ . }} minuti" 31 | posts_update_prefix: Aggiornato il 32 | posts_count: 33 | one: "Un post" 34 | other: "{{ . }} post" 35 | posts_tagged_with: Tutti i post etichettati con '{{ . }}' 36 | 37 | footer_build_with: > 38 | Realizzato con Hugo e 39 | 40 | footer_legal_notice: Avviso Legale 41 | footer_privacy_policy: Politica sulla Privacy 42 | footer_content_license_prefix: > 43 | Contenuto sotto licenza 44 | 45 | language_switch_no_tranlation_prefix: "Pagina non tradotta:" 46 | 47 | propertylist_required: richiesto 48 | propertylist_optional: opzionale 49 | propertylist_default: valore predefinito 50 | 51 | pagination_page_prev: precedente 52 | pagination_page_next: prossimo 53 | pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" 54 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/i18n/ja.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | edit_page: ページの編集 3 | 4 | nav_navigation: ナビゲーション 5 | nav_tags: タグ 6 | nav_more: さらに 7 | nav_top: トップへ戻る 8 | 9 | form_placeholder_search: 検索 10 | 11 | error_page_title: お困りですか?ご心配なく 12 | error_message_title: お困りですか? 13 | error_message_code: 404 エラー 14 | error_message_text: > 15 | お探しのものが見つからないようです。トップページ 16 | へ戻ることができるので、ご安心ください。 17 | 18 | button_toggle_dark: モードの切替 ダーク/ライト/自動 19 | button_nav_open: ナビゲーションを開く 20 | button_nav_close: ナビゲーションを閉じる 21 | button_menu_open: メニューバーを開く 22 | button_menu_close: メニューバーを閉じる 23 | button_homepage: トップページへ戻る 24 | 25 | title_anchor_prefix: "アンカー先:" 26 | 27 | posts_read_more: 全投稿を閲覧 28 | posts_read_time: 29 | one: "読むのに 1 分かかります" 30 | other: "読むのに要する時間 {{ . }} (分)" 31 | posts_update_prefix: 更新時刻 32 | posts_count: 33 | one: "一件の投稿" 34 | other: "{{ . }} 件の投稿" 35 | posts_tagged_with: "'{{ . }}'のタグが付いた記事全部" 36 | 37 | footer_build_with: > 38 | Hugo でビルドしています。 39 | 40 | footer_legal_notice: 法的な告知事項 41 | footer_privacy_policy: プライバシーポリシー 42 | footer_content_license_prefix: > 43 | 提供するコンテンツのライセンス 44 | 45 | language_switch_no_tranlation_prefix: "未翻訳のページ:" 46 | 47 | propertylist_required: 必須 48 | propertylist_optional: 任意 49 | propertylist_default: 既定値 50 | 51 | pagination_page_prev: 前 52 | pagination_page_next: 次 53 | pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" 54 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/i18n/nl.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | edit_page: Wijzig pagina 3 | 4 | nav_navigation: Navigatie 5 | nav_tags: Markering 6 | nav_more: Meer 7 | nav_top: Terug naar boven 8 | 9 | form_placeholder_search: Zoek 10 | 11 | error_page_title: Verdwaald? Geen probleem 12 | error_message_title: Verdwaald? 13 | error_message_code: Error 404 14 | error_message_text: > 15 | Het lijkt er op dat wat je zoekt niet gevonden kan worden. Geen probleem, 16 | we kunnen je terug naar de startpagina brengen. 17 | 18 | button_toggle_dark: Wijzig Donker/Licht/Auto weergave 19 | button_nav_open: Open navigatie 20 | button_nav_close: Sluit navigatie 21 | button_menu_open: Open menubalk 22 | button_menu_close: Sluit menubalk 23 | button_homepage: Terug naar startpagina 24 | 25 | title_anchor_prefix: "Link naar:" 26 | 27 | posts_read_more: Lees volledige bericht 28 | posts_read_time: 29 | one: "Een minuut leestijd" 30 | other: "{{ . }} minuten leestijd" 31 | posts_update_prefix: Bijgewerkt op 32 | posts_count: 33 | one: "Een bericht" 34 | other: "{{ . }} berichten" 35 | posts_tagged_with: Alle berichten gemarkeerd met '{{ . }}' 36 | 37 | footer_build_with: > 38 | Gebouwd met Hugo en 39 | 40 | footer_legal_notice: Juridische mededeling 41 | footer_privacy_policy: Privacybeleid 42 | footer_content_license_prefix: > 43 | Inhoud gelicenseerd onder 44 | 45 | language_switch_no_tranlation_prefix: "Pagina niet vertaald:" 46 | 47 | propertylist_required: verplicht 48 | propertylist_optional: optioneel 49 | propertylist_default: standaard 50 | 51 | pagination_page_prev: vorige 52 | pagination_page_next: volgende 53 | pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" 54 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/i18n/oc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | edit_page: Modificar la pagina 3 | 4 | nav_navigation: Navegacion 5 | nav_tags: Etiquetas 6 | nav_more: Mai 7 | nav_top: Tornar ennaut 8 | 9 | form_placeholder_search: Cercar 10 | 11 | error_page_title: Perdut ? Cap de problèma 12 | error_message_title: Perdut ? 13 | error_message_code: Error 404 14 | error_message_text: > 15 | Sembla que cercatz quicòm que se pòt pas trobat. Vos’n fagatz pas vos podèm 16 | tornar a la pagina d’acuèlh. 17 | 18 | button_toggle_dark: Alternar lo mòde escur/clar/auto 19 | button_nav_open: Dobrir la navegacion 20 | button_nav_close: Tampar la navegacion 21 | button_menu_open: Dobrir la barra de menú 22 | button_menu_close: Tampar la barra de menú 23 | button_homepage: Tornar a la pagina d’acuèlh 24 | 25 | title_anchor_prefix: "Ancorar a:" 26 | 27 | posts_read_more: Legir la publicacion complèta 28 | posts_read_time: 29 | one: "Una minuta de lectura" 30 | other: "{{ . }} minutas de lectura" 31 | posts_update_prefix: Actualizada lo 32 | posts_count: 33 | one: "Una publicacion" 34 | other: "{{ . }} publicacions" 35 | posts_tagged_with: Totas las publicacions amb '{{ . }}' 36 | 37 | footer_build_with: > 38 | Construch amb Hugo e 39 | 40 | footer_legal_notice: Mencions legalas 41 | footer_privacy_policy: politica de confidencialitat 42 | footer_content_license_prefix: > 43 | Contengut sota licéncia 44 | 45 | language_switch_no_tranlation_prefix: "Pagina non traducha :" 46 | 47 | propertylist_required: requerit 48 | propertylist_optional: opcional 49 | propertylist_default: per defaut 50 | 51 | pagination_page_prev: prec. 52 | pagination_page_next: seg. 53 | pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" 54 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/i18n/zh-cn.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | edit_page: 编辑页面 3 | 4 | nav_navigation: 导航 5 | nav_tags: 标签 6 | nav_more: 更多 7 | nav_top: 回到顶部 8 | 9 | form_placeholder_search: 搜索 10 | 11 | error_page_title: 迷路了? 不用担心 12 | error_message_title: 迷路了? 13 | error_message_code: 错误 404 14 | error_message_text: > 15 | 好像找不到你要找的东西。 别担心,我们可以 16 | 带您回到主页。 17 | 18 | button_toggle_dark: 切换暗/亮/自动模式 19 | button_nav_open: 打开导航 20 | button_nav_close: 关闭导航 21 | button_menu_open: 打开菜单栏 22 | button_menu_close: 关闭菜单栏 23 | button_homepage: 返回首页 24 | 25 | title_anchor_prefix: "锚定到:" 26 | 27 | posts_read_more: 阅读全文 28 | posts_read_time: 29 | one: "一分钟阅读时间" 30 | other: "{{ . }} 分钟阅读时间" 31 | posts_update_prefix: 更新时间 32 | posts_count: 33 | one: 一篇文章 34 | other: "{{ . }} 个帖子" 35 | posts_tagged_with: 所有带有“{{ . }}”标签的帖子。 36 | 37 | footer_build_with: > 38 | 基于 Hugo 39 | 制作 40 | footer_legal_notice: "法律声明" 41 | footer_privacy_policy: "隐私政策" 42 | footer_content_license_prefix: > 43 | 内容许可证 44 | 45 | language_switch_no_tranlation_prefix: "页面未翻译:" 46 | 47 | propertylist_required: 需要 48 | propertylist_optional: 可选 49 | propertylist_default: 默认值 50 | 51 | pagination_page_prev: 以前 52 | pagination_page_next: 下一个 53 | pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" 54 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/images/readme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/images/readme.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/images/screenshot.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/images/tn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/images/tn.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ partial "head/meta" . }} 5 | {{ i18n "error_page_title" }} 6 | 7 | {{ partial "head/favicons" . }} 8 | {{ partial "head/others" . }} 9 | 10 | 11 | 12 | {{ partial "svg-icon-symbols" . }} 13 | 14 | 15 |
16 | 17 | 18 | {{ partial "site-header" (dict "Root" . "MenuEnabled" false) }} 19 | 20 | 21 |
22 |
23 |
24 | 25 |
26 |
27 |
{{ i18n "error_message_title" }}
28 |
{{ i18n "error_message_code" }}
29 |
30 | {{ i18n "error_message_text" .Site.Home.Permalink | safeHTML }} 31 |
32 |
33 |
34 |
35 | 36 | {{ partial "site-footer" . }} 37 | 38 |
39 | 40 | 41 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/_default/_markup/render-codeblock-mermaid.html: -------------------------------------------------------------------------------- 1 | 2 | {{ if not (.Page.Scratch.Get "mermaid") }} 3 | 4 | 5 | {{ .Page.Scratch.Set "mermaid" true }} 6 | {{ end }} 7 | 8 | 9 |
10 |   {{- .Inner -}}
11 | 
12 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/_default/_markup/render-heading.html: -------------------------------------------------------------------------------- 1 | {{- $showAnchor := (and (default true .Page.Params.geekdocAnchor) (default true .Page.Site.Params.geekdocAnchor)) -}} 2 | 3 | 4 | 5 | {{- if $showAnchor -}} 6 |
7 | 11 | {{ .Text | safeHTML }} 12 | 13 | 14 | 15 | 16 |
17 | {{- else -}} 18 |
19 | 23 | {{ .Text | safeHTML }} 24 | 25 |
26 | {{- end -}} 27 | 28 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/_default/_markup/render-image.html: -------------------------------------------------------------------------------- 1 | {{ .Text }} 6 | {{- /* Drop trailing newlines */ -}} 7 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/_default/_markup/render-link.html: -------------------------------------------------------------------------------- 1 | {{- $raw := or (hasPrefix .Text " 12 | {{- .Text | safeHTML -}} 13 | 14 | {{- /* Drop trailing newlines */ -}} 15 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/_default/baseof.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | {{ partial "head/meta" . }} 9 | 10 | {{- if eq .Kind "home" -}} 11 | {{ .Site.Title }} 12 | {{- else -}} 13 | {{ printf "%s | %s" (partial "utils/title" .) .Site.Title }} 14 | {{- end -}} 15 | 16 | 17 | {{ partial "head/favicons" . }} 18 | {{ partial "head/rel-me" . }} 19 | {{ partial "head/microformats" . }} 20 | {{ partial "head/others" . }} 21 | {{ partial "head/custom" . }} 22 | 23 | 24 | 25 | 28 | 29 | {{ partial "svg-icon-symbols" . }} 30 | 31 | 32 |
35 | 36 | 37 | {{ $navEnabled := default true .Page.Params.geekdocNav }} 38 | {{ partial "site-header" (dict "Root" . "MenuEnabled" $navEnabled) }} 39 | 40 | 41 |
42 | {{ if $navEnabled }} 43 | 46 | {{ end }} 47 | 48 | 49 |
50 | {{ template "main" . }} 51 | 52 | 53 | {{ $showPrevNext := (default true .Site.Params.geekdocNextPrev) }} 54 | {{ if $showPrevNext }} 55 | 62 | {{ end }} 63 |
64 |
65 | 66 | {{ partial "site-footer" . }} 67 |
68 | 69 | {{ partial "foot" . }} 70 | 71 | 72 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/_default/list.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 | {{ partial "page-header" . }} 3 | 4 | 5 |
9 |

{{ partial "utils/title" . }}

10 | {{ partial "utils/content" . }} 11 |
12 | {{ end }} 13 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 | {{ partial "page-header" . }} 3 | 4 | 5 |
9 |

{{ partial "utils/title" . }}

10 | {{ partial "page-metadata" . }} 11 | {{ partial "utils/content" . }} 12 |
13 | {{ end }} 14 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/_default/taxonomy.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 |
3 | {{ range .Paginator.Pages }} 4 | 34 | {{ end }} 35 |
36 | {{ partial "pagination.html" . }} 37 | {{ end }} 38 | 39 | {{ define "post-tag" }} 40 | 51 | {{ end }} 52 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/_default/terms.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 |
3 | {{ range .Paginator.Pages.ByTitle }} 4 |
5 |
6 |

7 | {{ partial "utils/title" . }} 8 |

9 |
10 | 11 |
12 | 13 | {{ $pageCount := len .Pages }} 14 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | {{ $latet := index .Pages.ByDate 0 }} 24 | {{ with $latet }} 25 | {{ partial "utils/title" . }} 26 | {{ end }} 27 | 28 | 29 |
30 |
31 | {{ end }} 32 |
33 | {{ partial "pagination.html" . }} 34 | {{ end }} 35 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/foot.html: -------------------------------------------------------------------------------- 1 | {{ if default true .Site.Params.geekdocSearch }} 2 | 3 | {{- $searchConfigFile := printf "search/%s.config.json" .Language.Lang -}} 4 | {{- $searchConfig := resources.Get "search/config.json" | resources.ExecuteAsTemplate $searchConfigFile . | resources.Minify -}} 5 | {{- $searchConfig.Publish -}} 6 | {{ end }} 7 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/head/custom.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/head/favicons.html: -------------------------------------------------------------------------------- 1 | 2 | 8 | 14 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/head/meta.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ hugo.Generator }} 6 | 7 | {{ $keywords := default .Site.Params.Keywords .Keywords }} 8 | 9 | {{- with partial "utils/description" . }} 10 | 11 | {{- end }} 12 | {{- with $keywords }} 13 | 14 | {{- end }} 15 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/head/microformats.html: -------------------------------------------------------------------------------- 1 | {{ partial "microformats/opengraph.html" . }} 2 | {{ partial "microformats/twitter_cards.html" . }} 3 | {{ partial "microformats/schema" . }} 4 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/head/others.html: -------------------------------------------------------------------------------- 1 | {{- if default true .Site.Params.geekdocDarkModeToggle }} 2 | 3 | {{- end }} 4 | 5 | 6 | 13 | 20 | 21 | 26 | 31 | 32 | 37 | 42 | 43 | 48 | 53 | 54 | 59 | 64 | 65 | {{- with .OutputFormats.Get "html" }} 66 | {{ printf `` .Permalink .Rel .MediaType.Type | safeHTML }} 67 | {{- end }} 68 | 69 | {{- if (default false $.Site.Params.geekdocOverwriteHTMLBase) }} 70 | 71 | {{- end }} 72 | 73 | {{ printf "" "Made with Geekdoc theme https://github.com/thegeeklab/hugo-geekdoc" | safeHTML }} 74 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/head/rel-me.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/language.html: -------------------------------------------------------------------------------- 1 | {{ if hugo.IsMultilingual }} 2 | 3 |
    4 |
  • 5 | {{ range .Site.Languages }} 6 | {{ if eq . $.Site.Language }} 7 | 8 | 9 | {{ .Lang | upper }} 10 | 11 | {{ end }} 12 | {{ end }} 13 | 14 | 15 | 48 |
  • 49 |
50 |
51 | {{ end }} 52 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/menu-bundle-np.html: -------------------------------------------------------------------------------- 1 | {{ $current := . }} 2 | {{ $site := .Site }} 3 | {{ $current.Scratch.Set "prev" false }} 4 | {{ $current.Scratch.Set "getNext" false }} 5 | 6 | {{ $current.Scratch.Set "nextPage" false }} 7 | {{ $current.Scratch.Set "prevPage" false }} 8 | 9 | {{ template "menu-bundle-np" dict "sect" $.Site.Data.menu.main.main "current" $current "site" $site }} 10 | 11 | {{ define "menu-bundle-np" }} 12 | {{ $current := .current }} 13 | {{ $site := .site }} 14 | 15 | {{ range sort (default (seq 0) .sect) "weight" }} 16 | {{ $current.Scratch.Set "current" $current }} 17 | {{ $current.Scratch.Set "site" $site }} 18 | 19 | {{ $ref := default false .ref }} 20 | {{ if $ref }} 21 | {{ $site := $current.Scratch.Get "site" }} 22 | {{ $this := $site.GetPage .ref }} 23 | {{ $current := $current.Scratch.Get "current" }} 24 | 25 | {{ if reflect.IsMap .name }} 26 | {{ $current.Scratch.Set "refName" (index .name $site.Language.Lang) }} 27 | {{ else }} 28 | {{ $current.Scratch.Set "refName" .name }} 29 | {{ end }} 30 | {{ $name := $current.Scratch.Get "refName" }} 31 | 32 | {{ if $current.Scratch.Get "getNext" }} 33 | {{ $current.Scratch.Set "nextPage" (dict "name" $name "this" $this) }} 34 | {{ $current.Scratch.Set "getNext" false }} 35 | {{ end }} 36 | 37 | {{ if eq $current $this }} 38 | {{ $current.Scratch.Set "prevPage" ($current.Scratch.Get "prev") }} 39 | {{ $current.Scratch.Set "getNext" true }} 40 | {{ end }} 41 | 42 | {{ $current.Scratch.Set "prev" (dict "name" $name "this" $this) }} 43 | {{ end }} 44 | 45 | {{ $sub := default false .sub }} 46 | {{ if $sub }} 47 | {{ template "menu-bundle-np" dict "sect" $sub "current" ($current.Scratch.Get "current") "site" ($current.Scratch.Get "site") }} 48 | {{ end }} 49 | {{ end }} 50 | {{ end }} 51 | 52 | 53 | {{ with ($current.Scratch.Get "prevPage") }} 54 | 59 | gdoc_arrow_left_alt 60 | {{ .name }} 61 | 62 | {{ end }} 63 | 64 | 65 | {{ with ($current.Scratch.Get "nextPage") }} 66 | 71 | {{ .name }} 72 | gdoc_arrow_right_alt 73 | 74 | {{ end }} 75 | 76 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/menu-extra.html: -------------------------------------------------------------------------------- 1 | {{ $current := .current }} 2 | {{ template "menu-extra" dict "sect" .source "current" $current "site" $current.Site "target" .target }} 3 | 4 | 5 | 6 | {{ define "menu-extra" }} 7 | {{ $current := .current }} 8 | {{ $site := .site }} 9 | {{ $target := .target }} 10 | {{ $sect := .sect }} 11 | 12 | {{ range sort (default (seq 0) $sect) "weight" }} 13 | {{ if isset . "ref" }} 14 | {{ $this := $site.GetPage .ref }} 15 | {{ $isCurrent := eq $current $this }} 16 | {{ $icon := default false .icon }} 17 | 18 | {{ $name := .name }} 19 | {{ if reflect.IsMap .name }} 20 | {{ $name = (index .name $site.Language.Lang) }} 21 | {{ end }} 22 | 23 | {{ if not .icon }} 24 | {{ errorf "Missing 'icon' attribute in data file for '%s' menu item '%s'" $target $name }} 25 | {{ end }} 26 | 27 | {{ if eq $target "header" }} 28 | 29 | 40 | 41 | {{ $name }} 42 | 43 | 44 | 45 | 46 | {{ end }} 47 | {{ end }} 48 | {{ end }} 49 | {{ end }} 50 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/menu.html: -------------------------------------------------------------------------------- 1 | 45 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/microformats/opengraph.html: -------------------------------------------------------------------------------- 1 | {{ $isPage := or (and (ne .Type "posts") (in "section page" .Kind )) (and (eq .Type "posts") (eq .Kind "page")) }} 2 | 3 | {{- if ne .Kind "home" }} 4 | 8 | {{- end }} 9 | {{- with .Site.Title }} 10 | 11 | {{- end }} 12 | {{- with partial "utils/featured" . }} 13 | 14 | {{- end }} 15 | {{- with partial "utils/description" . }} 16 | 17 | {{- end }} 18 | 19 | 20 | {{- with .Params.audio }} 21 | 22 | {{- end }} 23 | {{- with .Params.locale }} 24 | 25 | {{- end }} 26 | {{- with .Params.videos }} 27 | {{- range . }} 28 | 29 | {{- end }} 30 | {{- end }} 31 | 32 | {{- /* If it is part of a series, link to related articles */}} 33 | {{- if .Site.Taxonomies.series }} 34 | {{- $permalink := .Permalink -}} 35 | {{- $siteSeries := .Site.Taxonomies.series -}} 36 | {{- with .Params.series }} 37 | {{- range $name := . }} 38 | {{- $series := index $siteSeries ($name | urlize) }} 39 | {{- range $page := first 6 $series.Pages }} 40 | {{- if ne $page.Permalink $permalink }} 41 | 42 | {{- end }} 43 | {{- end }} 44 | {{- end }} 45 | {{- end }} 46 | {{- end }} 47 | 48 | {{ if $isPage -}} 49 | {{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} 50 | 51 | {{- with .PublishDate }} 52 | 56 | {{- end }} 57 | {{- with .Lastmod }} 58 | 62 | {{- end }} 63 | {{- end }} 64 | 65 | {{- /* Facebook Page Admin ID for Domain Insights */}} 66 | {{- with .Site.Params.facebook_admin }} 67 | 68 | {{- end }} 69 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/microformats/schema.html: -------------------------------------------------------------------------------- 1 | {{ $isPage := or (and (ne .Type "posts") (in "section page" .Kind )) (and (eq .Type "posts") (eq .Kind "page")) }} 2 | {{- if eq .Kind "home" }} 3 | 21 | {{- else if $isPage }} 22 | 70 | {{- end }} 71 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/microformats/twitter_cards.html: -------------------------------------------------------------------------------- 1 | {{- with partial "utils/featured" . }} 2 | 3 | {{- else }} 4 | 5 | {{- end }} 6 | 7 | {{- with partial "utils/featured" . }} 8 | 9 | {{- end }} 10 | {{- with partial "utils/description" . }} 11 | 12 | {{- end }} 13 | {{- with .Site.Params.twitter -}} 14 | 15 | {{- end }} 16 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/page-header.html: -------------------------------------------------------------------------------- 1 | {{ $geekdocRepo := default (default false .Site.Params.geekdocRepo) .Page.Params.geekdocRepo }} 2 | {{ $geekdocEditPath := default (default false .Site.Params.geekdocEditPath) .Page.Params.geekdocEditPath }} 3 | {{ if .File }} 4 | {{ $.Scratch.Set "geekdocFilePath" (default (strings.TrimPrefix hugo.WorkingDir .File.Filename) .Page.Params.geekdocFilePath) }} 5 | {{ else }} 6 | {{ $.Scratch.Set "geekdocFilePath" false }} 7 | {{ end }} 8 | 9 | {{ define "breadcrumb" }} 10 | {{ $parent := .page.Parent }} 11 | {{ if $parent }} 12 | {{ $name := (partial "utils/title" $parent) }} 13 | {{ $position := (sub .position 1) }} 14 | {{ $value := (printf "
  • %s
  • /
  • %s" $parent.RelPermalink $parent.RelPermalink $name $position .value) }} 15 | {{ template "breadcrumb" dict "page" $parent "value" $value "position" $position }} 16 | {{ else }} 17 | {{ .value | safeHTML }} 18 | {{ end }} 19 | {{ end }} 20 | 21 | {{ $showBreadcrumb := (and (default true .Page.Params.geekdocBreadcrumb) (default true .Site.Params.geekdocBreadcrumb)) }} 22 | {{ $showEdit := (and ($.Scratch.Get "geekdocFilePath") $geekdocRepo $geekdocEditPath) }} 23 |
    34 | {{ if $showBreadcrumb }} 35 |
    36 | 37 | 43 |
    44 | {{ end }} 45 | {{ if $showEdit }} 46 |
    47 | 48 | 49 | 52 | {{ i18n "edit_page" }} 53 | 54 | 55 |
    56 | {{ end }} 57 |
    58 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/page-metadata.html: -------------------------------------------------------------------------------- 1 | {{- $showPageLastmod := (or (default false .Page.Params.geekdocPageLastmod) (default false .Site.Params.geekdocPageLastmod)) -}} 2 | 3 | {{- if $showPageLastmod -}} 4 | 5 | 6 | 12 | 13 | {{- end -}} 14 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/pagination.html: -------------------------------------------------------------------------------- 1 | {{ $pag := $.Paginator }} 2 | 3 | 4 | 23 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/posts/metadata.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | {{ $tc := 0 }} 19 | {{ with .Params.tags }} 20 | {{ range sort . }} 21 | {{ $name := . }} 22 | {{ with $.Site.GetPage (printf "/tags/%s" $name | urlize) }} 23 | {{ if eq $tc 0 }} 24 | 25 | 26 | {{ template "post-tag" dict "name" $name "page" . }} 27 | 28 | {{ else }} 29 | 30 | {{ template "post-tag" dict "name" $name "page" . }} 31 | 32 | {{ end }} 33 | {{ end }} 34 | {{ $tc = (add $tc 1) }} 35 | {{ end }} 36 | {{ end }} 37 | 38 | {{ define "post-tag" }} 39 | 48 | {{ end }} 49 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/search.html: -------------------------------------------------------------------------------- 1 | {{ if default true .Site.Params.geekdocSearch }} 2 | 16 | {{ end }} 17 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/site-footer.html: -------------------------------------------------------------------------------- 1 | 46 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/svg-icon-symbols.html: -------------------------------------------------------------------------------- 1 | {{ range resources.Match "sprites/*.svg" }} 2 | {{ printf "" . | safeHTML }} 3 | {{ .Content | safeHTML }} 4 | {{ end }} 5 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/utils/content.html: -------------------------------------------------------------------------------- 1 | {{ $content := .Content }} 2 | 3 | {{ $content = $content | replaceRE `` `` | safeHTML }} 4 | {{ $content = $content | replaceRE `((?:.|\n)+?
    )` `
    ${1}
    ` | safeHTML }} 5 | 6 | {{ return $content }} 7 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/utils/description.html: -------------------------------------------------------------------------------- 1 | {{ $isPage := or (and (ne .Type "posts") (in "section page" .Kind )) (and (eq .Type "posts") (eq .Kind "page")) }} 2 | {{ $description := "" }} 3 | 4 | {{ if .Description }} 5 | {{ $description = .Description }} 6 | {{ else }} 7 | {{ if $isPage }} 8 | {{ $description = .Summary }} 9 | {{ else if .Site.Params.description }} 10 | {{ $description = .Site.Params.description }} 11 | {{ end }} 12 | {{ end }} 13 | 14 | {{ return $description }} 15 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/utils/featured.html: -------------------------------------------------------------------------------- 1 | {{ $img := "" }} 2 | 3 | {{ with $source := ($.Resources.ByType "image").GetMatch "{*feature*,*cover*,*thumbnail*}" }} 4 | {{ $featured := .Fill (printf "1200x630 %s" (default "Smart" .Params.anchor)) }} 5 | {{ $img = $featured.Permalink }} 6 | {{ else }} 7 | {{ with default $.Site.Params.images $.Params.images }} 8 | {{ $img = index . 0 | absURL }} 9 | {{ end }} 10 | {{ end }} 11 | 12 | {{ return $img }} 13 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/partials/utils/title.html: -------------------------------------------------------------------------------- 1 | {{ $title := "" }} 2 | 3 | {{ if .Title }} 4 | {{ $title = .Title }} 5 | {{ else if and .IsSection .File }} 6 | {{ $title = path.Base .File.Dir | humanize | title }} 7 | {{ else if and .IsPage .File }} 8 | {{ $title = .File.BaseFileName | humanize | title }} 9 | {{ end }} 10 | 11 | {{ return $title }} 12 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/posts/list.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 |
    3 | {{ range .Paginator.Pages }} 4 | 32 | {{ end }} 33 |
    34 | {{ partial "pagination.html" . }} 35 | {{ end }} 36 | 37 | {{ define "post-tag" }} 38 | 49 | {{ end }} 50 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/posts/single.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 |
    3 |
    4 |

    {{ partial "utils/title" . }}

    5 | 8 |
    9 |
    10 | {{ partial "utils/content" . }} 11 |
    12 |
    13 | {{ end }} 14 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: /tags/* 3 | 4 | Sitemap: {{ "sitemap.xml" | absURL }} 5 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/shortcodes/audio.html: -------------------------------------------------------------------------------- 1 | {{- $source := ($.Page.Resources.ByType "audio").GetMatch (printf "%s" (.Get "name")) }} 2 | {{- $customAlt := .Get "alt" }} 3 | 4 | 5 | {{- with $source }} 6 | {{- $caption := default .Title $customAlt }} 7 | 8 |
    9 |
    10 | 13 | {{- with $caption }} 14 |
    15 | {{ . }} 16 | {{- with $source.Params.credits }} 17 | {{ printf " (%s)" . | $.Page.RenderString }} 18 | {{- end }} 19 |
    20 | {{- end }} 21 |
    22 |
    23 | {{- end }} 24 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/shortcodes/avatar.html: -------------------------------------------------------------------------------- 1 | {{- $source := ($.Page.Resources.ByType "image").GetMatch (printf "%s" (.Get "name")) }} 2 | {{- $customAlt := .Get "alt" }} 3 | {{- $customSize := .Get "size" | lower }} 4 | {{- $customAnchor := default "smart" (.Get "anchor") | title }} 5 | {{- $data := newScratch }} 6 | 7 | {{- with $source }} 8 | {{- $caption := default .Title $customAlt }} 9 | {{- $isSVG := (eq .MediaType.SubType "svg") }} 10 | {{- $origin := . -}} 11 | 12 | {{- if $isSVG }} 13 | {{- $data.SetInMap "size" "tiny" "160" }} 14 | {{- $data.SetInMap "size" "small" "300" }} 15 | {{- $data.SetInMap "size" "medium" "600" }} 16 | {{- $data.SetInMap "size" "large" "900" }} 17 | {{- else }} 18 | {{- $data.SetInMap "size" "tiny" (printf "160x160 %s" $customAnchor) }} 19 | {{- $data.SetInMap "size" "small" (printf "300x300 %s" $customAnchor) }} 20 | {{- $data.SetInMap "size" "medium" (printf "600x600 %s" $customAnchor) }} 21 | {{- $data.SetInMap "size" "large" (printf "900x900 %s" $customAnchor) }} 22 | {{- end -}} 23 | 24 | 57 | {{- end }} 58 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/shortcodes/button.html: -------------------------------------------------------------------------------- 1 | {{- $ref := "" }} 2 | {{- $class := "" }} 3 | {{- $size := default "regular" (.Get "size" | lower) }} 4 | 5 | {{- if not (in (slice "regular" "large") $size) }} 6 | {{- $size = "regular" }} 7 | {{- end }} 8 | 9 | {{- with .Get "href" }} 10 | {{- $ref = . }} 11 | {{- end }} 12 | 13 | {{- with .Get "relref" }} 14 | {{- $ref = relref $ . }} 15 | {{- end }} 16 | 17 | {{- with .Get "class" }} 18 | {{- $class = . }} 19 | {{- end }} 20 | 21 | 22 | 23 | 27 | {{ $.Inner }} 28 | 29 | 30 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/shortcodes/columns.html: -------------------------------------------------------------------------------- 1 | {{- $size := default "regular" (.Get "size" | lower) }} 2 | 3 | {{- if not (in (slice "regular" "large" "small") $size) }} 4 | {{- $size = "regular" }} 5 | {{- end }} 6 | 7 | 8 |
    9 | {{- range split .Inner "<--->" }} 10 |
    11 | {{ . | $.Page.RenderString -}} 12 |
    13 | {{- end }} 14 |
    15 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/shortcodes/expand.html: -------------------------------------------------------------------------------- 1 | {{ $id := substr (sha1 .Inner) 0 8 }} 2 |
    3 | 7 | 8 |
    9 | {{ .Inner | $.Page.RenderString }} 10 |
    11 |
    12 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/shortcodes/gist.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/shortcodes/hint.html: -------------------------------------------------------------------------------- 1 | {{- $type := default "note" (.Get "type") }} 2 | {{- $icon := .Get "icon" }} 3 | {{- $title := default ($type | title) (.Get "title") }} 4 | 5 | 6 |
    7 |
    8 | {{- with $icon -}} 9 | 10 | {{ $title }} 11 | {{- else -}} 12 | 13 | {{ $title }} 14 | {{- end -}} 15 |
    16 |
    {{ .Inner | $.Page.RenderString }}
    17 |
    18 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/shortcodes/icon.html: -------------------------------------------------------------------------------- 1 | {{ $id := .Get 0 }} 2 | 3 | {{- with $id -}} 4 | 5 | {{- end -}} 6 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/shortcodes/img.html: -------------------------------------------------------------------------------- 1 | {{- $source := ($.Page.Resources.ByType "image").GetMatch (printf "%s" (.Get "name")) }} 2 | {{- $customAlt := .Get "alt" }} 3 | {{- $customSize := .Get "size" | lower }} 4 | {{- $lazyLoad := default (default true $.Site.Params.geekdocImageLazyLoading) (.Get "lazy") }} 5 | {{- $data := newScratch }} 6 | 7 | {{- with $source }} 8 | {{- $caption := default .Title $customAlt }} 9 | {{- $isSVG := (eq .MediaType.SubType "svg") }} 10 | {{- $origin := . }} 11 | 12 | {{- if $isSVG }} 13 | {{- $data.SetInMap "size" "tiny" "320" }} 14 | {{- $data.SetInMap "size" "small" "600" }} 15 | {{- $data.SetInMap "size" "medium" "1200" }} 16 | {{- $data.SetInMap "size" "large" "1800" }} 17 | {{- else }} 18 | {{- $data.SetInMap "size" "tiny" "320x"}} 19 | {{- $data.SetInMap "size" "small" "600x" }} 20 | {{- $data.SetInMap "size" "medium" "1200x" }} 21 | {{- $data.SetInMap "size" "large" "1800x" }} 22 | {{- end -}} 23 | 24 |
    25 |
    26 | 27 | 28 | {{- $size := $data.Get "size" }} 29 | {{- if not $isSVG }} 30 | {{- if ne $customSize "origin" }} 31 | 38 | {{- end }} 39 | {{- end }} 40 | {{ $caption }} 53 | 54 | 55 | {{- with $caption }} 56 |
    57 | {{ . }} 58 | {{- with $source.Params.credits }} 59 | {{ printf " (%s)" . | $.Page.RenderString }} 60 | {{- end }} 61 |
    62 | {{- end }} 63 |
    64 |
    65 | {{- end }} 66 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/shortcodes/include.html: -------------------------------------------------------------------------------- 1 | {{ $file := .Get "file" }} 2 | {{ $page := .Site.GetPage $file }} 3 | {{ $type := .Get "type" }} 4 | {{ $language := .Get "language" }} 5 | {{ $options :=.Get "options" }} 6 | 7 | 8 |
    9 | {{- if (.Get "language") -}} 10 | {{- highlight ($file | readFile) $language (default "linenos=table" $options) -}} 11 | {{- else if eq $type "html" -}} 12 | {{- $file | readFile | safeHTML -}} 13 | {{- else if eq $type "page" -}} 14 | {{- with $page }}{{ .Content }}{{ end -}} 15 | {{- else -}} 16 | {{- $file | readFile | $.Page.RenderString -}} 17 | {{- end -}} 18 |
    19 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/shortcodes/katex.html: -------------------------------------------------------------------------------- 1 | 2 | {{ if not (.Page.Scratch.Get "katex") }} 3 | 4 | 8 | 9 | {{ .Page.Scratch.Set "katex" true }} 10 | {{ end }} 11 | 12 | 13 | 14 | {{ cond (in .Params "display") "\\[" "\\(" -}} 15 | {{- trim .Inner "\n" -}} 16 | {{- cond (in .Params "display") "\\]" "\\)" -}} 17 | 18 | {{- /* Drop trailing newlines */ -}} 19 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/shortcodes/mermaid.html: -------------------------------------------------------------------------------- 1 | 2 | {{ if not (.Page.Scratch.Get "mermaid") }} 3 | 4 | 5 | {{ .Page.Scratch.Set "mermaid" true }} 6 | {{ end }} 7 | 8 | 9 |
    10 |   {{- .Inner -}}
    11 | 
    12 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/shortcodes/progress.html: -------------------------------------------------------------------------------- 1 | {{- $value := default 0 (.Get "value") -}} 2 | {{- $type := default "main" (.Get "type") }} 3 | {{- $title := .Get "title" -}} 4 | {{- $icon := .Get "icon" -}} 5 | 6 | 7 |
    8 |
    9 |
    10 | {{ with $icon -}} 11 | 12 | {{- end }} 13 | {{ with $title }}{{ . }}{{ end }} 14 |
    15 |
    {{ $value }}%
    16 |
    17 |
    18 |
    23 |
    24 |
    25 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/shortcodes/propertylist.html: -------------------------------------------------------------------------------- 1 | {{- $name := .Get "name" -}} 2 | {{- $sort := .Get "sort" -}} 3 | {{- $order := default "asc" (.Get "order") -}} 4 | {{- $showAnchor := (and (default true .Page.Params.geekdocAnchor) (default true .Page.Site.Params.geekdocAnchor)) -}} 5 | 6 | {{- if .Site.Data.properties }} 7 |
    8 | {{- with (index .Site.Data.properties (split $name ".")) }} 9 | {{- $properties := .properties }} 10 | {{- with $sort }} 11 | {{- $properties = (sort $properties . $order) }} 12 | {{- end }} 13 | {{- range $properties }} 14 | {{- $uniqueAnchor := anchorize (printf "%s-%s" $name .name) | safeHTML }} 15 |
    16 | {{ .name }} 17 | {{- if .required }} 18 | {{ i18n "propertylist_required" | lower }} 19 | {{- else }} 20 | {{ i18n "propertylist_optional" | lower }} 21 | {{- end }} 22 | {{- with .type }} 23 | {{ . }} 24 | {{- end }} 25 | 26 | {{- with .tags }} 27 | {{- $tags := . }} 28 | {{- if reflect.IsMap $tags }} 29 | {{- $tags = (index $tags $.Site.Language.Lang) }} 30 | {{- end }} 31 | {{- range $tags }} 32 | {{ . }} 33 | {{- end }} 34 | {{- end }} 35 | {{- if $showAnchor }} 36 | 37 | 38 | 39 | {{- end }} 40 |
    41 |
    42 |
    43 | {{- with .description }} 44 | {{- $desc := . }} 45 | {{- if reflect.IsMap $desc }} 46 | {{- $desc = (index $desc $.Site.Language.Lang) }} 47 | {{- end }} 48 | {{ $desc | $.Page.RenderString }} 49 | {{- end }} 50 |
    51 |
    52 | {{- with default "none" (.defaultValue | string) }} 53 | {{ i18n "propertylist_default" | title }}: 54 | {{ . }} 55 | {{- end }} 56 |
    57 |
    58 | {{- end }} 59 | {{- end }} 60 |
    61 | {{- end }} 62 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/shortcodes/tab.html: -------------------------------------------------------------------------------- 1 | {{- if .Parent }} 2 | {{- $name := .Get 0 }} 3 | {{- $group := printf "tabs-%s" (.Parent.Get 0) }} 4 | 5 | {{- if not (.Parent.Scratch.Get $group) }} 6 | {{- .Parent.Scratch.Set $group slice }} 7 | {{- end }} 8 | 9 | {{- .Parent.Scratch.Add $group (dict "Name" $name "Content" .Inner) }} 10 | {{- else }} 11 | {{ errorf "%q: 'tab' shortcode must be inside 'tabs' shortcode" .Page.Path }} 12 | {{- end }} 13 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/shortcodes/tabs.html: -------------------------------------------------------------------------------- 1 | {{- if .Inner }}{{ end }} 2 | {{- $id := .Get 0 }} 3 | {{- $group := printf "tabs-%s" $id }} 4 | 5 | 6 |
    7 | {{- range $index, $tab := .Scratch.Get $group }} 8 | 15 | 18 |
    19 | {{ .Content | $.Page.RenderString }} 20 |
    21 | {{- end }} 22 |
    23 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/layouts/shortcodes/toc.html: -------------------------------------------------------------------------------- 1 | {{- $format := default "html" (.Get "format") }} 2 | {{- $tocLevels := default (default 6 .Site.Params.geekdocToC) .Page.Params.geekdocToC }} 3 | 4 | {{- if and $tocLevels .Page.TableOfContents -}} 5 | {{- if not (eq ($format | lower) "raw") -}} 6 |
    7 | {{ .Page.TableOfContents }} 8 |
    9 |
    10 | {{- else -}} 11 | {{ .Page.TableOfContents }} 12 | {{- end -}} 13 | {{- end -}} 14 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/custom.css: -------------------------------------------------------------------------------- 1 | /* You can add custom styles here. */ 2 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/android-chrome-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/android-chrome-144x144.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/android-chrome-192x192.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/android-chrome-256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/android-chrome-256x256.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/android-chrome-36x36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/android-chrome-36x36.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/android-chrome-384x384.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/android-chrome-384x384.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/android-chrome-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/android-chrome-48x48.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/android-chrome-512x512.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/android-chrome-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/android-chrome-72x72.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/android-chrome-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/android-chrome-96x96.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-1024x1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-1024x1024.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-114x114.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-144x144.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-167x167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-167x167.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-57x57.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-72x72.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-icon.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1125x2436.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1125x2436.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1136x640.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1136x640.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1170x2532.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1170x2532.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1179x2556.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1179x2556.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1242x2208.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1242x2208.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1242x2688.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1242x2688.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1284x2778.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1284x2778.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1290x2796.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1290x2796.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1334x750.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1334x750.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1488x2266.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1488x2266.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1536x2048.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1536x2048.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1620x2160.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1620x2160.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1640x2160.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1640x2160.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1668x2224.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1668x2224.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1668x2388.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1668x2388.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1792x828.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-1792x828.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2048x1536.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2048x1536.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2048x2732.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2048x2732.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2160x1620.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2160x1620.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2160x1640.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2160x1640.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2208x1242.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2208x1242.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2224x1668.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2224x1668.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2266x1488.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2266x1488.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2388x1668.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2388x1668.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2436x1125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2436x1125.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2532x1170.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2532x1170.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2556x1179.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2556x1179.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2688x1242.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2688x1242.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2732x2048.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2732x2048.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2778x1284.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2778x1284.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2796x1290.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-2796x1290.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-640x1136.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-640x1136.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-750x1334.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-750x1334.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-828x1792.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/apple-touch-startup-image-828x1792.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | #efefef 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/favicon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/favicon-48x48.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/favicon.ico -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/manifest.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "geekdoc", 3 | "short_name": "geekdoc", 4 | "description": "Hugo theme made for documentation", 5 | "dir": "auto", 6 | "lang": "en-US", 7 | "display": "standalone", 8 | "orientation": "any", 9 | "start_url": "/?homescreen=1", 10 | "background_color": "#efefef", 11 | "theme_color": "#efefef", 12 | "icons": [ 13 | { 14 | "src": "android-chrome-36x36.png", 15 | "sizes": "36x36", 16 | "type": "image/png", 17 | "purpose": "any" 18 | }, 19 | { 20 | "src": "android-chrome-48x48.png", 21 | "sizes": "48x48", 22 | "type": "image/png", 23 | "purpose": "any" 24 | }, 25 | { 26 | "src": "android-chrome-72x72.png", 27 | "sizes": "72x72", 28 | "type": "image/png", 29 | "purpose": "any" 30 | }, 31 | { 32 | "src": "android-chrome-96x96.png", 33 | "sizes": "96x96", 34 | "type": "image/png", 35 | "purpose": "any" 36 | }, 37 | { 38 | "src": "android-chrome-144x144.png", 39 | "sizes": "144x144", 40 | "type": "image/png", 41 | "purpose": "any" 42 | }, 43 | { 44 | "src": "android-chrome-192x192.png", 45 | "sizes": "192x192", 46 | "type": "image/png", 47 | "purpose": "any" 48 | }, 49 | { 50 | "src": "android-chrome-256x256.png", 51 | "sizes": "256x256", 52 | "type": "image/png", 53 | "purpose": "any" 54 | }, 55 | { 56 | "src": "android-chrome-384x384.png", 57 | "sizes": "384x384", 58 | "type": "image/png", 59 | "purpose": "any" 60 | }, 61 | { 62 | "src": "android-chrome-512x512.png", 63 | "sizes": "512x512", 64 | "type": "image/png", 65 | "purpose": "any" 66 | } 67 | ] 68 | } -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/mstile-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/mstile-144x144.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/mstile-150x150.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/mstile-310x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/mstile-310x150.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/mstile-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/mstile-310x310.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/favicon/mstile-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/favicon/mstile-70x70.png -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/GeekdocIcons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/GeekdocIcons.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/GeekdocIcons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/GeekdocIcons.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_AMS-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_AMS-Regular.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_AMS-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_AMS-Regular.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Caligraphic-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Caligraphic-Bold.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Caligraphic-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Caligraphic-Bold.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Caligraphic-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Caligraphic-Regular.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Caligraphic-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Caligraphic-Regular.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Fraktur-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Fraktur-Bold.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Fraktur-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Fraktur-Bold.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Fraktur-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Fraktur-Regular.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Fraktur-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Fraktur-Regular.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Bold.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Bold.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-BoldItalic.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-BoldItalic.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Italic.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Italic.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Regular.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Main-Regular.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Math-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Math-BoldItalic.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Math-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Math-BoldItalic.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Math-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Math-Italic.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Math-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Math-Italic.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Bold.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Bold.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Italic.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Italic.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Regular.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_SansSerif-Regular.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Script-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Script-Regular.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Script-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Script-Regular.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size1-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size1-Regular.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size1-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size1-Regular.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size2-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size2-Regular.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size2-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size2-Regular.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size3-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size3-Regular.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size3-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size3-Regular.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size4-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size4-Regular.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size4-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Size4-Regular.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Typewriter-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Typewriter-Regular.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/KaTeX_Typewriter-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/KaTeX_Typewriter-Regular.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/LiberationMono.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/LiberationMono.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/LiberationMono.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/LiberationMono.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/LiberationSans-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-Bold.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/LiberationSans-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-Bold.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/LiberationSans-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-BoldItalic.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/LiberationSans-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-BoldItalic.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/LiberationSans-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-Italic.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/LiberationSans-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/LiberationSans-Italic.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/LiberationSans.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/LiberationSans.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/LiberationSans.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/LiberationSans.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/Metropolis.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/Metropolis.woff -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/fonts/Metropolis.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/docs/themes/hugo-geekdoc/static/fonts/Metropolis.woff2 -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/js/110-f4b990d9.chunk.min.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkgeekdoc=self.webpackChunkgeekdoc||[]).push([[110],{5110:(e,r,a)=>{a.d(r,{diagram:()=>k});var t=a(758),s=(a(6474),a(7308),a(7938),a(1282),a(1099),a(7588),a(3115),a(6058),a(8159),a(9502)),k={parser:t.Zk,db:t.iP,renderer:t.q7,styles:t.tM,init:(0,s.K2)((e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute,t.iP.clear()}),"init")}}}]); -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/js/165-06872da1.chunk.min.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /*! 2 | Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable 3 | Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) 4 | Licensed under The MIT License (http://opensource.org/licenses/MIT) 5 | */ 6 | 7 | /*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */ 8 | 9 | /*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */ 10 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/js/354-5c1850f7.chunk.min.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkgeekdoc=self.webpackChunkgeekdoc||[]).push([[354],{7354:(e,r,a)=>{a.d(r,{diagram:()=>g});var t=a(6144),n=a(7286),s=a(9502),d=a(8731),i={parse:(0,s.K2)((async e=>{const r=await(0,d.qg)("info",e);s.Rm.debug(r)}),"parse")},o={version:t.r},g={parser:i,db:{getVersion:(0,s.K2)((()=>o.version),"getVersion")},renderer:{draw:(0,s.K2)(((e,r,a)=>{s.Rm.debug("rendering info diagram\n"+e);const t=(0,n.D)(r);(0,s.a$)(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${a}`)}),"draw")}}}}]); -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/js/387-3546ecdc.chunk.min.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkgeekdoc=self.webpackChunkgeekdoc||[]).push([[387],{2387:(e,c,k)=>{k.d(c,{createGitGraphServices:()=>s.b});var s=k(2785);k(9369)}}]); -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/js/391-549a9d24.chunk.min.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkgeekdoc=self.webpackChunkgeekdoc||[]).push([[391],{391:(e,r,s)=>{s.d(r,{diagram:()=>l});var a=s(6240),c=(s(6474),s(7308),s(7938),s(1282),s(1099),s(7588),s(3115),s(6058),s(8159),s(9502)),l={parser:a._$,db:a.z2,renderer:a.Lh,styles:a.tM,init:(0,c.K2)((e=>{e.class||(e.class={}),e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute,a.z2.clear()}),"init")}}}]); -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/js/452-e65d6d68.chunk.min.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkgeekdoc=self.webpackChunkgeekdoc||[]).push([[452],{4071:(e,c,k)=>{k.d(c,{createPacketServices:()=>s.$});var s=k(1609);k(9369)}}]); -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/js/56-09931933.chunk.min.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkgeekdoc=self.webpackChunkgeekdoc||[]).push([[56],{3056:(e,r,s)=>{s.d(r,{diagram:()=>l});var a=s(6240),c=(s(6474),s(7308),s(7938),s(1282),s(1099),s(7588),s(3115),s(6058),s(8159),s(9502)),l={parser:a._$,db:a.z2,renderer:a.Lh,styles:a.tM,init:(0,c.K2)((e=>{e.class||(e.class={}),e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute,a.z2.clear()}),"init")}}}]); -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/js/720-970f726e.chunk.min.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkgeekdoc=self.webpackChunkgeekdoc||[]).push([[720],{9720:(e,c,k)=>{k.d(c,{createArchitectureServices:()=>r.S});var r=k(9936);k(9369)}}]); -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/js/723-47eb515a.chunk.min.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkgeekdoc=self.webpackChunkgeekdoc||[]).push([[723],{7723:(e,c,k)=>{k.d(c,{createPieServices:()=>s.f});var s=k(8685);k(9369)}}]); -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/js/890-c9907c95.chunk.min.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkgeekdoc=self.webpackChunkgeekdoc||[]).push([[890],{890:(e,c,k)=>{k.d(c,{createInfoServices:()=>s.v});var s=k(7021);k(9369)}}]); -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/js/main-2e274343.bundle.min.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /*! 2 | * clipboard.js v2.0.11 3 | * https://clipboardjs.com/ 4 | * 5 | * Licensed MIT © Zeno Rocha 6 | */ 7 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/js/mermaid-c274c389.bundle.min.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */ 2 | 3 | /*! Bundled license information: 4 | 5 | js-yaml/dist/js-yaml.mjs: 6 | (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *) 7 | */ 8 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/js/search-16a110ff.bundle.min.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /**! 2 | * FlexSearch.js 3 | * Author and Copyright: Thomas Wilkerling 4 | * Licence: Apache-2.0 5 | * Hosted by Nextapps GmbH 6 | * https://github.com/nextapps-de/flexsearch 7 | */ 8 | -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/mobile-79ddc617.min.css: -------------------------------------------------------------------------------- 1 | @media screen and (max-width: 41rem){.gdoc-nav{margin-left:-18rem;font-size:16px}.gdoc-nav__control{display:inline-block}.gdoc-header svg.gdoc-icon{width:1.5rem;height:1.5rem}.gdoc-brand{font-size:1.5rem;line-height:1.5rem}.gdoc-brand__img{display:none}.gdoc-menu-header__items{display:none}.gdoc-menu-header__control,.gdoc-menu-header__home{display:flex}.gdoc-error{padding:6rem 1rem}.gdoc-error svg.gdoc-icon{width:6rem;height:6rem}.gdoc-error__message{padding-left:2rem}.gdoc-error__line{padding:.25rem 0}.gdoc-error__title{font-size:2rem}.gdoc-page__header .breadcrumb,.hidden-mobile{display:none}.flex-mobile-column{flex-direction:column}.flex-mobile-column.gdoc-columns{margin:2rem 0}.flex-mobile-column .gdoc-columns__content{min-width:auto;margin:0}#menu-control:checked~main .gdoc-nav nav,#menu-control:checked~main .gdoc-page{transform:translateX(18rem)}#menu-control:checked~main .gdoc-page{opacity:.25}#menu-control:checked~.gdoc-header .gdoc-nav__control svg.gdoc-icon.gdoc_menu{display:none}#menu-control:checked~.gdoc-header .gdoc-nav__control svg.gdoc-icon.gdoc_arrow_back{display:inline-block}#menu-header-control:checked~.gdoc-header .gdoc-brand{display:none}#menu-header-control:checked~.gdoc-header .gdoc-menu-header__items{display:flex}#menu-header-control:checked~.gdoc-header .gdoc-menu-header__control svg.gdoc-icon.gdoc_keyboard_arrow_left{display:none}} -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/static/print-72068949.min.css: -------------------------------------------------------------------------------- 1 | @media print{.gdoc-nav,.gdoc-footer .container span:not(:first-child),.gdoc-paging,.editpage{display:none}.gdoc-footer{border-top:1px solid #bdc0c3}.gdoc-markdown pre{white-space:pre-wrap;overflow-wrap:break-word}.chroma code{border:1px solid #bdc0c3;padding:.5rem !important;font-weight:normal !important}.gdoc-markdown code{font-weight:bold}a,a:visited{color:inherit !important;text-decoration:none !important}.gdoc-toc{flex:none}.gdoc-toc nav{position:relative;width:auto}.wrapper{display:block}.wrapper main{display:block}} -------------------------------------------------------------------------------- /docs/themes/hugo-geekdoc/theme.toml: -------------------------------------------------------------------------------- 1 | name = "Geekdoc" 2 | license = "MIT" 3 | licenselink = "https://github.com/thegeeklab/hugo-geekdoc/blob/main/LICENSE" 4 | description = "Hugo theme made for documentation" 5 | homepage = "https://geekdocs.de/" 6 | demosite = "https://geekdocs.de/" 7 | tags = ["docs", "documentation", "responsive", "simple"] 8 | min_version = "0.124" 9 | 10 | [author] 11 | name = "Robert Kaussow" 12 | homepage = "https://thegeeklab.de/" 13 | -------------------------------------------------------------------------------- /mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | exclude = prometheus_client/decorator.py|prometheus_client/twisted|tests/test_twisted.py 3 | implicit_reexport = False 4 | disallow_incomplete_defs = True 5 | 6 | [mypy-prometheus_client.decorator] 7 | follow_imports = skip 8 | -------------------------------------------------------------------------------- /prometheus_client/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from . import ( 4 | exposition, gc_collector, metrics, metrics_core, platform_collector, 5 | process_collector, registry, 6 | ) 7 | from .exposition import ( 8 | CONTENT_TYPE_LATEST, delete_from_gateway, generate_latest, 9 | instance_ip_grouping_key, make_asgi_app, make_wsgi_app, MetricsHandler, 10 | push_to_gateway, pushadd_to_gateway, start_http_server, start_wsgi_server, 11 | write_to_textfile, 12 | ) 13 | from .gc_collector import GC_COLLECTOR, GCCollector 14 | from .metrics import ( 15 | Counter, disable_created_metrics, enable_created_metrics, Enum, Gauge, 16 | Histogram, Info, Summary, 17 | ) 18 | from .metrics_core import Metric 19 | from .platform_collector import PLATFORM_COLLECTOR, PlatformCollector 20 | from .process_collector import PROCESS_COLLECTOR, ProcessCollector 21 | from .registry import CollectorRegistry, REGISTRY 22 | 23 | __all__ = ( 24 | 'CollectorRegistry', 25 | 'REGISTRY', 26 | 'Metric', 27 | 'Counter', 28 | 'Gauge', 29 | 'Summary', 30 | 'Histogram', 31 | 'Info', 32 | 'Enum', 33 | 'enable_created_metrics', 34 | 'disable_created_metrics', 35 | 'CONTENT_TYPE_LATEST', 36 | 'generate_latest', 37 | 'MetricsHandler', 38 | 'make_wsgi_app', 39 | 'make_asgi_app', 40 | 'start_http_server', 41 | 'start_wsgi_server', 42 | 'write_to_textfile', 43 | 'push_to_gateway', 44 | 'pushadd_to_gateway', 45 | 'delete_from_gateway', 46 | 'instance_ip_grouping_key', 47 | 'ProcessCollector', 48 | 'PROCESS_COLLECTOR', 49 | 'PlatformCollector', 50 | 'PLATFORM_COLLECTOR', 51 | 'GCCollector', 52 | 'GC_COLLECTOR', 53 | ) 54 | 55 | if __name__ == '__main__': 56 | c = Counter('cc', 'A counter') 57 | c.inc() 58 | 59 | g = Gauge('gg', 'A gauge') 60 | g.set(17) 61 | 62 | s = Summary('ss', 'A summary', ['a', 'b']) 63 | s.labels('c', 'd').observe(17) 64 | 65 | h = Histogram('hh', 'A histogram') 66 | h.observe(.6) 67 | 68 | start_http_server(8000) 69 | import time 70 | 71 | while True: 72 | time.sleep(1) 73 | -------------------------------------------------------------------------------- /prometheus_client/asgi.py: -------------------------------------------------------------------------------- 1 | from typing import Callable 2 | from urllib.parse import parse_qs 3 | 4 | from .exposition import _bake_output 5 | from .registry import CollectorRegistry, REGISTRY 6 | 7 | 8 | def make_asgi_app(registry: CollectorRegistry = REGISTRY, disable_compression: bool = False) -> Callable: 9 | """Create a ASGI app which serves the metrics from a registry.""" 10 | 11 | async def prometheus_app(scope, receive, send): 12 | assert scope.get("type") == "http" 13 | # Prepare parameters 14 | params = parse_qs(scope.get('query_string', b'')) 15 | accept_header = ",".join([ 16 | value.decode("utf8") for (name, value) in scope.get('headers') 17 | if name.decode("utf8").lower() == 'accept' 18 | ]) 19 | accept_encoding_header = ",".join([ 20 | value.decode("utf8") for (name, value) in scope.get('headers') 21 | if name.decode("utf8").lower() == 'accept-encoding' 22 | ]) 23 | # Bake output 24 | status, headers, output = _bake_output(registry, accept_header, accept_encoding_header, params, disable_compression) 25 | formatted_headers = [] 26 | for header in headers: 27 | formatted_headers.append(tuple(x.encode('utf8') for x in header)) 28 | # Return output 29 | payload = await receive() 30 | if payload.get("type") == "http.request": 31 | await send( 32 | { 33 | "type": "http.response.start", 34 | "status": int(status.split(' ')[0]), 35 | "headers": formatted_headers, 36 | } 37 | ) 38 | await send({"type": "http.response.body", "body": output}) 39 | 40 | return prometheus_app 41 | -------------------------------------------------------------------------------- /prometheus_client/bridge/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/prometheus_client/bridge/__init__.py -------------------------------------------------------------------------------- /prometheus_client/context_managers.py: -------------------------------------------------------------------------------- 1 | from timeit import default_timer 2 | from types import TracebackType 3 | from typing import ( 4 | Any, Callable, Literal, Optional, Tuple, Type, TYPE_CHECKING, TypeVar, 5 | Union, 6 | ) 7 | 8 | from .decorator import decorate 9 | 10 | if TYPE_CHECKING: 11 | from . import Counter 12 | F = TypeVar("F", bound=Callable[..., Any]) 13 | 14 | 15 | class ExceptionCounter: 16 | def __init__(self, counter: "Counter", exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]]) -> None: 17 | self._counter = counter 18 | self._exception = exception 19 | 20 | def __enter__(self) -> None: 21 | pass 22 | 23 | def __exit__(self, typ: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType]) -> Literal[False]: 24 | if isinstance(value, self._exception): 25 | self._counter.inc() 26 | return False 27 | 28 | def __call__(self, f: "F") -> "F": 29 | def wrapped(func, *args, **kwargs): 30 | with self: 31 | return func(*args, **kwargs) 32 | 33 | return decorate(f, wrapped) 34 | 35 | 36 | class InprogressTracker: 37 | def __init__(self, gauge): 38 | self._gauge = gauge 39 | 40 | def __enter__(self): 41 | self._gauge.inc() 42 | 43 | def __exit__(self, typ, value, traceback): 44 | self._gauge.dec() 45 | 46 | def __call__(self, f: "F") -> "F": 47 | def wrapped(func, *args, **kwargs): 48 | with self: 49 | return func(*args, **kwargs) 50 | 51 | return decorate(f, wrapped) 52 | 53 | 54 | class Timer: 55 | def __init__(self, metric, callback_name): 56 | self._metric = metric 57 | self._callback_name = callback_name 58 | 59 | def _new_timer(self): 60 | return self.__class__(self._metric, self._callback_name) 61 | 62 | def __enter__(self): 63 | self._start = default_timer() 64 | return self 65 | 66 | def __exit__(self, typ, value, traceback): 67 | # Time can go backwards. 68 | duration = max(default_timer() - self._start, 0) 69 | callback = getattr(self._metric, self._callback_name) 70 | callback(duration) 71 | 72 | def labels(self, *args, **kw): 73 | self._metric = self._metric.labels(*args, **kw) 74 | 75 | def __call__(self, f: "F") -> "F": 76 | def wrapped(func, *args, **kwargs): 77 | # Obtaining new instance of timer every time 78 | # ensures thread safety and reentrancy. 79 | with self._new_timer(): 80 | return func(*args, **kwargs) 81 | 82 | return decorate(f, wrapped) 83 | -------------------------------------------------------------------------------- /prometheus_client/core.py: -------------------------------------------------------------------------------- 1 | from .metrics import Counter, Enum, Gauge, Histogram, Info, Summary 2 | from .metrics_core import ( 3 | CounterMetricFamily, GaugeHistogramMetricFamily, GaugeMetricFamily, 4 | HistogramMetricFamily, InfoMetricFamily, Metric, StateSetMetricFamily, 5 | SummaryMetricFamily, UnknownMetricFamily, UntypedMetricFamily, 6 | ) 7 | from .registry import CollectorRegistry, REGISTRY 8 | from .samples import BucketSpan, Exemplar, NativeHistogram, Sample, Timestamp 9 | 10 | __all__ = ( 11 | 'BucketSpan', 12 | 'CollectorRegistry', 13 | 'Counter', 14 | 'CounterMetricFamily', 15 | 'Enum', 16 | 'Exemplar', 17 | 'Gauge', 18 | 'GaugeHistogramMetricFamily', 19 | 'GaugeMetricFamily', 20 | 'Histogram', 21 | 'HistogramMetricFamily', 22 | 'Info', 23 | 'InfoMetricFamily', 24 | 'Metric', 25 | 'NativeHistogram', 26 | 'REGISTRY', 27 | 'Sample', 28 | 'StateSetMetricFamily', 29 | 'Summary', 30 | 'SummaryMetricFamily', 31 | 'Timestamp', 32 | 'UnknownMetricFamily', 33 | 'UntypedMetricFamily', 34 | ) 35 | -------------------------------------------------------------------------------- /prometheus_client/gc_collector.py: -------------------------------------------------------------------------------- 1 | import gc 2 | import platform 3 | from typing import Iterable 4 | 5 | from .metrics_core import CounterMetricFamily, Metric 6 | from .registry import Collector, CollectorRegistry, REGISTRY 7 | 8 | 9 | class GCCollector(Collector): 10 | """Collector for Garbage collection statistics.""" 11 | 12 | def __init__(self, registry: CollectorRegistry = REGISTRY): 13 | if not hasattr(gc, 'get_stats') or platform.python_implementation() != 'CPython': 14 | return 15 | registry.register(self) 16 | 17 | def collect(self) -> Iterable[Metric]: 18 | collected = CounterMetricFamily( 19 | 'python_gc_objects_collected', 20 | 'Objects collected during gc', 21 | labels=['generation'], 22 | ) 23 | uncollectable = CounterMetricFamily( 24 | 'python_gc_objects_uncollectable', 25 | 'Uncollectable objects found during GC', 26 | labels=['generation'], 27 | ) 28 | 29 | collections = CounterMetricFamily( 30 | 'python_gc_collections', 31 | 'Number of times this generation was collected', 32 | labels=['generation'], 33 | ) 34 | 35 | for gen, stat in enumerate(gc.get_stats()): 36 | generation = str(gen) 37 | collected.add_metric([generation], value=stat['collected']) 38 | uncollectable.add_metric([generation], value=stat['uncollectable']) 39 | collections.add_metric([generation], value=stat['collections']) 40 | 41 | return [collected, uncollectable, collections] 42 | 43 | 44 | GC_COLLECTOR = GCCollector() 45 | """Default GCCollector in default Registry REGISTRY.""" 46 | -------------------------------------------------------------------------------- /prometheus_client/openmetrics/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/prometheus_client/openmetrics/__init__.py -------------------------------------------------------------------------------- /prometheus_client/platform_collector.py: -------------------------------------------------------------------------------- 1 | import platform as pf 2 | from typing import Any, Iterable, Optional 3 | 4 | from .metrics_core import GaugeMetricFamily, Metric 5 | from .registry import Collector, CollectorRegistry, REGISTRY 6 | 7 | 8 | class PlatformCollector(Collector): 9 | """Collector for python platform information""" 10 | 11 | def __init__(self, 12 | registry: Optional[CollectorRegistry] = REGISTRY, 13 | platform: Optional[Any] = None, 14 | ): 15 | self._platform = pf if platform is None else platform 16 | info = self._info() 17 | system = self._platform.system() 18 | if system == "Java": 19 | info.update(self._java()) 20 | self._metrics = [ 21 | self._add_metric("python_info", "Python platform information", info) 22 | ] 23 | if registry: 24 | registry.register(self) 25 | 26 | def collect(self) -> Iterable[Metric]: 27 | return self._metrics 28 | 29 | @staticmethod 30 | def _add_metric(name, documentation, data): 31 | labels = data.keys() 32 | values = [data[k] for k in labels] 33 | g = GaugeMetricFamily(name, documentation, labels=labels) 34 | g.add_metric(values, 1) 35 | return g 36 | 37 | def _info(self): 38 | major, minor, patchlevel = self._platform.python_version_tuple() 39 | return { 40 | "version": self._platform.python_version(), 41 | "implementation": self._platform.python_implementation(), 42 | "major": major, 43 | "minor": minor, 44 | "patchlevel": patchlevel 45 | } 46 | 47 | def _java(self): 48 | java_version, _, vminfo, osinfo = self._platform.java_ver() 49 | vm_name, vm_release, vm_vendor = vminfo 50 | return { 51 | "jvm_version": java_version, 52 | "jvm_release": vm_release, 53 | "jvm_vendor": vm_vendor, 54 | "jvm_name": vm_name 55 | } 56 | 57 | 58 | PLATFORM_COLLECTOR = PlatformCollector() 59 | """PlatformCollector in default Registry REGISTRY""" 60 | -------------------------------------------------------------------------------- /prometheus_client/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/prometheus_client/py.typed -------------------------------------------------------------------------------- /prometheus_client/samples.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, NamedTuple, Optional, Sequence, Union 2 | 3 | 4 | class Timestamp: 5 | """A nanosecond-resolution timestamp.""" 6 | 7 | def __init__(self, sec: float, nsec: float) -> None: 8 | if nsec < 0 or nsec >= 1e9: 9 | raise ValueError(f"Invalid value for nanoseconds in Timestamp: {nsec}") 10 | if sec < 0: 11 | nsec = -nsec 12 | self.sec: int = int(sec) 13 | self.nsec: int = int(nsec) 14 | 15 | def __str__(self) -> str: 16 | return f"{self.sec}.{self.nsec:09d}" 17 | 18 | def __repr__(self) -> str: 19 | return f"Timestamp({self.sec}, {self.nsec})" 20 | 21 | def __float__(self) -> float: 22 | return float(self.sec) + float(self.nsec) / 1e9 23 | 24 | def __eq__(self, other: object) -> bool: 25 | return isinstance(other, Timestamp) and self.sec == other.sec and self.nsec == other.nsec 26 | 27 | def __ne__(self, other: object) -> bool: 28 | return not self == other 29 | 30 | def __gt__(self, other: "Timestamp") -> bool: 31 | return self.nsec > other.nsec if self.sec == other.sec else self.sec > other.sec 32 | 33 | def __lt__(self, other: "Timestamp") -> bool: 34 | return self.nsec < other.nsec if self.sec == other.sec else self.sec < other.sec 35 | 36 | 37 | # BucketSpan is experimental and subject to change at any time. 38 | class BucketSpan(NamedTuple): 39 | offset: int 40 | length: int 41 | 42 | 43 | # NativeHistogram is experimental and subject to change at any time. 44 | class NativeHistogram(NamedTuple): 45 | count_value: float 46 | sum_value: float 47 | schema: int 48 | zero_threshold: float 49 | zero_count: float 50 | pos_spans: Optional[Sequence[BucketSpan]] = None 51 | neg_spans: Optional[Sequence[BucketSpan]] = None 52 | pos_deltas: Optional[Sequence[int]] = None 53 | neg_deltas: Optional[Sequence[int]] = None 54 | 55 | 56 | # Timestamp and exemplar are optional. 57 | # Value can be an int or a float. 58 | # Timestamp can be a float containing a unixtime in seconds, 59 | # a Timestamp object, or None. 60 | # Exemplar can be an Exemplar object, or None. 61 | class Exemplar(NamedTuple): 62 | labels: Dict[str, str] 63 | value: float 64 | timestamp: Optional[Union[float, Timestamp]] = None 65 | 66 | 67 | class Sample(NamedTuple): 68 | name: str 69 | labels: Dict[str, str] 70 | value: float 71 | timestamp: Optional[Union[float, Timestamp]] = None 72 | exemplar: Optional[Exemplar] = None 73 | native_histogram: Optional[NativeHistogram] = None 74 | -------------------------------------------------------------------------------- /prometheus_client/twisted/__init__.py: -------------------------------------------------------------------------------- 1 | from ._exposition import MetricsResource 2 | 3 | __all__ = ['MetricsResource'] 4 | -------------------------------------------------------------------------------- /prometheus_client/twisted/_exposition.py: -------------------------------------------------------------------------------- 1 | from twisted.internet import reactor 2 | from twisted.web.wsgi import WSGIResource 3 | 4 | from .. import exposition, REGISTRY 5 | 6 | MetricsResource = lambda registry=REGISTRY: WSGIResource( 7 | reactor, reactor.getThreadPool(), exposition.make_wsgi_app(registry) 8 | ) 9 | -------------------------------------------------------------------------------- /prometheus_client/utils.py: -------------------------------------------------------------------------------- 1 | import math 2 | 3 | INF = float("inf") 4 | MINUS_INF = float("-inf") 5 | NaN = float("NaN") 6 | 7 | 8 | def floatToGoString(d): 9 | d = float(d) 10 | if d == INF: 11 | return '+Inf' 12 | elif d == MINUS_INF: 13 | return '-Inf' 14 | elif math.isnan(d): 15 | return 'NaN' 16 | else: 17 | s = repr(d) 18 | dot = s.find('.') 19 | # Go switches to exponents sooner than Python. 20 | # We only need to care about positive values for le/quantile. 21 | if d > 0 and dot > 6: 22 | mantissa = f'{s[0]}.{s[1:dot]}{s[dot + 1:]}'.rstrip('0.') 23 | return f'{mantissa}e+0{dot - 1}' 24 | return s 25 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools>=77.0.0"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "prometheus_client" 7 | version = "0.22.1" 8 | description = "Python client for the Prometheus monitoring system." 9 | readme = "README.md" 10 | license = "Apache-2.0 AND BSD-2-Clause" 11 | license-files = [ 12 | "LICENSE", 13 | "NOTICE", 14 | ] 15 | requires-python = ">=3.9" 16 | authors = [ 17 | { name = "The Prometheus Authors", email = "prometheus-developers@googlegroups.com" }, 18 | ] 19 | keywords = [ 20 | "prometheus", 21 | "monitoring", 22 | "instrumentation", 23 | "client", 24 | ] 25 | classifiers = [ 26 | "Development Status :: 4 - Beta", 27 | "Intended Audience :: Developers", 28 | "Intended Audience :: Information Technology", 29 | "Intended Audience :: System Administrators", 30 | "Programming Language :: Python", 31 | "Programming Language :: Python :: 3", 32 | "Programming Language :: Python :: 3.9", 33 | "Programming Language :: Python :: 3.10", 34 | "Programming Language :: Python :: 3.11", 35 | "Programming Language :: Python :: 3.12", 36 | "Programming Language :: Python :: 3.13", 37 | "Programming Language :: Python :: Implementation :: CPython", 38 | "Programming Language :: Python :: Implementation :: PyPy", 39 | "Topic :: System :: Monitoring", 40 | ] 41 | 42 | [project.optional-dependencies] 43 | twisted = [ 44 | "twisted", 45 | ] 46 | 47 | [project.urls] 48 | Homepage = "https://github.com/prometheus/client_python" 49 | Documentation = "https://prometheus.github.io/client_python/" 50 | 51 | [tool.setuptools.package-data] 52 | prometheus_client = ['py.typed'] 53 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/tests/__init__.py -------------------------------------------------------------------------------- /tests/certs/cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIFkzCCA3ugAwIBAgIUWhYKmrh+gF5pZ7Yqj41cWJ2pRzkwDQYJKoZIhvcNAQEL 3 | BQAwWTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM 4 | GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDESMBAGA1UEAwwJbG9jYWxob3N0MB4X 5 | DTIyMDkyMDE4NTQzOFoXDTIyMTAyMDE4NTQzOFowWTELMAkGA1UEBhMCVVMxEzAR 6 | BgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5 7 | IEx0ZDESMBAGA1UEAwwJbG9jYWxob3N0MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A 8 | MIICCgKCAgEAxs6v9c/bNtA0TjNOzSoIq2CQuBhjWt8nwVG7Ujn3JBSvC263foRq 9 | OG0oGhaFrbt4HrbikYeSo5u/0CDBfKBIr7nuWifpISUovNSm2EVgVL7YQhgPOSvb 10 | PiJhrflfkUBZWUlNf0EAcFOn29xSvw3ElDUtxqUql39RRXUah1JDIIJpFPENwbmB 11 | 4jN5AoumdzSZde3S1xAXqoPf7gwxvsIgBKYGxRZs95DLx3HwesDAmRdmXcLShNZm 12 | RpUbIbomn4w3mf7S0QZ7H49/IHRghw61/TGKCX6ieJ8QTWwnBgo9EiwhhuTCVtFw 13 | IFhzQy5sP2b6mYkxQK4enYiHkTEHESdV9ipDoyZfE3G+WojEa65OYkrBFaZbuJ8q 14 | lBjRCA+pyXfxa40XkK4x3aibvdKeH1CGE+rYhxPYC6emu0Jk1wMO5TNff2Gv+eJv 15 | GEQXuyQPC5SmgSpy0tWwO9ReYmDU1++gbmFZc1QVB0GI/WxgF+PpBBEa8naFXxbe 16 | ZWG3Q6pFfrIJ3pbhb1lkTlk2zpJO2hTDUIBIn6pdVBbv+QAqCyu94gItfUxWWNL9 17 | SHT+dfyX4CtpF9R9m9VltoKqXKcVhnjkPc9wG03TBcJdCZT3e9sg8bSz09hwx+HO 18 | 5x8RrLkqUd7PFznhX59k/xhXTSIdtdWEfrhPjy2L36o2bEEpPL70qfMCAwEAAaNT 19 | MFEwHQYDVR0OBBYEFJOiGRDrPKW5+qvVZzs+Yu8qPNJnMB8GA1UdIwQYMBaAFJOi 20 | GRDrPKW5+qvVZzs+Yu8qPNJnMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL 21 | BQADggIBALbV73MLFz24tQpC8Ax6vh9okeuc5n2eVOk/ofe2A9DL16IeMyJo8QAG 22 | dK2j+mfZBvPfYYX/Uz596bOLauRKAsXm3ERmPW74nemLE4CiMhod2snIUMbSHrem 23 | 6iFLIqGGosncoqHIPJej4sG+XLKsqw8zLzflUSsvNveaHEwt2PSZys37bExADbB5 24 | uj4JU+vEBhagZ6ieZ3hENn3Uj5c46kimXrEStD3chT2PWoLAS4Am6VJyXUtqXQZj 25 | 1ef+S+6caCbldaJNfNEVU1jQliJpo0u+EfiF/DqU799xnnoW4D132AxiG0L1jPFr 26 | 7GbIme6H2ZbNCZngf6eCbdsoHAGkQZpD3wYFHLmTFDCNmjMJteb3YFMNHyU5eh8C 27 | 2bTp4D+pifgFRo3Mc23kuRXiIzyrhg/eOHl+Qi2V8BpXP/7bI27FZXglp9rzhP57 28 | YMfBeoOejRgRHJTeMPhBbEevQyqpb9ecZxpuGV77Pi3S5IA26fe3pZQCHRceufZr 29 | YKWLOCt2jZJ0y9KM4wdVg40yr6BVZqy2OPqDn64q0pAgMHG24XrxxuaFISjgPOgx 30 | bYhhTUG/4Dkb1BWhfEv4EwEf/uDxhHE8k6LoKk3Qb+aOzPr2PKGvW3yBHEFNSmKH 31 | x3SB8xxj/IOiA+em+TLtKd66gG0T0b8cPt037k+D3a0BqC9d2sVs 32 | -----END CERTIFICATE----- 33 | -------------------------------------------------------------------------------- /tests/openmetrics/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/tests/openmetrics/__init__.py -------------------------------------------------------------------------------- /tests/proc/26231/fd/0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/tests/proc/26231/fd/0 -------------------------------------------------------------------------------- /tests/proc/26231/fd/1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/tests/proc/26231/fd/1 -------------------------------------------------------------------------------- /tests/proc/26231/fd/2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/tests/proc/26231/fd/2 -------------------------------------------------------------------------------- /tests/proc/26231/fd/3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/tests/proc/26231/fd/3 -------------------------------------------------------------------------------- /tests/proc/26231/fd/4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prometheus/client_python/d24220a6c477eef2dfeb12a312e0da66539095e1/tests/proc/26231/fd/4 -------------------------------------------------------------------------------- /tests/proc/26231/limits: -------------------------------------------------------------------------------- 1 | Limit Soft Limit Hard Limit Units 2 | Max cpu time unlimited unlimited seconds 3 | Max file size unlimited unlimited bytes 4 | Max data size unlimited unlimited bytes 5 | Max stack size 8388608 unlimited bytes 6 | Max core file size 0 unlimited bytes 7 | Max resident set unlimited unlimited bytes 8 | Max processes 62898 62898 processes 9 | Max open files 2048 4096 files 10 | Max locked memory 65536 65536 bytes 11 | Max address space unlimited unlimited bytes 12 | Max file locks unlimited unlimited locks 13 | Max pending signals 62898 62898 signals 14 | Max msgqueue size 819200 819200 bytes 15 | Max nice priority 0 0 16 | -------------------------------------------------------------------------------- /tests/proc/26231/stat: -------------------------------------------------------------------------------- 1 | 26231 (vim) R 5392 7446 5392 34835 7446 4218880 32533 309516 26 82 1677 44 158 99 20 0 1 0 82375 56274944 1981 18446744073709551615 4194304 6294284 140736914091744 140736914087944 139965136429984 0 0 12288 1870679807 0 0 0 17 0 0 0 31 0 0 8391624 8481048 16420864 140736914093252 140736914093279 140736914093279 140736914096107 0 2 | -------------------------------------------------------------------------------- /tests/proc/584/stat: -------------------------------------------------------------------------------- 1 | 1020 ((a b ) ( c d) ) R 28378 1020 28378 34842 1020 4218880 286 0 0 0 0 0 0 0 20 0 1 0 10839175 10395648 155 18446744073709551615 4194304 4238788 140736466511168 140736466511168 140609271124624 0 0 0 0 0 0 0 17 5 0 0 0 0 0 6336016 6337300 25579520 140736466515030 140736466515061 140736466515061 140736466518002 0 2 | -------------------------------------------------------------------------------- /tests/proc/stat: -------------------------------------------------------------------------------- 1 | cpu 301854 612 111922 8979004 3552 2 3944 0 0 0 2 | cpu0 44490 19 21045 1087069 220 1 3410 0 0 0 3 | cpu1 47869 23 16474 1110787 591 0 46 0 0 0 4 | cpu2 46504 36 15916 1112321 441 0 326 0 0 0 5 | cpu3 47054 102 15683 1113230 533 0 60 0 0 0 6 | cpu4 28413 25 10776 1140321 217 0 8 0 0 0 7 | cpu5 29271 101 11586 1136270 672 0 30 0 0 0 8 | cpu6 29152 36 10276 1139721 319 0 29 0 0 0 9 | cpu7 29098 268 10164 1139282 555 0 31 0 0 0 10 | intr 8885917 17 0 0 0 0 0 0 0 1 79281 0 0 0 0 0 0 0 231237 0 0 0 0 250586 103 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 223424 190745 13 906 1283803 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0intr 8885917 17 0 0 0 0 0 0 0 1 79281 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 | ctxt 38014093 12 | btime 1418183276 13 | processes 26442 14 | procs_running 2 15 | procs_blocked 0 16 | softirq 5057579 250191 1481983 1647 211099 186066 0 1783454 622196 12499 508444 17 | -------------------------------------------------------------------------------- /tests/test_gc_collector.py: -------------------------------------------------------------------------------- 1 | import gc 2 | import platform 3 | import unittest 4 | 5 | from prometheus_client import CollectorRegistry, GCCollector 6 | 7 | SKIP = platform.python_implementation() != "CPython" 8 | 9 | 10 | @unittest.skipIf(SKIP, "Test requires CPython") 11 | class TestGCCollector(unittest.TestCase): 12 | def setUp(self): 13 | gc.disable() 14 | gc.collect() 15 | self.registry = CollectorRegistry() 16 | 17 | def test_working(self): 18 | GCCollector(registry=self.registry) 19 | self.registry.collect() 20 | before = self.registry.get_sample_value('python_gc_objects_collected_total', 21 | labels={"generation": "0"}) 22 | 23 | # add targets for gc 24 | a = [] 25 | a.append(a) 26 | del a 27 | b = [] 28 | b.append(b) 29 | del b 30 | 31 | gc.collect(0) 32 | self.registry.collect() 33 | 34 | after = self.registry.get_sample_value('python_gc_objects_collected_total', 35 | labels={"generation": "0"}) 36 | self.assertEqual(2, after - before) 37 | self.assertEqual(0, 38 | self.registry.get_sample_value( 39 | 'python_gc_objects_uncollectable_total', 40 | labels={"generation": "0"})) 41 | 42 | def test_empty(self): 43 | GCCollector(registry=self.registry) 44 | self.registry.collect() 45 | before = self.registry.get_sample_value('python_gc_objects_collected_total', 46 | labels={"generation": "0"}) 47 | gc.collect(0) 48 | self.registry.collect() 49 | 50 | after = self.registry.get_sample_value('python_gc_objects_collected_total', 51 | labels={"generation": "0"}) 52 | self.assertEqual(0, after - before) 53 | 54 | def tearDown(self): 55 | gc.enable() 56 | -------------------------------------------------------------------------------- /tests/test_platform_collector.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from prometheus_client import CollectorRegistry, PlatformCollector 4 | 5 | 6 | class TestPlatformCollector(unittest.TestCase): 7 | def setUp(self): 8 | self.registry = CollectorRegistry() 9 | self.platform = _MockPlatform() 10 | 11 | def test_python_info(self): 12 | PlatformCollector(registry=self.registry, platform=self.platform) 13 | self.assertLabels("python_info", { 14 | "version": "python_version", 15 | "implementation": "python_implementation", 16 | "major": "pvt_major", 17 | "minor": "pvt_minor", 18 | "patchlevel": "pvt_patchlevel" 19 | }) 20 | 21 | def test_system_info_java(self): 22 | self.platform._system = "Java" 23 | PlatformCollector(registry=self.registry, platform=self.platform) 24 | self.assertLabels("python_info", { 25 | "version": "python_version", 26 | "implementation": "python_implementation", 27 | "major": "pvt_major", 28 | "minor": "pvt_minor", 29 | "patchlevel": "pvt_patchlevel", 30 | "jvm_version": "jv_release", 31 | "jvm_release": "vm_release", 32 | "jvm_vendor": "vm_vendor", 33 | "jvm_name": "vm_name" 34 | }) 35 | 36 | def assertLabels(self, name, labels): 37 | for metric in self.registry.collect(): 38 | for s in metric.samples: 39 | if s.name == name: 40 | assert s.labels == labels 41 | return 42 | assert False 43 | 44 | 45 | class _MockPlatform: 46 | def __init__(self): 47 | self._system = "system" 48 | 49 | def python_version_tuple(self): 50 | return "pvt_major", "pvt_minor", "pvt_patchlevel" 51 | 52 | def python_version(self): 53 | return "python_version" 54 | 55 | def python_implementation(self): 56 | return "python_implementation" 57 | 58 | def system(self): 59 | return self._system 60 | 61 | def java_ver(self): 62 | return ( 63 | "jv_release", 64 | "jv_vendor", 65 | ("vm_name", "vm_release", "vm_vendor"), 66 | ("os_name", "os_version", "os_arch") 67 | ) 68 | -------------------------------------------------------------------------------- /tests/test_samples.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from prometheus_client import samples 4 | 5 | 6 | class TestSamples(unittest.TestCase): 7 | def test_gt(self): 8 | self.assertEqual(samples.Timestamp(1, 1) > samples.Timestamp(1, 1), False) 9 | self.assertEqual(samples.Timestamp(1, 1) > samples.Timestamp(1, 2), False) 10 | self.assertEqual(samples.Timestamp(1, 1) > samples.Timestamp(2, 1), False) 11 | self.assertEqual(samples.Timestamp(1, 1) > samples.Timestamp(2, 2), False) 12 | self.assertEqual(samples.Timestamp(1, 2) > samples.Timestamp(1, 1), True) 13 | self.assertEqual(samples.Timestamp(2, 1) > samples.Timestamp(1, 1), True) 14 | self.assertEqual(samples.Timestamp(2, 2) > samples.Timestamp(1, 1), True) 15 | self.assertEqual(samples.Timestamp(0, 2) > samples.Timestamp(1, 1), False) 16 | self.assertEqual(samples.Timestamp(2, 0) > samples.Timestamp(1, 1), True) 17 | 18 | def test_lt(self): 19 | self.assertEqual(samples.Timestamp(1, 1) < samples.Timestamp(1, 1), False) 20 | self.assertEqual(samples.Timestamp(1, 1) < samples.Timestamp(1, 2), True) 21 | self.assertEqual(samples.Timestamp(1, 1) < samples.Timestamp(2, 1), True) 22 | self.assertEqual(samples.Timestamp(1, 1) < samples.Timestamp(2, 2), True) 23 | self.assertEqual(samples.Timestamp(1, 2) < samples.Timestamp(1, 1), False) 24 | self.assertEqual(samples.Timestamp(2, 1) < samples.Timestamp(1, 1), False) 25 | self.assertEqual(samples.Timestamp(2, 2) < samples.Timestamp(1, 1), False) 26 | self.assertEqual(samples.Timestamp(0, 2) < samples.Timestamp(1, 1), True) 27 | self.assertEqual(samples.Timestamp(2, 0) < samples.Timestamp(1, 1), False) 28 | 29 | 30 | if __name__ == '__main__': 31 | unittest.main() 32 | -------------------------------------------------------------------------------- /tests/test_twisted.py: -------------------------------------------------------------------------------- 1 | from unittest import skipUnless 2 | 3 | from prometheus_client import CollectorRegistry, Counter, generate_latest 4 | 5 | try: 6 | from warnings import filterwarnings 7 | 8 | from twisted.internet import reactor 9 | from twisted.trial.unittest import TestCase 10 | from twisted.web.client import Agent, readBody 11 | from twisted.web.resource import Resource 12 | from twisted.web.server import Site 13 | 14 | from prometheus_client.twisted import MetricsResource 15 | 16 | HAVE_TWISTED = True 17 | except ImportError: 18 | from unittest import TestCase 19 | 20 | HAVE_TWISTED = False 21 | 22 | 23 | class MetricsResourceTest(TestCase): 24 | @skipUnless(HAVE_TWISTED, "Don't have twisted installed.") 25 | def setUp(self): 26 | self.registry = CollectorRegistry() 27 | 28 | def test_reports_metrics(self): 29 | """ 30 | ``MetricsResource`` serves the metrics from the provided registry. 31 | """ 32 | c = Counter('cc', 'A counter', registry=self.registry) 33 | c.inc() 34 | 35 | root = Resource() 36 | root.putChild(b'metrics', MetricsResource(registry=self.registry)) 37 | server = reactor.listenTCP(0, Site(root)) 38 | self.addCleanup(server.stopListening) 39 | 40 | agent = Agent(reactor) 41 | port = server.getHost().port 42 | url = f"http://localhost:{port}/metrics" 43 | d = agent.request(b"GET", url.encode("ascii")) 44 | 45 | # Ignore expected DeprecationWarning. 46 | filterwarnings("ignore", category=DeprecationWarning, message="Using readBody " 47 | "with a transport that does not have an abortConnection method") 48 | 49 | d.addCallback(readBody) 50 | d.addCallback(self.assertEqual, generate_latest(self.registry)) 51 | 52 | return d 53 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = coverage-clean,py{3.9,3.10,3.11,3.12,3.13,py3.9,3.9-nooptionals},coverage-report,flake8,isort,mypy 3 | 4 | [testenv] 5 | deps = 6 | coverage 7 | pytest 8 | attrs 9 | {py3.9,pypy3.9}: twisted 10 | # NOTE: Pinned due to https://github.com/prometheus/client_python/issues/1020 11 | py3.9: asgiref==3.7 12 | pypy3.9: asgiref==3.7 13 | commands = coverage run --parallel -m pytest {posargs} 14 | 15 | [testenv:py3.9-nooptionals] 16 | commands = coverage run --parallel -m pytest {posargs} 17 | 18 | [testenv:coverage-clean] 19 | deps = coverage 20 | skip_install = true 21 | commands = coverage erase 22 | 23 | [testenv:coverage-report] 24 | deps = coverage 25 | skip_install = true 26 | commands = 27 | coverage combine 28 | coverage report 29 | 30 | [testenv:flake8] 31 | deps = 32 | flake8==6.0.0 33 | flake8-docstrings==1.6.0 34 | flake8-import-order==0.18.2 35 | skip_install = true 36 | commands = 37 | flake8 prometheus_client/ tests/ 38 | 39 | [testenv:isort] 40 | deps = 41 | isort==5.10.1 42 | skip_install = true 43 | commands = 44 | isort --check prometheus_client/ tests/ 45 | 46 | [testenv:mypy] 47 | deps = 48 | pytest 49 | asgiref 50 | mypy==0.991 51 | skip_install = true 52 | commands = 53 | mypy --install-types --non-interactive prometheus_client/ tests/ 54 | 55 | [flake8] 56 | ignore = 57 | D, 58 | E303, 59 | E402, 60 | E501, 61 | E722, 62 | E741, 63 | F821, 64 | F841, 65 | W291, 66 | W293, 67 | W503, 68 | E129, 69 | E731 70 | 71 | per-file-ignores = prometheus_client/__init__.py:F401 72 | import-order-style = google 73 | application-import-names = prometheus_client 74 | 75 | [isort] 76 | force_alphabetical_sort_within_sections = True 77 | force_sort_within_sections = True 78 | include_trailing_comma = True 79 | multi_line_output = 5 80 | --------------------------------------------------------------------------------