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

Enable script processor for Metricbeat #14711

Merged
merged 2 commits into from
Nov 25, 2019

Conversation

exekias
Copy link
Contributor

@exekias exekias commented Nov 22, 2019

This PR enables the script processor in Metricbeat. We can use it for some data conversion in events coming from Lightweight modules.

@exekias
Copy link
Contributor Author

exekias commented Nov 22, 2019

@andrewkroh pinging you just in case there is some good reason not to do this. I see initially this was done mainly for Filebeat

@mtojek
Copy link
Contributor

mtojek commented Nov 22, 2019

LGTM based on references to other beats. Nice!

@mtojek mtojek mentioned this pull request Nov 22, 2019
14 tasks
@exekias exekias added the needs_backport PR is waiting to be backported to other branches. label Nov 22, 2019
@jsoriano
Copy link
Member

We can use it for some data conversion in events coming from Lightweight modules.

Take into account that light modules don't support processors at the moment.

@exekias
Copy link
Contributor Author

exekias commented Nov 22, 2019

yes, I noticed it, as of now the workaround would be to add the processor in the config.yml file, which seems to work.

Any plans to add support at the manifest level? that would be cool

@mtojek
Copy link
Contributor

mtojek commented Nov 22, 2019

I introduced these changes into fresh ActiveMQ module and it seems to report correctly:

  "activemq": {
    "broker": {
      "name": "localhost",
      "producers": {
        "count": 0
      },
      "mbean": "org.apache.activemq:brokerName=localhost,type=Broker",
      "memory": {
        "broker": {
          "pct": 0.18
        },
        "store": {
          "pct": 0
        },
        "temp": {
          "pct": 0
        }
      },
      "consumers": {
        "count": 0
      },
      "messages": {
        "count": 115170,
        "enqueue": {
          "count": 119854
        },
        "dequeue": {
          "count": 1249

@exekias exekias merged commit 829a29e into elastic:master Nov 25, 2019
@jsoriano
Copy link
Member

yes, I noticed it, as of now the workaround would be to add the processor in the config.yml file, which seems to work.

Yep, it would work in the config, but distributing logic this way can be error-prone, for example on upgrades the script wouldn't get updated if it is in the config.

Any plans to add support at the manifest level? that would be cool

Yes, this would increase a lot the possibilities of light modules, specially having the script processor. There are no plans for this yet, we could increase priority of that if we consider it valuable.

From what I remember from implementing light modules, the problem with adding processors support can be that they are configured with the pipeline before the module is loaded, but with light modules we wouldn't know what processors to add till we load the module. So we will need some mechanism to add processors to the pipeline during module instantiation, or a way to add a "pipe" to process events before sending them to the pipeline.

I will create an issue for that.

@jsoriano
Copy link
Member

Added issue for processors in light modules #14740

mtojek pushed a commit to mtojek/beats that referenced this pull request Jan 17, 2020
* Enable script processor for Metricbeat

(cherry picked from commit 829a29e)
@mtojek mtojek added v7.7.0 and removed needs_backport PR is waiting to be backported to other branches. labels Jan 17, 2020
mtojek pushed a commit to mtojek/beats that referenced this pull request Jan 17, 2020
* Enable script processor for Metricbeat

(cherry picked from commit 829a29e)
@mtojek mtojek added the v7.6.0 label Jan 17, 2020
mtojek added a commit that referenced this pull request Jan 17, 2020
…5633)

* Enable script processor for Metricbeat (#14711)

* Enable script processor for Metricbeat

(cherry picked from commit 829a29e)

* Fix: changelog

Co-authored-by: Carlos Pérez-Aradros Herce <exekias@gmail.com>
mtojek added a commit that referenced this pull request Jan 17, 2020
…5632)

* Enable script processor for Metricbeat (#14711)

* Enable script processor for Metricbeat

(cherry picked from commit 829a29e)

* Fix: changelog

Co-authored-by: Carlos Pérez-Aradros Herce <exekias@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants