This commit is contained in:
havelight-ee
2023-06-22 13:53:23 +09:00
parent 2999ff32a3
commit b9fefae7ff
14 changed files with 117 additions and 54 deletions

View File

@@ -2,30 +2,31 @@ agent:
metadata:
agent_name: "{{ log_agent_name | default('dsk-log-agent') }}"
collect:
{% for collect_item in log_collects %}
{% for collect_item in log_collects | default([{'paths': ['/var/log/sample/*/*.log'], 'exclude_paths': [], 'keywords': [], 'tag': 'Default', 'service': {'name': 'default', 'category': 'etc', 'type': 'etc'}}]) %}
- paths:
{% for path in collect_item.paths %}
- "{{ path | default('/var/log/sample/*/*.log') }}"
- "{{ path }}"
{% endfor %}
{% if collect_item.exclude_paths is defined %}
exclude_paths:
{% if collect_item.exclude_paths | default([]) %}
{% for exclude_path in collect_item.exclude_paths %}
- "{{ exclude_path | default('[]') }}"
- "{{ exclude_path }}"
{% endfor %}
{% endif %}
{% if collect_item.keywords is defined %}
keywords:
{% if collect_item.keywords | default([]) %}
{% for keyword in collect_item.keywords %}
- "{{ keyword | default('[]') }}"
- "{{- keyword -}}"
{% endfor %}
{% endif %}
tag: "{{ collect_item.tag | default('Default') }}"
{% if collect_item.tag is defined %}
tag: "{{ collect_item.tag }}"
{% endif %}
service:
name: "{{ collect_item.service.name | default('default') }}"
category: "{{ collect_item.service.category | default('etc') }}"
type: "{{ collect_item.service.type | default('etc') }}"
name: "{{ collect_item.service.name }}"
category: "{{ collect_item.service.category }}"
type: "{{ collect_item.service.type }}"
{% if collect_item.service.address is defined %}
address: "{{ collect_item.service.address }}"
{% endif %}
{% endfor %}
{% endfor %}

View File

@@ -0,0 +1,13 @@
agent:
metadata:
agent_name: "{{ plan_postgres_agent_name | default('dsk-plan-postgres-agent') }}"
data_source_name:
user: "{{ plan_postgres_user_name | default('') }}"
password: "{{ plan_postgres_user_password | default('') }}"
address: "{{ plan_postgres_database_address | default('') }}"
port: "{{ plan_postgres_database_port | default('') }}"
DBName: "{{ plan_postgres_database_name | default('') }}"
explain:
scrape_interval: {{ plan_postgres_scrape_interval | default('30s') }}
scrape_timeout: {{ plan_postgres_scrape_timeout | default('5s') }}
slow_query_standard: {{ plan_postgres_slow_query_standard | default('5s') }}

View File

@@ -2,30 +2,31 @@ agent:
metadata:
agent_name: "{{ log_agent_name | default('dsk-log-agent') }}"
collect:
{% for collect_item in log_collects %}
{% for collect_item in log_collects | default([{'paths': ['/var/log/*.log'], 'exclude_paths': [], 'keywords': [], 'tag': 'Default', 'service': {'name': 'default', 'category': 'etc', 'type': 'etc'}}]) %}
- paths:
{% for path in collect_item.paths %}
- "{{ path | default('/var/log/*.log') }}"
- "{{ path }}"
{% endfor %}
{% if collect_item.exclude_paths is defined %}
exclude_paths:
{% if collect_item.exclude_paths | default([]) %}
{% for exclude_path in collect_item.exclude_paths %}
- "{{ exclude_path | default('[]') }}"
- "{{ exclude_path }}"
{% endfor %}
{% endif %}
{% if collect_item.keywords is defined %}
keywords:
{% if collect_item.keywords | default([]) %}
{% for keyword in collect_item.keywords %}
- "{{ keyword | default('[]') }}"
- "{{- keyword -}}"
{% endfor %}
{% endif %}
tag: "{{ collect_item.tag | default('Default') }}"
{% if collect_item.tag is defined %}
tag: "{{ collect_item.tag }}"
{% endif %}
service:
name: "{{ collect_item.service.name | default('default') }}"
category: "{{ collect_item.service.category | default('etc') }}"
type: "{{ collect_item.service.type | default('etc') }}"
name: "{{ collect_item.service.name }}"
category: "{{ collect_item.service.category }}"
type: "{{ collect_item.service.type }}"
{% if collect_item.service.address is defined %}
address: "{{ collect_item.service.address }}"
{% endif %}
{% endfor %}
{% endfor %}

View File

@@ -4,4 +4,4 @@ agent:
cluster_id: "{{ trace_agent_cluster_id | default('unknown_cluster') }}"
option:
collector_config:
sampling_rate: "{{ trace_sampling_rate | default('10') }}"
sampling_rate: {{ trace_sampling_rate | default(10) | int }}