Skip to content

Commit a70f207

Browse files
authored
Merge pull request #3857 from albinsuresh/doc/agent-sync-signal
doc: sync signal support for tedge-agent
2 parents 01eebc1 + b374a18 commit a70f207

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

docs/src/extend/log-management.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ Retrieve logs with time filters (timestamps in seconds since epoch):
258258
sudo /usr/share/tedge/log-plugins/docker get tedge-agent --since 1696250000 --until 1696260000
259259
```
260260

261-
## Dynamic log type discovery
261+
## Refresh Supported Log Types
262262

263263
To ensure that any newly installed services or log sources are immediately available for log collection,
264264
`tedge-agent` automatically reloads the plugins and refreshes the supported log types on the following events:
@@ -268,9 +268,12 @@ To ensure that any newly installed services or log sources are immediately avail
268268
* A new software is installed with the agent (via the `software_update` command)
269269
* A new configuration is installed or updated with the agent (via the `config_update` command)
270270

271-
If the new software or configuration is installed/updated externally, and not via `tedge-agent`,
272-
a refresh can be triggered by just touching the plugin configuration file:
271+
A refresh can also be triggered manually by sending a sync signal to the agent as follows:
273272

274273
```
275-
touch /etc/tedge/plugins/tedge-log-plugin.toml
274+
tedge mqtt pub te/device/main/service/tedge-agent/signal/sync_log_upload '{}'
276275
```
276+
277+
The agent reacts to all these events by gathering the latest supported log types from all the installed plugins
278+
by invoking the `list` command on them,
279+
and publishes the aggregated types to the `te/device/main///cmd/log_upload` meta topic.

docs/src/references/mqtt-api.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -712,9 +712,10 @@ Where the signal segments are describe as follows:
712712

713713
The following table details some example signal types which are supported by %%te%%.
714714

715-
| Signal Type | Example Topic |
716-
|-------------|-------------------------------|
717-
| sync | `te/<identifier>/signal/sync` |
715+
| Signal Type | Example Topic |
716+
|-----------------|------------------------------------------|
717+
| sync | `te/<identifier>/signal/sync` |
718+
| sync_log_upload | `te/<identifier>/signal/sync_log_upload` |
718719

719720
The signal would be interpreted differently based on the target entity.
720721

@@ -725,14 +726,22 @@ We plan to add support for more signal types in the future.
725726

726727
### Examples: With default device/service topic semantics
727728

728-
#### Signal to a service
729+
#### Signal to the Cumulocity mapper service
729730

730731
Signal to request the supported operations of the `tedge-mapper-c8y` service:
731732

732733
```sh te2mqtt formats=v1
733734
tedge mqtt pub te/device/main/service/tedge-mapper-c8y/signal/sync '{}'
734735
```
735736

737+
#### Signal to the agent service
738+
739+
Signal to refresh the `log_upload` command metadata (supported log types) of the `tedge-agent` service:
740+
741+
```sh te2mqtt formats=v1
742+
tedge mqtt pub te/device/main/service/tedge-agent/signal/sync_log_upload '{}'
743+
```
744+
736745
## Health check
737746

738747
Services can publish their health status as follows:

0 commit comments

Comments
 (0)