Compare commits

...
3 Commits
Author SHA1 Message Date
GamingChaos c110991ce9 add labels for gitea and otel collector 2026-08-02 10:41:22 +00:00
GamingChaos 5660472ee1 add prometheus collector for self and gitea 2026-08-02 10:24:46 +00:00
GamingChaos 6ce22410a5 add san to certificates 2026-08-02 10:24:29 +00:00
3 changed files with 45 additions and 11 deletions
+16 -4
View File
@@ -23,11 +23,23 @@ receivers:
- job_name: 'otel-collector' - job_name: 'otel-collector'
scrape_interval: 5s scrape_interval: 5s
static_configs: static_configs:
- targets: ['127.0.0.1:8888'] - targets:
- '127.0.0.1:8888'
labels:
service.name: otel-collector
service.version: latest
host.name: charybdis.stuyckv.local
container.name: otel-collector
- job_name: 'gitea' - job_name: 'gitea'
scrape_interval: 5s scrape_interval: 5s
static_configs: static_configs:
- targets: ['gitea_server:3000'] - targets:
- 'gitea_server:3000'
labels:
service.name: gitea_server
service.version: latest
host.name: charybdis.stuyckv.local
container.name: gitea_server
# - job_name: 'matrix' # - job_name: 'matrix'
# scrape_interval: 5s # scrape_interval: 5s
# static_configs: # static_configs:
@@ -66,9 +78,9 @@ service:
processors: [batch, resource_detection/docker] processors: [batch, resource_detection/docker]
exporters: [otlp_grpc] exporters: [otlp_grpc]
metrics: metrics:
receivers: [otlp] receivers: [otlp, prometheus]
processors: [batch, resource_detection/docker] processors: [batch, resource_detection/docker]
exporters: [otlp_grpc, debug] exporters: [otlp_grpc]
logs: logs:
receivers: [otlp] receivers: [otlp]
processors: [batch, resource_detection/docker] processors: [batch, resource_detection/docker]
+7
View File
@@ -1,4 +1,9 @@
networks:
gitea_database:
external: true
services: services:
# OpenTelemetry Collector - receives and routes all telemetry # OpenTelemetry Collector - receives and routes all telemetry
@@ -15,3 +20,5 @@ services:
- ./config/otel-collector.yaml:/etc/otelcol-contrib/config.yaml - ./config/otel-collector.yaml:/etc/otelcol-contrib/config.yaml
- ./ssl:/etc/otelcol-contrib/ssl - ./ssl:/etc/otelcol-contrib/ssl
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
networks:
- gitea_database
+19 -4
View File
@@ -1,23 +1,38 @@
#!/usr/bin/env bash #!/usr/bin/env bash
[ -d ssl ] || mkdir ssl sudo rm -rf ./ssl ; mkdir ssl
cd ssl cd ssl
hostname=$(hostname)
lgtm_ssl=/home/vst/lgtm-stack/ssl lgtm_ssl=/home/vst/lgtm-stack/ssl
scart=$lgtm_ssl/ca.crt
hostname=$(hostname)
subj="/CN=$hostname.stuyckv.local"
san="subjectAltName=DNS:$hostname.stuyckv.local,DNS:localhost,IP:127.0.0.1"
function request-certificate { function request-certificate {
type=$1 type=$1
scsr=$lgtm_ssl/$hostname.$type.csr scsr=$lgtm_ssl/$hostname.$type.csr
scrt=$lgtm_ssl/$hostname.$type.crt scrt=$lgtm_ssl/$hostname.$type.crt
openssl req -new -newkey rsa:2048 -nodes -keyout $type.key -out $type.csr -subj "/CN=$hostname.stuyckv.local" openssl req -new -newkey rsa:2048 \
-keyout $type.key -out $type.csr \
-nodes -subj $subj
scp $type.csr vst@shion.stuyckv.local:$scsr scp $type.csr vst@shion.stuyckv.local:$scsr
ssh vst@shion.stuyckv.local openssl x509 -req -in $scsr -CA $lgtm_ssl/ca.crt -CAkey $lgtm_ssl/ca.key -CAcreateserial -out $scrt -days 365 ssh vst@shion.stuyckv.local \
"echo '$san' > /tmp/$hostname.san &&
openssl x509 -req \
-in $scsr -out $scrt -days 365 \
-CA $scart -CAkey $lgtm_ssl/ca.key \
-CAcreateserial \
-extfile /tmp/$hostname.san && \
rm /tmp/$hostname.san"
scp vst@shion.stuyckv.local:$scrt $type.crt scp vst@shion.stuyckv.local:$scrt $type.crt
rm $type.csr rm $type.csr
cat ca.crt >> $type.crt
} }
scp vst@shion.stuyckv.local:$scart ca.crt
request-certificate client request-certificate client
request-certificate server request-certificate server
# openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr -subj "/CN=$(hostname).stuyckv.local" # openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr -subj "/CN=$(hostname).stuyckv.local"