Skip to content

feat(exporters): Implement UDP and gRPC transport using common_system interfaces#276

Merged
kcenon merged 6 commits into
mainfrom
feature/273-udp-grpc-transport
Dec 26, 2025
Merged

feat(exporters): Implement UDP and gRPC transport using common_system interfaces#276
kcenon merged 6 commits into
mainfrom
feature/273-udp-grpc-transport

Conversation

@kcenon

@kcenon kcenon commented Dec 26, 2025

Copy link
Copy Markdown
Owner

Summary

Complete the network transport implementation for monitoring_system by implementing UDP (StatsD) and gRPC (OTLP) transports using the unified interfaces from common_system.

Changes

  • UDP Transport (udp_transport.h)

    • Abstract udp_transport interface for UDP communication
    • stub_udp_transport: Testing implementation with simulated sends
    • common_udp_transport: Uses common_system IUdpClient interface
    • network_udp_transport: Uses network_system UDP client
    • Factory functions for automatic backend selection
  • gRPC Transport (grpc_transport.h)

    • Abstract grpc_transport interface for gRPC communication
    • stub_grpc_transport: Testing implementation with simulated calls
    • Placeholder for network_grpc_transport when gRPC lib available
  • StatsD Exporter Updates

    • Integrated udp_transport abstraction
    • Start/stop lifecycle with connection management
    • Transport statistics in exporter stats
    • Custom transport injection for testing
  • OTLP Exporter Updates

    • Integrated http_transport and grpc_transport
    • OTLP/HTTP support (JSON and Protobuf formats)
    • OTLP/gRPC support
    • Basic OTLP JSON serialization
  • CMake Configuration

    • Transport interface detection for common_system
    • MONITORING_HAS_COMMON_TRANSPORT_INTERFACES compile definition
  • Tests

    • Comprehensive UDP transport tests
    • gRPC transport tests
    • Integration tests with custom transports

Current Transport Status

Transport Target Status Implementation
HTTP/Prometheus Push metrics Complete network_http_transport
UDP/StatsD Push metrics Complete udp_transport abstraction
gRPC/OTLP Push metrics + traces Complete grpc_transport + HTTP fallback

Test Plan

  • UDP transport unit tests (stub, connect, send, disconnect, statistics)
  • gRPC transport unit tests (stub, custom handlers, failure simulation)
  • StatsD exporter integration tests with custom transport
  • OTLP exporter integration tests with custom HTTP/gRPC transports
  • Integration test with real StatsD server (manual)
  • Integration test with real OTLP collector (manual)

Related Issues

Add udp_transport.h with abstract interface and implementations:
- udp_transport: abstract base class for UDP communication
- stub_udp_transport: testing implementation with simulated sends
- common_udp_transport: uses common_system IUdpClient interface
- network_udp_transport: uses network_system UDP client

Includes factory functions for creating transports with automatic
backend selection based on available compile-time flags.

Part of #273
Update statsd_exporter to use udp_transport abstraction:
- Add udp_transport member with factory-based creation
- Support custom transport injection for testing
- Implement start/stop lifecycle with connection management
- Replace stub send_udp_batch with real transport calls
- Add transport statistics to get_stats()

The exporter now sends real UDP packets when network backend
is available, with graceful fallback to stub for testing.

Part of #273, resolves #274
Add grpc_transport.h with abstract interface and implementations:
- grpc_transport: abstract base class for gRPC communication
- stub_grpc_transport: testing implementation with simulated calls
- Placeholder for network_grpc_transport when gRPC lib available

Update otlp_metrics_exporter to use transport abstractions:
- Add http_transport and grpc_transport members
- Implement send_via_http for OTLP/HTTP JSON and Protobuf
- Implement send_via_grpc for OTLP/gRPC protocol
- Add start/stop lifecycle management
- Include transport statistics in get_stats()
- Add basic OTLP JSON serialization

Part of #273, resolves #275
Add comprehensive tests for transport layer:
- UdpTransportTest: stub transport functionality, failure simulation,
  statistics tracking and reset
- GrpcTransportTest: stub transport functionality, custom response
  handlers, failure simulation
- Integration tests for statsd_exporter with custom UDP transport
- Integration tests for otlp_metrics_exporter with custom HTTP/gRPC
  transports

Part of #273
Add CMake configuration to detect common_system transport interfaces:
- Check for transport.h in multiple locations
- Define MONITORING_HAS_COMMON_TRANSPORT_INTERFACES when found
- Enable IHttpClient and IUdpClient integration automatically

This allows udp_transport.h and grpc_transport.h to use common_system
transport interfaces when available.

Part of #273
Document new transport features in both English and Korean:
- UDP and gRPC transport abstractions (#273)
- StatsD exporter with real UDP transport (#274)
- OTLP exporter with HTTP/gRPC transport (#275)
- CMake transport interface detection

Part of #273
@kcenon kcenon merged commit 1d3f946 into main Dec 26, 2025
21 checks passed
@kcenon kcenon deleted the feature/273-udp-grpc-transport branch December 26, 2025 02:26
kcenon added a commit that referenced this pull request Apr 13, 2026
… interfaces (#276)

* feat(exporters): add UDP transport abstraction

Add udp_transport.h with abstract interface and implementations:
- udp_transport: abstract base class for UDP communication
- stub_udp_transport: testing implementation with simulated sends
- common_udp_transport: uses common_system IUdpClient interface
- network_udp_transport: uses network_system UDP client

Includes factory functions for creating transports with automatic
backend selection based on available compile-time flags.

Part of #273

* feat(exporters): integrate UDP transport into statsd_exporter

Update statsd_exporter to use udp_transport abstraction:
- Add udp_transport member with factory-based creation
- Support custom transport injection for testing
- Implement start/stop lifecycle with connection management
- Replace stub send_udp_batch with real transport calls
- Add transport statistics to get_stats()

The exporter now sends real UDP packets when network backend
is available, with graceful fallback to stub for testing.

Part of #273, resolves #274

* feat(exporters): add gRPC transport and update OTLP exporter

Add grpc_transport.h with abstract interface and implementations:
- grpc_transport: abstract base class for gRPC communication
- stub_grpc_transport: testing implementation with simulated calls
- Placeholder for network_grpc_transport when gRPC lib available

Update otlp_metrics_exporter to use transport abstractions:
- Add http_transport and grpc_transport members
- Implement send_via_http for OTLP/HTTP JSON and Protobuf
- Implement send_via_grpc for OTLP/gRPC protocol
- Add start/stop lifecycle management
- Include transport statistics in get_stats()
- Add basic OTLP JSON serialization

Part of #273, resolves #275

* test(exporters): add UDP and gRPC transport tests

Add comprehensive tests for transport layer:
- UdpTransportTest: stub transport functionality, failure simulation,
  statistics tracking and reset
- GrpcTransportTest: stub transport functionality, custom response
  handlers, failure simulation
- Integration tests for statsd_exporter with custom UDP transport
- Integration tests for otlp_metrics_exporter with custom HTTP/gRPC
  transports

Part of #273

* build(cmake): add transport interface detection

Add CMake configuration to detect common_system transport interfaces:
- Check for transport.h in multiple locations
- Define MONITORING_HAS_COMMON_TRANSPORT_INTERFACES when found
- Enable IHttpClient and IUdpClient integration automatically

This allows udp_transport.h and grpc_transport.h to use common_system
transport interfaces when available.

Part of #273

* docs: update CHANGELOG with transport implementations

Document new transport features in both English and Korean:
- UDP and gRPC transport abstractions (#273)
- StatsD exporter with real UDP transport (#274)
- OTLP exporter with HTTP/gRPC transport (#275)
- CMake transport interface detection

Part of #273
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant