Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@patmaddox
Copy link
Contributor

Change description

Adds a template_file config to override the built-in grafana agent config template.

What problem does this solve?

We have multiple agent configs that differ from the built-in config template. We found it was elegant to provide our own template file, and let PromEx specify any defaults and pass through our new custom config keys.

Example usage

config :my_app, MyApp.PromEx,
  grafana_agent: [
    ...
    config_opts: [
      ...
      template_file: Application.app_dir(:my_app, "priv/templates/grafana_agent_config.eex"),
      custom_field: "custom value" # available as <%= @custom_field %> in the template
    ]
  ]

Additional details and screenshots

Checklist

  • I have added unit tests to cover my changes.
  • I have added documentation to cover my changes.
  • My changes have passed unit tests and have been tested E2E in an example project.

@patmaddox patmaddox changed the title Configurable template Configurable Grafana Agent template Aug 4, 2022
@patmaddox patmaddox force-pushed the configurable-template branch from 80f66b9 to 0b4bc2a Compare August 8, 2022 16:16
Copy link
Owner

@akoutmos akoutmos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@coveralls
Copy link

coveralls commented Aug 11, 2022

Coverage Status

Coverage increased (+0.04%) to 79.258% when pulling 0b4bc2a on patmaddox:configurable-template into 611912c on akoutmos:master.

@akoutmos akoutmos merged commit 859cecd into akoutmos:master Aug 11, 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.

3 participants