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

opentelemetry_collector - template error #310

Open
rmalenko opened this issue Jan 15, 2025 · 0 comments
Open

opentelemetry_collector - template error #310

rmalenko opened this issue Jan 15, 2025 · 0 comments

Comments

@rmalenko
Copy link

In ansible role:

        otel_collector_processors:
          memory_limiter:
            # 75% of maximum memory up to 1G
            limit_mib: "{{ (ansible_facts['memtotal_mb'] * 0.75) | round | int }}"
            # 25% of limit up to 1G
            spike_limit_mib: "{{ (ansible_facts['memtotal_mb'] * 0.25) | round | int }}"
            check_interval: 5s

In config.yaml, we have values with single quotes, which leads to an error at the start.

memory_limiter:
  limit_mib: '721'
  spike_limit_mib: '240'
  check_interval: 5s

I have changed in otel_collector.service.j2

processors:
{{ otel_collector_processors | to_nice_yaml(indent=2) | indent(2, true) }}
{% endif %}

to

processors:
{{ otel_collector_processors | to_nice_yaml(indent=2) | indent(2, true) | regex_replace("'", "") }}
{% endif %}

May someone have a better solutions?

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

No branches or pull requests

1 participant