Skip to content

Support gRPC #210

@michaelbushe

Description

@michaelbushe

Overview

The OpenTelemetry Protocol (OTLP) specification recommends supporting both gRPC (port 4317) and HTTP (port 4318) transports, with gRPC being the preferred default. Currently, the library only supports HTTP transport. This enhancement would add gRPC support to align with the specification recommendations.

Background

  • OTLP specification recommends implementations support both protocols
  • gRPC offers advantages like streaming support and better connection management
  • Many OpenTelemetry backends (Elastic, NewRelic, etc.) prefer gRPC connections
  • Current implementation only supports HTTP/protobuf transport

Proposed Changes

  1. Add gRPC transport implementation:

    • Implement gRPC client for OTLP export
    • Support configuration of transport type (gRPC vs HTTP)
    • Default to gRPC when available, fallback to HTTP
  2. Keep existing HTTP transport as fallback:

    • Maintain backward compatibility
    • Support environments where gRPC might be blocked

We will make these changes and contribute a PR.

Technical Details

  • Will use Dart's grpc and protobuf packages
  • Need to support both sync and async span processors
  • Will maintain compatibility with existing collector configurations

Questions

  • Should we generate protobuf files from official OpenTelemetry protos or include pre-generated ones?
  • Preference for how to configure transport type in the SDK?

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions