Skip to content

Update the Gateway to track egress [Accounting Service] #154

@fforbeck

Description

@fforbeck

Modify the Cloudflare Worker (Freeway) to send the egress event (customer ID, CID, and timestamp) to the AWS Egress queue. This will ensure that every egress event is recorded and sent to the accounting service for billing.

  • Implementing a Middleware to count egress bytes
  • Add Gateway identity to the context
  • Add delegation proofs to the context
  • Integrating with ucanto lib to invoke the space/content/serve/egress/record
  • Update the delegate-serve.js script to create spaces on the fly and authorize the gateway to record egress using space/content/serve/* capability
  • Create DID web of the gateway for all environments and upload keys to 1 password
  • Update the w3infra to resolve the DID web of the gateway
  • Fix customer resolution error in w3infra
  • Feature Flag to disable opentelemetry lib which causes errors during the execution of the invocation (Local & Staging)
  • Fix unit & integration tests
  • Deploy to Staging
  • Perform E2E Test
  • Write tests

TODO (another moment)

✘ [ERROR] Uncaught (async) TypeError: Illegal invocation: function called with incorrect `this` reference. See https://developers.cloudflare.com/workers/observability/errors/#illegal-invocation-errors for details.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions