Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/github-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.115.4
HUGO_VERSION: 0.145.0
steps:
- name: Install Hugo CLI
run: |
Expand Down
2 changes: 1 addition & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.hugo_build.lock
.hugo_build.lock
39 changes: 17 additions & 22 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,32 @@
Docs
----
# Docs

This directory contains [hugo](https://gohugo.io) documentation to be published in Github pages.

Run Locally
-----------
## Dependencies

```
- [Geekdocs v1.5.0](https://github.com/thegeeklab/hugo-geekdoc/releases/tag/v1.5.0)
- [Hugo v0.145.0](https://github.com/gohugoio/hugo/releases/tag/v0.145.0)

## Run Locally

To serve the documentation locally, run the following command:

```shell
hugo server -D
```

This will serve the docs on [http://localhost:1313](http://localhost:1313).

Deploy to Github Pages
----------------------

Changes to the `main` branch will be deployed automatically with Github actions.

Update Geekdocs
---------------
## Update Geekdocs

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/`.

Notes
-----

Here's how the initial `docs/` folder was set up:

```
hugo new site docs
cd docs/
```shell
rm -rf ./docs/themes/hugo-geekdoc
mkdir -p themes/hugo-geekdoc/
curl -L https://github.com/thegeeklab/hugo-geekdoc/releases/download/v0.41.1/hugo-geekdoc.tar.gz | tar -xz -C themes/hugo-geekdoc/ --strip-components=1
curl -L https://github.com/thegeeklab/hugo-geekdoc/releases/latest/download/hugo-geekdoc.tar.gz | tar -xz -C themes/hugo-geekdoc/ --strip-components=1
```

Create the initial `hugo.toml` file as described in [https://geekdocs.de/usage/getting-started/](https://geekdocs.de/usage/getting-started/).
## Deploy to Github Pages

Changes to the `master` branch will be deployed automatically with Github actions.
48 changes: 46 additions & 2 deletions docs/content/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,49 @@
---
title: "client_python"
title: client_python
weight: 1
---

This is the documentation for the [Prometheus Python client library](https://github.com/prometheus/client_python).
This tutorial shows the quickest way to get started with the Prometheus Python library.

**One**: Install the client:

```shell
pip install prometheus-client
```

**Two**: Paste the following into a Python interpreter:

```python
from prometheus_client import start_http_server, Summary
import random
import time

# Create a metric to track time spent and requests made.
REQUEST_TIME = Summary('request_processing_seconds', 'Time spent processing request')

# Decorate function with metric.
@REQUEST_TIME.time()
def process_request(t):
"""A dummy function that takes some time."""
time.sleep(t)

if __name__ == '__main__':
# Start up the server to expose the metrics.
start_http_server(8000)
# Generate some requests.
while True:
process_request(random.random())
```

**Three**: Visit [http://localhost:8000/](http://localhost:8000/) to view the metrics.

From one easy to use decorator you get:

* `request_processing_seconds_count`: Number of times this function was called.
* `request_processing_seconds_sum`: Total amount of time spent in this function.

Prometheus's `rate` function allows calculation of both requests per second,
and latency over time from this data.

In addition if you're on Linux the `process` metrics expose CPU, memory and
other information about the process for free!
4 changes: 0 additions & 4 deletions docs/content/getting-started/_index.md

This file was deleted.

48 changes: 0 additions & 48 deletions docs/content/getting-started/three-step-demo.md

This file was deleted.

101 changes: 95 additions & 6 deletions docs/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@ theme = "hugo-geekdoc"

pluralizeListTitles = false

# Geekdoc required configuration
#pygmentsUseClasses = true
pygmentsUseClasses = false
# Required to get well formatted code blocks
pygmentsUseClasses = true
pygmentsCodeFences = true
disablePathToLower = true
# geekdocFileTreeSortBy = "linkTitle"
enableGitInfo = true

# Required if you want to render robots.txt template
enableRobotsTXT = true

# Needed for mermaid shortcodes
[markup]
[markup.goldmark.renderer]
# Needed for mermaid shortcode
# Needed for mermaid shortcode or when nesting shortcodes (e.g. img within
# columns or tabs)
unsafe = true
[markup.tableOfContents]
startLevel = 1
Expand All @@ -28,3 +27,93 @@ enableRobotsTXT = true

[taxonomies]
tag = "tags"

[params]
# (Optional, default 6) Set how many table of contents levels to be showed on page.
# Use false to hide ToC, note that 0 will default to 6 (https://gohugo.io/functions/default/)
# You can also specify this parameter per page in front matter.
geekdocToC = 3

# (Optional, default static/brand.svg) Set the path to a logo for the Geekdoc
# relative to your 'static/' folder.
geekdocLogo = "brand.svg"

# (Optional, default false) Render menu from data file in 'data/menu/main.yaml'.
# See also https://geekdocs.de/usage/menus/#bundle-menu.
geekdocMenuBundle = false

# (Optional, default false) Collapse all menu entries, can not be overwritten
# per page if enabled. Can be enabled per page via 'geekdocCollapseSection'.
geekdocCollapseAllSections = false

# (Optional, default true) Show page navigation links at the bottom of each docs page.
geekdocNextPrev = true

# (Optional, default true) Show a breadcrumb navigation bar at the top of each docs page.
# You can also specify this parameter per page in front matter.
geekdocBreadcrumb = true

# (Optional, default none) Set source repository location. Used for 'Edit page' links.
# You can also specify this parameter per page in front matter.
geekdocRepo = "https://github.com/prometheus/client_python"

# (Optional, default none) Enable 'Edit page' links. Requires 'geekdocRepo' param
# and the path must point to the parent directory of the 'content' folder.
# You can also specify this parameter per page in front matter.
geekdocEditPath = "edit/master/docs"

# (Optional, default false) Show last modification date of the page in the header.
# Keep in mind that last modification date works best if `enableGitInfo` is set to true.
geekdocPageLastmod = true

# (Optional, default true) Enables search function with flexsearch.
# Index is built on the fly and might slow down your website.
geekdocSearch = true

# (Optional, default false) Display search results with the parent folder as prefix. This
# option allows you to distinguish between files with the same name in different folders.
# NOTE: This parameter only applies when 'geekdocSearch = true'.
geekdocSearchShowParent = true

# (Optional, default true) Add an anchor link to headlines.
geekdocAnchor = true

# (Optional, default true) Copy anchor url to clipboard on click.
geekdocAnchorCopy = true

# (Optional, default true) Enable or disable image lazy loading for images rendered
# by the 'img' shortcode.
geekdocImageLazyLoading = true

# (Optional, default false) Set HTMl <base> to .Site.Home.Permalink if enabled. It might be required
# if a subdirectory is used within Hugos BaseURL.
# See https://developer.mozilla.org/de/docs/Web/HTML/Element/base.
geekdocOverwriteHTMLBase = false

# (Optional, default true) Enable or disable the JavaScript based color theme toggle switch. The CSS based
# user preference mode still works.
geekdocDarkModeToggle = true

# (Optional, default false) Auto-decrease brightness of images and add a slightly grayscale to avoid
# bright spots while using the dark mode.
geekdocDarkModeDim = false

# (Optional, default false) Enforce code blocks to always use the dark color theme.
geekdocDarkModeCode = false

# (Optional, default true) Display a "Back to top" link in the site footer.
geekdocBackToTop = true

# (Optional, default false) Enable or disable adding tags for post pages automatically to the navigation sidebar.
geekdocTagsToMenu = true

# (Optional, default 'title') Configure how to sort file-tree menu entries. Possible options are 'title', 'linktitle',
# 'date', 'publishdate', 'expirydate' or 'lastmod'. Every option can be used with a reverse modifier as well
# e.g. 'title_reverse'.
geekdocFileTreeSortBy = "title"

# (Optional, default none) Adds a "Content licensed under <license>" line to the footer.
# Could be used if you want to define a default license for your content.
[params.geekdocContentLicense]
name = "Apache License 2.0"
link = "https://github.com/prometheus/client_python/blob/master/LICENSE"
1 change: 1 addition & 0 deletions docs/themes/hugo-geekdoc/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/*
2 changes: 1 addition & 1 deletion docs/themes/hugo-geekdoc/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Geekdoc

[![Build Status](https://ci.thegeeklab.de/api/badges/thegeeklab/hugo-geekdoc/status.svg)](https://ci.thegeeklab.de/repos/thegeeklab/hugo-geekdoc)
[![Hugo Version](https://img.shields.io/badge/hugo-0.112-blue.svg)](https://gohugo.io)
[![Hugo Version](https://img.shields.io/badge/hugo-0.124-blue.svg)](https://gohugo.io)
[![GitHub release](https://img.shields.io/github/v/release/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/releases/latest)
[![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/graphs/contributors)
[![License: MIT](https://img.shields.io/github/license/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/blob/main/LICENSE)
Expand Down
2 changes: 1 addition & 1 deletion docs/themes/hugo-geekdoc/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.41.1
v1.5.0
Loading