Skip to content

Commit

Permalink
Add juju_charm label to logs (#111)
Browse files Browse the repository at this point in the history
* add juju_charm label to logs

* lint

* add job labels

* use python38 dict merge
  • Loading branch information
cbartz authored May 28, 2024
1 parent 63b4df4 commit a4ba055
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,14 +416,15 @@ def _additional_log_configs(self) -> List[Dict[str, Any]]:
"targets": ["localhost"],
"labels": {
"__path__": "/var/log/**/*log",
"job": "varlog",
**self._own_labels,
},
}
],
},
{
"job_name": "syslog",
"journal": {"labels": self._own_labels},
"journal": {"labels": {**self._own_labels, **{"job": "syslog"}}},
"pipeline_stages": [
{
"drop": {
Expand Down
1 change: 1 addition & 0 deletions src/grafana_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,7 @@ def _instance_topology(self) -> Dict[str, str]:
"juju_model_uuid": self.model.uuid,
"juju_application": self.model.app.name,
"juju_unit": self.model.unit.name,
"juju_charm": self.meta.name,
}

@property
Expand Down

0 comments on commit a4ba055

Please sign in to comment.