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 juju_unit and juju_application labels #137

Merged
merged 11 commits into from
May 29, 2024
Merged

Conversation

Abuelodelanada
Copy link
Contributor

@Abuelodelanada Abuelodelanada commented May 27, 2024

Issue

This PR fixes #134

Solution

Based on the PR created by @dashmage, now we are able to properly add relabel_configs for juju_application and juju_unit

Testing Instructions

In an lxd model deploy the following:

default-base: [email protected]/stable
saas:
  prometheus:
    url: microk8s:admin/cos.prometheus
applications:
  cos-proxy:
    charm: local:cos-proxy-3
    num_units: 1
    to:
    - "10"
    constraints: arch=amd64
  nova-compute-kvm:
    charm: ubuntu
    channel: latest/stable
    revision: 24
    num_units: 1
    to:
    - "6"
    constraints: arch=amd64
    storage:
      block: loop,100M
      files: rootfs,100M
  nrpe:
    charm: nrpe
    channel: latest/edge
    revision: 122
    options:
      nagios_host_context: bootstack-blue
machines:
  "6":
    constraints: arch=amd64
  "10":
    constraints: arch=amd64
relations:
- - nrpe:general-info
  - nova-compute-kvm:juju-info
- - cos-proxy:monitors
  - nrpe:monitors
- - cos-proxy:downstream-prometheus-scrape
  - prometheus:metrics-endpoint

In a microk8s model deploy cos-lite (only prometheus and traefik are needed for the test though) using the offers overlay:

juju deploy cos-lite --channel=edge --trust --overlay ./offers-overlay.yaml

Offer Prometheus' metrics-endpoint interface so avoid installing g-agent:

juju offer cos.prometheus:metrics-endpoint 

Configure nagios_host_context:

juju config nrpe nagios_host_context="bootstack-blue"

Relate cos-proxy to prometheus:

juju relate cos-proxy prometheus    

You'll end up wit a deployment like this one:

image

Once every relation is in place, we can see in Prometheus that juju_application and juju_unit are ok:

image

Copy link
Contributor

@lucabello lucabello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

We should probably revert the fetch-lib of cos_agent.py because the pydantic pin will fail the CI :(

@sed-i sed-i merged commit 943e909 into main May 29, 2024
13 checks passed
@sed-i sed-i deleted the fix_juju_unit_application branch May 29, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

juju_application and juju_unit labels are incorrect and confusing
3 participants