Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion api/observability/v1/output_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -617,12 +617,18 @@ type HTTP struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Timeout",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:number"}
Timeout int `json:"timeout,omitempty"`

// Method specifies the Http method to be used for sending logs. If not set, 'POST' is used.
// Method specifies the HTTP method to be used for sending logs. If not set, 'POST' is used.
//
// +kubebuilder:validation:Enum:=GET;HEAD;POST;PUT;DELETE;OPTIONS;TRACE;PATCH
// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="HTTP Method"
Method string `json:"method,omitempty"`

// ProxyURL URL of a HTTP or HTTPS proxy to be used instead of direct connection.
//
// +kubebuilder:validation:Optional
// +kubebuilder:validation:XValidation:rule="self == '' || isURL(self)", message="invalid URL"
ProxyURL string `json:"proxyURL,omitempty"`
}

type KafkaTuningSpec struct {
Expand Down
3 changes: 1 addition & 2 deletions bundle/manifests/cluster-logging.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ metadata:
categories: OpenShift Optional, Logging & Tracing
certified: "false"
containerImage: quay.io/openshift-logging/cluster-logging-operator:latest
createdAt: "2024-10-25T13:58:52Z"
description: The Red Hat OpenShift Logging Operator for OCP provides a means for
configuring and managing log collection and forwarding.
features.operators.openshift.io/cnf: "false"
Expand Down Expand Up @@ -880,7 +879,7 @@ spec:
- description: Headers specify optional headers to be sent with the request
displayName: Headers
path: outputs[0].http.headers
- description: Method specifies the Http method to be used for sending logs.
- description: Method specifies the HTTP method to be used for sending logs.
If not set, 'POST' is used.
displayName: HTTP Method
path: outputs[0].http.method
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,7 @@ spec:
with the request
type: object
method:
description: Method specifies the Http method to be used
description: Method specifies the HTTP method to be used
for sending logs. If not set, 'POST' is used.
enum:
- GET
Expand All @@ -1468,6 +1468,13 @@ spec:
- TRACE
- PATCH
type: string
proxyURL:
description: ProxyURL URL of a HTTP or HTTPS proxy to be
used instead of direct connection.
type: string
x-kubernetes-validations:
- message: invalid URL
rule: self == '' || isURL(self)
timeout:
description: Timeout specifies the Http request timeout
in seconds. If not set, 10secs is used.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,7 @@ spec:
with the request
type: object
method:
description: Method specifies the Http method to be used
description: Method specifies the HTTP method to be used
for sending logs. If not set, 'POST' is used.
enum:
- GET
Expand All @@ -1468,6 +1468,13 @@ spec:
- TRACE
- PATCH
type: string
proxyURL:
description: ProxyURL URL of a HTTP or HTTPS proxy to be
used instead of direct connection.
type: string
x-kubernetes-validations:
- message: invalid URL
rule: self == '' || isURL(self)
timeout:
description: Timeout specifies the Http request timeout
in seconds. If not set, 10secs is used.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ spec:
- description: Headers specify optional headers to be sent with the request
displayName: Headers
path: outputs[0].http.headers
- description: Method specifies the Http method to be used for sending logs.
- description: Method specifies the HTTP method to be used for sending logs.
If not set, 'POST' is used.
displayName: HTTP Method
path: outputs[0].http.method
Expand Down
39 changes: 27 additions & 12 deletions docs/reference/operator/api_observability_v1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -811,24 +811,37 @@ Type:: array
|======================
|Property|Type|Description

|azureMonitor|object|
|cloudwatch|object|
|elasticsearch|object|
|googleCloudLogging|object|
|http|object|
|kafka|object|
|loki|object|
|lokiStack|object|
|azureMonitor|object| AzureMonitor configures forwarding log events to the Azure Monitor Logs service

|cloudwatch|object| Cloudwatch configures forwarding log events to AWS Cloudwatch logs

|elasticsearch|object| Elasticsearch configures forwarding log events to an Elasticsearch cluster

|googleCloudLogging|object| GoogleCloudLogging configures forwarding log events to GCP (formally Stackdriver) Operations

|http|object| HTTP configures forwarding log events to an HTTP server

|kafka|object| Kafka configures forwarding log events to Apache Kafka topics

|loki|object| Loki configures forwarding log events to a Loki aggregation system

|lokiStack|object| LokiStack configures forwarding log events to a Red Hat managed Loki deployment
using the Red Hat tenancy model

|name|string| Name used to refer to the output from a `pipeline`.

|otlp|object|
|otlp|object| OTLP configures forwarding log events to a receiver using the OpenTelemetry Protocol
with Red Openshift logging semantic conventions (ref: https://github.com/rhobs/observability-data-model/blob/main/cluster-logging.md)

|rateLimit|object| Limit imposes a limit in records-per-second on the total aggregate rate of logs forwarded
to this output from any given collector container. The total log flow from an individual collector
container to this output cannot exceed the limit. Generally, one collector is deployed per cluster node
Logs may be dropped to enforce the limit. Missing or 0 means no rate limit.

|splunk|object|
|syslog|object|
|splunk|object| Splunk configures forwarding log events to Splunk's HTTP event collector

|syslog|object| Syslog configures forwarding log events to a receiver using the syslog protocol

|tls|object| TLS contains settings for controlling options on TLS client connections.

|type|string| Type of output sink.
Expand Down Expand Up @@ -1420,7 +1433,9 @@ The 'username@password' part of `url` is ignored.

|headers|object| Headers specify optional headers to be sent with the request

|method|string| Method specifies the Http method to be used for sending logs. If not set, 'POST' is used.
|method|string| Method specifies the HTTP method to be used for sending logs. If not set, 'POST' is used.

|proxyURL|string| ProxyURL URL of a HTTP or HTTPS proxy to be used instead of direct connection.

|timeout|int| Timeout specifies the Http request timeout in seconds. If not set, 10secs is used.

Expand Down
7 changes: 7 additions & 0 deletions internal/generator/vector/output/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type Http struct {
Inputs string
URI string
Method string
Proxy string
common.RootMixin
}

Expand All @@ -32,6 +33,11 @@ type = "http"
inputs = {{.Inputs}}
uri = "{{.URI}}"
method = "{{.Method}}"
{{with .Proxy -}}
proxy.enabled = true
proxy.http = "{{.}}"
proxy.https = "{{.}}"
{{end -}}
{{.Compression}}
{{end}}
`
Expand Down Expand Up @@ -74,6 +80,7 @@ func Output(id string, o obs.OutputSpec, inputs []string, secrets observability.
Inputs: vectorhelpers.MakeInputs(inputs...),
URI: o.HTTP.URL,
Method: Method(o.HTTP),
Proxy: o.HTTP.ProxyURL,
RootMixin: common.NewRootMixin(nil),
}
}
Expand Down
5 changes: 5 additions & 0 deletions internal/generator/vector/output/http/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ var _ = Describe("Generate vector config", func() {
BaseOutputTuningSpec: *baseTune,
}
}, secrets, true, framework.NoOptions, "http_with_tuning.toml"),
Entry("with proxy", func(spec *obs.OutputSpec) {
spec.HTTP.ProxyURL = "http://somewhere.org/proxy"
spec.HTTP.Headers = nil
spec.HTTP.Authentication = nil
}, secrets, true, framework.NoOptions, "http_with_proxy.toml"),
)
})

Expand Down
12 changes: 12 additions & 0 deletions internal/generator/vector/output/http/http_with_proxy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[sinks.http_receiver]
type = "http"
inputs = ["application"]
uri = "https://my-logstore.com"
method = "post"
proxy.enabled = true
proxy.http = "http://somewhere.org/proxy"
proxy.https = "http://somewhere.org/proxy"

[sinks.http_receiver.encoding]
codec = "json"
except_fields = ["_internal"]