-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NETOBSERV-1522 Open Telemetry exporter API #671
Changes from 6 commits
d91053d
94d0fcb
317379b
d7a12c1
6d16b88
6b556fb
efdb0d4
9c9c293
01dde44
7ba86fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -373,6 +373,80 @@ type FlowCollectorIPFIXReceiver struct { | |||||||||||||||||||||
Transport string `json:"transport,omitempty"` | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
type FlowCollectorOpenTelemetryLogs struct { | ||||||||||||||||||||||
// Set `enable` to `true` to send logs to Open Telemetry receiver. | ||||||||||||||||||||||
//+kubebuilder:default:=true | ||||||||||||||||||||||
Enable *bool `json:"enable,omitempty"` | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
type FlowCollectorOpenTelemetryMetrics struct { | ||||||||||||||||||||||
// Set `enable` to `true` to send metrics to Open Telemetry receiver. | ||||||||||||||||||||||
//+kubebuilder:default:=true | ||||||||||||||||||||||
Enable *bool `json:"enable,omitempty"` | ||||||||||||||||||||||
|
||||||||||||||||||||||
// How often should metrics be sent to collector | ||||||||||||||||||||||
// +kubebuilder:default:="20s" | ||||||||||||||||||||||
PushTimeInterval *metav1.Duration `json:"pushTimeInterval,omitempty"` | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
type FlowCollectorOpenTelemetryTraces struct { | ||||||||||||||||||||||
// Set `enable` to `true` to send traces to Open Telemetry receiver. | ||||||||||||||||||||||
//+kubebuilder:default:=true | ||||||||||||||||||||||
Enable *bool `json:"enable,omitempty"` | ||||||||||||||||||||||
|
||||||||||||||||||||||
// Separate span for each prefix listed | ||||||||||||||||||||||
//+optional | ||||||||||||||||||||||
SpanSplitter []string `json:"spanSplitter,omitempty"` | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
type GenericTransformRule struct { | ||||||||||||||||||||||
Input string `json:"input,omitempty"` | ||||||||||||||||||||||
Output string `json:"output,omitempty"` | ||||||||||||||||||||||
Multiplier int `json:"multiplier,omitempty"` | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
type GenericTransform []GenericTransformRule | ||||||||||||||||||||||
|
||||||||||||||||||||||
type FlowCollectorOpenTelemetry struct { | ||||||||||||||||||||||
// Address of the Open Telemetry receiver | ||||||||||||||||||||||
// +kubebuilder:default:="" | ||||||||||||||||||||||
TargetHost string `json:"targetHost"` | ||||||||||||||||||||||
|
||||||||||||||||||||||
// Port for the Open Telemetry receiver | ||||||||||||||||||||||
TargetPort int `json:"targetPort"` | ||||||||||||||||||||||
|
||||||||||||||||||||||
// Protocol of Open Telemetry connection. The available options are `http` and `grpc`. | ||||||||||||||||||||||
// +optional | ||||||||||||||||||||||
Protocol string `json:"protocol"` | ||||||||||||||||||||||
|
||||||||||||||||||||||
// Headers to add to messages (optional) | ||||||||||||||||||||||
// +optional | ||||||||||||||||||||||
Headers map[string]string `json:"headers,omitempty"` | ||||||||||||||||||||||
|
||||||||||||||||||||||
// TLS client configuration. | ||||||||||||||||||||||
// +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 | ||||||||||||||||||||||
// +optional | ||||||||||||||||||||||
Rules *[]GenericTransformRule `json:"customRules,omitempty"` | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In general we try to make the CRD more opinionated than what FLP exposes. Here, I think we should present that more clearly as a mapping of fields, and tell why we expose it (because there's no standard) Here's a proposal:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also done in efdb0d4 |
||||||||||||||||||||||
|
||||||||||||||||||||||
// Open telemetry configuration for logs. | ||||||||||||||||||||||
// +optional | ||||||||||||||||||||||
Logs FlowCollectorOpenTelemetryLogs `json:"logs"` | ||||||||||||||||||||||
|
||||||||||||||||||||||
// Open telemetry configuration for metrics. | ||||||||||||||||||||||
// +optional | ||||||||||||||||||||||
Metrics FlowCollectorOpenTelemetryMetrics `json:"metrics"` | ||||||||||||||||||||||
|
||||||||||||||||||||||
// TODO: add traces in future | ||||||||||||||||||||||
// Open telemetry configuration for traces. | ||||||||||||||||||||||
// +optional | ||||||||||||||||||||||
//Traces FlowCollectorOpenTelemetryTraces `json:"traces"` | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
type ServerTLSConfigType string | ||||||||||||||||||||||
|
||||||||||||||||||||||
const ( | ||||||||||||||||||||||
|
@@ -1201,15 +1275,16 @@ type SubnetLabel struct { | |||||||||||||||||||||
type ExporterType string | ||||||||||||||||||||||
|
||||||||||||||||||||||
const ( | ||||||||||||||||||||||
KafkaExporter ExporterType = "Kafka" | ||||||||||||||||||||||
IpfixExporter ExporterType = "IPFIX" | ||||||||||||||||||||||
KafkaExporter ExporterType = "Kafka" | ||||||||||||||||||||||
IpfixExporter ExporterType = "IPFIX" | ||||||||||||||||||||||
OpenTelemetryExporter ExporterType = "OpenTelemetry" | ||||||||||||||||||||||
) | ||||||||||||||||||||||
|
||||||||||||||||||||||
// `FlowCollectorExporter` defines an additional exporter to send enriched flows to. | ||||||||||||||||||||||
type FlowCollectorExporter struct { | ||||||||||||||||||||||
// `type` selects the type of exporters. The available options are `Kafka` and `IPFIX`. | ||||||||||||||||||||||
// +unionDiscriminator | ||||||||||||||||||||||
// +kubebuilder:validation:Enum:="Kafka";"IPFIX" | ||||||||||||||||||||||
// +kubebuilder:validation:Enum:="Kafka";"IPFIX";"OpenTelemetry" | ||||||||||||||||||||||
// +kubebuilder:validation:Required | ||||||||||||||||||||||
Type ExporterType `json:"type"` | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
@@ -1220,6 +1295,10 @@ type FlowCollectorExporter struct { | |||||||||||||||||||||
// IPFIX configuration, such as the IP address and port to send enriched IPFIX flows to. | ||||||||||||||||||||||
// +optional | ||||||||||||||||||||||
IPFIX FlowCollectorIPFIXReceiver `json:"ipfix,omitempty"` | ||||||||||||||||||||||
|
||||||||||||||||||||||
// Open telemetry configuration, such as the IP address and port to send enriched logs, metrics and or traces to. | ||||||||||||||||||||||
// +optional | ||||||||||||||||||||||
OpenTelemetry FlowCollectorOpenTelemetry `json:"openTelemetry,omitempty"` | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
// `FlowCollectorStatus` defines the observed state of FlowCollector | ||||||||||||||||||||||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should be an enum I guess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, efdb0d4