elastic / elastic/integrations
[bug-hunter] agentless_hello_world HTTPJSON stream always reports status_code as 200
- Dominant language
- Handlebars
- Stars
- 333
- Forks
- 647
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 209
Description
## Impact
Users of the `agentless_hello_world` HTTPJSON input get incorrect `http.response.status_code` values. Failures from the upstream endpoint (4xx/5xx) are masked as `200`, which hides outages/auth errors and breaks observability for this sample integration.
## Reproduction Steps
1. Run this script from the repository root:
```python
from pathlib import Path
import yaml,sys
cfg_path = Path('packages/agentless_hello_world/data_stream/generic/agent/stream/httpjson.yml.hbs')
config = yaml.safe_load(cfg_path.read_text())
transforms = config['response.transforms']
# Simulate an event produced from an upstream HTTP 503 response.
event = {'body': {'http': {'response': {'status_code': 503}}}}
def set_path(obj, path, value):
parts = path.split('.')
cur = obj
for p in parts[:-1]:
cur = cur.setdefault(p, {})
cur[parts[-1]] = value
for t in transforms:
if 'set' in t:
s = t['set']
set_path(event, s['target'], s['value'])
expected = 503
actual = event['body']['http']['response']['status_code']
print(f'Expected status_code to remain upstream value {expected}; actual {actual}')
if actual != expected:
print('FAIL: transform overwrites real HTTP status with constant 200')
sys.exit(1)
print('PASS')
```
2. Observe output:
```text
Expected status_code to remain upstream value 503; actual 200
FAIL: transform overwrites real HTTP status with constant 200
```
## Expected vs Actual
**Expected:** `http.response.status_code` should reflect the real upstream HTTP response code.
**Actual:** the HTTPJSON stream forcibly sets `http.response.status_code` to `200`.
## Failing Test
```python
from pathlib import Path
import yaml,sys
cfg_path = Path('packages/agentless_hello_world/data_stream/generic/agent/stream/httpjson.yml.hbs')
config = yaml.safe_load(cfg_path.read_text())
transforms = config['response.transforms']
event = {'body': {'http': {'response': {'status_code': 503}}}}
def set_path(obj, path, value):
parts = path.split('.')
cur = obj
for p in parts[:-1]:
cur = cur.setdefault(p, {})
cur[parts[-1]] = value
for t in transforms:
if 'set' in t:
s = t['set']
set_path(event, s['target'], s['value'])
assert event['body']['http']['response']['status_code'] == 503
```
## Evidence
- Hardcoded value in HTTPJSON stream template:
- `packages/agentless_hello_world/data_stream/generic/agent/stream/httpjson.yml.hbs#L7-L10`
- `target: body.http.response.status_code`
- `value: 200`
- CEL stream in same package uses actual runtime response code:
- `packages/agentless_hello_world/data_stream/generic/agent/stream/cel.yml.hbs#L17-L20`
- `"status_code": resp.StatusCode`
- Package docs describe `status_code` as HTTP response status code:
- `packages/agentless_hello_world/docs/README.md#L30-L32`
---
[What is this?](https://ela.st/github-ai-tools) | [From workflow: Bug Hunter](https://github.com/elastic/integrations/actions/runs/25668925293)
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
> - [x] expires on May 18, 2026, 12:15 PM UTC
Contributor guide
Assessment
This issue has not been assessed yet.