Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion config/configgrpc/configgrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"go.opentelemetry.io/collector/config/configopaque"
"go.opentelemetry.io/collector/config/configoptional"
"go.opentelemetry.io/collector/config/configtls"
"go.opentelemetry.io/collector/confmap"
"go.opentelemetry.io/collector/extension/extensionauth"
)

Expand Down Expand Up @@ -65,6 +66,15 @@
return "round_robin"
}

var _ confmap.Unmarshaler = (*Headers)(nil)

type Headers map[string]configopaque.String

// Unmarshal implements confmap.Unmarshaler.
func (h *Headers) Unmarshal(conf *confmap.Conf) error {

Check failure on line 74 in config/configgrpc/configgrpc.go

View workflow job for this annotation

GitHub Actions / CodeQL-Build

unused-parameter: parameter 'conf' seems to be unused, consider removing or renaming it as _ (revive)

Check failure on line 74 in config/configgrpc/configgrpc.go

View workflow job for this annotation

GitHub Actions / lint

unused-parameter: parameter 'conf' seems to be unused, consider removing or renaming it as _ (revive)
panic("I got called")
}

// ClientConfig defines common settings for a gRPC client configuration.
type ClientConfig struct {
// The target to which the exporter is going to send traces or metrics,
Expand Down Expand Up @@ -95,7 +105,7 @@
WaitForReady bool `mapstructure:"wait_for_ready,omitempty"`

// The headers associated with gRPC requests.
Headers map[string]configopaque.String `mapstructure:"headers,omitempty"`
Headers Headers `mapstructure:"headers,omitempty"`

// Sets the balancer in grpclb_policy to discover the servers. Default is pick_first.
// https://github.com/grpc/grpc-go/blob/master/examples/features/load_balancing/README.md
Expand Down
Loading