Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/assign-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ jobs:
contents: read
issues: write
actions: write
id-token: write
uses: DataDog/issue-triage-action/.github/workflows/issue-triage.yml@ee200860ba35ba6ed3ad565e918afb16811fe975 # v1.0.0
uses: DataDog/issue-triage-action/.github/workflows/issue-triage.yml@b39f0bc12abc52fe8aa70dc9b9353bf307a13219 # v1.0.1
with:
slack_map_path: .github/workflows/config/github_slack_map.yaml
environment_name: issue-assigner
Expand Down
1 change: 1 addition & 0 deletions envoy/changelog.d/24237.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add adaptive concurrency gradient controller metrics.
84 changes: 84 additions & 0 deletions envoy/datadog_checks/envoy/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,27 @@
'envoy_http_rbac_denied': 'http.rbac_denied',
'envoy_http_rbac_shadow_allowed': 'http.rbac_shadow_allowed',
'envoy_http_rbac_shadow_denied': 'http.rbac_shadow_denied',
'envoy_http_adaptive_concurrency_gradient_controller_rq_blocked': (
'http.adaptive_concurrency.gradient_controller.rq_blocked'
),
'envoy_http_adaptive_concurrency_gradient_controller_min_rtt_calculation_active': (
'http.adaptive_concurrency.gradient_controller.min_rtt_calculation_active'
),
'envoy_http_adaptive_concurrency_gradient_controller_concurrency_limit': (
'http.adaptive_concurrency.gradient_controller.concurrency_limit'
),
'envoy_http_adaptive_concurrency_gradient_controller_gradient': (
'http.adaptive_concurrency.gradient_controller.gradient'
),
'envoy_http_adaptive_concurrency_gradient_controller_burst_queue_size': (
'http.adaptive_concurrency.gradient_controller.burst_queue_size'
),
'envoy_http_adaptive_concurrency_gradient_controller_min_rtt_msecs': (
'http.adaptive_concurrency.gradient_controller.min_rtt_msecs'
),
'envoy_http_adaptive_concurrency_gradient_controller_sample_rtt_msecs': (
'http.adaptive_concurrency.gradient_controller.sample_rtt_msecs'
),
'envoy_http_local_rate_limit_enabled': 'http.local_rate_limit_enabled',
'envoy_http_local_rate_limit_enforced': 'http.local_rate_limit_enforced',
'envoy_http_local_rate_limit_rate_limited': 'http.local_rate_limit_rate_limited',
Expand Down Expand Up @@ -4092,6 +4113,69 @@
),
'method': 'monotonic_count',
},
'http.adaptive_concurrency.gradient_controller.rq_blocked': {
'tags': (
('stat_prefix',),
(),
(),
(),
),
'method': 'monotonic_count',
},
'http.adaptive_concurrency.gradient_controller.min_rtt_calculation_active': {
'tags': (
('stat_prefix',),
(),
(),
(),
),
'method': 'gauge',
},
'http.adaptive_concurrency.gradient_controller.concurrency_limit': {
'tags': (
('stat_prefix',),
(),
(),
(),
),
'method': 'gauge',
},
'http.adaptive_concurrency.gradient_controller.gradient': {
'tags': (
('stat_prefix',),
(),
(),
(),
),
'method': 'gauge',
},
'http.adaptive_concurrency.gradient_controller.burst_queue_size': {
'tags': (
('stat_prefix',),
(),
(),
(),
),
'method': 'gauge',
},
'http.adaptive_concurrency.gradient_controller.min_rtt_msecs': {
'tags': (
('stat_prefix',),
(),
(),
(),
),
'method': 'gauge',
},
'http.adaptive_concurrency.gradient_controller.sample_rtt_msecs': {
'tags': (
('stat_prefix',),
(),
(),
(),
),
'method': 'gauge',
},
}
# fmt: on

Expand Down
8 changes: 8 additions & 0 deletions envoy/metadata.csv
Original file line number Diff line number Diff line change
Expand Up @@ -1029,3 +1029,11 @@ envoy.tls_inspector.sni.not_found.count,count,,,,[OpenMetrics V2] Total number o
envoy.tls_inspector.bytes_processed.bucket,count,,,,[OpenMetrics V2] Records sizes which records the number of bytes the tls_inspector processed while analyzing for tls usage,0,envoy,,
envoy.tls_inspector.bytes_processed.count,count,,,,[OpenMetrics V2] Count of records sizes which records the number of bytes the tls_inspector processed while analyzing for tls usage,0,envoy,,
envoy.tls_inspector.bytes_processed.sum,count,,,,[OpenMetrics V2] Total sum of records sizes which records the number of bytes the tls_inspector processed while analyzing for tls usage,0,envoy,,
envoy.http.adaptive_concurrency.gradient_controller.rq_blocked,count,,request,,[Legacy] Total requests blocked by the adaptive concurrency filter.,-1,envoy,,
envoy.http.adaptive_concurrency.gradient_controller.rq_blocked.count,count,,request,,[OpenMetrics V2] Total requests blocked by the adaptive concurrency filter.,-1,envoy,,
envoy.http.adaptive_concurrency.gradient_controller.min_rtt_calculation_active,gauge,,,,"[OpenMetrics V2] Set to 1 if the gradient controller is in the process of a minRTT calculation, and 0 otherwise.",0,envoy,,
envoy.http.adaptive_concurrency.gradient_controller.concurrency_limit,gauge,,request,,[OpenMetrics V2] The current concurrency limit.,0,envoy,,
envoy.http.adaptive_concurrency.gradient_controller.gradient,gauge,,,,"[OpenMetrics V2] The current gradient value multiplied by 1,000.",0,envoy,,
envoy.http.adaptive_concurrency.gradient_controller.burst_queue_size,gauge,,request,,[OpenMetrics V2] The current headroom value in the concurrency limit calculation.,0,envoy,,
envoy.http.adaptive_concurrency.gradient_controller.min_rtt_msecs,gauge,,millisecond,,[OpenMetrics V2] The current measured minimum round-trip time.,0,envoy,,
envoy.http.adaptive_concurrency.gradient_controller.sample_rtt_msecs,gauge,,millisecond,,[OpenMetrics V2] The current measured sample round-trip time aggregate.,0,envoy,,
22 changes: 22 additions & 0 deletions envoy/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,28 @@

CONNECTION_LIMIT_STAT_PREFIX_TAG = 'stat_prefix:ingress_http'

ADAPTIVE_CONCURRENCY_PROMETHEUS_COUNTER_METRIC = "http.adaptive_concurrency.gradient_controller.rq_blocked.count"

ADAPTIVE_CONCURRENCY_PROMETHEUS_VALUES = {
ADAPTIVE_CONCURRENCY_PROMETHEUS_COUNTER_METRIC: 5,
"http.adaptive_concurrency.gradient_controller.min_rtt_calculation_active": 0,
"http.adaptive_concurrency.gradient_controller.concurrency_limit": 30,
"http.adaptive_concurrency.gradient_controller.gradient": 1000,
"http.adaptive_concurrency.gradient_controller.burst_queue_size": 22,
"http.adaptive_concurrency.gradient_controller.min_rtt_msecs": 100,
"http.adaptive_concurrency.gradient_controller.sample_rtt_msecs": 95,
}

ADAPTIVE_CONCURRENCY_PROMETHEUS_METRICS = list(ADAPTIVE_CONCURRENCY_PROMETHEUS_VALUES.keys())

ADAPTIVE_CONCURRENCY_PROMETHEUS_STAT_PREFIX_TAG = 'stat_prefix:ingress_http'

ADAPTIVE_CONCURRENCY_PROMETHEUS_GAUGE_VALUES = {
metric: value
for metric, value in ADAPTIVE_CONCURRENCY_PROMETHEUS_VALUES.items()
if metric != ADAPTIVE_CONCURRENCY_PROMETHEUS_COUNTER_METRIC
}

TLS_INSPECTOR_METRICS = [
"tls_inspector.client_hello_too_large.count",
"tls_inspector.tls.found.count",
Expand Down
16 changes: 16 additions & 0 deletions envoy/tests/docker/api_v2/front-envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ static_resources:
route:
cluster: service2
http_filters:
- name: envoy.filters.http.adaptive_concurrency
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.adaptive_concurrency.v3.AdaptiveConcurrency
gradient_controller_config:
sample_aggregate_percentile:
value: 90
concurrency_limit_params:
concurrency_update_interval: 0.1s
min_rtt_calc_params:
jitter:
value: 10
interval: 60s
request_count: 50
enabled:
default_value: true
runtime_key: "adaptive_concurrency.enabled"
- name: envoy.router
clusters:
- name: service1
Expand Down
16 changes: 16 additions & 0 deletions envoy/tests/docker/api_v3/front-envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,22 @@ static_resources:
grpc_service:
envoy_grpc:
cluster_name: ext-proc
- name: envoy.filters.http.adaptive_concurrency
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.adaptive_concurrency.v3.AdaptiveConcurrency
gradient_controller_config:
sample_aggregate_percentile:
value: 90
concurrency_limit_params:
concurrency_update_interval: 0.1s
min_rtt_calc_params:
jitter:
value: 10
interval: 60s
request_count: 50
enabled:
default_value: true
runtime_key: "adaptive_concurrency.enabled"
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
Expand Down
7 changes: 7 additions & 0 deletions envoy/tests/fixtures/legacy/adaptive_concurrency.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
http.ingress_http.adaptive_concurrency.gradient_controller.rq_blocked: 5
http.ingress_http.adaptive_concurrency.gradient_controller.min_rtt_calculation_active: 1
http.ingress_http.adaptive_concurrency.gradient_controller.concurrency_limit: 30
http.ingress_http.adaptive_concurrency.gradient_controller.gradient: 1000
http.ingress_http.adaptive_concurrency.gradient_controller.burst_queue_size: 22
http.ingress_http.adaptive_concurrency.gradient_controller.min_rtt_msecs: 100
http.ingress_http.adaptive_concurrency.gradient_controller.sample_rtt_msecs: 95
14 changes: 14 additions & 0 deletions envoy/tests/fixtures/openmetrics/openmetrics.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1377,3 +1377,17 @@ envoy_tls_inspector_bytes_processed_bucket{le="3600000"} 0
envoy_tls_inspector_bytes_processed_bucket{le="+Inf"} 0
envoy_tls_inspector_bytes_processed_sum{} 0
envoy_tls_inspector_bytes_processed_count{} 0
# TYPE envoy_http_adaptive_concurrency_gradient_controller_rq_blocked counter
envoy_http_adaptive_concurrency_gradient_controller_rq_blocked{envoy_http_conn_manager_prefix="ingress_http"} 5
# TYPE envoy_http_adaptive_concurrency_gradient_controller_min_rtt_calculation_active gauge
envoy_http_adaptive_concurrency_gradient_controller_min_rtt_calculation_active{envoy_http_conn_manager_prefix="ingress_http"} 0
# TYPE envoy_http_adaptive_concurrency_gradient_controller_concurrency_limit gauge
envoy_http_adaptive_concurrency_gradient_controller_concurrency_limit{envoy_http_conn_manager_prefix="ingress_http"} 30
# TYPE envoy_http_adaptive_concurrency_gradient_controller_gradient gauge
envoy_http_adaptive_concurrency_gradient_controller_gradient{envoy_http_conn_manager_prefix="ingress_http"} 1000
# TYPE envoy_http_adaptive_concurrency_gradient_controller_burst_queue_size gauge
envoy_http_adaptive_concurrency_gradient_controller_burst_queue_size{envoy_http_conn_manager_prefix="ingress_http"} 22
# TYPE envoy_http_adaptive_concurrency_gradient_controller_min_rtt_msecs gauge
envoy_http_adaptive_concurrency_gradient_controller_min_rtt_msecs{envoy_http_conn_manager_prefix="ingress_http"} 100
# TYPE envoy_http_adaptive_concurrency_gradient_controller_sample_rtt_msecs gauge
envoy_http_adaptive_concurrency_gradient_controller_sample_rtt_msecs{envoy_http_conn_manager_prefix="ingress_http"} 95
14 changes: 14 additions & 0 deletions envoy/tests/legacy/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,17 @@
]

RBAC_METRICS = RBAC_ENFORCE_METRICS + RBAC_SHADOW_METRICS

ADAPTIVE_CONCURRENCY_STAT_PREFIX_TAG = ['stat_prefix:ingress_http']

ADAPTIVE_CONCURRENCY_METRIC_VALUES = {
"envoy.http.adaptive_concurrency.gradient_controller.rq_blocked": 5,
"envoy.http.adaptive_concurrency.gradient_controller.min_rtt_calculation_active": 1,
"envoy.http.adaptive_concurrency.gradient_controller.concurrency_limit": 30,
"envoy.http.adaptive_concurrency.gradient_controller.gradient": 1000,
"envoy.http.adaptive_concurrency.gradient_controller.burst_queue_size": 22,
"envoy.http.adaptive_concurrency.gradient_controller.min_rtt_msecs": 100,
"envoy.http.adaptive_concurrency.gradient_controller.sample_rtt_msecs": 95,
}

ADAPTIVE_CONCURRENCY_METRICS = list(ADAPTIVE_CONCURRENCY_METRIC_VALUES.keys())
7 changes: 6 additions & 1 deletion envoy/tests/legacy/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from datadog_checks.dev.utils import get_metadata_metrics
from datadog_checks.envoy import Envoy

from .common import FLAVOR, HOST
from .common import ADAPTIVE_CONCURRENCY_METRICS, ADAPTIVE_CONCURRENCY_STAT_PREFIX_TAG, FLAVOR, HOST

pytestmark = [pytest.mark.e2e]

Expand Down Expand Up @@ -288,6 +288,11 @@ def test_e2e(dd_agent_check, exercise_envoy):
for metric in METRICS:
aggregator.assert_metric(metric)

for metric in ADAPTIVE_CONCURRENCY_METRICS:
aggregator.assert_metric(metric)
for tag in ADAPTIVE_CONCURRENCY_STAT_PREFIX_TAG:
aggregator.assert_metric_has_tag(metric, tag)

if FLAVOR == 'api_v2':
for metric in METRICS_V2:
aggregator.assert_metric(metric)
Expand Down
23 changes: 22 additions & 1 deletion envoy/tests/legacy/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@
from datadog_checks.dev.utils import get_metadata_metrics
from datadog_checks.envoy.metrics import METRIC_PREFIX, METRICS

from .common import ENVOY_VERSION, EXT_AUTHZ_METRICS, INSTANCES, RBAC_METRICS
from .common import (
ADAPTIVE_CONCURRENCY_METRICS,
ADAPTIVE_CONCURRENCY_STAT_PREFIX_TAG,
ENVOY_VERSION,
EXT_AUTHZ_METRICS,
INSTANCES,
RBAC_METRICS,
)

CHECK_NAME = 'envoy'
UNIQUE_METRICS = EXT_AUTHZ_METRICS + RBAC_METRICS
Expand Down Expand Up @@ -53,6 +60,20 @@ def test_success(aggregator, check, dd_run_check):
aggregator.assert_metrics_using_metadata(metadata_metrics)


def test_adaptive_concurrency_metrics(aggregator, check, dd_run_check):
instance = INSTANCES['main']
c = check(instance)
dd_run_check(c)

# Guard against a vacuous pass: the controller needs real traffic to emit stats.
assert any(metric in aggregator.metric_names for metric in ADAPTIVE_CONCURRENCY_METRICS)

for metric in ADAPTIVE_CONCURRENCY_METRICS:
aggregator.assert_metric(metric)
for tag in ADAPTIVE_CONCURRENCY_STAT_PREFIX_TAG:
aggregator.assert_metric_has_tag(metric, tag)


def test_metadata_integration(datadog_agent, check):
instance = INSTANCES['main']
c = check(instance)
Expand Down
19 changes: 19 additions & 0 deletions envoy/tests/legacy/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
from datadog_checks.envoy.metrics import METRIC_PREFIX, METRICS

from .common import (
ADAPTIVE_CONCURRENCY_METRIC_VALUES,
ADAPTIVE_CONCURRENCY_METRICS,
ADAPTIVE_CONCURRENCY_STAT_PREFIX_TAG,
CONNECTION_LIMIT_METRICS,
CONNECTION_LIMIT_STAT_PREFIX_TAG,
ENVOY_VERSION,
Expand Down Expand Up @@ -351,3 +354,19 @@ def test_connection_limit_metrics(aggregator, fixture_path, mock_http_response,
aggregator.assert_metric_has_tag(metric, tag, count=1)

aggregator.assert_metrics_using_metadata(get_metadata_metrics())


def test_adaptive_concurrency_metrics(aggregator, fixture_path, mock_http_response, check, dd_run_check):
instance = INSTANCES['main']
c = check(instance)

mock_http_response(file_path=fixture_path('./legacy/adaptive_concurrency.txt'))
dd_run_check(c)

# Pin the fixture values so a wrong mapping or metric type would be caught, not just a wrong name.
for metric in ADAPTIVE_CONCURRENCY_METRICS:
aggregator.assert_metric(metric, value=ADAPTIVE_CONCURRENCY_METRIC_VALUES[metric])
for tag in ADAPTIVE_CONCURRENCY_STAT_PREFIX_TAG:
aggregator.assert_metric_has_tag(metric, tag, count=1)

aggregator.assert_metrics_using_metadata(get_metadata_metrics())
9 changes: 8 additions & 1 deletion envoy/tests/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from datadog_checks.envoy import Envoy

from .common import (
ADAPTIVE_CONCURRENCY_PROMETHEUS_METRICS,
CONNECTION_LIMIT_METRICS,
DEFAULT_INSTANCE,
FLAKY_METRICS,
Expand All @@ -24,7 +25,13 @@
def test_e2e(dd_agent_check, exercise_envoy):
aggregator = dd_agent_check(DEFAULT_INSTANCE, rate=True)

for metric in PROMETHEUS_METRICS + LOCAL_RATE_LIMIT_METRICS + CONNECTION_LIMIT_METRICS + TLS_INSPECTOR_METRICS:
for metric in (
PROMETHEUS_METRICS
+ LOCAL_RATE_LIMIT_METRICS
+ CONNECTION_LIMIT_METRICS
+ TLS_INSPECTOR_METRICS
+ ADAPTIVE_CONCURRENCY_PROMETHEUS_METRICS
):
formatted_metric = "envoy.{}".format(metric)
if metric in FLAKY_METRICS:
aggregator.assert_metric(formatted_metric, at_least=0)
Expand Down
Loading
Loading