Proposal: built-in tracing and metrics via ActivitySource/Meter
I maintainer di solito rispondono entro 3 giorni
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- csharp
- Ambito
- observability
Direzione di ricerca
Read the working prototype linked in the issue and inspect the existing Internal* methods it hooks into. The proposal covers tracing for connections, SFTP operations, and command execution, plus an operation duration metric; existing unit tests and integration tests are reported passing. Before implementation, resolve the dependency, attribute naming, command secrecy, and first PR scope questions; done means the agreed telemetry scope is covered and verified.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi, I'd like to propose adding built-in tracing and metrics to SSH.NET using System.Diagnostics.ActivitySource and Meter, the same approach Npgsql and the MongoDB driver use.
I first opened an OpenTelemetry contrib package that wraps ISftpClient/ISshClient (https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/5781). An OTel maintainer suggested building it into the library instead, so users only need AddSource("Renci.SshNet") and AddMeter("Renci.SshNet"). That also works with other backends (Datadog, App Insights), and covers cases a wrapper can't reach: CreateCommand + Execute, Begin*/End*, non-seekable streams.
I have a working prototype: https://github.com/YoussefElshemi/SSH.NET/tree/native-telemetry
- Spans:
Connect(ssh/sftp/scp/netconf)- SFTP
UploadFile,DownloadFile,ListDirectory SshCommandexecution
- Metric:
ssh.client.operation.durationhistogram (seconds) - Where it hooks in: the existing
Internal*methods, so every overload is covered - When nobody is listening: no allocation or extra work
- Tests: existing unit tests pass. New integration tests pass on net48/net8/net9/net10.
Questions before I go further:
- It adds
System.Diagnostics.DiagnosticSource(8.0.1) as a dependency on net462/netstandard2.0 only. Is that acceptable? - Attribute names like
ssh.operation.name,sftp.transfer.bytesandssh.command.exit_codearen't official OpenTelemetry names yet. Any preference? - Command text isn't recorded, since it may contain secrets. Should there be an opt-in?
- Should a first PR stay this small, or also cover
Exists/Delete/Rename/SCP?
Would you be open to a PR along these lines?
- Lingua principale
- C#
- Stelle
- 4.4k
- Fork
- 987
- Merge medio
- 2g 6h
- PR unite (30g)
- 4
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di sshnet/SSH.NET
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
sshnet/SSH.NET#1853 · 4 commenti ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 69/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
sshnet/SSH.NET#1843 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di sshnet/SSH.NET
Issue simili
-
needs-triage
Difficoltà 1/5 1-3 ore Idoneità per principianti 76/100
Azure/azure-sdk-for-net#64658 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
dotnet/aspnetcore#70370 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
NethermindEth/nethermind#15684 ·
I maintainer di solito rispondono entro 1 giorno
-
area/ai-assistant squad/flyt
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
Altinn/altinn-studio#21798 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
SubtitleEdit/subtitleedit#16699 ·
I maintainer di solito rispondono entro 1 giorno