From 8039a7127f3a8635b95f8e1ee2f7c5a08ffff62a Mon Sep 17 00:00:00 2001
From: Matthew Holt <mholt@users.noreply.github.com>
Date: Sun, 25 Mar 2018 21:50:07 -0600
Subject: [PATCH] telemetry: Remove a metric, clarify another, and fix tests

---
 caddytls/handshake.go        | 4 +---
 telemetry/collection_test.go | 6 +++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/caddytls/handshake.go b/caddytls/handshake.go
index 2d49d9787..077ec6323 100644
--- a/caddytls/handshake.go
+++ b/caddytls/handshake.go
@@ -121,9 +121,7 @@ func (cfg *Config) GetCertificate(clientHello *tls.ClientHelloInfo) (*tls.Certif
 	// })
 	cert, err := cfg.getCertDuringHandshake(strings.ToLower(clientHello.ServerName), true, true)
 	if err == nil {
-		go telemetry.Increment("tls_handshake_count")
-	} else {
-		go telemetry.Append("tls_handshake_error", err.Error())
+		go telemetry.Increment("tls_handshake_count") // TODO: This is a "best guess" for now, we need something listener-level
 	}
 	return &cert.Certificate, err
 }
diff --git a/telemetry/collection_test.go b/telemetry/collection_test.go
index e25b9b061..4199b684a 100644
--- a/telemetry/collection_test.go
+++ b/telemetry/collection_test.go
@@ -31,7 +31,7 @@ func TestInit(t *testing.T) {
 			t.Errorf("Second call to Init should have panicked")
 		}
 	}()
-	Init(id) // should panic
+	Init(id, nil) // should panic
 }
 
 func TestInitEmptyUUID(t *testing.T) {
@@ -41,7 +41,7 @@ func TestInitEmptyUUID(t *testing.T) {
 			t.Errorf("Call to Init with empty UUID should have panicked")
 		}
 	}()
-	Init(uuid.UUID([16]byte{}))
+	Init(uuid.UUID([16]byte{}), nil)
 }
 
 func TestSet(t *testing.T) {
@@ -92,7 +92,7 @@ func doInit(t *testing.T) uuid.UUID {
 	if err != nil {
 		t.Fatalf("Could not make UUID: %v", err)
 	}
-	Init(id)
+	Init(id, nil)
 	return id
 }