Skip to content

Commit

Permalink
Docs/add note about docker api (#6293)
Browse files Browse the repository at this point in the history
* Add note about exposing API outside Docker container

* Tidy up text

* Update the note text to add Docker port publishing

* Update docs/sources/static/api/_index.md

Co-authored-by: Jack Baldry <[email protected]>

---------

Co-authored-by: Jack Baldry <[email protected]>
  • Loading branch information
clayton-cornell and jdbaldry authored Feb 6, 2024
1 parent 0523960 commit 18b394c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions docs/sources/static/api/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ API endpoints are stable unless otherwise noted.

## Config management API (Beta)

Grafana Agent exposes a config management REST API for managing instance configurations when it is running in [scraping service mode][scrape].
Grafana Agent exposes a configuration management REST API for managing instance configurations when it's running in [scraping service mode][scrape].

{{< admonition type="note" >}}
The scraping service mode is a requirement for the config management
API, however this is not a prerequisite for the Agent API or Ready/Healthy API.
The scraping service mode is a requirement for the configuration management
API, however this isn't a prerequisite for the Agent API or Ready/Healthy API.
{{< /admonition >}}

The following endpoints are exposed:
Expand All @@ -37,6 +37,14 @@ The following endpoints are exposed:
- Update config: [`PUT /agent/api/v1/config/{name}`](#update-config)
- Delete config: [`DELETE /agent/api/v1/config/{name}`](#delete-config)

{{< admonition type="note" >}}
If you are running Grafana Agent in a Docker container and you want to expose the API outside the Docker container, you must change the default HTTP listen address from `127.0.0.1:12345` to a valid network interface address.
You can change the HTTP listen address with the command-line flag: `-server.http.address=0.0.0.0:12345`.
For more information, refer to the [Server](https://grafana.com/docs/agent/latest/static/configuration/flags/#server) command-line flag documentation.

You must also publish the port in Docker. Refer to [Published ports](https://docs.docker.com/network/#published-ports) in the Docker documentation for more information.
{{< /admonition >}}

### API response

All Config Management API endpoints will return responses in the following
Expand Down

0 comments on commit 18b394c

Please sign in to comment.