elastic / elastic/integrations

[bug-hunter] AWS billing stream template misspells latency condition and ignores configured latency

Open
#18,582 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Handlebars
Stars
333
Forks
647
Avg merge
3d 4h
Merged PRs (30d)
209

Description

## Impact
Users who set the `latency` setting for AWS Billing metrics do not get that setting applied in the rendered stream config. This can cause delayed CloudWatch billing metrics to be skipped, producing incomplete billing data.

## Reproduction Steps
1. Run this minimal reproduction script from the repo root:

```bash
python - <<'PY'
from pathlib import Path
manifest = Path('packages/aws/data_stream/billing/manifest.yml').read_text()
template = Path('packages/aws/data_stream/billing/agent/stream/stream.yml.hbs').read_text()

assert 'name: latency' in manifest, 'precondition failed: latency var missing in manifest'
assert '\{\\{\#if latency}}' in template, 'BUG: stream template checks `lantency` instead of `latency`, so configured latency is ignored'
print('ok')
PY
```

2. Observe the assertion failure.

## Expected vs Actual
**Expected:** The stream template condition should use `\{\\{\#if latency}}`, so setting `latency` in policy renders `latency: ...`.

**Actual:** The template uses `\{\\{\#if lantency}}` (misspelled), so the `latency` field is never rendered even when configured.

Observed output:

```text
Traceback (most recent call last):
File "", line 6, in
AssertionError: BUG: stream template checks `lantency` instead of `latency`, so configured latency is ignored
```

## Failing Test
```python
from pathlib import Path
manifest = Path('packages/aws/data_stream/billing/manifest.yml').read_text()
template = Path('packages/aws/data_stream/billing/agent/stream/stream.yml.hbs').read_text()

assert 'name: latency' in manifest, 'precondition failed: latency var missing in manifest'
assert '\{\\{\#if latency}}' in template, 'BUG: stream template checks `lantency` instead of `latency`, so configured latency is ignored'
```

## Evidence
- `packages/aws/data_stream/billing/manifest.yml:19-24` defines `latency` as a valid stream variable.
- `packages/aws/data_stream/billing/agent/stream/stream.yml.hbs:33-35` checks `\{\\{\#if lantency}}` and then outputs `latency: \{\{latency}}`.
- Because the condition key is misspelled, configured `latency` does not pass the guard and is dropped from rendered config.

> [!NOTE]
>
> 🔒 Integrity filter blocked 14 items
>
> The following items were blocked because they don't meet the GitHub integrity level.
>
> - [#14705](https://github.com/elastic/integrations/pull/14705) `search_pull_requests`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#9106](https://github.com/elastic/integrations/pull/9106) `search_pull_requests`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#8403](https://github.com/elastic/integrations/pull/8403) `search_pull_requests`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#564](https://github.com/elastic/integrations/pull/564) `search_pull_requests`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#17771](https://github.com/elastic/integrations/issues/17771) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#16425](https://github.com/elastic/integrations/issues/16425) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#11328](https://github.com/elastic/integrations/issues/11328) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#18289](https://github.com/elastic/integrations/issues/18289) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#12390](https://github.com/elastic/integrations/issues/12390) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#10494](https://github.com/elastic/integrations/issues/10494) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#14000](https://github.com/elastic/integrations/issues/14000) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#17283](https://github.com/elastic/integrations/issues/17283) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#10104](https://github.com/elastic/integrations/issues/10104) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#13580](https://github.com/elastic/integrations/issues/13580) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
>
> To allow these resources, lower `min-integrity` in your GitHub frontmatter:
>
> ```yaml
> tools:
> github:
> min-integrity: approved # merged | approved | unapproved | none
> ```
>
>

---
[What is this?](https://ela.st/github-ai-tools) | [From workflow: Bug Hunter](https://github.com/elastic/integrations/actions/runs/24775674832)

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
> - [x] expires on Apr 29, 2026, 11:39 AM UTC

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.