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

Can't use #{ENV['FOO_BAR']} expressions in @jfrog_send_metrics ddtags #53

Open
gangefors opened this issue Aug 6, 2024 · 1 comment

Comments

@gangefors
Copy link

The ddtags array doesn't support rupy expressions in the strings.

In most places you can use #{} to include ruby code but in the ddtags array there is no such support.

config

      <match jfrog.metrics.**>
        @type jfrog_send_metrics
        target_platform "DATADOG"
        apikey "#{ENV['DATADOG_API_KEY']}"
        url "https://api.#{ENV['DATADOG_API_HOST']}/api/v2/series"
        ddtags [
          "env:#{ENV['JPD_ENV']}",
          "hostname:#{ENV['JPD_HOSTNAME']}",
          "version:#{ENV['JPD_VERSION']}"
        ]
      </match>

fluentd logs

Additional tags to be added to metrics are
env:#{ENV['JPD_ENV']}
hostname:#{ENV['JPD_HOSTNAME']}
version:#{ENV['JPD_VERSION']}
Sending received metrics data

In datadog the values become

env:_env_jpd_env
hostname:_env_jpd_hostname
version:_env_jpd_version

DD tags should be able to use dynamic values.

@gangefors
Copy link
Author

I worked around this issue by using helm variables but this shouldn't be needed when all other dynamic variables comes from env. vars.

      <match jfrog.metrics.**>
        @type jfrog_send_metrics
        target_platform "DATADOG"
        apikey "#{ENV['DATADOG_API_KEY']}"
        url "https://api.#{ENV['DATADOG_API_HOST']}/api/v2/series"
        ddtags [
          "env:{{ .Values.jfrog.environment }}",
          "hostname:{{ .Values.jfrog.hostname }}",
          "version:{{ .Values.jfrog.version }}"
        ]
      </match>

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