This repository has been archived by the owner on May 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from azrod/devel
Merge from devel
- Loading branch information
Showing
17 changed files
with
230 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,41 @@ | ||
--- | ||
name: build on push dev | ||
name: CI devel | ||
|
||
on: | ||
push: | ||
branches: | ||
- "devel" | ||
|
||
jobs: | ||
gosec: | ||
runs-on: ubuntu-latest | ||
env: | ||
GO111MODULE: on | ||
steps: | ||
- name: Checkout Source | ||
uses: actions/checkout@v2 | ||
- name: Run Gosec Security Scanner | ||
uses: securego/gosec@master | ||
with: | ||
# we let the report trigger content trigger a failure using the GitHub Security features. | ||
args: "-no-fail -fmt sarif -out results.sarif ./..." | ||
- name: Upload SARIF file | ||
uses: github/codeql-action/upload-sarif@v1 | ||
with: | ||
# Path to SARIF file relative to the root of the repository | ||
sarif_file: results.sarif | ||
snyk: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- uses: snyk/actions/setup@master | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: "1.17" | ||
- name: Snyk monitor | ||
run: snyk test | ||
env: | ||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Providers | ||
|
||
A lot of providers are available. | ||
|
||
* [AWS](aws.md) | ||
* [Cloudflare](cloudflare.md) | ||
* [OVH](ovh.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package uip_cloudflare | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/prometheus/client_golang/prometheus" | ||
) | ||
|
||
var ( | ||
countUpdate = prometheus.NewCounter( | ||
prometheus.CounterOpts{ | ||
Name: "updateip_cloudflare_update", | ||
Help: "Number of ip updated on Cloudflare provider.", | ||
}, | ||
) | ||
|
||
// Status ... | ||
providerStatus = prometheus.NewGauge( | ||
prometheus.GaugeOpts{ | ||
Name: "updateip_cloudflare_status", | ||
Help: "cloudflare Providers status.", | ||
}, | ||
) | ||
|
||
// Histo ... | ||
funcTime = prometheus.NewHistogramVec(prometheus.HistogramOpts{ | ||
Name: "updateip_cloudflare_func_time", | ||
Help: "Time taken to do ...", | ||
}, | ||
[]string{"where"}, | ||
) | ||
|
||
eventReceive = prometheus.NewCounter( | ||
prometheus.CounterOpts{ | ||
Name: "updateip_cloudflare_event_receive", | ||
Help: "Count of events received on Cloudflare.", | ||
}, | ||
) | ||
) | ||
|
||
func (d *PCloudflare) RegistryMetrics() map[string][]interface{} { | ||
|
||
x := make(map[string][]interface{}) | ||
x["counter"] = []interface{}{countUpdate} | ||
x["gauge"] = []interface{}{providerStatus} | ||
x["gaugeVec"] = []interface{}{funcTime} | ||
|
||
return x | ||
} | ||
|
||
// TimeTrackS ... | ||
func timeTrackS(start time.Time, name string) { | ||
elapsed := time.Since(start) | ||
funcTime.WithLabelValues(name).Observe(elapsed.Seconds()) | ||
} |
Oops, something went wrong.