Files
hatchet/api/v1/server/handlers/monitoring/service.go
T
Sean Reilly cbc2526c0b add a monitoring probe (#1108)
* add a monitoring probe

---------

Co-authored-by: Sean Reilly <sean@hatchet.run>
2024-12-17 15:55:50 -05:00

34 lines
874 B
Go

package monitoring
import (
"time"
"github.com/rs/zerolog"
"github.com/hatchet-dev/hatchet/pkg/config/server"
)
type MonitoringService struct {
enabled bool
permittedTenants []string
eventName string
workflowName string
probeTimeout time.Duration
config *server.ServerConfig
l *zerolog.Logger
tlsRootCAFile string
}
func NewMonitoringService(config *server.ServerConfig) *MonitoringService {
return &MonitoringService{
enabled: config.Runtime.Monitoring.Enabled,
l: config.Logger,
permittedTenants: config.Runtime.Monitoring.PermittedTenants,
eventName: "monitoring:probe",
workflowName: "probe-workflow",
probeTimeout: config.Runtime.Monitoring.ProbeTimeout,
tlsRootCAFile: config.Runtime.Monitoring.TLSRootCAFile,
config: config,
}
}