open-code-review/internal/telemetry
paker 589a7249f5
fix(telemetry): support http:// scheme in otlp_endpoint for insecure gRPC (#280)
* fix(telemetry): support http:// scheme in otlp_endpoint for insecure gRPC

Parse the otlp_endpoint scheme before creating the OTLP gRPC exporters:
- http://host:port  -> strip scheme, call WithInsecure() (plaintext gRPC)
- https://host:port -> strip scheme, keep default TLS
- host:port          -> unchanged, keep default TLS (backward compatible)

Scheme matching is case-insensitive. Applies to both the trace and
metric exporters in initOTLPProviders.

Fixes #268

* fix(telemetry): trim trailing slash from otlp_endpoint after scheme strip

Addresses review feedback: a URL-style endpoint with a trailing slash
(e.g. "http://localhost:4317/") left the trailing "/" in the address
passed to WithEndpoint(), which expects a bare host:port with no path
and could cause connection failures.
2026-07-03 11:26:03 +08:00
..
config.go refactor(config): rename config directory from .open-code-review to .opencodereview 2026-05-25 23:07:36 +08:00
config_test.go test: add unit tests for output_helpers, config, model, stdout, and telemetry packages 2026-06-26 23:26:49 +08:00
events.go feat(llm): enable Anthropic prompt caching and fix token accounting 2026-06-06 19:26:34 +08:00
events_test.go test: improve coverage for telemetry package and exclude extensions from build targets 2026-06-27 10:43:45 +08:00
exporter.go fix(telemetry): support http:// scheme in otlp_endpoint for insecure gRPC (#280) 2026-07-03 11:26:03 +08:00
exporter_test.go fix(telemetry): support http:// scheme in otlp_endpoint for insecure gRPC (#280) 2026-07-03 11:26:03 +08:00
metrics.go style: apply go fmt formatting 2026-06-03 17:34:28 +08:00
metrics_test.go test: improve coverage for telemetry package and exclude extensions from build targets 2026-06-27 10:43:45 +08:00
provider.go feat: init 2026-05-20 22:03:52 +08:00
provider_test.go test: improve coverage for telemetry package and exclude extensions from build targets 2026-06-27 10:43:45 +08:00
shutdown.go feat: init 2026-05-20 22:03:52 +08:00
shutdown_test.go test: improve coverage for telemetry package and exclude extensions from build targets 2026-06-27 10:43:45 +08:00
span.go style: apply go fmt formatting 2026-06-03 17:34:28 +08:00
span_test.go test: improve coverage for telemetry package and exclude extensions from build targets 2026-06-27 10:43:45 +08:00