Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 8 additions & 8 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches: ['main']

env:
GO_VERSION: '1.23'
GO_VERSION: '1.25'

jobs:
test:
Expand All @@ -23,6 +23,13 @@ jobs:
go-version: ${{ env.GO_VERSION }}
cache: true

- name: Check formatting
run: |
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
echo "Code is not formatted properly:"
gofmt -s -l .
exit 1
fi

- name: Install Clang
run: sudo apt-get install -y clang
Expand All @@ -41,13 +48,6 @@ jobs:
# - name: Run vet
# run: go vet ./...

- name: Check formatting
run: |
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
echo "Code is not formatted properly:"
gofmt -s -l .
exit 1
fi
build:
needs: test
runs-on: ubuntu-22.04
Expand Down
17 changes: 14 additions & 3 deletions cmd/verifier/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"strings"
"time"

"github.com/hibiken/asynq"

Expand Down Expand Up @@ -84,19 +85,29 @@ func main() {

// Initialize metrics based on configuration
var httpMetrics *internalMetrics.HTTPMetrics
var appStoreCollector *internalMetrics.AppStoreCollector
if cfg.Metrics.Enabled {
logger.Info("Metrics enabled, setting up Prometheus metrics")

// Start metrics HTTP server with HTTP metrics
services := []string{internalMetrics.ServiceHTTP}
services := []string{internalMetrics.ServiceHTTP, internalMetrics.ServiceAppStore}
_ = internalMetrics.StartMetricsServer(internalMetrics.Config{
Enabled: true,
Host: cfg.Metrics.Host,
Port: cfg.Metrics.Port,
Token: cfg.Metrics.Token,
}, services, logger)

// Create HTTP metrics implementation
httpMetrics = internalMetrics.NewHTTPMetrics()

appStoreMetrics := internalMetrics.NewAppStoreMetrics()
appStoreCollector = internalMetrics.NewAppStoreCollector(db, appStoreMetrics, logger, 30*time.Second)
appStoreCollector.Start()

defer func() {
if appStoreCollector != nil {
appStoreCollector.Stop()
}
}()
} else {
logger.Info("Verifier metrics disabled")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ func main() {
if cfg.Metrics.Enabled {
logger.Info("Metrics enabled, setting up Prometheus metrics")

// Start metrics HTTP server with worker metrics
services := []string{internalMetrics.ServiceWorker}
_ = internalMetrics.StartMetricsServer(internalMetrics.Config{
Enabled: true,
Host: cfg.Metrics.Host,
Port: cfg.Metrics.Port,
Token: cfg.Metrics.Token,
}, services, logger)

// Create worker metrics instance
Expand Down
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ type MetricsConfig struct {
Enabled bool `mapstructure:"enabled" json:"enabled,omitempty"`
Host string `mapstructure:"host" json:"host,omitempty"`
Port int `mapstructure:"port" json:"port,omitempty"`
Token string `mapstructure:"token" json:"token,omitempty"`
}

type PluginAssetsConfig struct {
Expand Down
Loading