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

feat[elastic output]: add elastic pipeline flags #10505

Merged
merged 14 commits into from
Feb 17, 2022

Conversation

zpriddy
Copy link
Contributor

@zpriddy zpriddy commented Jan 24, 2022

  • Updated associated README.md.
  • Wrote appropriate unit tests.
  • Pull request title or commits are in [conventional commit format]

resolves #10502

Add new inputs and a new function to the elastic output plugin. The functionality used in these changes are modeled after existing functionality for getting the elastic index name in the plugin. Documentation in the generated sample config file was also updated to include these changes.

Tests were also added to test the functionality of the newly added function GetPipelineName.

@telegraf-tiger
Copy link
Contributor

Thanks so much for the pull request!
🤝 ✒️ Just a reminder that the CLA has not yet been signed, and we'll need it before merging. Please sign the CLA when you get a chance, then post a comment here saying !signed-cla

@telegraf-tiger
Copy link
Contributor

Thanks so much for the pull request!
🤝 ✒️ Just a reminder that the CLA has not yet been signed, and we'll need it before merging. Please sign the CLA when you get a chance, then post a comment here saying !signed-cla

@zpriddy
Copy link
Contributor Author

zpriddy commented Jan 24, 2022

!signed-cla

 Error: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive)
@zpriddy zpriddy force-pushed the elasic-output-pipelines branch from d20687a to 88b1214 Compare January 24, 2022 23:20
@zpriddy zpriddy marked this pull request as ready for review January 24, 2022 23:22
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Hey @zpriddy. Nice PR! I have some minor comments in the code, nothing big. Can you please take a look?

plugins/outputs/elasticsearch/README.md Outdated Show resolved Hide resolved
plugins/outputs/elasticsearch/elasticsearch.go Outdated Show resolved Hide resolved
plugins/outputs/elasticsearch/elasticsearch.go Outdated Show resolved Hide resolved
plugins/outputs/elasticsearch/elasticsearch.go Outdated Show resolved Hide resolved
plugins/outputs/elasticsearch/elasticsearch.go Outdated Show resolved Hide resolved
plugins/outputs/elasticsearch/elasticsearch.go Outdated Show resolved Hide resolved
plugins/outputs/elasticsearch/elasticsearch.go Outdated Show resolved Hide resolved
plugins/outputs/elasticsearch/elasticsearch_test.go Outdated Show resolved Hide resolved
plugins/outputs/elasticsearch/elasticsearch_test.go Outdated Show resolved Hide resolved
plugins/outputs/elasticsearch/elasticsearch_test.go Outdated Show resolved Hide resolved
@srebhan srebhan self-assigned this Jan 25, 2022
@srebhan srebhan added area/elasticsearch feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins labels Jan 25, 2022
@zpriddy
Copy link
Contributor Author

zpriddy commented Jan 25, 2022

Hi @srebhan - I applied all fixes except for one that i left the discussion open on in effort to not change the expected output by the plugin

@zpriddy zpriddy requested a review from srebhan January 27, 2022 23:01
@srebhan
Copy link
Member

srebhan commented Jan 28, 2022

@zpriddy please check my replies and let me know what you think...

@zpriddy zpriddy force-pushed the elasic-output-pipelines branch from 8f5dcd6 to cde270a Compare January 28, 2022 21:03
@zpriddy zpriddy force-pushed the elasic-output-pipelines branch from cde270a to 4ad6eb9 Compare January 28, 2022 21:05
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Almost @zpriddy. If you can reorder the struct-fields (see my comment) we are ready to go I think.

FloatReplacement float64 `toml:"float_replacement_value"`
IndexName string `toml:"index_name"`
DefaultTagValue string `toml:"default_tag_value"`
tagKeys []string
Copy link
Member

Choose a reason for hiding this comment

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

Can you maybe group the "user-option" fields and the internal fields here? I.e. move tagKeys and majorReleaseNumber at the end of the struct? That's what most other plugins look like...

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 couldn't decide before if they should be done that way, or alphabetically, or... So I ended up leaving it how it was.. Now they are done alphabetically grouped by User Config, locals, then core structs...

@zpriddy zpriddy requested a review from srebhan February 1, 2022 19:05
@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Feb 1, 2022

Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for your effort @zpriddy!

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Feb 2, 2022
Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

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

Thanks for the work on this!

Comment on lines +215 to +221
## To use a ingest pipeline, set this to the name of the pipeline you want to use.
# use_pipeline = "my_pipeline"
## Additionally, you can specify a tag name using the notation {{tag_name}}
## which will be used as part of the pipeline name. If the tag does not exist,
## the default pipeline will be used as the pipeline. If no default pipeline is set,
## no pipeline is used for the metric.
# use_pipeline = "{{es_pipeline}}"
Copy link
Contributor

Choose a reason for hiding this comment

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

We usually only mention a variable once in the sample config. Could you merge the two sections describing "use_pipeline" into one and remove one of the commented settings? It's just a project readme style that makes all the various plugins look more uniform.

Also maybe move the description of default_pipeline to be right before that setting?
Thanks

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 was trying to follow the same format as the index name section. But this can be merged, i just wanted to make it clear between using a static value and a dynamic value

Copy link
Contributor

Choose a reason for hiding this comment

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

@reimda are you good with this as-is?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm ok with bending the "one mention" rule to make it more clear, especially since index_name does it already in this plugin.

go.mod Outdated Show resolved Hide resolved
@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Feb 9, 2022

@powersj
Copy link
Contributor

powersj commented Feb 15, 2022

@zpriddy I think there are a couple of outstanding questions/changes and then this is ready?

@zpriddy
Copy link
Contributor Author

zpriddy commented Feb 15, 2022

@zpriddy I think there are a couple of outstanding questions/changes and then this is ready?

@powersj I think I have responded to all comments that were left behind.. I have been waiting for responses back to know what the next step should be.

@powersj
Copy link
Contributor

powersj commented Feb 15, 2022

@powersj I think I have responded to all comments that were left behind.. I have been waiting for responses back to know what the next step should be.

ok - I've responded to the one open comment

@reimda reimda merged commit a60027a into influxdata:master Feb 17, 2022
phemmer added a commit to phemmer/telegraf that referenced this pull request Feb 18, 2022
* origin/master: (211 commits)
  feat: update configs (influxdata#10676)
  feat[elastic output]: add elastic pipeline flags (influxdata#10505)
  Update changelog
  fix: ensure folders do not get loaded more than once (influxdata#10551)
  docs: update VMWare doc links (influxdata#10663)
  fix: prometheusremotewrite wrong timestamp unit (influxdata#10547)
  feat: update configs (influxdata#10662)
  fix: add graylog toml tags (influxdata#10660)
  feat: add socks5 proxy support for kafka output plugin (influxdata#8192)
  docs: override reported OpenSearch version (influxdata#10586)
  feat: update etc/telegraf.conf and etc/telegraf_windows.conf (influxdata#10659)
  fix: bump all go.opentelemetry.io dependencies (influxdata#10647)
  feat: collection offset implementation (influxdata#10545)
  chore: update go to 1.17.7 (influxdata#10658)
  fix: check for nil client before closing in amqp (influxdata#10635)
  fix: timestamp change during execution of json_v2 parser. (influxdata#10657)
  fix: bump github.com/signalfx/golib/v3 from 3.3.38 to 3.3.43 (influxdata#10652)
  fix: bump github.com/aliyun/alibaba-cloud-sdk-go (influxdata#10653)
  fix: incorrect handling of json_v2 timestamp_path (influxdata#10618)
  feat: gather additional stats from memcached (influxdata#10641)
  feat: update etc/telegraf.conf and etc/telegraf_windows.conf (influxdata#10649)
  fix: Revert deprecation of http_listener_v2 (influxdata#10648)
  fix: bump github.com/denisenkom/go-mssqldb from 0.10.0 to 0.12.0 (influxdata#10503)
  fix: bump github.com/gopcua/opcua from 0.2.3 to 0.3.1 (influxdata#10626)
  fix: use current time as ecs timestamp (influxdata#10636)
  fix: bump github.com/nats-io/nats-server/v2 from 2.6.5 to 2.7.2 (influxdata#10638)
  chore: add -race flag to go tests (influxdata#10629)
  feat: update etc/telegraf.conf and etc/telegraf_windows.conf (influxdata#10631)
  fix: license doc outdated causing CI failure (influxdata#10630)
  fix: bump k8s.io/client-go from 0.22.2 to 0.23.3 (influxdata#10589)
  feat: Implemented support for reading raw values, added tests and doc (influxdata#6501)
  fix: Improve parser tests by using go-cmp/cmp (influxdata#10497)
  feat(mongodb): add FsTotalSize and FsUsedSize informations (influxdata#10625)
  docs: update quay docs for auth (influxdata#10612)
  chore: allow downgrade of go version in windows script (influxdata#10614)
  chore: update CI go to 1.17.6 (influxdata#10611)
  feat: update etc/telegraf.conf and etc/telegraf_windows.conf (influxdata#10600)
  fix(inputs.opcua): add more data to error log (influxdata#10465)
  fix: bump github.com/aws/aws-sdk-go-v2/service/kinesis from 1.6.0 to 1.13.0 (influxdata#10601)
  refactor: use early return pattern (influxdata#10591)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/elasticsearch feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add options for calling elastic pipelines from events
5 participants