Skip to content

Commit

Permalink
addressed feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jpinsonneau committed Jul 2, 2024
1 parent 6b556fb commit efdb0d4
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 22 deletions.
12 changes: 7 additions & 5 deletions apis/flowcollector/v1beta2/flowcollector_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,10 @@ type FlowCollectorOpenTelemetry struct {
TargetPort int `json:"targetPort"`

// Protocol of Open Telemetry connection. The available options are `http` and `grpc`.
// +unionDiscriminator
// +kubebuilder:validation:Enum:="http";"grpc"
// +optional
Protocol string `json:"protocol"`
Protocol string `json:"protocol,omitempty"`

// Headers to add to messages (optional)
// +optional
Expand All @@ -427,11 +429,11 @@ type FlowCollectorOpenTelemetry struct {
// +optional
TLS ClientTLS `json:"tls"`

// Custom rules to transform flow logs to Opentelemetry-conformant format.
// By default the following format will be used: https://github.com/rhobs/observability-data-model/blob/main/network-observability.md#format-proposal
// Setting `customRules` will fully override the default rules allowing you to export each field to your naming convention
// Custom fields mapping to an OpenTelemetry conformant format.
// By default, NetObserv format proposal is used: https://github.com/rhobs/observability-data-model/blob/main/network-observability.md#format-proposal .
// As there is currently no accepted otlp standard for L3/4 network logs, you can freely override it with your own.
// +optional
Rules *[]GenericTransformRule `json:"customRules,omitempty"`
FieldsMapping *[]GenericTransformRule `json:"fieldsMapping,omitempty"`

// Open telemetry configuration for logs.
// +optional
Expand Down
4 changes: 2 additions & 2 deletions apis/flowcollector/v1beta2/zz_generated.deepcopy.go

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

11 changes: 7 additions & 4 deletions bundle/manifests/flows.netobserv.io_flowcollectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5804,11 +5804,11 @@ spec:
description: Open telemetry configuration, such as the IP address
and port to send enriched logs, metrics and or traces to.
properties:
customRules:
fieldsMapping:
description: |-
Custom rules to transform flow logs to Opentelemetry-conformant format.
By default the following format will be used: https://github.com/rhobs/observability-data-model/blob/main/network-observability.md#format-proposal
Setting `customRules` will fully override the default rules allowing you to export each field to your naming convention
Custom fields mapping to an OpenTelemetry conformant format.
By default, NetObserv format proposal is used: https://github.com/rhobs/observability-data-model/blob/main/network-observability.md#format-proposal .
As there is currently no accepted otlp standard for L3/4 network logs, you can freely override it with your own.
items:
properties:
input:
Expand Down Expand Up @@ -5849,6 +5849,9 @@ spec:
protocol:
description: Protocol of Open Telemetry connection. The
available options are `http` and `grpc`.
enum:
- http
- grpc
type: string
targetHost:
default: ""
Expand Down
11 changes: 7 additions & 4 deletions config/crd/bases/flows.netobserv.io_flowcollectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5367,11 +5367,11 @@ spec:
openTelemetry:
description: Open telemetry configuration, such as the IP address and port to send enriched logs, metrics and or traces to.
properties:
customRules:
fieldsMapping:
description: |-
Custom rules to transform flow logs to Opentelemetry-conformant format.
By default the following format will be used: https://github.com/rhobs/observability-data-model/blob/main/network-observability.md#format-proposal
Setting `customRules` will fully override the default rules allowing you to export each field to your naming convention
Custom fields mapping to an OpenTelemetry conformant format.
By default, NetObserv format proposal is used: https://github.com/rhobs/observability-data-model/blob/main/network-observability.md#format-proposal .
As there is currently no accepted otlp standard for L3/4 network logs, you can freely override it with your own.
items:
properties:
input:
Expand Down Expand Up @@ -5409,6 +5409,9 @@ spec:
type: object
protocol:
description: Protocol of Open Telemetry connection. The available options are `http` and `grpc`.
enum:
- http
- grpc
type: string
targetHost:
default: ""
Expand Down
2 changes: 1 addition & 1 deletion controllers/flp/flp_pipeline_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ func (b *PipelineBuilder) createOpenTelemetryStage(name string, spec *flowslates
// otel logs config
if spec.Logs.Enable != nil && *spec.Logs.Enable {
// add transform stage
transformStage := fromStage.TransformGeneric(fmt.Sprintf("%s-transform", name), helper.GetOtelTransformConfig(spec.Rules))
transformStage := fromStage.TransformGeneric(fmt.Sprintf("%s-transform", name), helper.GetOtelTransformConfig(spec.FieldsMapping))
// add encode stage(s)
transformStage.EncodeOtelLogs(fmt.Sprintf("%s-logs", name), api.EncodeOtlpLogs{
OtlpConnectionInfo: &conn,
Expand Down
14 changes: 8 additions & 6 deletions docs/FlowCollector.md
Original file line number Diff line number Diff line change
Expand Up @@ -11922,12 +11922,12 @@ Open telemetry configuration, such as the IP address and port to send enriched l
</td>
<td>true</td>
</tr><tr>
<td><b><a href="#flowcollectorspecexportersindexopentelemetrycustomrulesindex">customRules</a></b></td>
<td><b><a href="#flowcollectorspecexportersindexopentelemetryfieldsmappingindex">fieldsMapping</a></b></td>
<td>[]object</td>
<td>
Custom rules to transform flow logs to Opentelemetry-conformant format.
By default the following format will be used: https://github.com/rhobs/observability-data-model/blob/main/network-observability.md#format-proposal
Setting `customRules` will fully override the default rules allowing you to export each field to your naming convention<br/>
Custom fields mapping to an OpenTelemetry conformant format.
By default, NetObserv format proposal is used: https://github.com/rhobs/observability-data-model/blob/main/network-observability.md#format-proposal .
As there is currently no accepted otlp standard for L3/4 network logs, you can freely override it with your own.<br/>
</td>
<td>false</td>
</tr><tr>
Expand All @@ -11953,9 +11953,11 @@ Setting `customRules` will fully override the default rules allowing you to expo
<td>false</td>
</tr><tr>
<td><b>protocol</b></td>
<td>string</td>
<td>enum</td>
<td>
Protocol of Open Telemetry connection. The available options are `http` and `grpc`.<br/>
<br/>
<i>Enum</i>: http, grpc<br/>
</td>
<td>false</td>
</tr><tr>
Expand All @@ -11969,7 +11971,7 @@ Setting `customRules` will fully override the default rules allowing you to expo
</table>


### FlowCollector.spec.exporters[index].openTelemetry.customRules[index]
### FlowCollector.spec.exporters[index].openTelemetry.fieldsMapping[index]
<sup><sup>[↩ Parent](#flowcollectorspecexportersindexopentelemetry)</sup></sup>


Expand Down

0 comments on commit efdb0d4

Please sign in to comment.