-
-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: SuperQ <[email protected]>
- Loading branch information
Showing
23 changed files
with
599 additions
and
581 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,21 +1,16 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: gomod | ||
directory: / | ||
schedule: | ||
interval: weekly | ||
open-pull-requests-limit: 10 | ||
groups: | ||
aws-sdk-v2: | ||
patterns: | ||
- "github.com/aws/aws-sdk-go-v2*" | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: weekly | ||
open-pull-requests-limit: 10 | ||
- package-ecosystem: docker | ||
directory: / | ||
schedule: | ||
interval: weekly | ||
open-pull-requests-limit: 10 | ||
- package-ecosystem: gomod | ||
directory: / | ||
schedule: | ||
interval: monthly | ||
open-pull-requests-limit: 10 | ||
groups: | ||
aws-sdk-v2: | ||
patterns: | ||
- "github.com/aws/aws-sdk-go-v2*" | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: monthly | ||
open-pull-requests-limit: 10 |
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,29 @@ | ||
name: Go | ||
|
||
on: | ||
pull_request: | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
container: | ||
image: quay.io/prometheus/golang-builder:1.23-base | ||
steps: | ||
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | ||
- uses: prometheus/promci@52c7012f5f0070d7281b8db4a119e21341d43c91 # v0.4.5 | ||
- uses: ./.github/promci/actions/setup_environment | ||
- run: make | ||
- run: git diff --exit-code | ||
|
||
verify-example-configs: | ||
name: verify | ||
runs-on: ubuntu-latest | ||
container: | ||
image: quay.io/prometheus/golang-builder:1.23-base | ||
steps: | ||
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | ||
- run: make build | ||
- name: Verify example configs | ||
run: find ./examples -name "*.yml" -print0 | xargs -0 -I % ./yace verify-config -config.file % |
This file was deleted.
Oops, something went wrong.
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,39 @@ | ||
--- | ||
# This action is synced from https://github.com/prometheus/prometheus | ||
name: golangci-lint | ||
on: | ||
push: | ||
paths: | ||
- "go.sum" | ||
- "go.mod" | ||
- "**.go" | ||
- "scripts/errcheck_excludes.txt" | ||
- ".github/workflows/golangci-lint.yml" | ||
- ".golangci.yml" | ||
pull_request: | ||
|
||
permissions: # added using https://github.com/step-security/secure-repo | ||
contents: read | ||
|
||
jobs: | ||
golangci: | ||
permissions: | ||
contents: read # for actions/checkout to fetch code | ||
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
- name: Install Go | ||
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 | ||
with: | ||
go-version: 1.23.x | ||
- name: Install snmp_exporter/generator dependencies | ||
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev | ||
if: github.repository == 'prometheus/snmp_exporter' | ||
- name: Lint | ||
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1 | ||
with: | ||
args: --verbose | ||
version: v1.61.0 |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
.build | ||
yet-another-cloudwatch-exporter | ||
!charts/yet-another-cloudwatch-exporter | ||
vendor | ||
dist | ||
/yace | ||
.idea | ||
*.tar.gz |
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,25 @@ | ||
--- | ||
extends: default | ||
ignore: | | ||
**/node_modules | ||
|
||
rules: | ||
braces: | ||
max-spaces-inside: 1 | ||
level: error | ||
brackets: | ||
max-spaces-inside: 1 | ||
level: error | ||
commas: disable | ||
comments: disable | ||
comments-indentation: disable | ||
document-start: disable | ||
indentation: | ||
spaces: consistent | ||
indent-sequences: consistent | ||
key-duplicates: | ||
ignore: | | ||
config/testdata/section_key_dup.bad.yml | ||
line-length: disable | ||
truthy: | ||
check-keys: false |
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,29 +1,15 @@ | ||
FROM golang:1.23 as builder | ||
ARG ARCH="amd64" | ||
ARG OS="linux" | ||
FROM quay.io/prometheus/busybox-${OS}-${ARCH}:latest | ||
LABEL maintainer="The Prometheus Authors <[email protected]>" | ||
|
||
WORKDIR /opt/ | ||
ARG ARCH="amd64" | ||
ARG OS="linux" | ||
COPY .build/${OS}-${ARCH}/yace /bin/yace | ||
|
||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
COPY examples/ec2.yml /etc/yace/config.yml | ||
|
||
COPY . ./ | ||
|
||
ENV GOOS linux | ||
ENV CGO_ENABLED=0 | ||
|
||
ARG VERSION | ||
RUN go build -v -ldflags "-X main.version=$VERSION" -o yace ./cmd/yace | ||
|
||
FROM alpine:3.20.3 | ||
|
||
EXPOSE 5000 | ||
ENTRYPOINT ["yace"] | ||
CMD ["--config.file=/tmp/config.yml"] | ||
RUN addgroup -g 1000 exporter && \ | ||
adduser -u 1000 -D -G exporter exporter -h /exporter | ||
|
||
WORKDIR /exporter/ | ||
|
||
|
||
RUN apk --no-cache add ca-certificates | ||
COPY --from=builder /opt/yace /usr/local/bin/yace | ||
USER exporter | ||
EXPOSE 5000 | ||
USER nobody | ||
ENTRYPOINT [ "/bin/yace" ] | ||
CMD [ "--config.file=/etc/yace/config.yml" ] |
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
global: | ||
scrape_interval: 1m | ||
|
||
scrape_configs: | ||
- job_name: "prometheus" | ||
- job_name: prometheus | ||
scrape_interval: 1m | ||
static_configs: | ||
- targets: ["localhost:9090"] | ||
|
||
- job_name: "yace" | ||
- targets: | ||
- localhost:9090 | ||
- job_name: yace | ||
static_configs: | ||
- targets: ["yace:8080"] | ||
- targets: | ||
- yace:8080 |
Oops, something went wrong.