Skip to content

SD-11577: add worker subrequest support#12

Merged
rtalvarez merged 1 commit intomasterfrom
sub-req
Mar 19, 2026
Merged

SD-11577: add worker subrequest support#12
rtalvarez merged 1 commit intomasterfrom
sub-req

Conversation

@rtalvarez
Copy link
Member

@rtalvarez rtalvarez commented Mar 19, 2026

Pull Request Template

Description

  • Add worker subrequests metrics via Cloudflare's workersSubrequestsAdaptiveGroups GraphQL dataset
  • New metric cloudflare_worker_subrequests_count — subrequest count per script name
  • New metric cloudflare_worker_subrequest_time — response time quantiles (P50/P75/P99/P999) in microseconds per script name
  • Both metrics support the denylist and follow existing patterns (structs, registration, goroutine wiring)
  • README updated with new metrics

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Other (please describe):

Testing

Ran the app locally and verified the graphql query is executed correctly for workersSubrequestsAdaptiveGroups

DEBUG[2026-03-19 08:30:00] func:main.NewGraphQLClient.func1 file:graphql.go >> query: query ($accountID: String!, $mintime: Time!, $maxtime: Time!, $limit: Int!) { viewer { accounts(filter: {accountTag: $accountID}) { workersSubrequestsAdaptiveGroups(limit: $limit, filter: {datetime_geq: $mintime, datetime_lt: $maxtime}) { dimensions { scriptName } sum { subrequests } quantiles { timeToResponseUsP50 timeToResponseUsP75 timeToResponseUsP99 timeToResponseUsP999 } } } } }

Visiting localhost:8080/metrics locally, i can see both cloudflare_worker_subrequest_time and cloudflare_worker_subrequests_count

Code Quality

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

Before Submitting

Please ensure you have completed the following before submitting your PR:

# Run comprehensive tests
make pr-tests

If the above command fails, please fix the issues before submitting your PR.

Additional Notes

Add any other context about the pull request here.

Copy link

@chanceaclark chanceaclark left a comment

Choose a reason for hiding this comment

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

This is going to be nice for observability purposes :feelsgood:

@rtalvarez rtalvarez merged commit 3d905da into master Mar 19, 2026
3 checks passed
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.

2 participants