Proposal: built-in tracing and metrics via ActivitySource/Meter
Mantenedores costumam responder em até 3 dias
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- csharp
- Domínio
- observability
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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?
- Linguagem predominante
- C#
- Estrelas
- 4.4k
- Forks
- 987
- Merge médio
- 2d 6h
- PRs com merge (30d)
- 4
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de sshnet/SSH.NET
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 12/100
Mantenedores costumam responder em até 3 dias
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 3 dias
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
sshnet/SSH.NET#1853 · 4 comentários ·
Mantenedores costumam responder em até 3 dias
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 69/100
Mantenedores costumam responder em até 3 dias
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
sshnet/SSH.NET#1843 · 1 comentário ·
Mantenedores costumam responder em até 3 dias
Todas as issues de sshnet/SSH.NET
Issues semelhantes
-
needs-triage
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 76/100
Azure/azure-sdk-for-net#64658 · 1 comentário · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
dotnet/aspnetcore#70370 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
NethermindEth/nethermind#15684 ·
Mantenedores costumam responder em até 1 dia
-
area/ai-assistant squad/flyt
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
Altinn/altinn-studio#21798 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
SubtitleEdit/subtitleedit#16699 ·
Mantenedores costumam responder em até 1 dia