Skip to content

Implementation of Request Labeling via Headers for Granular Observability & Budgeting #319

@Neiko2002

Description

@Neiko2002

Description

I would like to propose a new Labeling System for GoModel. This feature would allow users to assign custom labels to incoming requests based on HTTP header information. These labels can then be used as a primary filter and grouping criterion across various admin and monitoring modules.

Problem Statement

Currently, tracking traffic in the Audit Logs or managing budgets is primarily tied to user_path or API keys. In complex environments where multiple applications (e.g., Staging vs. Production, or App-A/B Test) use the same gateway/path, it is difficult to differentiate and group the traffic for analysis or cost control without creating separate keys for every single instance.

Proposed Solution

  1. Label Configuration (New Admin UI/API):
  • A new menu item where users can define rules like:
  • If Header X-App-ID equals Mobile-App-iOS, assign Label iOS.
  • If Header X-App-Variant equals TypeA, assign Label TypeA.
  1. Data Enrichment:
  • GoModel should extract these headers during the request lifecycle and store the assigned label alongside the request metadata in the database (PostgreSQL/SQLite/MongoDB).
  1. Integration across Modules:
  • Audit Logs: Add a "Filter by Label" dropdown and a "Group by Label" view.
  • Usage/Budgeting: Allow setting budget limits or viewing cost breakdowns specifically for a label.
  • Failover Tests: Use labels to target specific traffic groups for testing.

Benefits

  • Improved Observability: Better grouping in the dashboard and logs (maybe with different colors).
  • Granular Budgeting: Monitor costs per application or department more easily.
  • Flexibility: Can be used in several futures features.

Metadata

Metadata

Assignees

No one assigned

    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