Skip to content

feat!: consume collectd data using a flow#6

Merged
didier-wenzek merged 3 commits into
thin-edge:mainfrom
didier-wenzek:feat/collectd-flow
Jun 2, 2026
Merged

feat!: consume collectd data using a flow#6
didier-wenzek merged 3 commits into
thin-edge:mainfrom
didier-wenzek:feat/collectd-flow

Conversation

@didier-wenzek

Copy link
Copy Markdown
Contributor

tedge-mapper-collectd being deprecated: use a flow to consume collectd data

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are 3 alternatives:

  1. Improve that script to handle the case of collectd messages with more than one values.
  2. use the script provided by feat: translate collect metrics into tedge measurements tedge-flows-examples#121.
  3. Extend tedge flows with a builtin collectd transformation.

My preference is for the first option: simple and less dependencies across independent repos.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided for option 1.

Comment thread src/collectd/flow.toml Outdated

steps = [
{ script = "collectd-to-te-measurements.js" },
{ builtin = "group-measurements", interval = "1s", config = { time_window = "500ms" } },

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using group-measurements introduces a dependency on the version of thin-edge that will integrate thin-edge/thin-edge.io#4136.

To have a simpler dependency on 2.0.0, we can comment out this line.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally, we decided to release a temporary solution with a script group-measurements.js.

See c7e0b73

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@didier-wenzek I pushed a commit to add an explicit dependency on thin-edge.io >= 2.0.0, 99c3588

Comment thread nfpm.yaml
group: tedge
owner: tedge
- src: ./src/collectd
dst: /etc/tedge/mappers/local/flows/collectd/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a fix (d1b5c6c) to the dst folder as it was missing the collectd/. Previously it didn't have the collectd/ suffix, so it resulted in the flow.toml being placed at /etc/tedge/mappers/local/flows/flow.toml

Comment thread src/collectd/flow.toml
Comment on lines +1 to +2
version = "1.0.0"
description = "Convert collectd messages to thin-edge.io measurements"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some minor meta information just so it is more descriptive when using tedge flows list --mapper local.

@reubenmiller reubenmiller left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a few very minor fixes after testing the new package manually in the tedge-demo-container, but overall it works nicely.

@reubenmiller

Copy link
Copy Markdown
Contributor

@didier-wenzek You'll have to squash the fix-up commits that I added before merging (as we don't have PR checks to block them).

didier-wenzek and others added 3 commits June 2, 2026 20:38
Signed-off-by: Didier Wenzek <didier.wenzek@free.fr>
This is a temporary solution,
waiting for tedge builtin flow transformer `group-measurements`

Signed-off-by: Didier Wenzek <didier.wenzek@free.fr>
@didier-wenzek didier-wenzek merged commit 0a21969 into thin-edge:main Jun 2, 2026
@didier-wenzek didier-wenzek deleted the feat/collectd-flow branch June 2, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants