Skip to content
Merged
Show file tree
Hide file tree
Changes from 123 commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
6eec2ab
Upgrade alpine to 3.18
xbglowx Aug 14, 2023
61f91b8
only include end user views when calculating counts of edge responses
dashford Mar 21, 2024
f612a39
Merge pull request #98 from xbglowx/upgrade-alpine-3.18
haad May 7, 2024
7f97eee
Go 1.22 update (#111)
haad May 13, 2024
b5d2b68
Bump alpine from 3.18 to 3.19
dependabot[bot] May 13, 2024
d836b24
Bump docker/setup-buildx-action from 1 to 3
dependabot[bot] May 13, 2024
326182f
Bump actions/setup-python from 2 to 5
dependabot[bot] May 13, 2024
0c93173
Bump docker/login-action from 1 to 3
dependabot[bot] May 13, 2024
5db0a2b
Bump actions/checkout from 2 to 4
dependabot[bot] May 13, 2024
563c4bf
Bump docker/build-push-action from 2 to 5
dependabot[bot] May 13, 2024
1e8953b
fix: CF_ZONES env var
pippitt May 15, 2024
53e8c34
Merge pull request #119 from pippitt/fix_cf_zones_filter
haad May 18, 2024
33910a6
Bump appVersion
haad May 20, 2024
7ff2795
Merge pull request #117 from lablabs/dependabot/github_actions/docker…
haad May 20, 2024
e78ba22
Merge pull request #116 from lablabs/dependabot/github_actions/action…
haad May 20, 2024
28f1e34
Merge pull request #115 from lablabs/dependabot/github_actions/docker…
haad May 20, 2024
f85b339
Merge pull request #114 from lablabs/dependabot/github_actions/action…
haad May 20, 2024
b78d4b3
Merge pull request #113 from lablabs/dependabot/github_actions/docker…
haad May 20, 2024
8bc93cb
Merge pull request #112 from lablabs/dependabot/docker/alpine-3.19
haad May 20, 2024
e4d9289
Bump alpine from 3.19 to 3.20
dependabot[bot] May 27, 2024
8093437
Bump docker/setup-qemu-action from 1 to 3
dependabot[bot] May 27, 2024
ba7fbea
Bump helm/kind-action from 1.2.0 to 1.10.0
dependabot[bot] May 27, 2024
2d8f2b7
Bump azure/setup-helm from 1 to 4
dependabot[bot] May 27, 2024
3f3f325
Bump docker/metadata-action from 3 to 5
dependabot[bot] May 27, 2024
cd7b22f
Bump docker/build-push-action from 5 to 6
dependabot[bot] Jun 24, 2024
3ed476a
feat: Add R2 metrics
Cyb3r-Jak3 Aug 1, 2024
26f0536
docs: Add new metrics to README
Cyb3r-Jak3 Aug 1, 2024
ddad742
Add pprof
Hexta Sep 20, 2024
f8fe7b0
Remove datetime from the workerInvocationsAdaptive query
jackatbancast Oct 25, 2024
191cd85
Export worker invocation status on metrics
jackatbancast Oct 25, 2024
5c929e9
Update README.md
mpursley Dec 12, 2024
6449a22
Refactored with cloudflare v4 library
fatihusta Feb 22, 2025
cd23d12
added cloudflare_pool_origin_health_status metric
fatihusta Feb 22, 2025
5c12451
removed batch_size
fatihusta Feb 22, 2025
76e240a
doc: updated README
fatihusta Feb 22, 2025
5292c3f
Add podLabels support
RafikFarhad Mar 3, 2025
5e0d502
Works on empty
RafikFarhad Mar 3, 2025
a7f59bd
Added on pod template
RafikFarhad Mar 3, 2025
19decbc
:package: Improve CLI help
andrew-demb Mar 16, 2025
f8d2348
:package: Improve fatal error messages to simplify investigate why th…
andrew-demb Mar 16, 2025
507678f
:package: Resolve docker build deprecations
andrew-demb Mar 16, 2025
f141c45
:package: Improve error messages to simplify investigate
andrew-demb Mar 16, 2025
9570b93
feat(zone_firewall): Custom Firewall rule name metrics
userbradley Oct 1, 2025
97fb47e
Merge pull request #139 from mpursley/patch-1
haad Oct 3, 2025
ced8620
Merge pull request #145 from andrew-demb/cobra-improvements
haad Oct 3, 2025
f28832d
Merge pull request #146 from andrew-demb/logger-improve-fatal-message
haad Oct 3, 2025
675bfd3
Merge pull request #148 from userbradley/master
haad Oct 3, 2025
0521e44
Merge pull request #147 from andrew-demb/docker-improvements
haad Oct 3, 2025
2150d8f
Make querying interval configurable and improve error handling
Oct 3, 2025
a46ee5e
Merge branch 'master' into add-r2-metrics
haad Oct 3, 2025
ddafaf4
Merge pull request #130 from Cyb3r-Jak3/add-r2-metrics
haad Oct 3, 2025
7d378c9
Merge pull request #136 from jackatbancast/fixup-worker-metrics
haad Oct 3, 2025
da7da16
Merge pull request #143 from RafikFarhad/add-pod-labels
haad Oct 3, 2025
d7a8e71
Merge branch 'master' into pprof
haad Oct 3, 2025
4658218
Merge pull request #132 from Hexta/pprof
haad Oct 3, 2025
567a85c
Merge pull request #123 from lablabs/dependabot/github_actions/docker…
haad Oct 3, 2025
916bae5
Merge pull request #124 from lablabs/dependabot/github_actions/helm/k…
haad Oct 3, 2025
599f8ac
Merge pull request #125 from lablabs/dependabot/github_actions/azure/…
haad Oct 3, 2025
421177f
Merge pull request #126 from lablabs/dependabot/github_actions/docker…
haad Oct 3, 2025
1a4bce7
Merge pull request #128 from lablabs/dependabot/github_actions/docker…
haad Oct 3, 2025
a9a748b
Merge pull request #122 from lablabs/dependabot/docker/alpine-3.20
haad Oct 3, 2025
08e7dc8
Merge pull request #109 from dashford/patch-1
haad Oct 3, 2025
f8fa69c
Fix merge error, fix issues found with golang-ci run.
haad Oct 5, 2025
3f47eca
Add new template for PR to make sure users know how to test PRs befor…
haad Oct 5, 2025
b76a888
Fix space in Makefile
haad Oct 5, 2025
8b2d48e
Bump go version to 1.25
haad Oct 5, 2025
34a43b5
Update golangci github action to version 8
haad Oct 5, 2025
2facc69
update branch from master
fatihusta Oct 5, 2025
c05bb1c
Bump alpine from 3.20 to 3.22
dependabot[bot] Oct 6, 2025
244417e
Bump helm/chart-releaser-action from 1.6.0 to 1.7.0
dependabot[bot] Oct 6, 2025
8fa4ec8
Bump actions/checkout from 4 to 5
dependabot[bot] Oct 6, 2025
406d088
Bump actions/setup-python from 5 to 6
dependabot[bot] Oct 6, 2025
f160e13
Bump helm/kind-action from 1.10.0 to 1.12.0
dependabot[bot] Oct 6, 2025
591c225
Bump helm/chart-testing-action from 2.6.1 to 2.7.0
dependabot[bot] Oct 6, 2025
c63c49d
Merge pull request #157 from lablabs/dependabot/github_actions/helm/c…
haad Oct 6, 2025
0200478
Merge pull request #156 from lablabs/dependabot/github_actions/helm/k…
haad Oct 6, 2025
247f141
Merge pull request #155 from lablabs/dependabot/github_actions/action…
haad Oct 6, 2025
be416d9
Merge pull request #154 from lablabs/dependabot/github_actions/action…
haad Oct 6, 2025
b5e85d3
Merge pull request #153 from lablabs/dependabot/github_actions/helm/c…
haad Oct 6, 2025
72c201e
Merge pull request #152 from lablabs/dependabot/docker/alpine-3.22
haad Oct 6, 2025
7945f13
Merge master
Oct 6, 2025
a040ea9
Merge pull request #150 from pagbrl/improve-reliability
haad Oct 6, 2025
cfef7bc
use ko instead of docker and add attestation
nissessenap Oct 7, 2025
af75a65
add ko to master release
nissessenap Oct 7, 2025
f13053a
support dockerhub
nissessenap Oct 7, 2025
962489f
copy
nissessenap Oct 7, 2025
e75e21b
latest
nissessenap Oct 7, 2025
d8d09b9
README
nissessenap Oct 7, 2025
03dbbab
fix: Remove fatal errors outside main.go to improve flexibility
arsenetar Oct 8, 2025
2c902f2
Set Filtering Zone to debug
nissessenap Oct 9, 2025
219d7c5
added new graphql client struct and middleware
fatihusta Oct 9, 2025
5bd8cec
added cloudflare request timeout option(cf_timeout)
fatihusta Oct 9, 2025
3450b1e
moved gqlQueryLimit const into graphql file
fatihusta Oct 9, 2025
c26a8c8
added timeout option gql req ctx
fatihusta Oct 9, 2025
317a6e2
added log function into graphql client
fatihusta Oct 9, 2025
13f2a8b
moved gql mutex before ctx
fatihusta Oct 9, 2025
4aeb67b
added GetTimeRange utils function
fatihusta Oct 9, 2025
8788ef6
added auto pagination
fatihusta Oct 9, 2025
7545915
moved json helper function into utils.go
fatihusta Oct 9, 2025
d918fdf
moved cfgraphqlreqlimit into graphql.go
fatihusta Oct 9, 2025
1a846b5
add debug log again for metricsSet
fatihusta Oct 11, 2025
8e18c66
fix: merge master into this branch
fatihusta Oct 11, 2025
f613d0c
Bump actions/setup-go from 5 to 6
dependabot[bot] Oct 13, 2025
caf3dc4
Merge pull request #166 from lablabs/dependabot/github_actions/action…
haad Oct 13, 2025
1a25437
Merge pull request #160 from nissessenap/mini_docker
haad Oct 13, 2025
82d93a5
Merge pull request #163 from arsenetar/as/no-fatal-outside-main
haad Oct 13, 2025
b8cbf88
Merge pull request #164 from nissessenap/filter_log_level
haad Oct 13, 2025
096d32c
Merge branch 'master' into cf4
fatihusta Oct 14, 2025
b229fa1
fix: potential infinite loop during cf auto page
fatihusta Oct 16, 2025
78e65e5
Bump actions/attest-build-provenance from 2 to 3
dependabot[bot] Oct 20, 2025
efbd569
Add basic Cloudflare Tunnel support
sboschman Oct 20, 2025
3973838
fix: use original fatal message
fatihusta Oct 24, 2025
2b80fc2
fix: linting issues
fatihusta Oct 24, 2025
801029e
Merge pull request #142 from fatihusta/cf4
haad Nov 6, 2025
4d7257a
Merge remote-tracking branch 'origin' into cloudflare_tunnel
sboschman Nov 7, 2025
f39eb59
chore: tidy up go.mod
sboschman Nov 7, 2025
f9d9aec
Merge pull request #169 from sboschman/cloudflare_tunnel
haad Nov 8, 2025
1b05e02
Merge pull request #168 from lablabs/dependabot/github_actions/action…
haad Nov 8, 2025
763e5d7
Add sleep to e2e tests execution
haad Nov 8, 2025
73c3896
Update PR doc
haad Nov 10, 2025
8aaea09
Merge remote-tracking branch 'upstream/master' into merge-upstream
alowde Nov 13, 2025
cfd3a5d
Align added functions with current code patterns
alowde Nov 13, 2025
35b91f5
Align names with current linter requirements
alowde Nov 13, 2025
18397d8
Fix merge conflict resolution errors
alowde Nov 13, 2025
dfce6bb
Fix merge conflict resolution errors
alowde Nov 13, 2025
b3a8da5
Update chart linting Python version as 3.7 is removed.
alowde Nov 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig is awesome: http://EditorConfig.org

root = true

[*]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8

[*.{yml, yaml}]
indent_size = 2

[*.go]
indent_style = tab

[Makefile]
indent_style = tab
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ updates:
interval: "weekly"
reviewers:
- "Shopify/infrasec"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
36 changes: 36 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## Pull Request Template

### Description
Please provide a brief description of the changes in this PR.

### Type of Change
- [ ] 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)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Other (please describe):

### Testing
- [ ] I have run `make pr-tests` and all tests pass
- [ ] 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

### Code Quality
- [ ] 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

### Before Submitting
Please ensure you have completed the following before submitting your PR:

```bash
# Run comprehensive tests
make pr-tests
```

If the above command fails, please fix the issues before submitting your PR.

### Additional Notes
Add any other context about the pull request here.
88 changes: 52 additions & 36 deletions .github/workflows/docker-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,67 @@ on:

jobs:
build-and-push-docker-image:
permissions:
contents: read
packages: write
id-token: write

name: Build Docker image and push to repositories with tag latest
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
lablabs/cloudflare_exporter
ghcr.io/lablabs/cloudflare_exporter
# generate Docker tags based on the following events/attributes
tags: type=raw,value=latest

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
uses: actions/checkout@v5

- name: Login to Github Packages
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build image and push to Docker Hub and GitHub Container Registry
uses: docker/build-push-action@v2

- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
go-version-file: "go.mod"
cache: false


- uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9
with:
version: v0.18.0
- name: Build and push
id: publish-image
env:
KO_DOCKER_REPO: "ghcr.io/${{ github.repository }}"
run: |
ko build . --sbom=none --bare --platform linux/arm64,linux/amd64 -t latest \
--image-label org.opencontainers.image.title=cloudflare-exporter \
--image-label org.opencontainers.image.description="Prometheus CloudFlare Exporter" \
--image-label org.opencontainers.image.url=${{ github.server_url }}/${{ github.repository }} \
--image-label org.opencontainers.image.revision=${{ github.sha }} \
--image-label org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} \
--image-label org.opencontainers.image.licenses=Apache-2.0 \
--image-label org.opencontainers.image.version=latest \
--image-label org.opencontainers.image.created="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"

distribute-to-dockerhub:
runs-on: ubuntu-latest
needs:
- build-and-push-docker-image
permissions:
packages: read
steps:
- name: Copy image to dockerhub
env:
GHCR_REPO: "ghcr.io/${{ github.repository }}"
GHCR_USERNAME: ${{ github.actor }}
GHCR_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
run: |
docker run --rm quay.io/containers/skopeo:v1.18.0 \
copy --multi-arch all \
--src-creds "$GHCR_USERNAME:$GHCR_PASSWORD" \
--dest-creds "$DOCKER_USERNAME:$DOCKER_TOKEN" \
docker://${GHCR_REPO}:latest \
docker://lablabs/cloudflare_exporter:latest
113 changes: 76 additions & 37 deletions .github/workflows/docker-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,91 @@ on:

jobs:
build-and-push-docker-image:
permissions:
contents: read
packages: write
id-token: write
attestations: write

name: Build Docker image and push to repositories with version tag
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
lablabs/cloudflare_exporter
ghcr.io/lablabs/cloudflare_exporter
# generate Docker tags based on the following events/attributes
tags: type=ref,event=tag

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
uses: actions/checkout@v5

- name: Login to Github Packages
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build image and push to Docker Hub and GitHub Container Registry
uses: docker/build-push-action@v2

- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6
with:
go-version-file: "go.mod"
cache: false


- uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

version: v0.18.0
- name: Build and push
id: publish-image
env:
IMAGE_VERSION: ${{ github.ref_name }}
KO_DOCKER_REPO: "ghcr.io/${{ github.repository }}"
run: |
ko build . --sbom=none --image-refs ./image-digest --bare --platform linux/arm64,linux/amd64 -t ${IMAGE_VERSION} \
--image-label org.opencontainers.image.title=cloudflare-exporter \
--image-label org.opencontainers.image.description="Prometheus CloudFlare Exporter" \
--image-label org.opencontainers.image.url=${{ github.server_url }}/${{ github.repository }} \
--image-label org.opencontainers.image.revision=${{ github.sha }} \
--image-label org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} \
--image-label org.opencontainers.image.licenses=Apache-2.0 \
--image-label org.opencontainers.image.version=${IMAGE_VERSION} \
--image-label org.opencontainers.image.created="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"

# Extract image digest from ko output
# The file contains multiple lines (one per platform + manifest list at the end)
# We need only the last line (manifest list) for attestation
cat ./image-digest
IMAGE_REF=$(head -n 1 ./image-digest)
IMAGE_DIGEST=$(echo "$IMAGE_REF" | cut -d'@' -f2)

echo "Image reference: $IMAGE_REF"
echo "Image digest: $IMAGE_DIGEST"

echo "digest=$IMAGE_DIGEST" >> "$GITHUB_OUTPUT"
echo "image-ref=$IMAGE_REF" >> "$GITHUB_OUTPUT"

- name: Attest
uses: actions/attest-build-provenance@v3
id: attest
with:
subject-name: ghcr.io/${{ github.repository }}
subject-digest: ${{ steps.publish-image.outputs.digest }}
push-to-registry: true

distribute-to-dockerhub:
runs-on: ubuntu-latest
needs:
- build-and-push-docker-image
permissions:
packages: read
steps:
- name: Copy image to dockerhub
env:
IMAGE_VERSION: ${{ github.ref_name }}
GHCR_REPO: "ghcr.io/${{ github.repository }}"
GHCR_USERNAME: ${{ github.actor }}
GHCR_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
run: |
docker run --rm quay.io/containers/skopeo:v1.18.0 \
copy --multi-arch all \
--src-creds "$GHCR_USERNAME:$GHCR_PASSWORD" \
--dest-creds "$DOCKER_USERNAME:$DOCKER_TOKEN" \
docker://${GHCR_REPO}:${IMAGE_VERSION} \
docker://lablabs/cloudflare_exporter:${IMAGE_VERSION}
4 changes: 2 additions & 2 deletions .github/workflows/go-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
uses: actions/checkout@v5
- name: Generate build files
uses: thatisuday/go-cross-build@v1
with:
Expand All @@ -23,4 +23,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: "./dist/*"
args: "./dist/*"
9 changes: 6 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ jobs:
name: GO lang CI linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: "1.25"
- name: golangci-lint
uses: golangci/golangci-lint-action@v2 # https://github.com/marketplace/actions/run-golangci-lint
uses: golangci/golangci-lint-action@v8 # https://github.com/marketplace/actions/run-golangci-lint
with:
version: v1.43
version: latest
10 changes: 5 additions & 5 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v1
uses: azure/setup-helm@v4
with:
version: v3.4.0

- uses: actions/setup-python@v2
- uses: actions/setup-python@v6
with:
python-version: 3.7

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.0.1
uses: helm/chart-testing-action@v2.7.0

- name: Run chart-testing (list-changed)
id: list-changed
Expand All @@ -35,7 +35,7 @@ jobs:
run: ct lint --target-branch master

- name: Create kind cluster
uses: helm/kind-action@v1.2.0
uses: helm/kind-action@v1.12.0
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install)
Expand Down
Loading
Loading