Giter Site home page Giter Site logo

Comments (12)

DavidKnacker avatar DavidKnacker commented on August 24, 2024 1

@Athishpranav2003 to come back to your question, I do see the @id field for logs generated by the input plugin.

from fluentd.

Athishpranav2003 avatar Athishpranav2003 commented on August 24, 2024

@DavidKnacker is the id missing even for logs generated by input plugin?

from fluentd.

DavidKnacker avatar DavidKnacker commented on August 24, 2024

@Athishpranav2003 I haven't checked it for error logs thrown by an input plugin yet.
But am I correct to assume that using @id to track errors should work for all kind of plugins? (or at least the ones that are shipped by default with fluentd?)

from fluentd.

Athishpranav2003 avatar Athishpranav2003 commented on August 24, 2024

Ideally yes but since it's not behaving in that way I was checking what's the difference in underlying code
Will check it meanwhile

Just ping me later with the case of input plugin

from fluentd.

DavidKnacker avatar DavidKnacker commented on August 24, 2024

👍
will check the behavior for the input plugin tomorrow and report back

from fluentd.

kenhys avatar kenhys commented on August 24, 2024

another scope of Idea: track plugin which emit error event in router side, then emit more user friendly error message.

from fluentd.

daipom avatar daipom commented on August 24, 2024

Thanks for your report.
This is Fluentd's specification.

This dump an error event log is generated by RootAgent (Fluentd's common logic).
The filter_parser plugin just emits the error event to the router.
So, this log does not have its id.

def emit_error_event(tag, time, record, error)
error_info = {error: error, location: (error.backtrace ? error.backtrace.first : nil), tag: tag, time: time}
if @error_collector
# A record is not included in the logs because <@ERROR> handles it. This warn is for the notification
log.warn "send an error event to @ERROR:", error_info
@error_collector.emit(tag, time, record)
else
error_info[:record] = record
log.warn "dump an error event:", error_info
end
end

Although this is the current specification, it looks like not so good.
Maybe it could be improved somehow.

from fluentd.

daipom avatar daipom commented on August 24, 2024

Although this is the current specification, it looks like not so good.
Maybe it could be improved somehow.

It would be better to include the id of the plugin that emits the error event.

It may be easy to manually include the id of filter_parser in the error info that it emits.

if @emit_invalid_record_to_error
router.emit_error_event(tag, time, record, Fluent::Plugin::Parser::ParserError.new("pattern not matched with data '#{raw_value}'"))
end

However, it is not so good because every plugin that emits error events needs to consider this issue.

As @kenhys says in #4567 (comment), it would be great if we could create a common mechanism for this.

another scope of Idea: track plugin which emit error event in router side, then emit more user friendly error message.

from fluentd.

Athishpranav2003 avatar Athishpranav2003 commented on August 24, 2024

@daipom so basically we need to avoid change in function signature but capture the caller plugin id?

from fluentd.

daipom avatar daipom commented on August 24, 2024

so basically we need to avoid change in function signature but capture the caller plugin id?

Yes.
We can't change the signature of emit_error_event() because it is related to Event Emitter plugin helper API.
We need to keep compatibility for the plugins that use this function.

from fluentd.

Athishpranav2003 avatar Athishpranav2003 commented on August 24, 2024

Why don't we use log.error method to generate the error log than emitting it as event(It's indirect but works the same way right)?

from fluentd.

Athishpranav2003 avatar Athishpranav2003 commented on August 24, 2024

Why don't we use log.error method to generate the error log than emitting it as event(It's indirect but works the same way right)?

@daipom what about this?

from fluentd.

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.