Skip to content

Commit

Permalink
fixup! fix(output): make all OTLPgrpc fields available
Browse files Browse the repository at this point in the history
Signed-off-by: Szilard Parrag <szilard.parrag@axoflow.com>
  • Loading branch information
OverOrion committed Feb 2, 2024
1 parent 2eb1ea1 commit e84e68d
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 7 deletions.
14 changes: 7 additions & 7 deletions api/telemetry/v1alpha1/oteloutput_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ type OtelOutputSpec struct {

// OTLP grpc exporter config ref: https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/otlpexporter/config.go
type OTLPgrpc struct {
QueueConfig QueueSettings `json:"sending_queue,omitempty"`
RetryConfig BackOffConfig `json:"retry_on_failure,omitempty"`
TimeoutSettings `json:",inline"`
GRPCClientSettings `json:",inline"`
QueueConfig QueueSettings `json:"sending_queue,omitempty" yaml:"sending_queue,omitempty"`
RetryConfig BackOffConfig `json:"retry_on_failure,omitempty" yaml:"retry_on_failure,omitempty"`
TimeoutSettings `json:",inline" yaml:",inline"`
GRPCClientSettings `json:",inline" yaml:",inline"`
}

// OtelOutputStatus defines the observed state of OtelOutput
Expand All @@ -52,15 +52,15 @@ type OtelOutput struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec OtelOutputSpec `json:"spec,omitempty"`
Status OtelOutputStatus `json:"status,omitempty"`
Spec OtelOutputSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
Status OtelOutputStatus `json:"status,omitempty" `
}

//+kubebuilder:object:root=true

// OtelOutputList contains a list of OtelOutput
type OtelOutputList struct {
metav1.TypeMeta `json:",inline"`
metav1.TypeMeta `json:",inline" yaml:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []OtelOutput `json:"items"`
}
Expand Down
1 change: 1 addition & 0 deletions api/telemetry/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions config/crd/bases/telemetry.kube-logging.dev_oteloutputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,23 @@ spec:
tls:
description: TLSSetting struct exposes TLS client configuration.
properties:
ca_file:
description: |-
Path to the CA cert. For a client this verifies the server certificate.
For a server this verifies client certificates. If empty uses system root CA.
(optional)
type: string
ca_pem:
description: In memory PEM encoded cert. (optional)
type: string
cert_file:
description: Path to the TLS cert to use for TLS required
connections. (optional)
type: string
cert_pem:
description: In memory PEM encoded TLS cert to use for TLS
required connections. (optional)
type: string
insecure:
description: |-
In gRPC when set to true, this is used to disable the client transport security.
Expand All @@ -178,6 +195,30 @@ spec:
description: InsecureSkipVerify will enable TLS but not verify
the certificate.
type: boolean
key_file:
description: Path to the TLS key to use for TLS required connections.
(optional)
type: string
key_pem:
description: In memory PEM encoded TLS key to use for TLS
required connections. (optional)
type: string
max_version:
description: |-
MaxVersion sets the maximum TLS version that is acceptable.
If not set, refer to crypto/tls for defaults. (optional)
type: string
min_version:
description: |-
MinVersion sets the minimum TLS version that is acceptable.
If not set, TLS 1.2 will be used. (optional)
type: string
reload_interval:
description: |-
ReloadInterval specifies the duration after which the certificate will be reloaded
If not set, it will never be reloaded (optional)
format: int64
type: integer
server_name_override:
description: |-
ServerName requested by client for virtual hosting.
Expand Down
1 change: 1 addition & 0 deletions internal/controller/telemetry/otel_conf_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ func (cfgInput *OtelColConfigInput) generateOTLPExporters() map[string]any {
var result = make(map[string]any)

for _, output := range cfgInput.Outputs {
// TODO: add proper error handling
name := fmt.Sprintf("otlp/%s_%s", output.Namespace, output.Name)
otlpGrpcValuesMarshaled, err := yaml.Marshal(output.Spec.OTLP)
if err != nil {
Expand Down

0 comments on commit e84e68d

Please sign in to comment.