1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Demand control enabled in measure mode.
demand_control:
enabled: true
# Use measure mode to monitor the costs of your operations without rejecting any.
mode: measure
strategy:
# Static estimated strategy has a fixed cost for elements.
static_estimated:
# The assumed returned list size for operations. Set this to the maximum number of items in a GraphQL list
list_size: 10
# The maximum cost of a single operation, above which the operation is rejected.
max: 1000
# Basic telemetry configuration for cost.
telemetry:
exporters:
metrics:
common:
service_name: apollo-router
views:
# Define a custom view because cost is different than the default latency-oriented view of OpenTelemetry
- name: cost.*
aggregation:
histogram:
buckets:
- 0
- 10
- 100
- 1000
- 10000
- 100000
- 1000000
instrumentation:
instruments:
supergraph:
cost.estimated:
attributes:
cost.result: true