(cfg grpcclient.Config, addr string, requestDuration *prometheus.HistogramVec)
| 106 | } |
| 107 | |
| 108 | func dialAlertmanagerClient(cfg grpcclient.Config, addr string, requestDuration *prometheus.HistogramVec) (*alertmanagerClient, error) { |
| 109 | opts, err := cfg.DialOption(grpcclient.Instrument(requestDuration)) |
| 110 | if err != nil { |
| 111 | return nil, err |
| 112 | } |
| 113 | conn, err := grpc.NewClient(addr, opts...) |
| 114 | if err != nil { |
| 115 | return nil, errors.Wrapf(err, "failed to dial alertmanager %s", addr) |
| 116 | } |
| 117 | |
| 118 | return &alertmanagerClient{ |
| 119 | AlertmanagerClient: alertmanagerpb.NewAlertmanagerClient(conn), |
| 120 | HealthClient: grpc_health_v1.NewHealthClient(conn), |
| 121 | conn: conn, |
| 122 | }, nil |
| 123 | } |
| 124 | |
| 125 | type alertmanagerClient struct { |
| 126 | alertmanagerpb.AlertmanagerClient |
no test coverage detected