← Back to Pull requests

Remove gRPC dependencies from metric and log OTLP HTTP exporters #9499

Merged
pellared merged 47 files (540 lines) on Nov 27, 2026 13:39 UTC
View on GitHub
pellared pellared commented on Nov 12, 2026 18:04 UTC
Author

The go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp and go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp modules currently pull in google.golang.org/grpc and github.com/grpc-ecosystem/grpc-gateway/v2. Replace go.opentelemetry.io/proto/otlp with go.opentelemetry.io/proto/slim/otlp v1.11.1 to remove those dependencies from their module graphs and compiled dependencies.

The slim release includes the descriptor coexistence fix from open-telemetry/opentelemetry-proto-go#707. These HTTP exporters can coexist with exporters backed by go.opentelemetry.io/proto/otlp without a protobuf registration panic.

Partially addresses #2579. The go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp module remains unchanged: its v1 client/exporter API exposes types from go.opentelemetry.io/proto/otlp, so removing that dependency requires a new major API or a separate module.

Shared transformation and collector templates accept a protobuf import root with go.opentelemetry.io/proto/otlp as the default. Metric HTTP generation also omits unused google.golang.org/grpc configuration and its corresponding test collector. Public metric/log HTTP APIs, TLS cloning, and transport behavior are preserved. Generated output for go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc and go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc remains unchanged.

Compatibility

opentelemetry-proto-go#707 documents a deliberate v1 compatibility exception in go.opentelemetry.io/proto/slim/otlp to fix descriptor-registration collisions. Public exporter Go APIs, OTLP wire encoding, and ordinary ProtoJSON mappings remain compatible.

  • Protobuf full names now use opentelemetry.proto.slim.*, and source descriptor paths use opentelemetry/proto/slim/.... These identities differ from both go.opentelemetry.io/proto/otlp and older go.opentelemetry.io/proto/slim/otlp releases. Custom integrations using reflection, proto.MessageName, global registry lookups, or service full names must account for the distinct namespace. The HTTP endpoints remain unchanged.

  • External google.protobuf.Any envelopes containing slim messages use different type URLs. Stored envelopes or custom resolvers tied to the previous identities may need migration. Core OTLP schemas do not embed google.protobuf.Any, so ordinary exported telemetry does not acquire these type URLs.

  • The generated Go message types from go.opentelemetry.io/proto/slim/otlp and go.opentelemetry.io/proto/otlp are distinct, despite compatible serialization. Both HTTP exporters' public APIs use SDK data rather than these protobuf types, so the internal type substitution does not change their signatures.

  • Applications already using the separate slim profiles or process-context development modules should upgrade those to descriptor-distinct releases at the same time, as described in the released slim module's compatibility notes.
  • Ordinary exporter users do not need to add go.opentelemetry.io/proto/otlp. A specific exception is code that looks up original OTLP protobuf names in the global registry and relied on these HTTP exporters to register them indirectly. An explicit import of the relevant go.opentelemetry.io/proto/otlp message package restores those entries. Applications already importing the relevant packages need no changes. This workaround can retain google.golang.org/grpc and github.com/grpc-ecosystem/grpc-gateway/v2 in the application's dependency graph.

    Validation

  • make precommit passes, including repository-wide linting, module checks, generation, and race-enabled tests.

  • Consecutive make generate runs produce identical output; formatting during precommit leaves that output unchanged.

  • go mod why -m google.golang.org/grpc github.com/grpc-ecosystem/grpc-gateway/v2 reports that neither HTTP module needs either dependency.

  • The self-contained manual verification script below passes: each HTTP module and a combined HTTP-only consumer exclude google.golang.org/grpc, github.com/grpc-ecosystem/grpc-gateway/v2, and go.opentelemetry.io/proto/otlp from module graphs and compiled test dependencies. A separate consumer imports all six existing OTLP exporters and race-tests populated metric/log requests with gzip and decoders/responses from go.opentelemetry.io/proto/otlp.

  • Existing exporter and transformation benchmarks were compared before/after using six 100ms samples and benchstat. Transform bytes/allocations are unchanged. Timing results are included below; HTTP benchmark timings include local transport overhead.
  • Manual verification code is included below for reproducibility and is not added to the repository. The Makefile and CI workflows remain unchanged.

    <details>
    <summary>Self-contained manual verification script</summary>

    Run from the repository checkout with a Go toolchain that supports the race detector. Save the script below as /tmp/verify_otlp_http_dependencies.sh, then execute:

    bash /tmp/verify_otlp_http_dependencies.sh
    

    The script generates both Go consumer tests in temporary directories, supplies local module replacements, and removes temporary files on exit.

    #!/bin/bash
    
    # Copyright The OpenTelemetry Authors
    # SPDX-License-Identifier: Apache-2.0
    
    set -euo pipefail
    
    # Check each module independently so a workspace cannot hide dependencies.
    export GOWORK=off
    
    ROOT_DIR="$(git rev-parse --show-toplevel)"
    WORK_DIR=$(mktemp -d)
    trap 'rm -rf "$WORK_DIR"' EXIT
    
    HTTP_MODULES=(
        exporters/otlp/otlpmetric/otlpmetrichttp
        exporters/otlp/otlplog/otlploghttp
    )
    FORBIDDEN='(^|[[:space:]])(google[.]golang[.]org/grpc|github[.]com/grpc-ecosystem/grpc-gateway|go[.]opentelemetry[.]io/proto/otlp)(@|/|[[:space:]]|$)'
    
    check_dependencies() {
        local directory=$1
        echo "Checking OTLP/HTTP dependencies in $directory"
        (
            cd "$directory"
            go mod graph > "$WORK_DIR/graph"
            go list -deps -test ./... > "$WORK_DIR/packages"
        )
        if grep -E "$FORBIDDEN" "$WORK_DIR/graph" "$WORK_DIR/packages"; then
            echo "Error: OTLP/HTTP depends on google.golang.org/grpc, github.com/grpc-ecosystem/grpc-gateway/v2, or go.opentelemetry.io/proto/otlp." >&2
            return 1
        fi
    }
    
    for module in "${HTTP_MODULES[@]}"; do
        check_dependencies "$ROOT_DIR/$module"
    done
    
    # Dependency-module replacements are not inherited by consumers. Replace every
    # repository module explicitly so these consumers exercise the local source.
    git -C "$ROOT_DIR" ls-files 'go.mod' '*/go.mod' > "$WORK_DIR/modules"
    new_consumer() {
        local name=$1
        local exporters=("${HTTP_MODULES[@]}")
        if [[ "$name" == mixed ]]; then
            exporters+=(
                exporters/otlp/otlplog/otlploggrpc
                exporters/otlp/otlpmetric/otlpmetricgrpc
                exporters/otlp/otlptrace/otlptracegrpc
                exporters/otlp/otlptrace/otlptracehttp
            )
        fi
        mkdir "$WORK_DIR/$name"
        case "$name" in
            http-only)
                cat > "$WORK_DIR/$name/consumer_test.go" <<'HTTP_ONLY_TEST'
    // Copyright The OpenTelemetry Authors
    // SPDX-License-Identifier: Apache-2.0
    
    package otlphttp_test
    
    import (
    	"testing"
    
    	"go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp"
    	"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp"
    )
    
    func TestHTTPExporters(t *testing.T) {
    	metrics, err := otlpmetrichttp.New(t.Context())
    	if err != nil {
    		t.Fatal(err)
    	}
    	if err := metrics.Shutdown(t.Context()); err != nil {
    		t.Fatal(err)
    	}
    	logs, err := otlploghttp.New(t.Context())
    	if err != nil {
    		t.Fatal(err)
    	}
    	if err := logs.Shutdown(t.Context()); err != nil {
    		t.Fatal(err)
    	}
    }
    HTTP_ONLY_TEST
                ;;
            mixed)
                cat > "$WORK_DIR/$name/consumer_test.go" <<'MIXED_TEST'
    // Copyright The OpenTelemetry Authors
    // SPDX-License-Identifier: Apache-2.0
    
    package otlphttp_test
    
    import (
    	"bytes"
    	"compress/gzip"
    	"context"
    	"io"
    	"net/http"
    	"net/http/httptest"
    	"testing"
    	"time"
    
    	"go.opentelemetry.io/otel/attribute"
    	_ "go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc"
    	"go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp"
    	_ "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc"
    	"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp"
    	_ "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
    	_ "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp"
    	"go.opentelemetry.io/otel/log"
    	"go.opentelemetry.io/otel/sdk/instrumentation"
    	sdklog "go.opentelemetry.io/otel/sdk/log"
    	"go.opentelemetry.io/otel/sdk/log/logtest"
    	"go.opentelemetry.io/otel/sdk/metric/metricdata"
    	"go.opentelemetry.io/otel/sdk/resource"
    	"go.opentelemetry.io/otel/trace"
    	collectorlog "go.opentelemetry.io/proto/otlp/collector/logs/v1"
    	collectormetric "go.opentelemetry.io/proto/otlp/collector/metrics/v1"
    	logpb "go.opentelemetry.io/proto/otlp/logs/v1"
    	metricpb "go.opentelemetry.io/proto/otlp/metrics/v1"
    	"google.golang.org/protobuf/proto"
    )
    
    func TestMetricWireCompatibility(t *testing.T) {
    	t.Setenv("OTEL_EXPORTER_OTLP_METRICS_PROTOCOL", "http/protobuf")
    	server, requests := collector(t, "/v1/metrics", &collectormetric.ExportMetricsServiceResponse{
    		PartialSuccess: &collectormetric.ExportMetricsPartialSuccess{},
    	})
    	exporter, err := otlpmetrichttp.New(t.Context(),
    		otlpmetrichttp.WithEndpointURL(server.URL+"/v1/metrics"),
    		otlpmetrichttp.WithCompression(otlpmetrichttp.GzipCompression),
    	)
    	if err != nil {
    		t.Fatal(err)
    	}
    	t.Cleanup(func() {
    		ctx, cancel := context.WithTimeout(context.Background(), time.Second)
    		defer cancel()
    		if err := exporter.Shutdown(ctx); err != nil {
    			t.Error(err)
    		}
    	})
    
    	now := time.Unix(1_700_000_000, 123)
    	data := metricdata.ResourceMetrics{
    		Resource: resource.NewWithAttributes("resource-schema", attribute.String("service.name", "wire-test")),
    		ScopeMetrics: []metricdata.ScopeMetrics{{
    			Scope: instrumentation.Scope{Name: "wire-meter", Version: "1.2.3", SchemaURL: "scope-schema"},
    			Metrics: []metricdata.Metrics{{
    				Name: "requests", Description: "request count", Unit: "{request}",
    				Data: metricdata.Sum[int64]{
    					Temporality: metricdata.CumulativeTemporality,
    					IsMonotonic: true,
    					DataPoints: []metricdata.DataPoint[int64]{{
    						Attributes: attribute.NewSet(attribute.String("method", "GET")),
    						StartTime:  now.Add(-time.Second), Time: now, Value: 42,
    					}},
    				},
    			}},
    		}},
    	}
    	if err := exporter.Export(t.Context(), &data); err != nil {
    		t.Fatal(err)
    	}
    	var request collectormetric.ExportMetricsServiceRequest
    	if err := proto.Unmarshal(receiveRequest(t, requests), &request); err != nil {
    		t.Fatal(err)
    	}
    	if len(request.ResourceMetrics) != 1 || len(request.ResourceMetrics[0].ScopeMetrics) != 1 {
    		t.Fatalf("unexpected resource/scope metrics: %v", &request)
    	}
    	rm := request.ResourceMetrics[0]
    	sm := rm.ScopeMetrics[0]
    	if rm.SchemaUrl != "resource-schema" || len(rm.GetResource().GetAttributes()) != 1 ||
    		rm.Resource.Attributes[0].Key != "service.name" || rm.Resource.Attributes[0].Value.GetStringValue() != "wire-test" ||
    		sm.GetScope().GetName() != "wire-meter" || sm.GetScope().GetVersion() != "1.2.3" || sm.SchemaUrl != "scope-schema" || len(sm.Metrics) != 1 {
    		t.Fatalf("resource/scope metadata changed: %v", rm)
    	}
    	m := sm.Metrics[0]
    	sum := m.GetSum()
    	if m.Name != "requests" || m.Description != "request count" || m.Unit != "{request}" ||
    		sum.GetAggregationTemporality() != metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE ||
    		!sum.GetIsMonotonic() || len(sum.GetDataPoints()) != 1 {
    		t.Fatalf("metric changed: %v", m)
    	}
    	dp := sum.DataPoints[0]
    	if dp.GetAsInt() != 42 || dp.TimeUnixNano != uint64(now.UnixNano()) ||
    		dp.StartTimeUnixNano != uint64(now.Add(-time.Second).UnixNano()) ||
    		len(dp.Attributes) != 1 || dp.Attributes[0].Key != "method" || dp.Attributes[0].Value.GetStringValue() != "GET" {
    		t.Fatalf("metric data point changed: %v", dp)
    	}
    }
    
    func TestLogWireCompatibility(t *testing.T) {
    	t.Setenv("OTEL_EXPORTER_OTLP_LOGS_PROTOCOL", "http/protobuf")
    	server, requests := collector(t, "/v1/logs", &collectorlog.ExportLogsServiceResponse{
    		PartialSuccess: &collectorlog.ExportLogsPartialSuccess{},
    	})
    	exporter, err := otlploghttp.New(t.Context(),
    		otlploghttp.WithEndpointURL(server.URL+"/v1/logs"),
    		otlploghttp.WithCompression(otlploghttp.GzipCompression),
    	)
    	if err != nil {
    		t.Fatal(err)
    	}
    	t.Cleanup(func() {
    		ctx, cancel := context.WithTimeout(context.Background(), time.Second)
    		defer cancel()
    		if err := exporter.Shutdown(ctx); err != nil {
    			t.Error(err)
    		}
    	})
    
    	now := time.Unix(1_700_000_000, 123)
    	traceID := trace.TraceID{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}
    	spanID := trace.SpanID{1, 2, 3, 4, 5, 6, 7, 8}
    	record := logtest.RecordFactory{
    		Timestamp: now, ObservedTimestamp: now.Add(time.Second),
    		Severity: log.SeverityWarn, SeverityText: "WARN", Body: attribute.StringValue("request failed"),
    		Attributes: []attribute.KeyValue{attribute.Int("status", 503)},
    		TraceID:    traceID, SpanID: spanID, TraceFlags: trace.FlagsSampled,
    		Resource:             resource.NewWithAttributes("resource-schema", attribute.String("service.name", "wire-test")),
    		InstrumentationScope: &instrumentation.Scope{Name: "wire-logger", Version: "1.2.3", SchemaURL: "scope-schema"},
    	}.NewRecord()
    	if err := exporter.Export(t.Context(), []sdklog.Record{record}); err != nil {
    		t.Fatal(err)
    	}
    	var request collectorlog.ExportLogsServiceRequest
    	if err := proto.Unmarshal(receiveRequest(t, requests), &request); err != nil {
    		t.Fatal(err)
    	}
    	if len(request.ResourceLogs) != 1 || len(request.ResourceLogs[0].ScopeLogs) != 1 {
    		t.Fatalf("unexpected resource/scope logs: %v", &request)
    	}
    	rl := request.ResourceLogs[0]
    	sl := rl.ScopeLogs[0]
    	if rl.SchemaUrl != "resource-schema" || len(rl.GetResource().GetAttributes()) != 1 ||
    		rl.Resource.Attributes[0].Key != "service.name" || rl.Resource.Attributes[0].Value.GetStringValue() != "wire-test" ||
    		sl.GetScope().GetName() != "wire-logger" || sl.GetScope().GetVersion() != "1.2.3" || sl.SchemaUrl != "scope-schema" || len(sl.LogRecords) != 1 {
    		t.Fatalf("resource/scope metadata changed: %v", rl)
    	}
    	lr := sl.LogRecords[0]
    	if lr.Body.GetStringValue() != "request failed" || lr.SeverityNumber != logpb.SeverityNumber_SEVERITY_NUMBER_WARN || lr.SeverityText != "WARN" ||
    		lr.TimeUnixNano != uint64(now.UnixNano()) || lr.ObservedTimeUnixNano != uint64(now.Add(time.Second).UnixNano()) ||
    		!bytes.Equal(lr.TraceId, traceID[:]) || !bytes.Equal(lr.SpanId, spanID[:]) || lr.Flags != uint32(trace.FlagsSampled) ||
    		len(lr.Attributes) != 1 || lr.Attributes[0].Key != "status" || lr.Attributes[0].Value.GetIntValue() != 503 {
    		t.Fatalf("log record changed: %v", lr)
    	}
    }
    
    func receiveRequest(t *testing.T, requests <-chan []byte) []byte {
    	t.Helper()
    	ctx, cancel := context.WithTimeout(t.Context(), 5*time.Second)
    	defer cancel()
    	select {
    	case body := <-requests:
    		return body
    	case <-ctx.Done():
    		t.Fatal("no export request received: ", ctx.Err())
    		return nil
    	}
    }
    
    func collector(t *testing.T, path string, response proto.Message) (*httptest.Server, <-chan []byte) {
    	t.Helper()
    	responseBody, err := proto.Marshal(response)
    	if err != nil {
    		t.Fatal(err)
    	}
    	requests := make(chan []byte, 1)
    	server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
    		if r.Method != http.MethodPost || r.URL.Path != path || r.Header.Get("Content-Type") != "application/x-protobuf" ||
    			r.Header.Get("Content-Encoding") != "gzip" {
    			t.Errorf("unexpected request: %s %s %v", r.Method, r.URL.Path, r.Header)
    		}
    		reader, err := gzip.NewReader(r.Body)
    		if err != nil {
    			t.Error(err)
    			w.WriteHeader(http.StatusBadRequest)
    			return
    		}
    		defer reader.Close()
    		body, err := io.ReadAll(reader)
    		if err != nil {
    			t.Error(err)
    			w.WriteHeader(http.StatusBadRequest)
    			return
    		}
    		select {
    		case requests <- body:
    		default:
    			t.Error("unexpected duplicate export request")
    			w.WriteHeader(http.StatusBadRequest)
    			return
    		}
    		w.Header().Set("Content-Type", "application/x-protobuf")
    		if _, err := w.Write(responseBody); err != nil {
    			t.Error(err)
    		}
    	}))
    	t.Cleanup(server.Close)
    	return server, requests
    }
    MIXED_TEST
                ;;
        esac
        (
            cd "$WORK_DIR/$name"
            go mod init "example.com/$name"
            while IFS= read -r mod_file; do
                mod_path=$(awk '$1 == "module" {print $2; exit}' "$ROOT_DIR/$mod_file")
                go mod edit "-replace=$mod_path=$ROOT_DIR/$(dirname "$mod_file")"
            done < "$WORK_DIR/modules"
            # Load the exporters' pinned dependencies before resolving fixture
            # imports, rather than selecting the latest external protobuf version.
            for exporter in "${exporters[@]}"; do
                mod_path=$(awk '$1 == "module" {print $2; exit}' "$ROOT_DIR/$exporter/go.mod")
                go mod edit "-require=$mod_path@v0.0.0"
            done
            go mod tidy
        )
    }
    
    new_consumer http-only
    check_dependencies "$WORK_DIR/http-only"
    (cd "$WORK_DIR/http-only" && go test -count=1 -timeout=2m ./...)
    
    # Keep canonical imports outside the HTTP modules. Importing all six exporters
    # also catches descriptor-registration collisions during process initialization.
    new_consumer mixed
    (cd "$WORK_DIR/mixed" && go test -race -count=1 -timeout=2m ./...)
    
    echo "OTLP/HTTP dependency and protobuf coexistence checks passed."
    

    </details>

    <details>
    <summary>Metric benchmark comparison (benchstat)</summary>

    Run in exporters/otlp/otlpmetric/otlpmetrichttp before and after the change:

    go test -run '^$' -bench 'Benchmark(ExporterExportMetrics|ResourceMetrics)$' -benchmem -count=6 -benchtime=100ms . ./internal/transform
    

    goos: linux
    goarch: amd64
    pkg: go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp
    cpu: AMD EPYC 7571
                                             │ /tmp/otlp-metric-before.txt │    /tmp/otlp-metric-after.txt     │
                                             │           sec/op            │   sec/op     vs base              │
    ExporterExportMetrics/Observability-16                     379.7µ ± 5%   349.2µ ± 4%  -8.02% (p=0.002 n=6)
    ExporterExportMetrics/NoObservability-16                   375.8µ ± 6%   355.8µ ± 4%       ~ (p=0.065 n=6)
    geomean                                                    377.8µ        352.5µ       -6.68%
    
                                             │ /tmp/otlp-metric-before.txt │     /tmp/otlp-metric-after.txt     │
                                             │            B/op             │     B/op      vs base              │
    ExporterExportMetrics/Observability-16                    29.56Ki ± 5%   29.21Ki ± 6%       ~ (p=0.394 n=6)
    ExporterExportMetrics/NoObservability-16                  29.16Ki ± 4%   29.27Ki ± 5%       ~ (p=0.589 n=6)
    geomean                                                   29.36Ki        29.24Ki       -0.40%
    
                                             │ /tmp/otlp-metric-before.txt │    /tmp/otlp-metric-after.txt    │
                                             │          allocs/op          │ allocs/op   vs base              │
    ExporterExportMetrics/Observability-16                      450.0 ± 1%   450.0 ± 1%       ~ (p=0.727 n=6)
    ExporterExportMetrics/NoObservability-16                    449.0 ± 0%   449.5 ± 0%       ~ (p=0.545 n=6)
    geomean                                                     449.5        449.7       +0.06%
    
    pkg: go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/internal/transform
                                                     │ /tmp/otlp-metric-before.txt │     /tmp/otlp-metric-after.txt     │
                                                     │           sec/op            │    sec/op     vs base              │
    ResourceMetrics/with_a_gauge-16                                   970.5n ±  5%    930.1n ± 4%  -4.16% (p=0.041 n=6)
    ResourceMetrics/with_a_sum-16                                     1.068µ ± 10%    1.011µ ± 2%  -5.29% (p=0.002 n=6)
    ResourceMetrics/with_a_histogram-16                               975.5n ±  3%   1004.0n ± 2%  +2.92% (p=0.026 n=6)
    ResourceMetrics/with_an_exponential_histogram-16                  989.2n ±  2%   1053.5n ± 8%       ~ (p=0.240 n=6)
    ResourceMetrics/with_a_summary-16                                 786.7n ±  5%    799.0n ± 6%       ~ (p=1.000 n=6)
    geomean                                                           953.1n          955.1n       +0.21%
    
                                                     │ /tmp/otlp-metric-before.txt │     /tmp/otlp-metric-after.txt      │
                                                     │            B/op             │    B/op      vs base                │
    ResourceMetrics/with_a_gauge-16                                    1000.0 ± 0%   1000.0 ± 0%       ~ (p=1.000 n=6) ¹
    ResourceMetrics/with_a_sum-16                                       777.0 ± 0%    777.0 ± 0%       ~ (p=1.000 n=6) ¹
    ResourceMetrics/with_a_histogram-16                                 777.0 ± 0%    777.0 ± 0%       ~ (p=1.000 n=6) ¹
    ResourceMetrics/with_an_exponential_histogram-16                    777.0 ± 0%    777.0 ± 0%       ~ (p=1.000 n=6) ¹
    ResourceMetrics/with_a_summary-16                                   920.0 ± 0%    920.0 ± 0%       ~ (p=1.000 n=6) ¹
    geomean                                                             845.3         845.3       +0.00%
    ¹ all samples are equal
    
                                                     │ /tmp/otlp-metric-before.txt │     /tmp/otlp-metric-after.txt     │
                                                     │          allocs/op          │ allocs/op   vs base                │
    ResourceMetrics/with_a_gauge-16                                     16.00 ± 0%   16.00 ± 0%       ~ (p=1.000 n=6) ¹
    ResourceMetrics/with_a_sum-16                                       14.00 ± 0%   14.00 ± 0%       ~ (p=1.000 n=6) ¹
    ResourceMetrics/with_a_histogram-16                                 14.00 ± 0%   14.00 ± 0%       ~ (p=1.000 n=6) ¹
    ResourceMetrics/with_an_exponential_histogram-16                    14.00 ± 0%   14.00 ± 0%       ~ (p=1.000 n=6) ¹
    ResourceMetrics/with_a_summary-16                                   15.00 ± 0%   15.00 ± 0%       ~ (p=1.000 n=6) ¹
    geomean                                                             14.58        14.58       +0.00%
    ¹ all samples are equal
    

    </details>

    <details>
    <summary>Log benchmark comparison (benchstat)</summary>

    Run in exporters/otlp/otlplog/otlploghttp before and after the change:

    go test -run '^$' -bench 'Benchmark(ExporterExportLogs|ResourceLogs)$' -benchmem -count=6 -benchtime=100ms . ./internal/transform
    

    goos: linux
    goarch: amd64
    pkg: go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp
    cpu: AMD EPYC 7571
                                          │ /tmp/otlp-log-before.txt │      /tmp/otlp-log-after.txt       │
                                          │          sec/op          │   sec/op     vs base               │
    ExporterExportLogs/Observability-16                  472.6µ ± 5%   440.0µ ± 5%   -6.90% (p=0.009 n=6)
    ExporterExportLogs/NoObservability-16                488.8µ ± 6%   435.0µ ± 2%  -11.01% (p=0.002 n=6)
    geomean                                              480.7µ        437.5µ        -8.98%
    
                                          │ /tmp/otlp-log-before.txt │      /tmp/otlp-log-after.txt       │
                                          │           B/op           │     B/op      vs base              │
    ExporterExportLogs/Observability-16                 40.80Ki ± 4%   40.79Ki ± 4%       ~ (p=1.000 n=6)
    ExporterExportLogs/NoObservability-16               41.05Ki ± 3%   40.75Ki ± 4%       ~ (p=0.485 n=6)
    geomean                                             40.93Ki        40.77Ki       -0.39%
    
                                          │ /tmp/otlp-log-before.txt │     /tmp/otlp-log-after.txt      │
                                          │        allocs/op         │ allocs/op   vs base              │
    ExporterExportLogs/Observability-16                   563.0 ± 1%   563.0 ± 1%       ~ (p=1.000 n=6)
    ExporterExportLogs/NoObservability-16                 563.0 ± 0%   563.0 ± 0%       ~ (p=1.000 n=6)
    geomean                                               563.0        563.0       +0.00%
    
    pkg: go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp/internal/transform
                    │ /tmp/otlp-log-before.txt │   /tmp/otlp-log-after.txt    │
                    │          sec/op          │   sec/op     vs base         │
    ResourceLogs-16               14.58µ ± 15%   14.58µ ± 6%  ~ (p=0.784 n=6)
    
                    │ /tmp/otlp-log-before.txt │    /tmp/otlp-log-after.txt    │
                    │           B/op           │     B/op      vs base         │
    ResourceLogs-16               11.77Ki ± 0%   11.77Ki ± 0%  ~ (p=1.000 n=6)
    
                    │ /tmp/otlp-log-before.txt │    /tmp/otlp-log-after.txt    │
                    │        allocs/op         │ allocs/op   vs base           │
    ResourceLogs-16                 235.0 ± 0%   235.0 ± 0%  ~ (p=1.000 n=6) ¹
    ¹ all samples are equal
    

    </details>

    Diff: 540 lines (+174 / -366) across 47 files Reviewer: dashpole Review duration: 21334m
    All Vouch review confidence checks passed
    Residual risk 0.08 = Change Risk (0.69) × (1 − Review Confidence (0.88)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.69 · 540 lines diff across 47 files
    0.69
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.84 · 5 substantive comment(s)
    0.84
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    87%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.377
    Mass File Touch mass_file_touch
    0.080
    Real PR Conversation Timeline
    19 items
    opentelemetry-pr-dashboard[bot] opentelemetry-pr-dashboard[bot] commented on Nov 12, 2026 18:05 UTC
    Bot

    <!-- pull-request-dashboard-status -->
    <!-- pull-request-dashboard-status-revision:24 -->

    Pull request dashboard status

    Merged · refreshed 2026-11-27 13:40 UTC

    <details>
    <summary>Status above doesn't look right?</summary>

    <br>

  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.
  • </details>

    codecov[bot] codecov[bot] commented on Nov 12, 2026 18:09 UTC
    Bot

    Codecov Report


    :white_check_mark: All modified and coverable lines are covered by tests.
    :white_check_mark: Project coverage is 90.0%. Comparing base (beb960d) to head (c2111db).
    :warning: Report is 1 commits behind head on main.

    <details><summary>Additional details and impacted files</summary>

    ![Impacted file tree graph](https://app.codecov.io/gh/open-telemetry/opentelemetry-go/pull/9499?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)

    @@          Coverage Diff          @@
    ##            main   #9499   +/-   ##
    =====================================
      Coverage   90.0%   90.0%           
    =====================================
      Files        360     360           
      Lines      24732   24667   -65     
    =====================================
    - Hits       22261   22211   -50     
    + Misses      2471    2456   -15     
    

    | Files with missing lines | Coverage Δ | |
    |---|---|---|
    | exporters/otlp/otlplog/otlploghttp/client.go | 92.6% <ø> (+0.5%) | :arrow_up: |
    | ...otlp/otlplog/otlploghttp/internal/transform/log.go | 98.3% <ø> (ø) | |
    | exporters/otlp/otlpmetric/otlpmetrichttp/client.go | 91.8% <ø> (-0.6%) | :arrow_down: |
    | ...porters/otlp/otlpmetric/otlpmetrichttp/exporter.go | 90.9% <ø> (ø) | |
    | ...otlpmetric/otlpmetrichttp/internal/observ/count.go | 100.0% <ø> (ø) | |
    | .../otlpmetrichttp/internal/observ/instrumentation.go | 100.0% <ø> (ø) | |
    | ...tlpmetric/otlpmetrichttp/internal/oconf/options.go | 90.7% <100.0%> (-4.8%) | :arrow_down: |
    | ...otlpmetric/otlpmetrichttp/internal/otest/client.go | 98.6% <ø> (ø) | |
    | ...pmetric/otlpmetrichttp/internal/otest/collector.go | 79.8% <ø> (+12.6%) | :arrow_up: |
    | ...ric/otlpmetrichttp/internal/transform/attribute.go | 97.6% <ø> (ø) | |
    | ... and 2 more | |

    ... and 7 files with indirect coverage changes
    </details>
    <details><summary> :rocket: New features to boost your workflow: </summary>

  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

  • </details>

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 12, 2026 19:08 UTC
    Reviewer

    Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 13, 2026 08:38 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🟢 Approval recommended

    No active review issues require further changes before approval.

    No open issues 🎉

    <sub>Review effort: Balanced</sub>

    dashpole dashpole commented on code on Nov 14, 2026 23:14 UTC
    Code Review
    exporters/otlp/otlpmetric/otlpmetrichttp/go.mod:1
    @@ -13,25 +13,19 @@ require (
     	go.opentelemetry.io/otel/metric v1.47.0
     	go.opentelemetry.io/otel/sdk v1.47.0
     	go.opentelemetry.io/otel/sdk/metric v1.47.0
    -	go.opentelemetry.io/proto/otlp v1.11.0
    -	google.golang.org/grpc v1.85.0
    +	go.opentelemetry.io/proto/slim/otlp v1.11.1

    Would it make sense to add a depguard rule in .golangci.yml for otlpmetrichttp and otlploghttp so CI catches any accidental re-import of google.golang.org/grpc or go.opentelemetry.io/proto/otlp?

    dashpole dashpole commented on code on Nov 14, 2026 23:14 UTC
    Code Review
    exporters/otlp/otlpmetric/otlpmetrichttp/internal/gen.go:1
    @@ -19,19 +19,20 @@ package internal
     //go:generate gotmpl --body=../../../../../internal/shared/otlp/otlpmetric/oconf/envconfig_test.go.tmpl "--data={}" --out=oconf/envconfig_test.go
     //go:generate gotmpl --body=../../../../../internal/shared/otlp/otlpmetric/oconf/options.go.tmpl "--data={\"isHTTP\": true, \"retryImportPath\": \"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/internal/retry\"}" --out=oconf/options.go
     //go:generate gotmpl --body=../../../../../internal/shared/otlp/otlpmetric/oconf/options_test.go.tmpl "--data={\"isHTTP\": true, \"envconfigImportPath\": \"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/internal/envconfig\"}" --out=oconf/options_test.go
    +//go:generate gofmt -w oconf/options_test.go

    Could we use {{- if .isHTTP }} / {{- else }} for the TLS assertions in internal/shared/otlp/otlpmetric/oconf/options_test.go.tmpl (similar to WithTLSClientConfig in options.go.tmpl) so gotmpl outputs valid indentation directly without needing gofmt -w here?

    dashpole dashpole approved these changes on Nov 14, 2026 23:14 UTC
    Approved Reviewer

    Approved these changes.

    pellared pellared commented on code on Nov 16, 2026 12:57 UTC
    Code Review
    exporters/otlp/otlpmetric/otlpmetrichttp/go.mod:1
    @@ -13,25 +13,19 @@ require (
     	go.opentelemetry.io/otel/metric v1.47.0
     	go.opentelemetry.io/otel/sdk v1.47.0
     	go.opentelemetry.io/otel/sdk/metric v1.47.0
    -	go.opentelemetry.io/proto/otlp v1.11.0
    -	google.golang.org/grpc v1.85.0
    +	go.opentelemetry.io/proto/slim/otlp v1.11.1

    Added in 49a61247f. The otlphttp depguard rule covers source and test files, including nested packages, in both HTTP exporters. It rejects gRPC, grpc-gateway, and canonical OTLP protobuf imports and directs users to the slim protobuf package. The repository's existing generated-file exclusion still applies.

    Verified forbidden-import fixtures from both module directories, allowed slim imports, and a gRPC exporter control. make precommit passes.

    pellared pellared commented on code on Nov 16, 2026 12:57 UTC
    Code Review
    exporters/otlp/otlpmetric/otlpmetrichttp/internal/gen.go:1
    @@ -19,19 +19,20 @@ package internal
     //go:generate gotmpl --body=../../../../../internal/shared/otlp/otlpmetric/oconf/envconfig_test.go.tmpl "--data={}" --out=oconf/envconfig_test.go
     //go:generate gotmpl --body=../../../../../internal/shared/otlp/otlpmetric/oconf/options.go.tmpl "--data={\"isHTTP\": true, \"retryImportPath\": \"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/internal/retry\"}" --out=oconf/options.go
     //go:generate gotmpl --body=../../../../../internal/shared/otlp/otlpmetric/oconf/options_test.go.tmpl "--data={\"isHTTP\": true, \"envconfigImportPath\": \"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/internal/envconfig\"}" --out=oconf/options_test.go
    +//go:generate gofmt -w oconf/options_test.go

    Done in 49a61247f. The five TLS assertions now use {{- if .isHTTP }} / {{- else }} branches, and the extra gofmt generation directive is removed.

    Verified that raw gotmpl output for both HTTP and gRPC is already gofmt-clean and byte-identical to the checked-in files. make precommit passes.

    pellared pellared commented on code on Nov 16, 2026 12:58 UTC
    Code Review
    exporters/otlp/otlpmetric/otlpmetrichttp/internal/gen.go:1
    @@ -19,19 +19,20 @@ package internal
     //go:generate gotmpl --body=../../../../../internal/shared/otlp/otlpmetric/oconf/envconfig_test.go.tmpl "--data={}" --out=oconf/envconfig_test.go
     //go:generate gotmpl --body=../../../../../internal/shared/otlp/otlpmetric/oconf/options.go.tmpl "--data={\"isHTTP\": true, \"retryImportPath\": \"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/internal/retry\"}" --out=oconf/options.go
     //go:generate gotmpl --body=../../../../../internal/shared/otlp/otlpmetric/oconf/options_test.go.tmpl "--data={\"isHTTP\": true, \"envconfigImportPath\": \"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/internal/envconfig\"}" --out=oconf/options_test.go
    +//go:generate gofmt -w oconf/options_test.go
    pellared pellared commented on code on Nov 16, 2026 12:58 UTC
    Code Review
    exporters/otlp/otlpmetric/otlpmetrichttp/go.mod:1
    @@ -13,25 +13,19 @@ require (
     	go.opentelemetry.io/otel/metric v1.47.0
     	go.opentelemetry.io/otel/sdk v1.47.0
     	go.opentelemetry.io/otel/sdk/metric v1.47.0
    -	go.opentelemetry.io/proto/otlp v1.11.0
    -	google.golang.org/grpc v1.85.0
    +	go.opentelemetry.io/proto/slim/otlp v1.11.1
    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 16, 2026 13:06 UTC
    Reviewer

    Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 20, 2026 11:22 UTC
    Reviewer

    Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 24, 2026 15:13 UTC
    Reviewer

    Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

    pellared pellared commented on Nov 24, 2026 15:16 UTC
    Author

    @open-telemetry/go-approvers PTAL

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 24, 2026 23:16 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🟢 Approval recommended

    No active review issues remain for the change removing gRPC dependencies from the metric and log HTTP exporters.

    No open issues 🎉

    <sub>Review effort: Balanced</sub>

    dmathieu dmathieu approved these changes on Nov 25, 2026 09:12 UTC
    Approved Reviewer

    Approved these changes.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 27, 2026 13:19 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🟢 Approval recommended

    No active review issues block the metric and log HTTP exporter dependency cleanup.

    No open issues 🎉

    <sub>Review effort: Balanced</sub>

    Reviewers
    Assignees
    pellared pellared
    Labels
    risk: low confidence: 87.9% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 69.2% (HIGH) · Higher = larger blast radius
    69.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 87.9% · Lower = rushed or shallow review
    87.9%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 8.4% · Safe to merge
    8.4%