mirror of
https://github.com/luxfi/trace.git
synced 2026-10-30 15:15:40 +00:00
exporter_default.go was the default half of a //go:build pair whose grpc half was deleted in413feede4. Its errLegacyOTLPDisabled told a caller holding Type=GRPC or Type=HTTP to migrate — and66c2bb10bdeleted those constants, so no value reaching that branch has ever been a legacy OTLP config. The only way in now is a raw cast of an unknown byte, for which errUnknownExporterType already exists and says the true thing. One file, one error var, one indirection gone; New's default branch returns the right error directly. ResolveCollectorAddr + envValue: born dead in3ff36b828and never called anywhere in the workspace (grep across ~/work, including ignored files). envValue is a stub returning "", so ResolveCollectorAddr could only ever return "" — every service that wanted this wrote its own (hanzo/ai has firstNonEmptyEnv). A helper that cannot work and has no callers. var _ = net.IPv4zero: its own comment says it exists only to keep the net import live. The import existed only for it. Both gone. newZAPNativeExporter built a context with a 2s timeout, assigned it to _, and cancelled it without dialing. Nothing observed it; the real connect is exp.connect() below. Gone with the now-unused time import. exporter_config.go's header explained that the type sits outside "the tagged exporter files" so -tags otlp and -tags grpc builds share it. There are no tagged exporter files and no such tags. A comment that describes a build that cannot happen is worse than none. Also gofmt -s the two test cases66c2bb10bleft misaligned; the repo's CI runs a format check. Build + go vet + go test clean. Co-authored-by: Hanzo Dev <[email protected]>
18 lines
445 B
Go
18 lines
445 B
Go
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package trace
|
|
|
|
type ExporterConfig struct {
|
|
Type ExporterType `json:"type"`
|
|
|
|
// Endpoint to send traces to. If empty, the default endpoint will be used.
|
|
Endpoint string `json:"endpoint"`
|
|
|
|
// Headers to send with traces
|
|
Headers map[string]string `json:"headers"`
|
|
|
|
// If true, don't use TLS
|
|
Insecure bool `json:"insecure"`
|
|
}
|