Skip to content

Conversation

RassK
Copy link
Contributor

@RassK RassK commented Sep 3, 2025

Changes

Adds WebSockets support for .NET.

Leaving TODO:

  • WebSockets for .NET Framework
  • WebSockets sending large packages (WsTransmitter.cs)
  • Certification handling

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes

@github-actions github-actions bot added the comp:opamp.client Things related to OpenTelemetry.OpAmp.Client label Sep 3, 2025
@codecov
Copy link

codecov bot commented Sep 3, 2025

Codecov Report

❌ Patch coverage is 87.50000% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.83%. Comparing base (263129e) to head (747d220).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
....Client/Internal/Transport/WebSocket/WsReceiver.cs 83.07% 11 Missing ⚠️
...nTelemetry.OpAmp.Client/Internal/Utils/Varint64.cs 85.18% 4 Missing ⚠️
...OpAmp.Client/Internal/Utils/OpAmpWsHeaderHelper.cs 70.00% 3 Missing ⚠️
...nTelemetry.OpAmp.Client/Internal/FrameProcessor.cs 88.88% 1 Missing ⚠️
...ient/Internal/Transport/WebSocket/WsTransmitter.cs 92.85% 1 Missing ⚠️
...etry.OpAmp.Client/Internal/Utils/SequenceHelper.cs 90.90% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3064      +/-   ##
==========================================
+ Coverage   69.77%   69.83%   +0.06%     
==========================================
  Files         410      426      +16     
  Lines       16272    16491     +219     
==========================================
+ Hits        11354    11517     +163     
- Misses       4918     4974      +56     
Flag Coverage Δ
unittests-Contrib.Shared.Tests 83.73% <ø> (ø)
unittests-Exporter.Geneva 53.33% <ø> (ø)
unittests-Exporter.InfluxDB 95.14% <ø> (ø)
unittests-Exporter.Instana 74.86% <ø> (ø)
unittests-Exporter.OneCollector 94.61% <ø> (ø)
unittests-Extensions 90.65% <ø> (ø)
unittests-Extensions.Enrichment 100.00% <ø> (ø)
unittests-Extensions.Enrichment.AspNetCore 94.11% <ø> (ø)
unittests-Instrumentation.AWS 83.80% <ø> (ø)
unittests-Instrumentation.AspNet 75.18% <ø> (+0.24%) ⬆️
unittests-Instrumentation.AspNetCore 70.76% <ø> (ø)
unittests-Instrumentation.Cassandra 23.52% <ø> (?)
unittests-Instrumentation.ConfluentKafka 14.10% <ø> (ø)
unittests-Instrumentation.ElasticsearchClient 80.12% <ø> (ø)
unittests-Instrumentation.EntityFrameworkCore 80.80% <ø> (ø)
unittests-Instrumentation.EventCounters 76.36% <ø> (ø)
unittests-Instrumentation.GrpcCore 91.42% <ø> (ø)
unittests-Instrumentation.GrpcNetClient 79.61% <ø> (ø)
unittests-Instrumentation.Hangfire 84.61% <ø> (ø)
unittests-Instrumentation.Http 74.18% <ø> (ø)
unittests-Instrumentation.Owin 88.62% <ø> (ø)
unittests-Instrumentation.Process 100.00% <ø> (ø)
unittests-Instrumentation.Quartz 78.76% <ø> (ø)
unittests-Instrumentation.Runtime 100.00% <ø> (ø)
unittests-Instrumentation.ServiceFabricRemoting 34.54% <ø> (ø)
unittests-Instrumentation.SqlClient 87.29% <ø> (ø)
unittests-Instrumentation.StackExchangeRedis 70.31% <ø> (ø)
unittests-Instrumentation.Wcf 78.95% <ø> (ø)
unittests-OpAmp.Client 73.93% <87.50%> (+12.85%) ⬆️
unittests-PersistentStorage 65.88% <ø> (+0.66%) ⬆️
unittests-Resources.AWS 74.42% <ø> (ø)
unittests-Resources.Azure 85.31% <ø> (ø)
unittests-Resources.Container 67.34% <ø> (ø)
unittests-Resources.Gcp 71.42% <ø> (ø)
unittests-Resources.Host 73.91% <ø> (ø)
unittests-Resources.OperatingSystem 76.98% <ø> (ø)
unittests-Resources.Process 100.00% <ø> (ø)
unittests-Resources.ProcessRuntime 79.59% <ø> (ø)
unittests-Sampler.AWS 88.25% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...Client/Internal/Transport/WebSocket/WsTransport.cs 100.00% <100.00%> (ø)
...metry.OpAmp.Client/Internal/Utils/BufferSegment.cs 100.00% <100.00%> (ø)
...nTelemetry.OpAmp.Client/Internal/FrameProcessor.cs 83.05% <88.88%> (+1.05%) ⬆️
...ient/Internal/Transport/WebSocket/WsTransmitter.cs 92.85% <92.85%> (ø)
...etry.OpAmp.Client/Internal/Utils/SequenceHelper.cs 92.85% <90.90%> (+26.19%) ⬆️
...OpAmp.Client/Internal/Utils/OpAmpWsHeaderHelper.cs 70.00% <70.00%> (ø)
...nTelemetry.OpAmp.Client/Internal/Utils/Varint64.cs 85.18% <85.18%> (ø)
....Client/Internal/Transport/WebSocket/WsReceiver.cs 83.07% <83.07%> (ø)

... and 12 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.


internal class WsTransmitter
{
private const int BufferSize = 4096;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to choose realistic buffer size, anyone suggests what are the usuals?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4096 is common in things like Stream - you could benchmark to find if there's a better value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May need to tune later then. Prob need to get full session up and have some stats based on different message sizes.
My theory is that the most common message size should be default. 4kB for small messages, maybe increase a new block size to 8kB if there are already 2-3 4kB blocks requested 🤔


internal class WsReceiver : IDisposable
{
private const int RentalBufferSize = 4096;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to choose realistic buffer size, anyone suggests what are the usuals?

@RassK RassK marked this pull request as ready for review September 3, 2025 14:05
@RassK RassK requested a review from a team as a code owner September 3, 2025 14:05

internal class WsTransmitter
{
private const int BufferSize = 4096;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4096 is common in things like Stream - you could benchmark to find if there's a better value.

Copy link
Member

@Kielek Kielek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some NITs

@Kielek Kielek mentioned this pull request Sep 9, 2025
Copy link
Member

@Kielek Kielek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMRS

@Kielek Kielek merged commit 0fb8d71 into open-telemetry:main Sep 9, 2025
233 checks passed
@RassK RassK deleted the opamp-client-wstransport branch September 9, 2025 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:opamp.client Things related to OpenTelemetry.OpAmp.Client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants