Skip to content

Commit a001b1d

Browse files
committed
merge v3
2 parents 0bbba1c + 9b574fa commit a001b1d

35 files changed

+51474
-156
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -306,23 +306,3 @@ jobs:
306306
- name: Push load test result
307307
if: ${{ success() && github.ref_name == 'v3'}}
308308
run: git push 'https://github-actions:${{ secrets.GITHUB_TOKEN }}@github.com/nginx/agent.git' benchmark-results:benchmark-results
309-
310-
publish-packages:
311-
name: Publish NGINX Agent v3 packages
312-
if: ${{ github.ref_name == 'v3' &&
313-
!github.event.pull_request.head.repo.fork }}
314-
needs: [ lint, unit-test, performance-tests,
315-
load-tests, official-oss-image-integration-tests,
316-
official-plus-image-integration-tests,
317-
race-condition-test, integration-tests ]
318-
uses: ./.github/workflows/release-branch.yml
319-
secrets: inherit
320-
permissions:
321-
id-token: write
322-
contents: read
323-
with:
324-
packageVersion: "3.0.0"
325-
packageBuildNo: "${{ github.run_number }}"
326-
uploadAzure: true
327-
publishPackages: true
328-
releaseBranch: "v3"

.github/workflows/release-branch.yml

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -39,35 +39,6 @@ on:
3939
description: 'Location to publish packages to'
4040
required: false
4141
default: "https://up-ap.nginx.com"
42-
workflow_call:
43-
inputs:
44-
githubRelease:
45-
type: boolean
46-
default: false
47-
packageVersion:
48-
type: string
49-
default: "3.0.0"
50-
packageBuildNo:
51-
type: string
52-
default: "1"
53-
uploadAzure:
54-
type: boolean
55-
default: true
56-
publishPackages:
57-
type: boolean
58-
default: true
59-
tagRelease:
60-
type: boolean
61-
default: false
62-
createPullRequest:
63-
type: boolean
64-
default: false
65-
releaseBranch:
66-
type: string
67-
required: true
68-
uploadUrl:
69-
type: string
70-
default: "https://up-ap.nginx.com"
7142

7243
env:
7344
NFPM_VERSION: 'v2.35.3'

internal/collector/nginxplusreceiver/factory.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"github.com/nginx/agent/v3/internal/collector/nginxplusreceiver/internal/metadata"
2020
)
2121

22+
// nolint: ireturn
2223
const defaultTimeout = 10 * time.Second
2324

2425
// nolint: ireturn

internal/collector/otelcol.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ exporters:
160160
tls:
161161
insecure: {{ if .TLS -}}false{{ else -}}true{{- end }}
162162
{{- if .TLS }}
163+
insecure_skip_verify: {{ .TLS.SkipVerify }}
163164
{{ if gt (len .TLS.Ca) 0 -}}ca_file: "{{- .TLS.Ca -}}"{{- end }}
164165
{{ if gt (len .TLS.Cert) 0 -}}cert_file: "{{- .TLS.Cert -}}"{{- end }}
165166
{{ if gt (len .TLS.Key) 0 -}}key_file: "{{- .TLS.Key -}}"{{- end }}

internal/config/config.go

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func checkCollectorConfiguration(collector *Collector, config *Config) {
139139
if isOTelExporterConfigured(collector) && config.IsGrpcClientConfigured() && config.IsAuthConfigured() &&
140140
config.IsTLSConfigured() {
141141
slog.Info("No collector configuration found in NGINX Agent config, command server configuration found." +
142-
"Using default collector configuration")
142+
" Using default collector configuration")
143143
defaultCollector(collector, config)
144144
}
145145
}
@@ -366,13 +366,25 @@ func registerClientFlags(fs *flag.FlagSet) {
366366
fs.Int(
367367
ClientGRPCMaxMessageReceiveSizeKey,
368368
DefMaxMessageRecieveSize,
369-
"Updates the client grpc setting MaxRecvMsgSize with the specific value in MB.",
369+
"Updates the client grpc setting MaxRecvMsgSize with the specific value in bytes.",
370370
)
371371

372372
fs.Int(
373373
ClientGRPCMaxMessageSendSizeKey,
374374
DefMaxMessageSendSize,
375-
"Updates the client grpc setting MaxSendMsgSize with the specific value in MB.",
375+
"Updates the client grpc setting MaxSendMsgSize with the specific value in bytes.",
376+
)
377+
378+
fs.Uint32(
379+
ClientGRPCFileChunkSizeKey,
380+
DefFileChunkSize,
381+
"File chunk size in bytes.",
382+
)
383+
384+
fs.Uint32(
385+
ClientGRPCMaxFileSizeKey,
386+
DefMaxFileSize,
387+
"Max file size in bytes.",
376388
)
377389
}
378390

@@ -709,6 +721,8 @@ func resolveClient() *Client {
709721
MaxMessageSize: viperInstance.GetInt(ClientGRPCMaxMessageSizeKey),
710722
MaxMessageReceiveSize: viperInstance.GetInt(ClientGRPCMaxMessageReceiveSizeKey),
711723
MaxMessageSendSize: viperInstance.GetInt(ClientGRPCMaxMessageSendSizeKey),
724+
MaxFileSize: viperInstance.GetUint32(ClientGRPCMaxFileSizeKey),
725+
FileChunkSize: viperInstance.GetUint32(ClientGRPCFileChunkSizeKey),
712726
},
713727
Backoff: &BackOff{
714728
InitialInterval: viperInstance.GetDuration(ClientBackoffInitialIntervalKey),

internal/config/config_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ func checkDefaultsClientValues(t *testing.T, viperInstance *viper.Viper) {
106106
assert.Equal(t, DefMaxMessageSize, viperInstance.GetInt(ClientGRPCMaxMessageSizeKey))
107107
assert.Equal(t, DefMaxMessageRecieveSize, viperInstance.GetInt(ClientGRPCMaxMessageReceiveSizeKey))
108108
assert.Equal(t, DefMaxMessageSendSize, viperInstance.GetInt(ClientGRPCMaxMessageSendSizeKey))
109+
assert.Equal(t, DefFileChunkSize, viperInstance.GetUint32(ClientGRPCFileChunkSizeKey))
110+
assert.Equal(t, DefMaxFileSize, viperInstance.GetUint32(ClientGRPCMaxFileSizeKey))
109111
assert.Equal(t, make(map[string]string), viperInstance.GetStringMapString(LabelsRootKey))
110112
}
111113

@@ -783,6 +785,8 @@ func createConfig() *Config {
783785
MaxMessageSize: 1048575,
784786
MaxMessageReceiveSize: 1048575,
785787
MaxMessageSendSize: 1048575,
788+
MaxFileSize: 485753,
789+
FileChunkSize: 48575,
786790
},
787791
Backoff: &BackOff{
788792
InitialInterval: 200 * time.Millisecond,

internal/config/defaults.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
package config
66

77
import (
8-
"math"
98
"time"
109

1110
pkg "github.com/nginx/agent/v3/pkg/config"
@@ -28,9 +27,11 @@ const (
2827
DefCommandTLServerNameKey = ""
2928

3029
// Client GRPC Settings
31-
DefMaxMessageSize = 0 // 0 = unset
32-
DefMaxMessageRecieveSize = 4194304 // default 4 MB
33-
DefMaxMessageSendSize = math.MaxInt32
30+
DefMaxMessageSize = 0 // 0 = unset
31+
DefMaxMessageRecieveSize = 4194304 // default 4 MB
32+
DefMaxMessageSendSize = 4194304 // default 4 MB
33+
DefMaxFileSize uint32 = 1048576 // 1MB
34+
DefFileChunkSize uint32 = 524288 // 0.5MB
3435

3536
// Client HTTP Settings
3637
DefHTTPTimeout = 10 * time.Second
@@ -41,11 +42,11 @@ const (
4142
DefGRPCKeepAlivePermitWithoutStream = true
4243

4344
// Client Backoff defaults
44-
DefBackoffInitialInterval = 500 * time.Millisecond
45+
DefBackoffInitialInterval = 1 * time.Second
4546
DefBackoffRandomizationFactor = 0.5 // the value is 0 <= and < 1
46-
DefBackoffMultiplier = 1.5
47-
DefBackoffMaxInterval = 10 * time.Minute
48-
DefBackoffMaxElapsedTime = 30 * time.Second
47+
DefBackoffMultiplier = 3
48+
DefBackoffMaxInterval = 20 * time.Second
49+
DefBackoffMaxElapsedTime = 1 * time.Minute
4950

5051
// Watcher defaults
5152
DefInstanceWatcherMonitoringFrequency = 5 * time.Second

internal/config/flags.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ var (
3636
ClientGRPCMaxMessageSendSizeKey = pre(ClientRootKey) + "grpc_max_message_send_size"
3737
ClientGRPCMaxMessageReceiveSizeKey = pre(ClientRootKey) + "grpc_max_message_receive_size"
3838
ClientGRPCMaxMessageSizeKey = pre(ClientRootKey) + "grpc_max_message_size"
39+
ClientGRPCMaxFileSizeKey = pre(ClientRootKey) + "grpc_max_file_size"
40+
ClientGRPCFileChunkSizeKey = pre(ClientRootKey) + "grpc_file_chunk_size"
3941

4042
ClientBackoffInitialIntervalKey = pre(ClientRootKey) + "backoff_initial_interval"
4143
ClientBackoffMaxIntervalKey = pre(ClientRootKey) + "backoff_max_interval"

internal/config/testdata/nginx-agent.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ client:
4242
max_message_size: 1048575
4343
max_message_receive_size: 1048575
4444
max_message_send_size: 1048575
45+
max_file_size: 485753
46+
file_chunk_size: 48575
4547
backoff:
4648
initial_interval: 200ms
4749
max_interval: 10s

internal/config/types.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,11 @@ type (
8383
KeepAlive *KeepAlive `yaml:"keepalive" mapstructure:"keepalive"`
8484
// if MaxMessageSize is size set then we use that value,
8585
// otherwise MaxMessageRecieveSize and MaxMessageSendSize for individual settings
86-
MaxMessageSize int `yaml:"max_message_size" mapstructure:"max_message_size"`
87-
MaxMessageReceiveSize int `yaml:"max_message_receive_size" mapstructure:"max_message_receive_size"`
88-
MaxMessageSendSize int `yaml:"max_message_send_size" mapstructure:"max_message_send_size"`
86+
MaxMessageSize int `yaml:"max_message_size" mapstructure:"max_message_size"`
87+
MaxMessageReceiveSize int `yaml:"max_message_receive_size" mapstructure:"max_message_receive_size"`
88+
MaxMessageSendSize int `yaml:"max_message_send_size" mapstructure:"max_message_send_size"`
89+
MaxFileSize uint32 `yaml:"max_file_size" mapstructure:"max_file_size"`
90+
FileChunkSize uint32 `yaml:"file_chunk_size" mapstructure:"file_chunk_size"`
8991
}
9092

9193
KeepAlive struct {

0 commit comments

Comments
 (0)