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 gateway support for Host Logs #437

Merged
merged 2 commits into from
Apr 29, 2022

Conversation

KingJ
Copy link
Contributor

@KingJ KingJ commented Apr 25, 2022

Host logs does not currently support gateway mode. If running the agent in gateway mode, the exporters section of the logs/host pipeline will be set to splunk_hec/platform_logs. In gateway mode, the agent does not have this exporter configured and it is only present on the collector. Therefore, the exporter must be set to otlp so that logs are sent to the collector.

This is the same approach used for main logs pipeline on lines 637 - 647 - if running in gateway mode use the otlp exporter, otherwise use the splunk_hec/o11y or splunk_hec/platform_logs exporters depending on configuration.

n.b. the triple {{- end }} at the end of this diff may seem confusing. I think the first {{-end }} on line 678 closes the if statement in 676, but prior to this change the second {{-end }} on line 679 closes the if statement on line 649 and is indented wrongly? With this change, it's now the third {{-end }} on line 680 that closes the if statement on line 649 and is still indented wrongly. As i'm essentially just adding a new if/else that needs closing, I have not fixed the indentation of the "final" if statement. If anyone else thinks this statement is wrongly indented, I can add another commit to fix it.

Host logs does not currently support gateway mode. If running the agent in gateway mode, the exporters section of the logs/host pipeline will be set to splunk_hec/platform_logs. In gateway mode, the agent does not have this exporter configured and it is only present on the collector. Therefore, the exporter must be set to otlp so that logs are sent to the collector.

This is the same approach used for main logs pipeline - if running in gateway mode use the otlp exporter, otherwise use the splunk_hec/o11y or splunk_hec/platform_logs exporters depending on configuration.
@KingJ KingJ requested review from a team as code owners April 25, 2022 13:40
@dmitryax
Copy link
Contributor

prior to this change the second {{-end }} on line 679 closes the if statement on line 649 and is indented wrongly?

I think you are right, it is intended wrongly. Feel free to submit another PR to fix it.

Thanks for the contribution!

@dmitryax dmitryax merged commit feffc94 into signalfx:main Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants