logdna / logdna/logspout

Use /etc/host_hostname

Open
#22 6 comments 0 reactions 2 assignees View on GitHub

@alfeng6 is already working on this.

Since Jul 7, 2020.

question
Dominant language
Go
Stars
16
Forks
17
PR merge metrics
No merged PRs in 30d

Description

The upstream logspout project supports reading `/etc/host_hostname` to determine the hostname. This allows one to expose the actual hosts name to the container rather than using the container id.

Currently, this does not work for logdna's logspout as the `HOSTNAME` environment variable appears to be the only way to set the hostname.

I am currently working around this as follows:

docker run -d \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /etc/hostname:/etc/host_hostname:ro \
-e LOGDNA_KEY= \
--entrypoint /bin/sh \
logdna/logspout:latest \
-c "HOSTNAME=\`cat /etc/host_hostname\` /bin/logspout"

I'm starting this container as part of an image baking process, so I cannot set the hostname to the value at the time the container is created as it will change.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.