Comments (20)
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.
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.
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.
// 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.
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.
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.
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.
BTW, the key of maximum timeout wrong?
from gogstash.
And we can add SetErrorLog
for the elastic client or After
callback for the BulkRequest so that it will not silent fail?
from gogstash.
BTW, does the type time.Duration
support some kind of writing like "5s"
or "1h"
from gogstash.
done
from gogstash.
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.
I create a new error logger for it.
from gogstash.
oh! Beautiful!
Super thanks!
from gogstash.
BTW, Logger
's Out changed to Stdout
, does it affect the config.Logger.Errorf
output?
from gogstash.
No, Logger always output to stdout, ErrorLogger always output to stderr, no matter what's the function call.
from gogstash.
Oh I see
from gogstash.
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.
Thanks.
Replaced with lowercase and remember to update dependent lib before rebuilding.
from gogstash.
Cheers!
from gogstash.
Related Issues (20)
- Elastic output document type as deprecated HOT 1
- Splitting one input into multiple outputs HOT 3
- Can I use dynamic index with elasticsearch output? HOT 2
- Back pressure handling document HOT 3
- useragent filter should use uap-go regexes by default HOT 1
- Fields with dots in the name cannot be referenced HOT 3
- Filter for key-value and unix nano timestamps HOT 2
- How to log in to elasticsearch HOT 2
- Input - UDP packet mode HOT 3
- Issues with file output HOT 1
- How does output to loki work? HOT 9
- Improve error message for geoip filter HOT 1
- output module "http" failed HOT 4
- Do you have any plan to add plain codec? HOT 5
- Cannot stop program HOT 3
- Supporting Logstash config syntax HOT 3
- Ctrl+C does not kill worker processes HOT 1
- Using GOMAXPROC instead of Forking HOT 12
- testing with zinc HOT 1
- Loki and org_id HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gogstash.