On 2019-10-15 16:09, Andrew Hooker wrote:
> Well I guess the question is how to do this in Terraform itself. I do
> not see a way to apend commandline flags. I was hoping the someone in
> the community may have encountered this issue previously.
>
> The specific problem I have crosses three boundaries. It is not
> specific to Prometheus and is in fact a config using the docker
> supported provider in Terraform.
>
> So I could raise this in multiple places :)
>
So in Terraform you'd set the "command" option in the docker_container:
command - (Optional, list of strings) The command to use to start the
container. For example, to run /usr/bin/myprogram -f baz.conf set the
command to be ["/usr/bin/myprogram", "-f", "baz.conf"].
The default command line for the Prometheus image is as follows:
[ "--config.file=/etc/prometheus/prometheus.yml", \
"--storage.tsdb.path=/prometheus", \
"--web.console.libraries=/usr/share/prometheus/console_libraries", \
"--web.console.templates=/usr/share/prometheus/consoles" ]
So you'd want to add those plus any extra entries you need.
> On Tuesday, 15 October 2019 15:59:10 UTC+1, Stuart Clark wrote:
>
>> As you mentioned some items like the retention period are set via
>> the command line rather than prometheus.yml, so these would be added
>> to the Terraform configuration of the container.
>>
>> Is there a specific problem you are encountering?
>>
>> On 15 October 2019 15:55:30 BST, Andrew Hooker
>> <
and...@shrubwood.net> wrote:
>>
>>> I have the standard prometheus container working via docker using
>>> the terraform docker container provider. This is running great
>>> with persistant storage, prometheus.yml etc.
>>>
>>> I am trying to understand how within the terraform configuration
>>> you add the commandline flags to set items like retention etc. I
>>> can find no where that it is possible to set these settings types
>>> in a config file and it seems they must be set on the command line
>>> when the prometheus service is started?
>>>
>>> Has anyone got this working and can give me a pointer to help me?
>>>
>>> Many Thanks
>>
>> --
>> Sent from my Android device with K-9 Mail. Please excuse my brevity.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
prometheus-use...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/prometheus-users/76a58095-c3d6-414d-859b-3f8732dd7fbc%40googlegroups.com
> [1].
>
>
> Links:
> ------
> [1]
>
https://groups.google.com/d/msgid/prometheus-users/76a58095-c3d6-414d-859b-3f8732dd7fbc%40googlegroups.com?utm_medium=email&utm_source=footer
--
Stuart Clark