From 942348f5f0e0858f6a9895482b0c90fca2bdcf99 Mon Sep 17 00:00:00 2001 From: Oluwole Fadeyi <16049411+tfadeyi@users.noreply.github.com> Date: Fri, 7 Apr 2023 00:22:31 +0100 Subject: [PATCH] Clean documentation Signed-off-by: Oluwole Fadeyi <16049411+tfadeyi@users.noreply.github.com> --- .github/workflows/release.yml | 1 + README.md | 27 +++++++++++-------- deploy/charts/auth0-exporter/Chart.yaml | 6 ++--- deploy/charts/auth0-exporter/README.md | 20 +++++++------- deploy/charts/auth0-exporter/README.md.gotmpl | 14 +++++----- pkg/docs/docs.go | 4 +-- pkg/docs/swagger.json | 4 +-- pkg/docs/swagger.yaml | 4 +-- pkg/exporter/server.go | 4 +-- 9 files changed, 47 insertions(+), 37 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a835de5..d0be2a6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -127,5 +127,6 @@ jobs: uses: helm/chart-releaser-action@v1.5.0 with: skip_packaging: true + mark_as_latest: false env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/README.md b/README.md index 9b50400..28965d9 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,11 @@ # Auth0 Exporter -[![release pipeline](https://github.com/tfadeyi/auth0-simple-exporter/actions/workflows/release.yml/badge.svg?style=flat-square)](https://github.com/tfadeyi/auth0-simple-exporter/actions/workflows/release.yml?event=push) -[![Continuous Integration](https://github.com/tfadeyi/auth0-simple-exporter/actions/workflows/ci.yml/badge.svg?style=flat-square)](https://github.com/tfadeyi/auth0-simple-exporter/actions/workflows/ci.yml) +[![Continuous Integration](https://img.shields.io/github/actions/workflow/status/tfadeyi/auth0-simple-exporter/ci.yml?branch=main&style=flat-square)](https://github.com/tfadeyi/auth0-simple-exporter/actions/workflows/ci.yml) [![License](https://img.shields.io/badge/License-Apache_2.0-yellowgreen.svg?style=flat-square)](https://github.com/tfadeyi/auth0-simple-exporter/blob/main/LICENSE) -[![Language](https://img.shields.io/badge/language-Go-blue.svg?style=flat-square)](https://github.com/tfadeyi/auth0-simple-exporter) -[![GitHub release](https://img.shields.io/badge/release-0.0.3-green.svg?style=flat-square)](https://github.com/tfadeyi/auth0-simple-exporter/releases) - +[![Language](https://img.shields.io/github/go-mod/go-version/tfadeyi/auth0-simple-exporter?style=flat-square)](https://github.com/tfadeyi/auth0-simple-exporter) +[![GitHub release](https://img.shields.io/github/v/release/tfadeyi/auth0-simple-exporter?color=green&style=flat-square)](https://github.com/tfadeyi/auth0-simple-exporter/releases) +[![Code size](https://img.shields.io/github/languages/code-size/tfadeyi/auth0-simple-exporter?color=orange&style=flat-square)](https://github.com/tfadeyi/auth0-simple-exporter) --- @@ -33,9 +32,14 @@ This Prometheus exporter aims to simplify this, making it easier to expose tenan Run exporter's container with TLS disabled. ```shell -$ export TOKEN="< auth0 management API static static token >" -$ export DOMAIN="< auth0 tenant domain >" -$ docker run --network host -u $(id -u):$(id -g) -e TOKEN="$TOKEN" -e DOMAIN="$DOMAIN" ghcr.io/tfadeyi/auth0-simple-exporter:latest export --tls.disabled +export TOKEN="< auth0 management API static static token >" +export DOMAIN="< auth0 tenant domain >" + +curl -LJO https://github.com/tfadeyi/auth0-simple-exporter/releases/download/v0.0.1/auth0-simple-exporter-linux-amd64.tar.gz && \ +tar -xzvf auth0-simple-exporter-linux-amd64.tar.gz && \ +cd auth0-simple-exporter-linux-amd64 + +./auth0-simple-exporter export --tls.disabled ``` ## Installation @@ -57,13 +61,14 @@ $ docker run --network host -u $(id -u):$(id -g) -e TOKEN="$TOKEN" -e DOMAIN="$D * ### Helm This shows a simple installation of the exporter helm chart, running with TLS disabled. ```shell - $ export TOKEN="< auth0 management API static static token >" - $ export DOMAIN="< auth0 tenant domain >" + export TOKEN="< auth0 management API static static token >" + export DOMAIN="< auth0 tenant domain >" ``` ```shell # Installing by passing in secret directly + helm repo add auth0-exporter https://tfadeyi.github.io/auth0-simple-exporter helm upgrade --install --create-namespace -n auth0-exporter auth0-exporter \ - https://tfadeyi.github.io/charts \ + auth0-simple-exporter \ --set auth0.domain="$DOMAIN" --set auth0.token="$TOKEN" \ --set exporter.tls.disabled=true ``` diff --git a/deploy/charts/auth0-exporter/Chart.yaml b/deploy/charts/auth0-exporter/Chart.yaml index 9345afb..a9a3871 100644 --- a/deploy/charts/auth0-exporter/Chart.yaml +++ b/deploy/charts/auth0-exporter/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: auth0-exporter -description: Auth0 Prometheus exporter +description: The helm chart for the auth0 prometheus exporter. # A chart can be either an 'application' or a 'library' chart. # @@ -15,13 +15,13 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.0.4 +version: 0.0.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.0.4" +appVersion: "0.0.2" home: https://github.com/tfadeyi/auth0-simple-exporter maintainers: diff --git a/deploy/charts/auth0-exporter/README.md b/deploy/charts/auth0-exporter/README.md index 9d42864..2a6aaea 100644 --- a/deploy/charts/auth0-exporter/README.md +++ b/deploy/charts/auth0-exporter/README.md @@ -1,8 +1,10 @@ # auth0-exporter -Auth0 Prometheus exporter +The helm chart for the auth0 prometheus exporter. -![Version: 0.0.3](https://img.shields.io/badge/Version-0.0.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.3](https://img.shields.io/badge/AppVersion-0.0.3-informational?style=flat-square) +[![Version](https://img.shields.io/github/v/release/tfadeyi/auth0-simple-exporter?color=blue&label=Version&sort=semver&style=flat-square)](https://img.shields.io/github/v/release/tfadeyi/auth0-simple-exporter?color=blue&label=Version&sort=semver&style=flat-square) +![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) +[![AppVersion](https://img.shields.io/github/v/release/tfadeyi/auth0-simple-exporter?color=blue&label=AppVersion&sort=semver&style=flat-square)](https://img.shields.io/github/v/release/tfadeyi/auth0-simple-exporter?color=blue&label=AppVersion&sort=semver&style=flat-square) ## Additional Information @@ -16,16 +18,16 @@ on the `/metrics` endpoint. #### Pass secret to chart as a value, it creates the secret This shows a simple installation of the exporter helm chart, running with TLS disabled. ```shell - $ export TOKEN="< auth0 management API static static token >" - $ export DOMAIN="< auth0 tenant domain >" + export TOKEN="< auth0 management API static static token >" + export DOMAIN="< auth0 tenant domain >" ``` - ```shell # Installing by passing in secret directly + helm repo add auth0-exporter https://tfadeyi.github.io/auth0-simple-exporter helm upgrade --install --create-namespace -n auth0-exporter auth0-exporter \ - https://tfadeyi.github.io/charts \ + auth0-simple-exporter \ --set auth0.domain="$DOMAIN" --set auth0.token="$TOKEN" \ - --set exporter.tls.disabled=true + --set exporter.tls.disabled=true ``` ## Values @@ -58,8 +60,8 @@ on the `/metrics` endpoint. | replicaCount | int | `1` | | | resources.limits.cpu | string | `"100m"` | | | resources.limits.memory | string | `"128Mi"` | | -| resources.requests.cpu | string | `"50m"` | | -| resources.requests.memory | string | `"64Mi"` | | +| resources.requests.cpu | string | `"100m"` | | +| resources.requests.memory | string | `"128Mi"` | | | securityContext.capabilities.drop[0] | string | `"ALL"` | | | securityContext.readOnlyRootFilesystem | bool | `true` | | | securityContext.runAsNonRoot | bool | `true` | | diff --git a/deploy/charts/auth0-exporter/README.md.gotmpl b/deploy/charts/auth0-exporter/README.md.gotmpl index 80ab26f..1250f3a 100644 --- a/deploy/charts/auth0-exporter/README.md.gotmpl +++ b/deploy/charts/auth0-exporter/README.md.gotmpl @@ -1,7 +1,9 @@ {{ template "chart.header" . }} {{ template "chart.description" . }} -{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} +[![Version](https://img.shields.io/github/v/release/tfadeyi/auth0-simple-exporter?color=blue&label=Version&sort=semver&style=flat-square)](https://img.shields.io/github/v/release/tfadeyi/auth0-simple-exporter?color=blue&label=Version&sort=semver&style=flat-square) +{{ template "chart.typeBadge" . }} +[![AppVersion](https://img.shields.io/github/v/release/tfadeyi/auth0-simple-exporter?color=blue&label=AppVersion&sort=semver&style=flat-square)](https://img.shields.io/github/v/release/tfadeyi/auth0-simple-exporter?color=blue&label=AppVersion&sort=semver&style=flat-square) ## Additional Information @@ -15,16 +17,16 @@ on the `/metrics` endpoint. #### Pass secret to chart as a value, it creates the secret This shows a simple installation of the exporter helm chart, running with TLS disabled. ```shell - $ export TOKEN="< auth0 management API static static token >" - $ export DOMAIN="< auth0 tenant domain >" + export TOKEN="< auth0 management API static static token >" + export DOMAIN="< auth0 tenant domain >" ``` - ```shell # Installing by passing in secret directly + helm repo add auth0-exporter https://tfadeyi.github.io/auth0-simple-exporter helm upgrade --install --create-namespace -n auth0-exporter auth0-exporter \ - https://tfadeyi.github.io/charts \ + auth0-simple-exporter \ --set auth0.domain="$DOMAIN" --set auth0.token="$TOKEN" \ - --set exporter.tls.disabled=true + --set exporter.tls.disabled=true ``` {{ template "chart.requirementsSection" . }} diff --git a/pkg/docs/docs.go b/pkg/docs/docs.go index ea90654..f763df0 100644 --- a/pkg/docs/docs.go +++ b/pkg/docs/docs.go @@ -49,8 +49,8 @@ const docTemplate = `{ // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ - Version: "0.0.3", - Host: "localhost:9301", + Version: "0.0.2", + Host: "localhost:8080", BasePath: "/", Schemes: []string{}, Title: "Auth0 simple exporter", diff --git a/pkg/docs/swagger.json b/pkg/docs/swagger.json index 2008c72..71d41b6 100644 --- a/pkg/docs/swagger.json +++ b/pkg/docs/swagger.json @@ -10,9 +10,9 @@ "name": "Apache 2.0", "url": "https://github.com/tfadeyi/auth0-simple-exporter/blob/main/LICENSE" }, - "version": "0.0.3" + "version": "0.0.2" }, - "host": "localhost:9301", + "host": "localhost:8080", "basePath": "/", "paths": { "/metrics": { diff --git a/pkg/docs/swagger.yaml b/pkg/docs/swagger.yaml index e1ad04c..7433dc7 100644 --- a/pkg/docs/swagger.yaml +++ b/pkg/docs/swagger.yaml @@ -1,5 +1,5 @@ basePath: / -host: localhost:9301 +host: localhost:8080 info: contact: name: Oluwole Fadeyi (@tfadeyi) @@ -10,7 +10,7 @@ info: name: Apache 2.0 url: https://github.com/tfadeyi/auth0-simple-exporter/blob/main/LICENSE title: Auth0 simple exporter - version: 0.0.3 + version: 0.0.2 paths: /metrics: get: diff --git a/pkg/exporter/server.go b/pkg/exporter/server.go index 77cb873..b1c1e9d 100644 --- a/pkg/exporter/server.go +++ b/pkg/exporter/server.go @@ -16,7 +16,7 @@ import ( ) // @title Auth0 simple exporter -// @version 0.0.3 +// @version 0.0.2 // @description A simple Prometheus exporter for Auth0 log [events](https://auth0.com/docs/api/management/v2#!/Logs/get_logs), // @description which allows you to collect metrics from Auth0 and expose them in a format that can be consumed by Prometheus. @@ -25,7 +25,7 @@ import ( // @license.name Apache 2.0 // @license.url https://github.com/tfadeyi/auth0-simple-exporter/blob/main/LICENSE -// @host localhost:9301 +// @host localhost:8080 // @BasePath / // Export configures the exporter Router and starts the server with the given configuration