GithubHelp home page GithubHelp logo

Comments (7)

megakid avatar megakid commented on June 12, 2024

Due to our monotonic bookmarking in the durable shipper, as noted in the linked issue, it is difficult to know what to do when a single document in the middle of a bulk index fails.

We can use the _id field to stop us inserting duplicates here. If we generate a unique _id when we save the files to the durable file, we can use this in each of our index commands to allow ElasticSearch to either: reject duplicate _ids that are already indexed using the create operation or "upsert" (updating any existing document with the same _id or create if nonexistent) using the index operation. Only if the entire batch passes do we bookmark and continue. Perhaps we could retry a batch a certain number of times before bookmarking it anyway?

from serilog-sinks-elasticsearch.

Lanoli avatar Lanoli commented on June 12, 2024

What's the status on this issue ?
@konste stated on serilog/serilog#599 that a PR was made with NEST 2.0, but I can't seem te find it.
@mivano was working on a feature branch https://github.com/serilog/serilog-sinks-elasticsearch/tree/handlefailures , but this was never finished or merged to dev.

It would be nice to just parse the bulk response and log any failures. Retries are less important to me, as most failures will most likely be the result of malformed requests.

Are there still any plans to continute this work, or will it be discarded?

from serilog-sinks-elasticsearch.

konste avatar konste commented on June 12, 2024

This is custom modification of the official Serilog ES Sink, done for two reasons:

  1. To be able to apply modified ES Json Formatter;
  2. To modify EmitBatch method so that it records possible server side failures to internal log;

ElasticsearchSinkMod.cs.txt

from serilog-sinks-elasticsearch.

Lanoli avatar Lanoli commented on June 12, 2024

Thanks @konste . I'm using the DurableElasticsearchSink though, the parsing of the response happens in the ElastsearchLogShipper. Which means I'ld have to copy a lot more code. I'll first try fixing the problem in my fork. I see you are using Nest to parse the response to BulkResponse. Something I already tried and which wasn't 100% correct. So I'll look into that. Problem is the overlap with @mivano 's work, of which I wonder why it was discontinued.

from serilog-sinks-elasticsearch.

Lanoli avatar Lanoli commented on June 12, 2024

PR : #110

from serilog-sinks-elasticsearch.

mivano avatar mivano commented on June 12, 2024

It just lost interest but we had indeed some ideas how to act on failures. So at least check the result from ES by parsing the return data. If there is a failure in there (can even be one of the 50 in the batch) we allowed to either send it to selflog or another sink.
If interest is there, I can port it to the current version.

from serilog-sinks-elasticsearch.

mivano avatar mivano commented on June 12, 2024

Since v5.5 there have been some improvements in this area.

from serilog-sinks-elasticsearch.

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.