Skip to content

Commit e4f11c2

Browse files
committed
Logdna fix
1 parent b9ad7c8 commit e4f11c2

File tree

9 files changed

+358
-24
lines changed

9 files changed

+358
-24
lines changed

charts/logging-operator/crds/logging.banzaicloud.io_clusteroutputs.yaml

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2885,10 +2885,83 @@ spec:
28852885
type: string
28862886
app:
28872887
type: string
2888-
buffer_chunk_limit:
2889-
type: string
2888+
buffer:
2889+
properties:
2890+
chunk_full_threshold:
2891+
type: string
2892+
chunk_limit_records:
2893+
type: integer
2894+
chunk_limit_size:
2895+
type: string
2896+
compress:
2897+
type: string
2898+
delayed_commit_timeout:
2899+
type: string
2900+
disable_chunk_backup:
2901+
type: boolean
2902+
flush_at_shutdown:
2903+
type: boolean
2904+
flush_interval:
2905+
type: string
2906+
flush_mode:
2907+
type: string
2908+
flush_thread_burst_interval:
2909+
type: string
2910+
flush_thread_count:
2911+
type: integer
2912+
flush_thread_interval:
2913+
type: string
2914+
overflow_action:
2915+
type: string
2916+
path:
2917+
type: string
2918+
queue_limit_length:
2919+
type: integer
2920+
queued_chunks_limit_size:
2921+
type: integer
2922+
retry_exponential_backoff_base:
2923+
type: string
2924+
retry_forever:
2925+
type: boolean
2926+
retry_max_interval:
2927+
type: string
2928+
retry_max_times:
2929+
type: integer
2930+
retry_randomize:
2931+
type: boolean
2932+
retry_secondary_threshold:
2933+
type: string
2934+
retry_timeout:
2935+
type: string
2936+
retry_type:
2937+
type: string
2938+
retry_wait:
2939+
type: string
2940+
tags:
2941+
type: string
2942+
timekey:
2943+
type: string
2944+
timekey_use_utc:
2945+
type: boolean
2946+
timekey_wait:
2947+
type: string
2948+
timekey_zone:
2949+
type: string
2950+
total_limit_size:
2951+
type: string
2952+
type:
2953+
type: string
2954+
type: object
28902955
hostname:
28912956
type: string
2957+
ingester_domain:
2958+
type: string
2959+
ingester_endpoint:
2960+
type: string
2961+
request_timeout:
2962+
type: string
2963+
tags:
2964+
type: string
28922965
required:
28932966
- api_key
28942967
- hostname

charts/logging-operator/crds/logging.banzaicloud.io_outputs.yaml

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2881,10 +2881,83 @@ spec:
28812881
type: string
28822882
app:
28832883
type: string
2884-
buffer_chunk_limit:
2885-
type: string
2884+
buffer:
2885+
properties:
2886+
chunk_full_threshold:
2887+
type: string
2888+
chunk_limit_records:
2889+
type: integer
2890+
chunk_limit_size:
2891+
type: string
2892+
compress:
2893+
type: string
2894+
delayed_commit_timeout:
2895+
type: string
2896+
disable_chunk_backup:
2897+
type: boolean
2898+
flush_at_shutdown:
2899+
type: boolean
2900+
flush_interval:
2901+
type: string
2902+
flush_mode:
2903+
type: string
2904+
flush_thread_burst_interval:
2905+
type: string
2906+
flush_thread_count:
2907+
type: integer
2908+
flush_thread_interval:
2909+
type: string
2910+
overflow_action:
2911+
type: string
2912+
path:
2913+
type: string
2914+
queue_limit_length:
2915+
type: integer
2916+
queued_chunks_limit_size:
2917+
type: integer
2918+
retry_exponential_backoff_base:
2919+
type: string
2920+
retry_forever:
2921+
type: boolean
2922+
retry_max_interval:
2923+
type: string
2924+
retry_max_times:
2925+
type: integer
2926+
retry_randomize:
2927+
type: boolean
2928+
retry_secondary_threshold:
2929+
type: string
2930+
retry_timeout:
2931+
type: string
2932+
retry_type:
2933+
type: string
2934+
retry_wait:
2935+
type: string
2936+
tags:
2937+
type: string
2938+
timekey:
2939+
type: string
2940+
timekey_use_utc:
2941+
type: boolean
2942+
timekey_wait:
2943+
type: string
2944+
timekey_zone:
2945+
type: string
2946+
total_limit_size:
2947+
type: string
2948+
type:
2949+
type: string
2950+
type: object
28862951
hostname:
28872952
type: string
2953+
ingester_domain:
2954+
type: string
2955+
ingester_endpoint:
2956+
type: string
2957+
request_timeout:
2958+
type: string
2959+
tags:
2960+
type: string
28882961
required:
28892962
- api_key
28902963
- hostname

config/crd/bases/logging.banzaicloud.io_clusteroutputs.yaml

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2885,10 +2885,83 @@ spec:
28852885
type: string
28862886
app:
28872887
type: string
2888-
buffer_chunk_limit:
2889-
type: string
2888+
buffer:
2889+
properties:
2890+
chunk_full_threshold:
2891+
type: string
2892+
chunk_limit_records:
2893+
type: integer
2894+
chunk_limit_size:
2895+
type: string
2896+
compress:
2897+
type: string
2898+
delayed_commit_timeout:
2899+
type: string
2900+
disable_chunk_backup:
2901+
type: boolean
2902+
flush_at_shutdown:
2903+
type: boolean
2904+
flush_interval:
2905+
type: string
2906+
flush_mode:
2907+
type: string
2908+
flush_thread_burst_interval:
2909+
type: string
2910+
flush_thread_count:
2911+
type: integer
2912+
flush_thread_interval:
2913+
type: string
2914+
overflow_action:
2915+
type: string
2916+
path:
2917+
type: string
2918+
queue_limit_length:
2919+
type: integer
2920+
queued_chunks_limit_size:
2921+
type: integer
2922+
retry_exponential_backoff_base:
2923+
type: string
2924+
retry_forever:
2925+
type: boolean
2926+
retry_max_interval:
2927+
type: string
2928+
retry_max_times:
2929+
type: integer
2930+
retry_randomize:
2931+
type: boolean
2932+
retry_secondary_threshold:
2933+
type: string
2934+
retry_timeout:
2935+
type: string
2936+
retry_type:
2937+
type: string
2938+
retry_wait:
2939+
type: string
2940+
tags:
2941+
type: string
2942+
timekey:
2943+
type: string
2944+
timekey_use_utc:
2945+
type: boolean
2946+
timekey_wait:
2947+
type: string
2948+
timekey_zone:
2949+
type: string
2950+
total_limit_size:
2951+
type: string
2952+
type:
2953+
type: string
2954+
type: object
28902955
hostname:
28912956
type: string
2957+
ingester_domain:
2958+
type: string
2959+
ingester_endpoint:
2960+
type: string
2961+
request_timeout:
2962+
type: string
2963+
tags:
2964+
type: string
28922965
required:
28932966
- api_key
28942967
- hostname

config/crd/bases/logging.banzaicloud.io_outputs.yaml

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2881,10 +2881,83 @@ spec:
28812881
type: string
28822882
app:
28832883
type: string
2884-
buffer_chunk_limit:
2885-
type: string
2884+
buffer:
2885+
properties:
2886+
chunk_full_threshold:
2887+
type: string
2888+
chunk_limit_records:
2889+
type: integer
2890+
chunk_limit_size:
2891+
type: string
2892+
compress:
2893+
type: string
2894+
delayed_commit_timeout:
2895+
type: string
2896+
disable_chunk_backup:
2897+
type: boolean
2898+
flush_at_shutdown:
2899+
type: boolean
2900+
flush_interval:
2901+
type: string
2902+
flush_mode:
2903+
type: string
2904+
flush_thread_burst_interval:
2905+
type: string
2906+
flush_thread_count:
2907+
type: integer
2908+
flush_thread_interval:
2909+
type: string
2910+
overflow_action:
2911+
type: string
2912+
path:
2913+
type: string
2914+
queue_limit_length:
2915+
type: integer
2916+
queued_chunks_limit_size:
2917+
type: integer
2918+
retry_exponential_backoff_base:
2919+
type: string
2920+
retry_forever:
2921+
type: boolean
2922+
retry_max_interval:
2923+
type: string
2924+
retry_max_times:
2925+
type: integer
2926+
retry_randomize:
2927+
type: boolean
2928+
retry_secondary_threshold:
2929+
type: string
2930+
retry_timeout:
2931+
type: string
2932+
retry_type:
2933+
type: string
2934+
retry_wait:
2935+
type: string
2936+
tags:
2937+
type: string
2938+
timekey:
2939+
type: string
2940+
timekey_use_utc:
2941+
type: boolean
2942+
timekey_wait:
2943+
type: string
2944+
timekey_zone:
2945+
type: string
2946+
total_limit_size:
2947+
type: string
2948+
type:
2949+
type: string
2950+
type: object
28862951
hostname:
28872952
type: string
2953+
ingester_domain:
2954+
type: string
2955+
ingester_endpoint:
2956+
type: string
2957+
request_timeout:
2958+
type: string
2959+
tags:
2960+
type: string
28882961
required:
28892962
- api_key
28902963
- hostname

pkg/sdk/api/v1beta1/zz_generated.deepcopy.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/sdk/model/output/logdna.go

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,16 @@ type LogDNAOutput struct {
4545
HostName string `json:"hostname"`
4646
// Application name
4747
App string `json:"app,omitempty"`
48-
// Do not increase past 8m (8MB) or your logs will be rejected by LogDNA server.
49-
BufferQueueLimit string `json:"buffer_chunk_limit,omitempty" default:"1m"`
48+
// Comma-Separated List of Tags, Optional
49+
Tags string `json:"tags,omitempty"`
50+
// HTTPS POST Request Timeout, Optional. Supports s and ms Suffices (default: 30 s)
51+
RequestTimeout string `json:"request_timeout,omitempty"`
52+
// Custom Ingester URL, Optional (default: https://logs.logdna.com)
53+
IngesterDomain string `json:"ingester_domain,omitempty"`
54+
// Custom Ingester Endpoint, Optional (default: /logs/ingest)
55+
IngesterEndpoint string `json:"ingester_endpoint,omitempty"`
56+
// +docLink:"Buffer,../buffer/"
57+
Buffer *Buffer `json:"buffer,omitempty"`
5058
}
5159

5260
// #### Example `LogDNA` filter configurations
@@ -60,6 +68,9 @@ type LogDNAOutput struct {
6068
// api_key: xxxxxxxxxxxxxxxxxxxxxxxxxxx
6169
// hostname: logging-operator
6270
// app: my-app
71+
// tags: web,dev
72+
// ingester_domain https://logs.logdna.com
73+
// ingester_endpoint /logs/ingest
6374
// ```
6475
//
6576
// #### Fluentd Config Result
@@ -90,5 +101,12 @@ func (l *LogDNAOutput) ToDirective(secretLoader secret.SecretLoader, id string)
90101
} else {
91102
logdna.Params = params
92103
}
104+
if l.Buffer != nil {
105+
if buffer, err := l.Buffer.ToDirective(secretLoader, id); err != nil {
106+
return nil, err
107+
} else {
108+
logdna.SubDirectives = append(logdna.SubDirectives, buffer)
109+
}
110+
}
93111
return logdna, nil
94112
}

0 commit comments

Comments
 (0)