Skip to content

added GetSensorUsageHourly as this allows you to pull hourly billing based on Cloud calculated billing.#1375

Merged
jshcodes merged 1 commit into
CrowdStrike:devfrom
atav928:fix-sensor-issue
Nov 5, 2025
Merged

added GetSensorUsageHourly as this allows you to pull hourly billing based on Cloud calculated billing.#1375
jshcodes merged 1 commit into
CrowdStrike:devfrom
atav928:fix-sensor-issue

Conversation

@atav928

@atav928 atav928 commented Sep 8, 2025

Copy link
Copy Markdown

Add GetSensorUsageHourly

Added GetSensorUsageHourly to _sensor_usage.py endpoint; tested it in production, and works by providing either hourly or weekly billing usage depending on how billing is calculated. This is part of CrowdStrike documentation and also shows in the billing dashboard how these values are pulled. This helps calculate the Cloud (reserved hourly) usage. The endpoint that is not documented, but works along with getting weekly billing information is: "/billing-dashboards-usage/aggregates/hourly-average/v1"

  • Enhancement
  • Updated unit tests

Unit test coverage

pytest tests/test_sensor_usage.py -v
============================================================ test session starts ============================================================
cachedir: .pytest_cache
rootdir: /GitHub/falconpy
configfile: pyproject.toml
plugins: cov-6.3.0
collected 1 item                                                                                                                            

tests/test_sensor_usage.py::TestSensorUsage::test_all_code_paths PASSED                                                               [100%]

============================================================= 1 passed in 1.97s =============================================================

Bandit analysis

[main]	INFO	running on Python 3.13.3
Working... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:01
Run started:2025-11-05 19:15:54.058193

Test results:
	No issues identified.

Code scanned:
	Total lines of code: 98726
	Total lines skipped (#nosec): 0

Run metrics:
	Total issues (by severity):
		Undefined: 0
		Low: 0
		Medium: 0
		High: 0
	Total issues (by confidence):
		Undefined: 0
		Low: 0
		Medium: 0
		High: 0
Files skipped (0):

Added features and functionality

  • If your PR adds features or functionality, what should be included in the next release notes?
    Added support for pulling hourly billing data from billing-dashboard-usage endpoint on top of the weekly-average values.

@jshcodes jshcodes changed the base branch from main to dev September 11, 2025 00:12
@jshcodes jshcodes assigned jshcodes and atav928 and unassigned jshcodes Sep 11, 2025
@jshcodes jshcodes added the sensor usage Sensor usage issues and questions label Sep 11, 2025
…oud based; added it to test sensor; tested it in production and works since the endpoint does work and provides hourly usage billing that is used for Cloud (reserved hourly) usage
@jshcodes

jshcodes commented Nov 5, 2025

Copy link
Copy Markdown
Member

Merging into dev for additional unit testing and confirmation.

@jshcodes jshcodes left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for your contribution!!! 🙇

@jshcodes jshcodes merged commit cdacbf4 into CrowdStrike:dev Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sensor usage Sensor usage issues and questions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants