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

Fix label treatment of related charms #63

Merged
merged 8 commits into from
Mar 1, 2024
Merged

Fix label treatment of related charms #63

merged 8 commits into from
Mar 1, 2024

Conversation

sed-i
Copy link
Contributor

@sed-i sed-i commented Feb 27, 2024

Issue

Telemetry reaches prom/loki with incorrect labels.

Solution

Fixes #60.

Drive-by fixes:

  • Fetch-lib
  • Add .wokeignore to .jujuignore
  • Update issue templates

Context

Testing Instructions

Deploy something like this bundle:

series: jammy
saas:
  loki:
    url: microk8s:admin/pebnote.loki
  loki2:
    url: microk8s:admin/pebnote.loki2
  prom:
    url: microk8s:admin/pebnote.prom
applications:
  cp:
    charm: local:cos-proxy-1
    num_units: 1
  ga:
    charm: local:grafana-agent-3
  nrpe:
    charm: nrpe
    channel: edge
    revision: 117
  ub:
    charm: ubuntu
    channel: edge
    revision: 24
    num_units: 1
  ub2:
    charm: ubuntu
    channel: edge
    revision: 24
    num_units: 1
  zk:
    charm: zookeeper
    channel: 3/edge
    revision: 126
    num_units: 1
relations:
- - ga:juju-info
  - ub:juju-info
- - ga:logging-consumer
  - loki:logging
- - ga:send-remote-write
  - prom:receive-remote-write
- - cp:monitors
  - nrpe:monitors
- - nrpe:general-info
  - ub2:juju-info
- - cp:downstream-logging
  - loki2:logging
- - cp:downstream-prometheus-scrape
  - prom:metrics-endpoint
- - zk:cos-agent
  - ga:cos-agent

When related to prometheus, you should see an instance label for the grafana-agent hostname:

$ curl -s 10.1.166.117:9090/api/v1/label/instance/values | jq  # PROMETHEUS
{
  "status": "success",
  "data": [
    "10.238.171.191:5666",
    "juju_799803_2_lxd",
    "pebnote_897e972f-2c41-42e3-88bd-c1298f707c61_prom_prom/0"
  ]
}

$ curl -s 10.1.166.109:3100/loki/api/v1/label/instance/values | jq  # LOKI
{
  "status": "success",
  "data": [
    "juju_799803_2_lxd"
  ]
}

@sed-i sed-i marked this pull request as ready for review February 27, 2024 23:48
@sed-i sed-i merged commit 10868a4 into main Mar 1, 2024
13 checks passed
@sed-i sed-i deleted the feature/fix-labels branch March 1, 2024 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant