Add more parameters to opensearch output plugin#1785
Add more parameters to opensearch output plugin#1785marcofranssen merged 6 commits intofluent:masterfrom
Conversation
3bbc042 to
0425dbb
Compare
0425dbb to
5b3a930
Compare
|
@marcofranssen thanks for the hint ;) Refactor to use generic params.InsertPairs helper function
|
243bdb2 to
6440c13
Compare
|
Hi @discostur , can you please sign off the commits? see details here |
abcf973 to
38a4919
Compare
|
@cw-Guo done |
| case *int16: | ||
| ps.InsertPairs(key, strconv.FormatInt(int64(*v), 10)) | ||
| case *int32: | ||
| ps.InsertPairs(key, strconv.FormatInt(int64(*v), 10)) |
There was a problem hiding this comment.
| ps.InsertPairs(key, strconv.FormatInt(int64(*v), 10)) | |
| ps.InsertPairs(key, strconv.FormatInt(int32(*v), 10)) |
Not sure, looks like all we use int64, but not sure if that is correct either.
There was a problem hiding this comment.
The conversion to int64/uint64 in these lines looks correct to me - it's required by strconv.FormatInt() and strconv.FormatUint().
The underlying inconsistency is in the type definitions across the project:
- Input ports: mostly *int32
- Output ports: mostly *uint32
- Exception: monitor_agent.Port uses *int64
- Other numeric fields: mixed *int16, *int32, *int64
The InsertPairs function must support all these types generically, hence the different cases. Standardizing types across the project could be a good idea for the future ;)
|
Sorry if this is the wrong place to ask, but would it be easy to add |
|
@kristiangronas |
|
@discostur could you rebase the PR and resovle the conflicts? |
77f3617 to
10648f6
Compare
|
@marcofranssen done |
7401292 to
3e5cc09
Compare
bad5da3 to
cbb790a
Compare
|
synced with main |
b9514f0 to
845cdd7
Compare
|
Basic tests are failing. Can you fix those? |
9c4b1dc to
67132ed
Compare
Signed-off-by: kilian.ries <kr@opusdns.com>
67132ed to
a98ca77
Compare
|
@marcofranssen done |
* add more parameters to opensearch output plugin Signed-off-by: Kilian Ries <mail@kilian-ries.de> * refactor Signed-off-by: Kilian Ries <mail@kilian-ries.de> * refactor Signed-off-by: Kilian Ries <mail@kilian-ries.de> * Regenerate opensearch plugin documentation Signed-off-by: kilian.ries <kr@opusdns.com> --------- Signed-off-by: Kilian Ries <mail@kilian-ries.de> Signed-off-by: kilian.ries <kr@opusdns.com>
* add more parameters to opensearch output plugin Signed-off-by: Kilian Ries <mail@kilian-ries.de> * refactor Signed-off-by: Kilian Ries <mail@kilian-ries.de> * refactor Signed-off-by: Kilian Ries <mail@kilian-ries.de> * Regenerate opensearch plugin documentation Signed-off-by: kilian.ries <kr@opusdns.com> --------- Signed-off-by: Kilian Ries <mail@kilian-ries.de> Signed-off-by: kilian.ries <kr@opusdns.com>
Add Extended OpenSearch Output Plugin Support
Summary
This PR significantly extends the OpenSearch output plugin CRD to support critical production features that were previously missing from the fluent-operator. Most notably, it adds support for
log_os_400_reason, which is essential for debugging 400 errors from OpenSearch without enabling full debug logging.Motivation
The current OpenSearch output plugin implementation only supported basic configuration options (host, port, credentials, SSL verification). This limited functionality made it difficult to:
log_os_400_reason)Changes
Key Features Added
Debugging & Error Handling:
logOs400Reason- Log 400 error reasons without debug level (critical for troubleshooting)reconnectOnError- Automatically reconnect on connection errorsignoreExceptions- Specify exception classes to ignoreexceptionBackup- Backup chunks when exceptions occurSSL/TLS Configuration:
caFile,clientCert,clientKey,clientKeyPassword- Mutual TLS supportsslVersion,sslMinVersion,sslMaxVersion- Fine-grained TLS version controlConnection Management:
requestTimeout- HTTP request timeout configurationreloadConnections,reloadAfter,reloadOnFailure- Connection pooling controlPerformance Tuning:
compressionLevel- Enable gzip compressionhttpBackend- Choose HTTP backend (excon/typhoeus)preferOjSerializer- Use faster JSON serializationbulkMessageRequestThreshold- Control bulk request splittingRecord & Index Management:
includeTagKey,tagKey- Include Fluentd tags in recordsidKey- Specify document ID fieldremoveKeys,removeKeysOnUpdate- Remove sensitive fieldswriteOperation- Support create/update/upsert operationsemitErrorForMissingId- Error handling for missing IDspipeline- OpenSearch ingest pipeline supportTemplate & Version Management:
templateOverwrite,maxRetryPuttingTemplate- Template managementverifyOsVersionAtStartup,maxRetryGetOsVersion- Version detectiondefaultOpensearchVersion- Fallback version configurationapplicationName,indexDatePattern- Rollover index supportuseLegacyTemplate- Support for both legacy and composable templatesAdvanced Options:
suppressTypeName- Handle OpenSearch 2.x type deprecationcontentType- Configure Content-Type headercustomHeaders- Add custom HTTP headerssnifferClassName,selectorClassName- Advanced node discoverysuppressDocWrap- Control document wrappingutcIndex- UTC vs local time for indicesModified Files
apis/fluentd/v1alpha1/plugins/output/opensearch.go- Added 67 new configuration fieldsapis/fluentd/v1alpha1/plugins/output/types.go- Implemented serialization for all new fieldsconfig/crd/bases/fluentd.fluent.io_clusteroutputs.yaml- Generated CRD with new fieldsconfig/crd/bases/fluentd.fluent.io_outputs.yaml- Generated CRD with new fieldscharts/fluent-operator/charts/fluentd-crds/crds/*.yaml- Updated Helm chart CRDsmanifests/setup/*.yaml- Updated manifest filesdocs/plugins/fluentd/output/opensearch.md- Updated documentation with all new parametersTesting
Test_Cfg2OpenSearch,Test_ClusterCfgOutput2OpenSearch,Test_MixedCfgs2OpenSearch)make generate)make manifests)Documentation
Updated comprehensive documentation including:
Backward Compatibility
✅ Fully backward compatible - All new fields are optional with sensible defaults that match the plugin's behavior. Existing configurations will continue to work unchanged.
Usage Example
References