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

Plugin specific metric collection framework #3894

Closed
ph opened this issue Sep 9, 2015 · 6 comments
Closed

Plugin specific metric collection framework #3894

ph opened this issue Sep 9, 2015 · 6 comments

Comments

@ph
Copy link
Contributor

ph commented Sep 9, 2015

I think the easiest part of the code we can instrument is probably the pipeline itself and this will give us a good idea how a plugin perform in real world. One way to do it is to instrument the bounderies of the plugins which are the method interactings with the SizeQueue, the filter and the receive methods.
This is options require the least invasive changes and can be done in a backward compatible way.

Most the interaction or useful metrics concerning plugin are related to throughput of a specific plugin.

To correctly instrument a plugin we must be sure that every plugins has a unique identifier. Ref: #3892, #3893

input

I suggest we change how we are sending the queue to the plugin, instead of sending directly the SizeQueue to #run method we can send an instrumented SizeQueue and the code would look like something like this:

queue = InstrumentedSizeQueue.new(queue, :id => plugin.unique_id)
plugin.run(queue)

We can easily instrument push of events and probably the SizeQueue's contention lock?
Since the current SizeQueue is only working with Events we could track when a specific event enter or leave a specific queue.

Filter

The majority of filter don't do any buffering, beside the multiline filter but since we are dealing with current time when we yield a metrics we can also track the flush.

ifilter = InstrumentedFilter.new(filter)
ifilter.filter(event)
ifilter.flush() # This logic is similar to the `batch_acks` below

output

The problem with the output is we don't give any feedback up to the pipeline if all the events were correctly written to disk or send to ES.
If even worse if the plugin is doing some kind of buffering, the output base class need to provide a way to record the metrics when we correctly send a event.

# The pipeline knows when an events get in.
receive(event)

# the pipeline need to know if we successfully send a event.
ack(event)
batch_acks(events)

The output also need a way to track dropped events and/or failures with a specific message so we can track different error scenario.

@ph
Copy link
Contributor Author

ph commented Sep 9, 2015

I think metrics tracing in the conditionals should be done when doing the refactor of the ast #3774

@suyograo suyograo added v2.1.0 and removed 2.0 labels Sep 11, 2015
@ph ph changed the title Metrics: Pipeline Plugin interaction (no conditionals for now) Pipeline Plugin interaction (no conditionals for now) Sep 11, 2015
@jsvd
Copy link
Member

jsvd commented Sep 11, 2015

I'd probably include a nak in the outputs, we can often enough know that we gave up on an event or discarded it for some reason

@ph
Copy link
Contributor Author

ph commented Sep 11, 2015

The nak is more like an error count, I think this should be a separate concept no?

@jsvd
Copy link
Member

jsvd commented Sep 11, 2015

not sure what you mean by separate concept, but at least it should likely be reported with a similar interface

@ph
Copy link
Contributor Author

ph commented Sep 11, 2015

By separate concept, I should have said we need more information for theses kind of stats.

# not actual syntax.
drop_event(event, :timeout_error)
drop_event(event, :invalid_document)

@ph
Copy link
Contributor Author

ph commented Sep 11, 2015

updated with your comment.

@suyograo suyograo added v5.0.0 and removed v2.1.0 labels Oct 20, 2015
@ph ph closed this as completed Jan 12, 2016
@suyograo suyograo changed the title Pipeline Plugin interaction (no conditionals for now) Plugin specific metric collection framework Jan 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants