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

Add a unique ID on every plugin and allow user to override it. #3892

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

Add a unique ID on every plugin and allow user to override it. #3892

ph opened this issue Sep 9, 2015 · 6 comments

Comments

@ph
Copy link
Contributor

ph commented Sep 9, 2015

In the configuration we can define multiples time the same plugin with different configurations, but to associate the metrics to a specific plugins we need to make sure we can correctly identify it. This ID has a side effect to allow us to update the configuration of a specific plugin if needed via an API..

I propose:

  • By default every plugins (input, filter, output and codec) generate a unique ID.
  • This ID should be still human readable to understand what it refer too
  • Users should be allowed to override it.
  • Logstash should be smart enough to raise an issue if two plugins has the same ID.
  • If would be awesome if a codec ID contains information about the plugin defining it.
  • --debug should show the ID in the comment.
  • The ID need to be reproducable to associated with the same plugin between each restart.

This is a what a config would look like with user defined ids.

input {
 sqs {
  id => "fast-queue"
  codec  => json { id => "json-fast" }
 }
}
@ph
Copy link
Contributor Author

ph commented Sep 9, 2015

I am open to naming suggestion, could be id, uuid or identifier ?

@jsvd
Copy link
Member

jsvd commented Sep 11, 2015

id is fine.

what's your idea to auto generate a human readable plugin instance id? some concatenation of options + auto increment id?

as for codecs, if we have a pipeline level structure to register the plugin ids then we can nest them, thus when we get a full id of a codec it comes with the parent plugin id too

@ph
Copy link
Contributor Author

ph commented Sep 11, 2015

Yes, for that.

what's your idea to auto generate a human readable plugin instance id? some concatenation of options + auto increment id?

@ph
Copy link
Contributor Author

ph commented Sep 11, 2015

Agree about the register, this is a good time to finally use/fixed the Logstash Registry class.

@ph ph changed the title Metrics: Add a unique ID on every plugin and allow user to override it. Add a unique ID on every plugin and allow user to override it. Sep 11, 2015
@suyograo
Copy link
Contributor

Why would a user care about plugin ID? IOW, when would a user override a plugin ID? A user can query LS to get all grok plugins and this would list IDs. You can then re-query LS using this ID. Will this work?

@ph
Copy link
Contributor Author

ph commented Sep 17, 2015

@suyograo This was mostly for a human convenience, to allow them to easily spot where metrics are emitted by which part of their configuration they maintain, since they are the expert in their config/topology.

A common use could be a user with multiples different grok filters, this would make it easy to spot a slower pattern and they could improve it and compare before and after their changes, since creating ID that stay the same could be complicated if the config change, this allow the ID to be resilient to config modification (change in pattern) or adding new plugins to an existing configuration.

@suyograo suyograo added v5.0.0 and removed v2.1.0 labels Oct 20, 2015
@ph ph self-assigned this Oct 29, 2015
ph added a commit to ph/logstash that referenced this issue Jan 19, 2016
This method return an ID for the plugins and be configured by the users
in the configuration like this:

```
elasticsearch {
  id => "ABC"
  ...
}
```

This information will be used when collecting metrics for a specific
plugin. Allowing the user to change it allow to stick between restart.

Fixes elastic#3892
@ph ph added v5.0.0-alpha1 and removed v5.0.0 labels Jan 26, 2016
ph added a commit to ph/logstash that referenced this issue Feb 1, 2016
This method return an ID for the plugins and be configured by the users
in the configuration like this:

```
elasticsearch {
  id => "ABC"
  ...
}
```

This information will be used when collecting metrics for a specific
plugin. Allowing the user to change it allow to stick between restart.

Fixes elastic#3892
elasticsearch-bot pushed a commit that referenced this issue Feb 1, 2016
This method return an ID for the plugins and be configured by the users
in the configuration like this:

```
elasticsearch {
  id => "ABC"
  ...
}
```

This information will be used when collecting metrics for a specific
plugin. Allowing the user to change it allow to stick between restart.

Fixes #3892

Fixes #4525
@ph ph closed this as completed Feb 1, 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