15954: Merge branch 'master'
[arvados.git] / services / health / main.go
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 package main
6
7 import (
8         "context"
9         "os"
10
11         "git.arvados.org/arvados.git/lib/cmd"
12         "git.arvados.org/arvados.git/lib/service"
13         "git.arvados.org/arvados.git/sdk/go/arvados"
14         "git.arvados.org/arvados.git/sdk/go/health"
15         "github.com/prometheus/client_golang/prometheus"
16 )
17
18 var (
19         version             = "dev"
20         command cmd.Handler = service.Command(arvados.ServiceNameHealth, newHandler)
21 )
22
23 func newHandler(ctx context.Context, cluster *arvados.Cluster, _ string, _ *prometheus.Registry) service.Handler {
24         return &health.Aggregator{Cluster: cluster}
25 }
26
27 func main() {
28         os.Exit(command.RunCommand(os.Args[0], os.Args[1:], os.Stdin, os.Stdout, os.Stderr))
29 }