Skip to content

Commit

Permalink
New major version
Browse files Browse the repository at this point in the history
  • Loading branch information
snovichkov committed Feb 20, 2023
1 parent 541359c commit 358b353
Show file tree
Hide file tree
Showing 10 changed files with 626 additions and 463 deletions.
15 changes: 15 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
coverage:
range: 70..98
round: down
precision: 2
status:
project:
default:
enabled: yes
target: 89
if_not_found: success
if_ci_failed: error
patch:
default:
enabled: yes
target: 70
34 changes: 34 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Unit Tests

on:
push:
branches: [ "master" ]

pull_request:
branches: [ "master" ]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
go-version:
- 1.18
- 1.19

steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}

- name: Run Tests
run: bash .scripts/test.sh

- name: Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
15 changes: 15 additions & 0 deletions .scripts/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -e

if [[ -f coverage.txt ]]; then
rm coverage.txt
fi

for d in $(go list ./... | grep -v ditest); do
go test -coverprofile=profile.out -coverpkg=./... -covermode=atomic "$d"
if [[ -f profile.out ]]; then
cat profile.out >>coverage.txt
rm profile.out
fi
done
39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,37 @@
# GoZix Prometheus

[documentation-img]: https://img.shields.io/badge/godoc-reference-blue.svg?color=24B898&style=for-the-badge&logo=go&logoColor=ffffff
[documentation-url]: https://pkg.go.dev/github.com/gozix/prometheus/v2
[license-img]: https://img.shields.io/github/license/gozix/prometheus.svg?style=for-the-badge
[license-url]: https://github.com/gozix/prometheus/blob/master/LICENSE
[release-img]: https://img.shields.io/github/tag/gozix/prometheus.svg?label=release&color=24B898&logo=github&style=for-the-badge
[release-url]: https://github.com/gozix/prometheus/releases/latest
[build-status-img]: https://img.shields.io/github/actions/workflow/status/gozix/prometheus/go.yml?logo=github&style=for-the-badge
[build-status-url]: https://github.com/gozix/prometheus/actions
[go-report-img]: https://img.shields.io/badge/go%20report-A%2B-green?style=for-the-badge
[go-report-url]: https://goreportcard.com/report/github.com/gozix/prometheus
[code-coverage-img]: https://img.shields.io/codecov/c/github/gozix/prometheus.svg?style=for-the-badge&logo=codecov
[code-coverage-url]: https://codecov.io/gh/gozix/prometheus

[![License][license-img]][license-url]
[![Documentation][documentation-img]][documentation-url]

[![Release][release-img]][release-url]
[![Build Status][build-status-img]][build-status-url]
[![Go Report Card][go-report-img]][go-report-url]
[![Code Coverage][code-coverage-img]][code-coverage-url]

The bundle provide a Prometheus integration to GoZix application.

## Installation

```shell
go get github.com/gozix/prometheus/v2
```

## Dependencies

* [zap](https://github.com/gozix/zap)
* [zap](https://github.com/gozix/prometheus)
* [viper](https://github.com/gozix/viper)

## Configuration example
Expand All @@ -22,3 +51,11 @@
```
--prometheus-port - Prometheus metrics port. The same `prometheus.port` config, but with high priority.
```

## Documentation

You can find documentation on [pkg.go.dev][documentation-url] and read source code if needed.

## Questions

If you have any questions, feel free to create an issue.
49 changes: 40 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,45 @@
module github.com/gozix/prometheus
module github.com/gozix/prometheus/v2

go 1.15
go 1.18

require (
github.com/gozix/glue/v2 v2.3.0
github.com/gozix/viper/v2 v2.1.1
github.com/gozix/zap/v2 v2.0.2
github.com/prometheus/client_golang v1.7.1
github.com/sarulabs/di/v2 v2.4.0
github.com/gozix/di v1.0.0
github.com/gozix/glue/v3 v3.0.0
github.com/gozix/viper/v3 v3.0.0
github.com/gozix/zap/v3 v3.0.0
github.com/prometheus/client_golang v1.14.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.1
go.uber.org/zap v1.16.0
github.com/spf13/viper v1.15.0
go.uber.org/zap v1.24.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.40.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/cobra v1.6.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 358b353

Please sign in to comment.