Closed shayancanonical closed 3 months ago
Note for future reference:
plugs:
logs:
interface: content
target: $SNAP/shared-logs
slots:
logs:
interface: content
source:
read:
- $SNAP_COMMON/var/log/mysql
- $SNAP_COMMON/var/log/mysqlrouter
slots:
logs:
interface: content
source:
read:
- $SNAP_COMMON/var/log/zookeeper
Just noting that it looks like we explicitly don't take juju_unit
and juju_application
from the topology.
Edit: that's because that topology information comes from Grafana agent; we need to check if and how we can get the principal's topology here.
Bug Description
When relating mysql-router vm operator to COS using grafana-agent's![image](https://github.com/canonical/grafana-agent-operator/assets/99665202/629ed344-a33e-4b72-b1b8-04af61027548)
cos-agent
interface, we are unable to see thejuju_unit
label being applied to the mysql-router logs. See below image for the lack of such a labelSee below image for the presence of such a label for the![image](https://github.com/canonical/grafana-agent-operator/assets/99665202/ac7a6d90-0161-4964-8741-dd379a859a95)
grafana-agent/0
unitThe MySQLRouter VM charm uses COSAgentProvider. The charmed-mysql-snap has 2 directories defined the logs slot
To Reproduce
cos
in this case, with controller nameduk8s
)juju add-model database
)juju deploy -n 1 mysql --channel=8.0/stable
juju deploy -n 1 mysql-test-app --channel=latest/stable
juju deploy -n 1 mysql-router --channel=dpe/edge
juju relate mysql-router mysql-test-app
juju relate mysql-router mysql
juju deploy -n 1 grafana-agent --channel=latest/edge
juju relate grafana-agent mysql-test-app
juju find-offers uk8s:
juju consume uk8s:admin/cos.grafana
juju consume uk8s:admin/cos.loki
juju consume uk8s:admin/cos.prometheus
juju relate grafana-agent mysql-router:cos-agent
juju relate grafana-agent grafana
juju relate grafana-agent loki
juju relate grafana-agent prometheus
juju_unit=mysql-router/0
(which is not available). However logs with labeljuju_unit=grafana-agent/0
will be available. To see logs for mysql-router/0, you will have to apply the following label filters:path=/mysqlrouter
Environment
COS-lite deployed on juju with uk8s Database deployed on juju with lxd
Relevant log output
juju debug-log:
Additional context
Following entries are present under
logs.configs
in/etc/grafana-agent.yaml
:Following entries are available in
/var/lib/snapd/mount/snap.grafana-agent.fstab
Interestingly, I do not see the shared-logs directory defined in fstab:
Confirmed that the snap connection exists: