Hi InfluxData Team,
We are using Terraform to deploy Docker containers with servers. Our continuous integration system deploys to a QA cluster and runs automated tests. We can manually start deployments to staging and production clusters. Each engineer has their own cluster for development. We need all of these deployments to draw their configuration from the source code repository. This is easy to accomplish when each deployed server reads its configuration from a file, env vars, or command args.
Unfortunately, Chronograf seems to provide only an API for configuration. This is a severe limitation for us adopting Chronograf.
This comment from a discussion thread sums it up: "Lacking the ability to do automated setup without going through the GUI is an automatic no-go for my project."
Please add a way to provide files to Chronograf that automatically create and update data sources, organizations, users, permissions, dashboards, alerts, and saved log queries.
Also update the docs to provide the knowledge required by everyone setting up Chronograf in a modern cloud-based deployment:
Sincerely,
Michael
Unfortunately, Chronograf seems to provide only an API for configuration.
I'm not sure I follow, are you referring to only providing an API for creating dashboards, sources, etc... or actual chronograf configuration?
chronograf --help produces all the cli flags and corresponding environment variables for configuring a chronograf.
Please add a way to provide files to Chronograf that automatically create and update data sources, organizations, users, permissions, dashboards, alerts, and saved log queries.
Have you checked out the --resources-path config option? Documentation surrounding this and the other --*-path options can likely be improved, but you can place files in that location that contain pre-configured chronograf resources. These resources can include dashboards, sources, kapacitors, and organizations.
To create a dashboard, you can define it in json format (iirc, it's the same/similar format as fetching a dashboard from the api) and store it with a .dashboard extension. Similarly, save a source, kapacitor and org with .src, .kap, .org extensions, respectively.
This comment from a discussion thread
The discussion thread you linked is specific to InfluxDB 2.0 line, which Chronograf is not part of and thus is not subject to those unimplemented-at-the-time features referenced.
PUT to /chronograf/v1/config/auth with a payload of {"superAdminNewUsers":false}./chronograf/v1/dashboards to see how much data is being stored on disk for dashboards.INFO[0000] Serving chronograf at http://[::]:8888 component=server
INFO[0003] Response: OK component=server method=GET remote_addr="[::1]:43322" response_time="270.791碌s" status=200
ERRO[6147] Error message Unparsable JSON component=server http_status =400
thanks.
let me know if you still have questions
I just spent hours trying to figure out why resources path files were not being detected. The documentation says there is a default but that doesn't appear to be the case. I had to set it in the environment variable first. I am using docker-compose at the moment. Putting this here in the interim until the documentation or the image is fixed to save people some time :)
Chronograf can be started with several environment variables that can pre-define some entities (dashboards, canned files, source influx ...), but unfortunately not all types are supported (users, permissions ...). The hand-made UI configuration tasks are stored in an internal bolt database file (/var/lib/chronograf/chronograf-v1.db). /var/lib/chronograf/ is a defined docker volume that can be mapped to a pre-configured directory with chronograf-v1.db file. This database file can be created in advance to store all the required configuration aspects. It can use relative addresses (hostnames) so that the repetitive deployment works fine. Hostnames is IMHO the only thing that changes. There is no better solution on the roadmap.