Updated Service for flow mode (#54)

This commit is contained in:
Aaron 2023-05-17 01:16:39 -04:00 committed by GitHub
parent c66a55dd88
commit 2e81758100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,6 +17,21 @@ Environment={{key}}={{value}}
{% endfor %} {% endfor %}
EnvironmentFile={{ grafana_agent_config_dir }}/{{ grafana_agent_env_file}} EnvironmentFile={{ grafana_agent_config_dir }}/{{ grafana_agent_env_file}}
{% if grafana_agent_mode == 'flow' %}
ExecStart={{ grafana_agent_install_dir }}/{{ grafana_agent_binary }} run \
{% for flag, flag_value in grafana_agent_flags_extra.items() %}
{% if not flag_value %}
--{{ flag }} \
{% elif flag_value is string %}
--{{ flag }}={{ flag_value }} \
{% elif flag_value is sequence %}
{% for flag_value_item in flag_value %}
--{{ flag }}={{ flag_value_item }} \
{% endfor %}
{% endif %}
{% endfor %}
{{ grafana_agent_config_dir }}/{{ grafana_agent_config_filename }}
{% else %}
ExecStart={{ grafana_agent_install_dir }}/{{ grafana_agent_binary }} \ ExecStart={{ grafana_agent_install_dir }}/{{ grafana_agent_binary }} \
{% for flag, flag_value in grafana_agent_flags_extra.items() %} {% for flag, flag_value in grafana_agent_flags_extra.items() %}
{% if not flag_value %} {% if not flag_value %}
@ -30,6 +45,7 @@ ExecStart={{ grafana_agent_install_dir }}/{{ grafana_agent_binary }} \
{% endif %} {% endif %}
{% endfor %} {% endfor %}
--config.file={{ grafana_agent_config_dir }}/{{ grafana_agent_config_filename }} --config.file={{ grafana_agent_config_dir }}/{{ grafana_agent_config_filename }}
{% endif %}
SyslogIdentifier=grafana-agent SyslogIdentifier=grafana-agent
Restart=always Restart=always