Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(router): schema usage lite export via prometheus #1704

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

endigma
Copy link
Member

@endigma endigma commented Mar 18, 2025

Overview

Some customers would like to use Prometheus for schema usage metrics, instead of the stack provided by Cosmo.

Changes

  • Added a new feature to export schema usage to prometheus
  • New configuration section /telemetry/metrics/prometheus/schema_usage
  • Option within the new object include_operation_sha controls whether or not the metrics include an attribute containing the sha256 of the operation, this can be disabled to reduce cardinality
    • This doesn't use the normal labels exclusion mechanism because computing the sha256 is not always required
    • Disabling here and excluding the label has no extra effect, and disabling it via the label exclusion does work, but if this option is true the sha256 will unconditionally be computed
  • debug.config.yaml now sets
    • log_level: debug
    • telemetry.prometheus.schema_usage.enabled: true
    • telemetry.prometheus.schema_usage.include_operation_sha: true

Config example

telemetry:
  metrics:
    prometheus:
      schema_usage:
        enabled: true
        include_operation_sha: true

Copy link

github-actions bot commented Mar 18, 2025

Router image scan passed

✅ No security vulnerabilities found in image:

ghcr.io/wundergraph/cosmo/router:sha-0d4a87620d1dd74f0bbf3dd52c6bb545ffba9ccf

@endigma endigma force-pushed the jesse/eng-6451-schema-usage-export-via-prometheus branch 2 times, most recently from d9f1302 to bc8b8c9 Compare March 18, 2025 11:09
@endigma endigma marked this pull request as ready for review March 19, 2025 08:42
@endigma endigma force-pushed the jesse/eng-6451-schema-usage-export-via-prometheus branch from dc2f1ea to f51057f Compare March 19, 2025 09:43
@endigma endigma requested review from StarpTech and Copilot March 19, 2025 10:04
@endigma endigma force-pushed the jesse/eng-6451-schema-usage-export-via-prometheus branch 6 times, most recently from 064b604 to a4f56e0 Compare March 26, 2025 09:15
@StarpTech StarpTech changed the title feat(router): schema usage export via prometheus feat(router): schema usage lite export via prometheus Mar 26, 2025
@endigma endigma force-pushed the jesse/eng-6451-schema-usage-export-via-prometheus branch from fa4f638 to 370d6cb Compare March 26, 2025 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants