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

Migrate in_monitor_agent to v0.14 API #1151

Merged
merged 15 commits into from
Aug 26, 2016

Conversation

cosmo0920
Copy link
Contributor

@cosmo0920 cosmo0920 commented Aug 8, 2016

I've migrated in_monitor_agent plugin to v0.14 API.

Remaining tasks

  • Write more test cases for in_monitor_agent

Not for this PR tasks

  • support more plugin classes in in_monitor_agent (e.g. parser and storage plugins support)

@tagomoris
Copy link
Member

More test cases are very good for this change.
But I think it's not time to add new features... it should be done in another following pull-requests.

@cosmo0920
Copy link
Contributor Author

MultiOutput class should belong to output plugin category?
Or, leave it as-is for now?

@tagomoris
Copy link
Member

Leave it as-is. It's far different from normal output plugins.

@cosmo0920
Copy link
Contributor Author

I've tried to add test cases for in_monitor_agent.

matches.each { |rule|
if rule.match?(tag)
if rule.collector.is_a?(Output)
if rule.collector.is_a?(Fluent::Output)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fluent::Plugin::Output looks correct instead of Fluent::Output(this means v0.12 plugin instances only).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I've missed it. 😰
I'll fix it.

@cosmo0920 cosmo0920 changed the title [WIP] Migrate in_monitor_agent to v0.14 API Migrate in_monitor_agent to v0.14 API Aug 17, 2016
@cosmo0920
Copy link
Contributor Author

I've tried to reduce too strict assertions and add tests.
Please review this PR once again.

@@ -330,7 +282,7 @@ def all_plugins
# from the plugin `pe` recursively
def self.collect_children(pe, array=[])
array << pe
if pe.is_a?(MultiOutput) && pe.respond_to?(:outputs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is required to collect data for old MultiOutput plugins.
Old (v0.12) MultiOutput plugin are not children of Fluent::Plugin::MultiOutput, but Fluent::Compat::MultiOutput (and it is child of Fluent::Plugin::BareOutput).
fluent-plugin-forest and other plugins are affected with it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see....
I've added additional commit to resolve your commented problem: 03cf62e

Copy link
Member

@tagomoris tagomoris Aug 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should do pe.is_a?(Fluent::Plugin::MultiOutput) || pe.is_a?(Fluent::MultiOutput) (both respond to #outputs).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cosmo0920 ping?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pong. I've pushed a commit to fix this.

@cosmo0920 cosmo0920 force-pushed the migrate-v0.14-in_monitor_agent branch from ad54714 to 99370c5 Compare August 23, 2016 08:28
@cosmo0920 cosmo0920 force-pushed the migrate-v0.14-in_monitor_agent branch from 99370c5 to 3a0267b Compare August 24, 2016 08:46
matches.each { |rule|
if rule.match?(tag)
if rule.collector.is_a?(Output)
if rule.collector.is_a?(Fluent::Plugin::Output) || rule.collector.is_a?(Fluent::Output)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we should both Fluent::Plugin::Output and Fluent::Output as output plugins, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right.

@tagomoris
Copy link
Member

LGTM.

@tagomoris tagomoris merged commit 753b566 into fluent:master Aug 26, 2016
@cosmo0920
Copy link
Contributor Author

Thanks! 😉

@cosmo0920 cosmo0920 deleted the migrate-v0.14-in_monitor_agent branch August 26, 2016 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants