Some questions regarding COS integration

Hello Obs team!

I’ve currently implemented a subordinate for “Grafana Alloy” to test out the concept shipping logs to loki.

Grafana Alloy, is a open telemery collector, with extra ability for grafana cloud. It is most likely drop in compatible with the standard/native otel-collector.

The reason we are not using the K8 version from Canonical is that we don’t use K8, but have a 100% machine platform.

I want to make sure tje Grafana Alloy charm passes on juju topology just like the cos charms does, but not 100% sure what is the correct version to use.

Question 1: What is the correct specc for a juju topoligy. I think I have seen a few variants.

Version 1:

“model”,“model_uuid”,“application”,“unit”,“charm_name”

Version 2:

“juju_model”,“juju_model_uuid”,“juju_application”,“juju_unit”,“juju_charm_name”

Question 2: What is it that I should pass on to grafana loki as labels? The topology as-is, or, rename the labels?

Question 3: Is there any repo which has the vm versions of the otel collector charms? I could only see the k8 one you linked earlier. I would benefit from trying to mimic the behaviour/implementation.

Question 4: Would it be possible to add some example on how to use the “from cosl import loki_logger”? I’m thinking to use this for sending logs about upgrade events for charms to a central place to track upgrades we do across many models, separate from workload logging. I want to track certain events, like upgrades, for all of our charms to get a good track record of what happens in pur environments.

A note: I wanted to use the cosl library, and found an error using it with machine charms on ubuntu24.04: ModuleNotFoundError: No module named 'puccinialin' · Issue #149 · canonical/cos-lib · GitHub - the workaround is quite nasty, but works.

Hope to collaborate more as we move along here.

Hi @erik-lonroth!

Sounds exiciting! We are now working on a VM version of the otelcol charm and hope to have an initial version merged soon. You would probably need to replicate in you galloy charm the cos-agent incoming relation (and prom, loki, grafana outgoing relations) the same we we have there.

For more info on topology labels, see this doc. Feel free to raise doc issues for missing bits.