cloudsmith: add billable_only filter to analytics metrics (default: True) - #3024
Merged
steveny91 merged 13 commits intoJun 18, 2026
Merged
Conversation
- Add `billable` config option (default: true) to filter analytics API calls to billable download requests only - Prevents inflated metrics when Cloudsmith native (non-billable) traffic is introduced alongside standard download logs - Adds `billable` query param to all `_build_analytics_url` calls - Bump version 1.3.0 -> 1.4.0 - Update spec.yaml, conf.yaml.example, CHANGELOG.md, README.md - Add 2 new tests covering default-true and explicit-false behaviour
This comment has been minimized.
This comment has been minimized.
The Cloudsmith analytics API parameter has been renamed from 'billable' to 'billable_only', with capitalised True/False values. Semantics: True filters to billable requests only (download domain, no error responses >= 400). False returns all results with no filtering applied (equivalent to omitting the parameter entirely). - Rename instance config key: billable -> billable_only - Rename internal attribute: analytics_billable -> analytics_billable_only - Update URL param: billable=true/false -> billable_only=True/False - Update spec.yaml, conf.yaml.example, CHANGELOG, and tests
billable filter to analytics metrics (default: true)billable_only filter to analytics metrics (default: True)
BartoszBlizniak
left a comment
Contributor
There was a problem hiding this comment.
One small comment from me
joepeeples
approved these changes
Jun 3, 2026
Contributor
Author
|
@london-wharton this PR is still pending your review. Thank you. |
Contributor
|
Hey @dkirov-dd (apologies for direct @ ), but is there any chance we could please push this forward up in your review queue - it's a small parameter change, however, it's a very necessary change on our end as our data team is changing how the API works and this is currently blocking us. Thank you 🙏 |
Contributor
Author
|
@london-wharton this is still pending your review. Unfortunately, one of the checks is now failing: |
Contributor
Author
|
@joepeeples, can you help get a second reviewer on this pending PR? |
steveny91
approved these changes
Jun 18, 2026
This was referenced Aug 4, 2026
Draft
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.
What does this PR do?
Adds a
billable_onlyboolean configuration option (default:True) to the Cloudsmith integration. WhenTrue, the analytics API is queried withbillable_only=True, limiting metrics to billable download requests only (download domain, no error responses >= 400). WhenFalse, all traffic is returned with no filtering applied — equivalent to omitting the parameter entirely.Files changed:
check.pybillable_onlyfrom instance config (defaultTrue); appendbillable_only=<value>to every_build_analytics_urlcallspec.yamlbillable_onlyas an optional boolean parameterconf.yaml.examplebillable_onlywith@paramannotation__about__.py1.3.0→1.4.0CHANGELOG.mdtests/test_cloudsmith.pybillable_only=Truein URL; explicitFalse→billable_only=Falsein URLMotivation
Cloudsmith is introducing native logs — a new category of traffic that is non-billable and was not previously tracked. Once native logs are live, the analytics API will return a mix of billable and non-billable requests unless filtered. Without this change, customers and Cloudsmith users monitoring download/bandwidth metrics via this Datadog integration would see a sudden and unexplained increase in metric values.
By defaulting
billable_only=True, the integration maintains the same billing-consistent behaviour it had before native logs were introduced — no customer action required. Users who explicitly want to include all traffic (billable and non-billable) can opt in by settingbillable_only: false.Cloudsmith API parameter details
billable_onlyTrue: Filters to billable requests only — requests through the download domain with HTTP status < 400False: Returns all results with no filtering applied (includes native CDN logs and errored requests); equivalent to omitting the parameter entirelyReview checklist
Additional Notes
billable_onlyquery parameter was added to the Cloudsmith Analytics v2 API as part of internal ticket ENG-11511.Trueis intentional and backwards-compatible — it preserves existing metric values for all current users./analytics/metrics/client/time-series/); all other API calls (quota, audit log, vulnerabilities, members, repositories) are unaffected.