Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loki logs sending instance="none" by default #762

Closed
candlerb opened this issue Apr 17, 2024 · 0 comments
Closed

Loki logs sending instance="none" by default #762

candlerb opened this issue Apr 17, 2024 · 0 comments
Assignees
Labels
Bug Confirmed to be a bug Easy Good for new contributors
Milestone

Comments

@candlerb
Copy link
Contributor

Required information

  • Distribution: Ubuntu
  • Distribution version: 22.04.4
  • Incus version: 6.0-202404040310-ubuntu22.04

Issue description

The documentation for the config setting loki.instance says:

Key: loki.instance
Type: string
Default: Local server host name or cluster member name
Scope: global

This allows replacing the default instance value (server host name) by a more relevant value like a cluster identifier.

On my servers, it is unset:

root@nuc3:~# incus config get loki.instance

root@nuc3:~# hostname
nuc3
root@nuc3:~#

However, the logs are being sent with instance="none" rather than instance="<hostname>"

root@loki:~# logcli query '{app="incus"}' --since=1h --limit=3
2024/04/17 09:14:27 http://localhost:3100/loki/api/v1/query_range?direction=BACKWARD&end=1713345267346769206&limit=3&query=%7Bapp%3D%22incus%22%7D&start=1713341667346769206
2024/04/17 09:14:27 Common labels: {app="incus", instance="none", location="none", type="logging"}
                                                 ^^^^^^^^^^^^^^^
2024-04-17T08:41:41Z {} level="info" Done updating images
2024-04-17T08:41:41Z {} level="info" Done pruning expired backups
2024-04-17T08:41:41Z {} level="info" Updating images

WORKAROUND: set loki.instance explicitly on each host.

incus config set loki.instance=nuc3

Steps to reproduce

  1. Install Loki
  2. Forward logs using loki.api.url. Don't set loki.instance
  3. Examine logs and look at values of instance label
@stgraber stgraber self-assigned this Apr 17, 2024
@stgraber stgraber added Bug Confirmed to be a bug Easy Good for new contributors labels Apr 17, 2024
@stgraber stgraber added this to the incus-6.1 milestone Apr 17, 2024
stgraber added a commit to stgraber/incus that referenced this issue Apr 17, 2024
…systems

Closes lxc#762

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
@tych0 tych0 closed this as completed in f7acfd8 Apr 17, 2024
simondeziel pushed a commit to simondeziel/lxd that referenced this issue May 3, 2024
…ystems

Closes lxc/incus#762

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
(cherry picked from commit f7acfd818d3538c9908438bb92e64ec669dbd165)
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
License: Apache-2.0
simondeziel pushed a commit to simondeziel/lxd that referenced this issue May 3, 2024
…ystems

Closes lxc/incus#762

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
(cherry picked from commit f7acfd818d3538c9908438bb92e64ec669dbd165)
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
License: Apache-2.0
simondeziel pushed a commit to simondeziel/lxd that referenced this issue May 3, 2024
…ystems

Closes lxc/incus#762

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
(cherry picked from commit f7acfd818d3538c9908438bb92e64ec669dbd165)
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
License: Apache-2.0
stgraber added a commit that referenced this issue May 27, 2024
…systems

Closes #762

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
tomponline pushed a commit to tomponline/lxd that referenced this issue Jun 6, 2024
…ystems

Closes lxc/incus#762

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
(cherry picked from commit f7acfd818d3538c9908438bb92e64ec669dbd165)
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
License: Apache-2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Confirmed to be a bug Easy Good for new contributors
Development

No branches or pull requests

2 participants