Add microservices development documentation#2700
Merged
Conversation
Document the APIs available to custom microservices and the development process including: - Creating microservices using the CLI generator - Microservice structure and lifecycle - Plugin configuration keywords - Available APIs (with API vs Script warning) - Base class attributes and methods - Logging, state management, secrets, HTTP endpoints - Note about frontend polling for state/custom status - Subscribing to Redis topics - Example safety monitor microservice Closes #2561 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2700 +/- ##
==========================================
- Coverage 79.31% 79.24% -0.07%
==========================================
Files 662 664 +2
Lines 52588 52825 +237
Branches 734 734
==========================================
+ Hits 41708 41862 +154
- Misses 10800 10883 +83
Partials 80 80
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
clayandgen
reviewed
Jan 2, 2026
| ## Available APIs | ||
|
|
||
| :::warning API vs Script | ||
| When writing code for a microservice (or interface) that runs _within_ COSMOS, you must use the `openc3/api` library, **NOT** `openc3/script`. |
Contributor
There was a problem hiding this comment.
this is a good callout here 👍
| @logger.info("Info message") | ||
| @logger.warn("Warning message") | ||
| @logger.error("Error message") | ||
| @logger.fatal("Fatal message") |
Contributor
There was a problem hiding this comment.
it could be worth mentioning the type: Logger::ALERT option you can pass in to bubble up to the notifications.
|
|
||
| ```ruby | ||
| @metric.set(name: 'requests_total', value: @count, type: 'counter') | ||
| @metric.set(name: 'processing_seconds', value: elapsed, type: 'gauge', unit: 'seconds') |
Contributor
There was a problem hiding this comment.
We may want to provide additional info on what counter and gauge are?
- Add Alert Notifications section documenting Logger::ALERT type option for bubbling log messages to UI notifications - Add Metric Types section explaining counter vs gauge metrics Co-Authored-By: Claude Opus 4.5 <[email protected]>
clayandgen
approved these changes
Jan 8, 2026
Contributor
clayandgen
left a comment
There was a problem hiding this comment.
Claude is a good technical writer 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Key Documentation Sections
Closes #2561
🤖 Generated with Claude Code