Skip to content

Add processor documentation and CLI support #2108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 4, 2025
Merged

Add processor documentation and CLI support #2108

merged 7 commits into from
Jun 4, 2025

Conversation

jmthomas
Copy link
Member

@jmthomas jmthomas commented Jun 3, 2025

No description provided.

Copy link

codecov bot commented Jun 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.77%. Comparing base (a81467a) to head (578904e).
Report is 10 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2108   +/-   ##
=======================================
  Coverage   79.76%   79.77%           
=======================================
  Files         633      633           
  Lines       48026    48025    -1     
  Branches      754      754           
=======================================
  Hits        38310    38310           
+ Misses       9633     9632    -1     
  Partials       83       83           
Flag Coverage Δ
python 83.80% <ø> (ø)
ruby-api 78.69% <ø> (ø)
ruby-backend 82.99% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.


To create a Ruby processor simply replace `--python` with `--ruby`. This creates a processor called `slope_processor.py` at `targets/GSE/lib/slope_processor.py`. The code which is generated looks like the following:

```python
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be Ruby to match the rest of our docs?

Copy link
Member Author

@jmthomas jmthomas Jun 3, 2025

Choose a reason for hiding this comment

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

I think the majority of our users are going to be Python going forward so I'm slowing switching the docs over to Python as the primary example.


Processors execute code every time a packet is received to calculate values that can be retrieved by a [ProcessorConversion](/docs/configuration/conversions#processor_conversion). Processors are applied using the [PROCESSOR](/docs/configuration/telemetry#processor) keyword and generate values unique to the processor.

If you only want to perform a single calculation to modify a single telemetry value you probably want to use a [Conversion](/docs/configuration/conversions). Processors are used when you're deriving a number of values from a single telemetry item.
Copy link
Member

Choose a reason for hiding this comment

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

I would say from a single packet, not from a single item.


### Instantiate Processor

Now that we have implemented the processor logic we need to create the processor by adding it to a telemetry packet with the line `PROCESSOR slope_conversion.rb` in the [telemetry](/docs/configuration/telemetry) definition file. We also need a [ProcessorConversion](/docs/configuration/conversions#processor_conversion) to pull the calculated values out of the processor and into a [derived](/docs/configuration/telemetry#derived-items) telemetry item. This could look something like this:
Copy link
Member

Choose a reason for hiding this comment

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

Confusing switch to ruby. Probably need to provide examples for both languages.

Copy link
Member Author

Choose a reason for hiding this comment

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

Accidental switch to Ruby ... this matches the Conversion documentation

Copy link

sonarqubecloud bot commented Jun 3, 2025

@jmthomas jmthomas merged commit 466da67 into main Jun 4, 2025
29 checks passed
@jmthomas jmthomas deleted the processor branch June 4, 2025 04:11
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.

4 participants