Add config options for metrics

This commit is contained in:
Daniel 2021-03-10 14:00:51 +01:00
parent 4a05c26339
commit aef3f26ad3
4 changed files with 89 additions and 16 deletions

View file

@ -90,7 +90,7 @@ func writeMetricsTo(ctx context.Context, url string) error {
}
// Create request
req, err := http.NewRequestWithContext(ctx, http.MethodPut, url, buf)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, url, buf)
if err != nil {
return fmt.Errorf("failed to create request: %w", err)
}
@ -118,6 +118,7 @@ func writeMetricsTo(ctx context.Context, url string) error {
}
func metricsWriter(ctx context.Context) error {
pushURL := pushOption()
ticker := time.NewTicker(10 * time.Second)
defer ticker.Stop()