summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--go.mod1
-rw-r--r--internal/sshd/sshd.go4
2 files changed, 5 insertions, 0 deletions
diff --git a/go.mod b/go.mod
index f0fe06d..1a44922 100644
--- a/go.mod
+++ b/go.mod
@@ -7,6 +7,7 @@ require (
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/mattn/go-shellwords v1.0.11
github.com/mikesmitty/edkey v0.0.0-20170222072505-3356ea4e686a
+ github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/otiai10/copy v1.4.2
github.com/pires/go-proxyproto v0.6.0
github.com/prometheus/client_golang v1.10.0
diff --git a/internal/sshd/sshd.go b/internal/sshd/sshd.go
index b918109..6e6d587 100644
--- a/internal/sshd/sshd.go
+++ b/internal/sshd/sshd.go
@@ -12,6 +12,7 @@ import (
"sync"
"time"
+ "github.com/opentracing/opentracing-go"
"github.com/pires/go-proxyproto"
"golang.org/x/crypto/ssh"
@@ -216,6 +217,9 @@ func (s *Server) handleConn(ctx context.Context, nconn net.Conn) {
ctx, cancel := context.WithCancel(correlation.ContextWithCorrelation(ctx, correlation.SafeRandomID()))
defer cancel()
+ span, ctx := opentracing.StartSpanFromContext(ctx, "SSH connection")
+ defer span.Finish()
+
sconn, chans, reqs, err := ssh.NewServerConn(nconn, s.serverConfig(ctx))
if err != nil {
log.WithError(err).Info("Failed to initialize SSH connection")