Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Commit

Permalink
Remove metric scrape interval (#3)
Browse files Browse the repository at this point in the history
* remove metric scrape interval as it should be up to the invoker how to run

* feat: add gh workflows (iamseth#265)

* Bump github.com/BurntSushi/toml from 1.2.0 to 1.2.1 (iamseth#271)

Bumps [github.com/BurntSushi/toml](https://github.com/BurntSushi/toml) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/BurntSushi/toml/releases)
- [Commits](BurntSushi/toml@v1.2.0...v1.2.1)

---
updated-dependencies:
- dependency-name: github.com/BurntSushi/toml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump github.com/prometheus/exporter-toolkit from 0.7.3 to 0.8.2 (iamseth#272)

Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.7.3 to 0.8.2.
- [Release notes](https://github.com/prometheus/exporter-toolkit/releases)
- [Changelog](https://github.com/prometheus/exporter-toolkit/blob/master/CHANGELOG.md)
- [Commits](prometheus/exporter-toolkit@v0.7.3...v0.8.2)

---
updated-dependencies:
- dependency-name: github.com/prometheus/exporter-toolkit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump github.com/prometheus/client_golang from 1.13.0 to 1.14.0 (iamseth#274)

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.13.0 to 1.14.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](prometheus/client_golang@v1.13.0...v1.14.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump github.com/prometheus/common from 0.37.0 to 0.39.0 (iamseth#273)

Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.37.0 to 0.39.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](prometheus/common@v0.37.0...v0.39.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: Fixed github action runs against forked repos (iamseth#280)

* chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

fix: fix typo

fix: fix typo

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

fix: fix typo

* chore: savepoint

chore: savepoint

feat: test gh action pr-cleanup (#2)

* feat: test gh action pr-cleanup

* chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

* chore: savepoint

* chore: savepoint

* chore: savepoint

* chore: savepoint

* chore: savepoint

* chore: savepoint

* chore: savepoint

* feat: do a release 0.4.1 (#3)

* chore: savepoint

* chore: savepoint

* chore: savepoint

* feat: do a release 0.4.2 (iamseth#4)

* chore: savepoint

* chore: savepoint (iamseth#5)

* chore: savepoint

* chore: savepoint

* chore: savepoint

* feat: do release 0.4.4 (iamseth#6)

* feat: do a release 0.4.4

* chore: savepoint

* chore: savepoint

* chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

chore: savepoint

* fix: fix GitHub release failed with status: 403 (iamseth#282)

* Fix 0.4.0 compilation problem (iamseth#277)

* Fix parsing kingpin flags according to exporter-toolkit v0.8.2

Fixes iamseth#275

Signed-off-by: Nikolay Pelov <npelov@gmail.com>

* Update README file to reflect the changed options from exporter-toolkit.

* Update release version to 0.4.1

---------

Signed-off-by: Nikolay Pelov <npelov@gmail.com>

* Improve logging after the switch to github.com/go-kit/kit/log (iamseth#278)

Signed-off-by: Nikolay Pelov <npelov@gmail.com>

* refact: refact PR/release github-actions  (iamseth#286)

* refact: refact PR github action a bit

* chore: savepoint

* chore: savepoint

* Caiwc/multi target (iamseth#234)

* feat(): support scrape multi target

rebase branch && update Makefile version

* add multi-target explain to readme

* docs: correct dns example port of readme

---------

Co-authored-by: wccai <wccai@easyops.cn>
Co-authored-by: wccai <wccai@easyops>

* README: add example of image hosted on github image registry

* Bump golang.org/x/net from 0.4.0 to 0.7.0 (iamseth#290)

Bumps [golang.org/x/net](https://github.com/golang/net) from 0.4.0 to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](golang/net@v0.4.0...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump github.com/prometheus/common from 0.39.0 to 0.40.0 (iamseth#291)

Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.39.0 to 0.40.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](prometheus/common@v0.39.0...v0.40.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump github.com/prometheus/common from 0.40.0 to 0.41.0 (iamseth#292)

Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.40.0 to 0.41.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](prometheus/common@v0.40.0...v0.41.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump github.com/prometheus/exporter-toolkit from 0.8.2 to 0.9.0 (iamseth#294)

Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.8.2 to 0.9.0.
- [Release notes](https://github.com/prometheus/exporter-toolkit/releases)
- [Changelog](https://github.com/prometheus/exporter-toolkit/blob/master/CHANGELOG.md)
- [Commits](prometheus/exporter-toolkit@v0.8.2...v0.9.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/exporter-toolkit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump github.com/prometheus/exporter-toolkit from 0.9.0 to 0.9.1 (iamseth#295)

Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.9.0 to 0.9.1.
- [Release notes](https://github.com/prometheus/exporter-toolkit/releases)
- [Changelog](https://github.com/prometheus/exporter-toolkit/blob/master/CHANGELOG.md)
- [Commits](prometheus/exporter-toolkit@v0.9.0...v0.9.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/exporter-toolkit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump github.com/prometheus/common from 0.41.0 to 0.42.0 (iamseth#296)

Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.41.0 to 0.42.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](prometheus/common@v0.41.0...v0.42.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix broken link (iamseth#298)

* 👷 Update packages versions + clean up

* Update packages versions + clean up
* Use Oracle image to retrieve binaries
* Use FQN for docker image

* 🐛 Fix oraclelinux image build

* 🔧 Use a parameter to set oracle client version

* remove percent and hyphen (iamseth#302)

Some oracledb tables return names with % and -

* try to resolve scrape interval of 0 implications

* fix scrape interval nil check

* fix synchronization

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Nikolay Pelov <npelov@gmail.com>
Co-authored-by: Viktor Utkin <vutkin@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nikolay Pelov <npelov@gmail.com>
Co-authored-by: caiwc <wc1002075582@qq.com>
Co-authored-by: wccai <wccai@easyops.cn>
Co-authored-by: wccai <wccai@easyops>
Co-authored-by: Yannig Perré <yannig.perre@aios.sh>
Co-authored-by: markruler <imcxsu@gmail.com>
Co-authored-by: Yannig <yannig.perre@gmail.com>
Co-authored-by: Egor Sidortsov <marquizee@yandex.ru>
  • Loading branch information
11 people authored Apr 14, 2023
1 parent 6896822 commit 74cb2dc
Show file tree
Hide file tree
Showing 23 changed files with 1,487 additions and 655 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ alpline
.*
tests
*-example.toml
.golangci.yml
*.md
*.pc
dist
34 changes: 34 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Description

<!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. -->

Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

# How Has This Been Tested?

<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->

## Screenshots (if appropriate):

# Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
- [ ] Updated version in Makefile respecting [semver v2](https://semver.org/spec/v2.0.0.html)
Empty file.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"
16 changes: 16 additions & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## I'm submitting a ...

- [ ] bug report
- [ ] feature request

## What is the current behavior?

## If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

## What is the expected behavior?

## What is the motivation / use case for changing the behavior?

## Please tell us about your environment:

Version: X.Y.Z
20 changes: 20 additions & 0 deletions .github/workflow-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"go-version": "1.19.4",
"deploy": {
"pull-request": true,
"sign-docker-image": false,
"pull-request-images": [
{
"name": "ubuntu"
}
],
"release-images": [
{
"name": "ubuntu"
},
{
"name": "oraclelinux"
}
]
}
}
96 changes: 96 additions & 0 deletions .github/workflows/pull-request-cleanup-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: "[Manual] Pull Request Cleanup"

on:
workflow_dispatch:
inputs:
pattern:
description: |
Tags pattern filter
required: true
type: string
default: "rc.pr-"

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

permissions:
contents: write
packages: write

env:
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
PULL_REQUEST_BRANCH: ${{ github.head_ref }}
IMAGE_NAME: "ghcr.io/${{ github.repository }}"
PACKAGE_NAME: oracledb_exporter
PACKAGE_TYPE: container
USERNAME: ${{ github.repository_owner }}

jobs:
cleanup-ghcr:
runs-on: ubuntu-latest
name: "cleanup ghcr / ${{ github.event.inputs.pattern }}"
steps:
- name: Cleanup versions
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILTER: ${{ github.event.inputs.pattern }}
run: |
gh api \
-H "Accept: application/vnd.github+json" \
"/users/${{ env.USERNAME }}/packages/${{ env.PACKAGE_TYPE }}/${{ env.PACKAGE_NAME }}/versions" > versions.json
VERSIONS=$(jq -r '.[] | select(.metadata.container.tags[] | test("${{ env.FILTER }}")) | .id' versions.json)
for VERSION in $(echo -n "$VERSIONS")
do
TAG=$(jq -r \
--arg VERSION "$VERSION" \
'.[] | select(.id | tostring | test($VERSION)) | .metadata.container.tags | join(",")' \
versions.json
)
DIGEST=$(jq -r \
--arg VERSION "$VERSION" \
'.[] | select(.id | tostring | test($VERSION)) | .name' \
versions.json
)
echo "deleting ${IMAGE_NAME}:${TAG} with digest=${DIGEST}"
echo "deleting package PACKAGE_VERSION_ID=${VERSION}"
# https://github.com/cli/cli/issues/3937
echo -n | gh api \
--silent \
--method DELETE \
-H "Accept: application/vnd.github+json" \
"/users/${{ env.USERNAME }}/packages/${{ env.PACKAGE_TYPE }}/${{ env.PACKAGE_NAME }}/versions/$VERSION" \
--input -
done
cleanup-pre-releases:
runs-on: ubuntu-latest
name: "cleanup pre-releases / ${{ github.event.inputs.pattern }}"
steps:
- name: Cleanup releases
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILTER: ${{ github.event.inputs.pattern }}
run: |
gh api \
-H "Accept: application/vnd.github+json" \
"/repos/${{ github.repository }}/releases" \
--jq='.[] | select(.prerelease=false) | select(.tag_name | test("${{ env.FILTER }}"))' > versions.json
VERSIONS=$(jq -r '.id' versions.json)
for VERSION in $(echo -n "$VERSIONS")
do
RELEASE=$(jq -r \
--arg VERSION "$VERSION" \
'select(.id | tostring | test($VERSION)) | .name' \
versions.json
)
echo "deleting release \"$RELEASE\" with RELEASE_ID=${VERSION}"
# https://github.com/cli/cli/issues/3937
echo -n | gh api \
--silent \
--method DELETE \
-H "Accept: application/vnd.github+json" \
"/repos/${{ github.repository }}/releases/$VERSION" \
--input -
done
90 changes: 90 additions & 0 deletions .github/workflows/pull-request-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Pull Request Cleanup

on:
pull_request:
types: [closed]

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

env:
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
PULL_REQUEST_BRANCH: ${{ github.head_ref }}
IMAGE_NAME: "ghcr.io/${{ github.repository }}"
PACKAGE_NAME: oracledb_exporter
PACKAGE_TYPE: container
USERNAME: ${{ github.repository_owner }}

permissions:
contents: write
packages: write

jobs:
cleanup-ghcr:
runs-on: ubuntu-latest
name: "cleanup ghcr"
steps:
- name: Cleanup versions
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILTER: rc.pr-${{ env.PULL_REQUEST_NUMBER }}
run: |
gh api \
-H "Accept: application/vnd.github+json" \
"/users/${{ env.USERNAME }}/packages/${{ env.PACKAGE_TYPE }}/${{ env.PACKAGE_NAME }}/versions" > versions.json
VERSIONS=$(jq -r '.[] | select(.metadata.container.tags[] | test("${{ env.FILTER }}")) | .id' versions.json)
for VERSION in $(echo -n "$VERSIONS")
do
TAG=$(jq -r \
--arg VERSION "$VERSION" \
'.[] | select(.id | tostring | test($VERSION)) | .metadata.container.tags | join(",")' \
versions.json
)
DIGEST=$(jq -r \
--arg VERSION "$VERSION" \
'.[] | select(.id | tostring | test($VERSION)) | .name' \
versions.json
)
echo "deleting ${IMAGE_NAME}:${TAG} with digest=${DIGEST}"
echo "deleting package PACKAGE_VERSION_ID=${VERSION}"
# https://github.com/cli/cli/issues/3937
echo -n | gh api \
--silent \
--method DELETE \
-H "Accept: application/vnd.github+json" \
"/users/${{ env.USERNAME }}/packages/${{ env.PACKAGE_TYPE }}/${{ env.PACKAGE_NAME }}/versions/$VERSION" \
--input -
done
cleanup-pre-releases:
runs-on: ubuntu-latest
name: "cleanup pre-releases"
steps:
- name: Cleanup releases
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILTER: rc.pr-${{ env.PULL_REQUEST_NUMBER }}
run: |
gh api \
-H "Accept: application/vnd.github+json" \
"/repos/${{ github.repository }}/releases" \
--jq='.[] | select(.prerelease=false) | select(.tag_name | test("${{ env.FILTER }}"))' > versions.json
VERSIONS=$(jq -r '.id' versions.json)
for VERSION in $(echo -n "$VERSIONS")
do
RELEASE=$(jq -r \
--arg VERSION "$VERSION" \
'select(.id | tostring | test($VERSION)) | .name' \
versions.json
)
echo "deleting release \"$RELEASE\" with RELEASE_ID=${VERSION}"
# https://github.com/cli/cli/issues/3937
echo -n | gh api \
--silent \
--method DELETE \
-H "Accept: application/vnd.github+json" \
"/repos/${{ github.repository }}/releases/$VERSION" \
--input -
done
Loading

0 comments on commit 74cb2dc

Please sign in to comment.