Giter Site home page Giter Site logo

Comments (20)

tengattack avatar tengattack commented on August 13, 2024

Oh I noticed that action changed in master branch.
It start using elastic's bulk API to make output.

However, would it silent fail in latest code, because I haven't find out the error handling for the elastic's BulkProcessor
https://github.com/olivere/elastic/blob/a487785d708c8e6a99b8d498947c220511b6ec7f/bulk_processor.go#L524

from gogstash.

tsaikd avatar tsaikd commented on August 13, 2024

Thanks for the feedback.

olivere/elastic#666 add an interface Backoff to provide customized error handling. I will push a new patch to fix the retry issue in a few days later.

from gogstash.

tengattack avatar tengattack commented on August 13, 2024

Great!
BTW, could we add a backoff maximum time config for elastic output? So that I can customized the backoff action. Currently, It can only retry about 5 times until it reach the maximum time (200ms to 10000ms).

from gogstash.

tsaikd avatar tsaikd commented on August 13, 2024
	// RetryTimes when write to elastic failed, how many times to retry.
	// Defaults to 3 and can be set to -1 to be disabled.
	RetryTimes int `json:"retry_times,omitempty"`

	// RetryInterval retry interval
	// Defaults to 10 seconds
	RetryInterval time.Duration `json:"retry_interval_ms,omitempty"`

the config above is enough?

from gogstash.

tengattack avatar tengattack commented on August 13, 2024

Does it set the elastic's backoff type? Maybe we can find a way to specify the backoff type:
https://github.com/olivere/elastic/blob/a7f6620ddddaaccb6fa041eaa281182fd4b4fcc4/backoff.go

I prefer to use the default exponential backoff :)

from gogstash.

tsaikd avatar tsaikd commented on August 13, 2024

There are no stop condition in ConstantBackoff and ExponentialBackoff. I mean it will retry forever, until memory full or app crash. But maybe it make sense for logging scenario. What about this?

	// ExponentialBackoffInitialTimeout used to set the first/minimal interval in elastic.ExponentialBackoff
	// Defaults to 10 seconds
	ExponentialBackoffInitialTimeout time.Duration `json:"exponential_backoff_initial_timeout,omitempty"`

	// ExponentialBackoffMaxTimeout used to set the maximum wait interval in elastic.ExponentialBackoff
	// Defaults to 300 seconds
	ExponentialBackoffMaxTimeout time.Duration `json:"exponential_backoff_initial_timeout,omitempty"`

from gogstash.

tengattack avatar tengattack commented on August 13, 2024

Ummm, I think ExponentialBackoff will stop when it reach the maximum timeout:
https://github.com/olivere/elastic/blob/a7f6620ddddaaccb6fa041eaa281182fd4b4fcc4/backoff.go#L91

But that's work! Thank you!

from gogstash.

tengattack avatar tengattack commented on August 13, 2024

BTW, the key of maximum timeout wrong?

from gogstash.

tengattack avatar tengattack commented on August 13, 2024

And we can add SetErrorLog for the elastic client or After callback for the BulkRequest so that it will not silent fail?

from gogstash.

tengattack avatar tengattack commented on August 13, 2024

BTW, does the type time.Duration support some kind of writing like "5s" or "1h"

from gogstash.

tsaikd avatar tsaikd commented on August 13, 2024

done

from gogstash.

tengattack avatar tengattack commented on August 13, 2024

If we just connect the SetErrorLog to config.Logger 24a6a2d does the error logs will send to stdout instead of stderr? Maybe we need to make a Printf to Errorf redirect?

from gogstash.

tsaikd avatar tsaikd commented on August 13, 2024

I create a new error logger for it.

from gogstash.

tengattack avatar tengattack commented on August 13, 2024

oh! Beautiful!
Super thanks!

from gogstash.

tengattack avatar tengattack commented on August 13, 2024

BTW, Logger's Out changed to Stdout, does it affect the config.Logger.Errorf output?

from gogstash.

tsaikd avatar tsaikd commented on August 13, 2024

No, Logger always output to stdout, ErrorLogger always output to stderr, no matter what's the function call.

from gogstash.

tengattack avatar tengattack commented on August 13, 2024

Oh I see

from gogstash.

tengattack avatar tengattack commented on August 13, 2024

Last question, as I trying to find out github.com/sirupsen/logrus's code, I found the owner name (sirupsen) is lowercase initials, shall we correct it?
a8ad508#diff-beaa11a399561a57ec0d693757f6afb1R6

from gogstash.

tsaikd avatar tsaikd commented on August 13, 2024

Thanks.
Replaced with lowercase and remember to update dependent lib before rebuilding.

from gogstash.

tengattack avatar tengattack commented on August 13, 2024

Cheers!

from gogstash.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.