https://github.com/udhos/apiping
apiping
https://github.com/udhos/apiping
api go golang health-check helm kubernetes ping
Last synced: 6 months ago
JSON representation
apiping
- Host: GitHub
- URL: https://github.com/udhos/apiping
- Owner: udhos
- License: mit
- Created: 2023-07-02T03:08:24.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-02T23:18:49.000Z (9 months ago)
- Last Synced: 2025-05-08T01:41:56.432Z (8 months ago)
- Topics: api, go, golang, health-check, helm, kubernetes, ping
- Language: Go
- Homepage:
- Size: 215 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/udhos/apiping/blob/main/LICENSE)
[](https://goreportcard.com/report/github.com/udhos/apiping)
[](https://pkg.go.dev/github.com/udhos/apiping)
[](https://artifacthub.io/packages/search?repo=apiping)
[](https://hub.docker.com/r/udhos/apiping)
# apiping
apiping
# Build
```bash
git clone https://github.com/udhos/apiping
cd apiping
./build.sh
```
# Run and test
```
apiping
```
```bash
curl localhost:8080/ping
ok
```
# Configuration env vars
```
export ADDR=:8080
export ROUTE=/ping
export TARGETS='["http://localhost:8080/ping"]'
export INTERVAL=20s
export TIMEOUT=15s
export METRICS_ADDR=:3000
export METRICS_PATH=/metrics
export METRICS_NAMESPACE=""
export METRICS_BUCKETS_LATENCY_SERVER="0.000005, 0.00001, 0.000025, 0.00005, 0.0001, 0.00025, 0.0005, 0.001, 0.0025, 0.005, 0.01, 0.025, 0.05, 0.1"
export METRICS_BUCKETS_LATENCY_CLIENT="0.0001, 0.00025, 0.0005, 0.001, 0.0025, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, .5, 1"
export HEALTH_ADDR=:8888
export HEALTH_PATH=/health
export OTEL_TRACE_ENABLE=true
export OTEL_TRACES_SAMPLER=parentbased_traceidratio
export OTEL_TRACES_SAMPLER_ARG="0.01"
# pick one of OTEL_SERVICE_NAME or OTEL_RESOURCE_ATTRIBUTES
#export OTEL_SERVICE_NAME=mynamespace.apiping
#export OTEL_RESOURCE_ATTRIBUTES='service.name=mynamespace.apiping,key2=value2'
export OTELCONFIG_EXPORTER=jaeger
export OTEL_TRACES_EXPORTER=jaeger
export OTEL_PROPAGATORS=b3multi
export OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger-collector:14268
export OTELCONFIG_EXPORTER=grpc
export OTEL_TRACES_EXPORTER=otlp
export OTEL_PROPAGATORS=b3multi
export OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger-collector:4317
export OTELCONFIG_EXPORTER=http
export OTEL_TRACES_EXPORTER=otlp
export OTEL_PROPAGATORS=b3multi
export OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger-collector:4318
```
# Open Telemetry Exporter Configuration:
https://opentelemetry.io/docs/concepts/sdk-configuration/otlp-exporter-configuration/
# Docker
Docker hub:
https://hub.docker.com/r/udhos/apiping
Run from docker hub:
```
docker run -p 8080:8080 --rm udhos/apiping:0.0.0
```
Build recipe:
```
./docker/build.sh
docker push udhos/apiping:0.0.0
```
# Helm chart
You can use the provided helm charts to install apiping in your Kubernetes cluster.
See: https://udhos.github.io/apiping/
## Lint
helm lint ./charts/apiping --values charts/apiping/values.yaml
## Debug
helm template ./charts/apiping --values charts/apiping/values.yaml --debug
## Render at server
helm install my-apiping ./charts/apiping --values charts/apiping/values.yaml --dry-run
## Install
helm install my-apiping ./charts/apiping --values charts/apiping/values.yaml
helm list -A
# Datadog
Image tags suffixed with `-datadog` are instrumented with Datadog [Orchestrion](https://github.com/DataDog/orchestrion).
See https://hub.docker.com/r/udhos/apiping/tags
## Example
Install latest image instrumented with support for Datadog:
helm upgrade --install apiping-dd ./charts/apiping --set image.tag=latest-datadog