Skip to content
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

out_calyptia: retry agent registration on flush callback #9656

Merged
merged 2 commits into from
Nov 28, 2024

Conversation

niedbalski
Copy link
Collaborator

Description

if register_retry_on_flush is set (default true, my proposal)0, agent registration is retried on each flush callback.
if set to false then registration will cause to abort the plugin initialisation.

Testing

  • Example configuration file for the change
  • Debug log output from testing the change
    Use with this configuration
[SERVICE]
    Log_Level debug

[CUSTOM]
    name                calyptia
    api_key xxx
    log_level           debug
    calyptia_host       localhost
    calyptia_port       5000
    calyptia_tls        off
    calyptia_tls.verify off
    register_retry_on_flush false


If set to true (my proposed default)

[2024/11/27 22:09:00] [ warn] [output:calyptia:calyptia.0] agent registration failed
[2024/11/27 22:09:00] [debug] [out flush] cb_destroy coro_id=0
[2024/11/27 22:09:00] [debug] [retry] new retry created for task_id=0 attempts=1
[2024/11/27 22:09:00] [ warn] [engine] failed to flush chunk '57405-1732741739.505948000.flb', retry in 11 seconds: task_id=0, input=fluentbit_metrics.0 > output=calyptia.0 (out_id=0)

[2024/11/27 22:09:11] [ info] [output:calyptia:calyptia.0] agent_id not found and register_retry_on_flush=true, attempting registration
[2024/11/27 22:09:11] [debug] [net] socket #36 could not connect to ::1:5000
[2024/11/27 22:09:11] [debug] [net] socket #36 could not connect to 127.0.0.1:5000
[2024/11/27 22:09:11] [debug] [net] could not connect to localhost:5000
[2024/11/27 22:09:11] [debug] [upstream] connection #-1 failed to localhost:5000
[2024/11/27 22:09:11] [ warn] [output:calyptia:calyptia.0] agent registration failed
[2024/11/27 22:09:11] [debug] [out flush] cb_destroy coro_id=1
[2024/11/27 22:09:11] [debug] [task] task_id=0 reached retry-attempts limit 1/1
[2024/11/27 22:09:11] [error] [engine] chunk '57405-1732741739.505948000.flb' cannot be retried: task_id=0, input=fluentbit_metrics.0 > output=calyptia.0
[2024/11/27 22:09:11] [debug] [task] destroy task=0x60f000007c00 (task_id=0)

If set to false, registration terminates the initialisation.

[2024/11/27 22:10:12] [debug] [calyptia:calyptia.0] created event channels: read=29 write=30
[2024/11/27 22:10:12] [debug] [output:calyptia:calyptia.0] machine_id=73a2e3fa6b6844dd36fcd9970d39537980905f85972aa7f9c210080c55dcf3e2
[2024/11/27 22:10:12] [debug] [http_client] not using http_proxy for header
[2024/11/27 22:10:12] [error] [/Users/niedbalski/code/fluent/fluent-bit/src/flb_http_client.c:1376 errno=32] Broken pipe
[2024/11/27 22:10:12] [ warn] [output:calyptia:calyptia.0] http_do=-1
[2024/11/27 22:10:12] [ warn] [output:calyptia:calyptia.0] agent registration failed
[2024/11/27 22:10:12] [error] [output:calyptia:calyptia.0] agent registration failed and register_retry_on_flush=false
[2024/11/27 22:10:12] [error] [output] failed to initialize 'calyptia' plugin
[2024/11/27 22:10:12] [error] [engine] output initialization failed
[2024/11/27 22:10:12] [ info] [input] pausing fluentbit_metrics.0
[2024/11/27 22:10:12] [ info] [input] pausing storage_backlog.1

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

if register_retry_on_flush is set (default true), agent registration
is retried on each flush callback.

if set to false then registration will cause to abort the plugin
initialisation.

Signed-off-by: Jorge Niedbalski <[email protected]>
@niedbalski niedbalski force-pushed the fix/register-retry-on-flush branch from aee889a to 06698b0 Compare November 27, 2024 21:29
@niedbalski niedbalski force-pushed the fix/register-retry-on-flush branch from 06698b0 to ed8587b Compare November 27, 2024 21:36
@niedbalski niedbalski self-assigned this Nov 27, 2024
@niedbalski niedbalski force-pushed the fix/register-retry-on-flush branch from ed8587b to ef97189 Compare November 28, 2024 10:32
@niedbalski niedbalski marked this pull request as ready for review November 28, 2024 10:33
@niedbalski niedbalski force-pushed the fix/register-retry-on-flush branch from 84d00f4 to 4b6637d Compare November 28, 2024 13:53
@niedbalski niedbalski force-pushed the fix/register-retry-on-flush branch from 4b6637d to 29e793f Compare November 28, 2024 14:03
@niedbalski niedbalski force-pushed the fix/register-retry-on-flush branch from 29e793f to 4f361a6 Compare November 28, 2024 14:33
Copy link
Contributor

@patrick-stephens patrick-stephens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

macOS failures unrelated - due to cprofiles: fluent/cprofiles#7

@niedbalski niedbalski merged commit 4acffc2 into master Nov 28, 2024
80 of 85 checks passed
@niedbalski niedbalski deleted the fix/register-retry-on-flush branch November 28, 2024 16:24
AdheipSingh pushed a commit to AdheipSingh/fluent-bit that referenced this pull request Dec 4, 2024
* out_calyptia: retry registering agent on flush.

if register_retry_on_flush is set (default true), agent registration
is retried on each flush callback.

if set to false then registration will cause to abort the plugin
initialisation.

Signed-off-by: Jorge Niedbalski <[email protected]>

* custom_calyptia: cascade register_retry_on_flush variables.

Signed-off-by: Jorge Niedbalski <[email protected]>

---------

Signed-off-by: Jorge Niedbalski <[email protected]>
Co-authored-by: Jorge Niedbalski <[email protected]>
Signed-off-by: AdheipSingh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-package-test Run PR packaging tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants