Skip to content

Commit

Permalink
Merge pull request #318 from rkleinem/telegraf-droneuuid
Browse files Browse the repository at this point in the history
Make TelegrafMonitoring Plugin send Drone UUID
  • Loading branch information
giffels committed Nov 14, 2023
2 parents 980d3d3 + bb1228f commit 0348c67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions tardis/plugins/telegrafmonitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ async def notify(self, state: State, resource_attributes: AttributeDict) -> None
tags = dict(
site_name=resource_attributes.site_name,
machine_type=resource_attributes.machine_type,
drone_uuid=resource_attributes.drone_uuid,
)
self.client.metric(self.metric, data, tags=tags)
await self.client.close()
5 changes: 4 additions & 1 deletion tests/plugins_t/test_telegrafmonitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def test_notify(self):
test_param = AttributeDict(
site_name="test-site",
machine_type="test_machine_type",
drone_uuid="test_drone_uuid",
created=datetime.now(),
updated=datetime.now(),
)
Expand All @@ -59,7 +60,9 @@ def test_notify(self):
updated=datetime.timestamp(test_param.updated),
)
test_tags = dict(
site_name=test_param.site_name, machine_type=test_param.machine_type
site_name=test_param.site_name,
machine_type=test_param.machine_type,
drone_uuid=test_param.drone_uuid,
)
run_async(self.plugin.notify, test_state, test_param)
self.mock_aiotelegraf.Client.assert_called_with(
Expand Down

0 comments on commit 0348c67

Please sign in to comment.