From 95f8f04293434b4f7294dcf9375f0e0ad5aa8e95 Mon Sep 17 00:00:00 2001 From: Avi Deitcher Date: Tue, 21 Apr 2026 17:47:13 +0300 Subject: [PATCH] include database info Signed-off-by: Avi Deitcher --- cmd/dump.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/cmd/dump.go b/cmd/dump.go index 39bb9b4..9668659 100644 --- a/cmd/dump.go +++ b/cmd/dump.go @@ -257,7 +257,24 @@ func dumpCmd(passedExecs execs, cmdConfig *cmdConfiguration) (*cobra.Command, er bytes := int64(0) exitCode := 0 backupStatus := "ok" - dumpSpan.SetAttributes(attribute.String("backup.run_id", uid.String())) + attrs := []attribute.KeyValue{ + attribute.String("backup.run_id", uid.String()), + attribute.String("db.system", "mysql"), + } + if cmdConfig.dbconn != nil { + transport := "tcp" + if strings.HasPrefix(cmdConfig.dbconn.Host, "/") { + transport = "unix" + } + attrs = append(attrs, + attribute.String("network.transport", transport), + attribute.String("server.address", cmdConfig.dbconn.Host), + ) + if transport == "tcp" && cmdConfig.dbconn.Port > 0 { + attrs = append(attrs, attribute.Int("server.port", cmdConfig.dbconn.Port)) + } + } + dumpSpan.SetAttributes(attrs...) defer func() { attrs := []attribute.KeyValue{ attribute.String("backup.status", backupStatus),