Skip to content

Aclp logs support#686

Open
sjer-akamai wants to merge 45 commits into
linode:devfrom
sjer-akamai:ACLP-logs-support
Open

Aclp logs support#686
sjer-akamai wants to merge 45 commits into
linode:devfrom
sjer-akamai:ACLP-logs-support

Conversation

@sjer-akamai
Copy link
Copy Markdown

@sjer-akamai sjer-akamai commented Apr 23, 2026

📝 Description

Adds support for monitor logs functionality
What does this PR do and why is this change necessary?

  1. Adds full SDK support for monitor Logs API. This includes both the destinations and streams. This is a new feature not yet supported in the SDK.
  2. Adds unit tests for newly implemented features.
  3. Adds integration tests for newly implemented features.
  4. Integration tests include safeguards based around the limitations of API.
    • The feature is currently in limited availability, these integration tests are skipped if the feature is not available for the account running tests.
    • Logs Stream functionality is limited to one stream per account. For this reason Logs stream tests will automatically skip if there's a stream existing on the account.
    • Full e2e test for streams require a stream to complete provisioning - based on experience during development this can take up to an hour. Similarly to what's already present for database related tests, an environment variable (run_aclp_logs_stream_tests) needs to be set as true or yes to enable testing the Stream portion of the API.
  5. github workflow files were updated to include the run_aclp_logs_stream_tests environment variable.

Notes:

  • Techdocs for stream POST and PUT requests mention destinations being "One or more unique identifiers for the sync points that will receive logs data." This differs from the actual API implementation: streams currently support only a single destination, and the API expects a single-element list in the request. This was confirmed with the team developing the ACLP Logs API, and a documentation update was requested.

✔️ How to Test

How do I run the relevant unit/integration tests?
Unit tests:

  1. Follow usual installation/setup steps
  2. run pytest test/unit to run all unit tests, or:
  3. run pytest test/unit/objects/monitor_test.py to run only monitor related tests

Integration tests:

  1. setup your linode token:
    • export LINODE_TOKEN="YOUR_REAL_TOKEN"
  2. set environment variable to enable Logs Stream tests. This step is optional - if the variable is not set only destination related tests will run.
    • export RUN_ACLP_LOGS_STREAM_TESTS=true
  3. run test suite:
    • make TEST_CASE=test_monitor_logs test-int

Notes:

  • Integration tests will be skipped if account has no Akamai Cloud Pulse Logs account capability
  • Stream integration tests will be skipped if another Logs stream is present on the account

@sjer-akamai sjer-akamai requested review from a team as code owners April 23, 2026 11:25
@sjer-akamai sjer-akamai removed the request for review from a team April 23, 2026 11:25
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mawilk90 mawilk90 requested a review from psnoch-akamai April 27, 2026 07:24
@sjer-akamai
Copy link
Copy Markdown
Author

Added missing signature to the commit, CI fails on lint because of PR title. Should I change it to something specific?

@yec-akamai yec-akamai added community-contribution for contributions made by a non-DX author new-feature for new features in the changelog. labels Apr 29, 2026
@yec-akamai
Copy link
Copy Markdown
Contributor

Added missing signature to the commit, CI fails on lint because of PR title. Should I change it to something specific?

Just added label to your PR to pass the CI

Comment thread test/integration/models/monitor/test_monitor_logs.py Outdated
@sjer-akamai sjer-akamai force-pushed the ACLP-logs-support branch from a3e0e27 to d0a00ff Compare May 7, 2026 11:48
@sjer-akamai sjer-akamai force-pushed the ACLP-logs-support branch from d0a00ff to 0d07f53 Compare May 7, 2026 14:27
@mawilk90 mawilk90 removed their request for review May 12, 2026 08:54
"version": Property(),
}

def update_destinations(self, destinations: List[int]):
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 wonder why is it necessary to have a separate function to update destinations? You can just mark it as a mutable property, and we can handle it as other updatable field.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It boils down to the API being asymmetric for the destination update - the request takes only a (single element) list of destination ids as opposed to a whole destination object in general. Marking the field as mutable would make the whole LogsStreamDestination mutable and serialized for requests which would fail on API end. I think this was a cleaner solution than having a mutable property and then overriding the save and _serialize - with the mutable property user could call something like stream.destinations[0].label = "new_label" call stream.save() and expect the destination to be modified, but it'll be silently ignored. This version seems to match the actual API capabilities

Copy link
Copy Markdown
Contributor

@yec-akamai yec-akamai left a comment

Choose a reason for hiding this comment

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

Tested and works well locally, nice work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution for contributions made by a non-DX author new-feature for new features in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants