kashalls / kromgo Goto Github PK
View Code? Open in Web Editor NEWEasily expose preconfigured prometheus metrics to the outside using badges.
Easily expose preconfigured prometheus metrics to the outside using badges.
When I wrote this 12 hours ago, I planned for most people to use an external source of ratelimiting like NGINX or Cloudflare. Some people are calling it tacky and overcomplicated, so I need to figure out a way to put it in the already condensed app.
I figured out how to middleware it, its just that its difficult to figure out what the real clients ip is for the sake of ratelimiting. You have to trust the proxy thats forwarding to the app to make sure it trusts the X-Forwarded-For or X-Real-Ip or CF-Connecting-IP, plus these IPs have a chance to be non-rfc compliant often having the forwarded ips seperated with commas like: 192.168.1.1,192,168.1.2,etc.
I guess I could set it up so that in the config, you have to specify which header to retrieve the connecting ip with? The http.Request.RemoteAddr
in Go has been told to be very very unreliable as per stackoverflow.
There's a debug: true
you can flag in the config to put more verbose in the replies from prometheus, but other than that its a design flaw in my part.
Initial configuration attempt left me with:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x6eeedf]
goroutine 1 [running]:
main.main()
/go/src/github.com/kashalls/kromgo/main.go:64 +0x27f
I tracked it down to having this defined:
globalMounts:
- path: /kromgo/config.yaml
subPath: config.yaml
readOnly: true
Yet, mistakenly the configmap.data
had a mismatched extension:
configMaps:
configmap:
enabled: true
data:
config.yml: |
...
I assume that left the pod with either a missing config file or a zero-byte, etc.
The ask is for some additional checks on the config file to log something more friendly and not a panic message.
It would be cool to add something like label_values to extract values of labels.
e.g.
label_values(kubernetes_build_info{instance="192.168.42.10:10257"}, git_version)
would return 1.29.1
The endpoint format seems to be more often used than the raw endpoint, leading me to believe we should default the format to the shields supported format.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
Dockerfile
golang 1.22.3-alpine
.github/workflows/build-schema.yaml
actions/checkout v4.1.6@a5ac7e51b41094c92402da3b24376905380afc29
actions/setup-go v5
stefanzweifel/git-auto-commit-action v5.0.1@8621497c8c39c72f3e2a999a26b4ca1b5058a842
.github/workflows/container-ci.yaml
actions/checkout v4@a5ac7e51b41094c92402da3b24376905380afc29
docker/metadata-action v5
docker/setup-qemu-action v3
docker/setup-buildx-action v3.3.0
docker/login-action v3.1.0
docker/build-push-action v5.3.0
.github/workflows/does-the-container-build.yaml
actions/checkout v4@a5ac7e51b41094c92402da3b24376905380afc29
go.mod
go 1.22.1
github.com/invopop/jsonschema v0.12.0
github.com/prometheus/client_golang v1.19.0
github.com/prometheus/common v0.52.2
gopkg.in/yaml.v2 v2.4.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.