elastic / elastic/integrations

[bug-hunter] jaeger_input_otel allows an empty protocols block when all toggles are disabled

Open
#18,853 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 can configure `jaeger_input_otel` so that all Jaeger protocol toggles are disabled, but the template still renders a `jaeger` receiver with an empty `protocols` block. This produces a non-functional Jaeger receiver configuration while package text says at least one protocol must be enabled.

## Reproduction Steps
1. From repo root, create an isolated venv and install tiny render deps:
```bash
python3 -m venv /tmp/gh-aw/agent/jaeger-repro-venv
/tmp/gh-aw/agent/jaeger-repro-venv/bin/pip install --quiet pybars3 pyyaml
```
2. Run this new minimal repro script:
```bash
/tmp/gh-aw/agent/jaeger-repro-venv/bin/python - <<'PY'
from pathlib import Path
from pybars import Compiler
import yaml, sys

template = Path('packages/jaeger_input_otel/agent/input/input.yml.hbs').read_text()
ctx = {
'grpc_enabled': False,
'grpc_endpoint': 'localhost:14250',
'thrift_http_enabled': False,
'thrift_http_endpoint': 'localhost:14268',
'thrift_compact_enabled': False,
'thrift_compact_endpoint': 'localhost:6831',
'thrift_binary_enabled': False,
'thrift_binary_endpoint': 'localhost:6832',
'udp_queue_size': 1000,
'udp_max_packet_size': 65000,
'udp_workers': 10,
'udp_socket_buffer_size': 0,
'tls_enabled': False,
'tls_cert_file': '',
'tls_key_file': '',
'tls_client_ca_file': '',
}

rendered = Compiler().compile(template)(ctx)
config = yaml.safe_load(rendered)
protocols = (((config or {}).get('receivers') or {}).get('jaeger') or {}).get('protocols')
print('Rendered protocols:', protocols)
if protocols:
print('PASS')
sys.exit(0)
print('FAIL: no Jaeger protocols are configured even though package description says at least one must be enabled')
sys.exit(1)
PY
```

## Expected vs Actual
**Expected:** policy rendering/enforcement should prevent zero-protocol Jaeger configuration (at least one of gRPC / Thrift HTTP / Thrift compact / Thrift binary enabled).

**Actual:** rendering succeeds with an empty `protocols` section:
```yaml
receivers:
jaeger:
protocols:

service:
pipelines:
traces:
receivers: [jaeger]
```
and the repro exits with:
```text
Rendered protocols: None
FAIL: no Jaeger protocols are configured even though package description says at least one must be enabled
```

## Failing Test
```python
from pathlib import Path
from pybars import Compiler
import yaml, sys

template = Path('packages/jaeger_input_otel/agent/input/input.yml.hbs').read_text()
ctx = {
'grpc_enabled': False,
'grpc_endpoint': 'localhost:14250',
'thrift_http_enabled': False,
'thrift_http_endpoint': 'localhost:14268',
'thrift_compact_enabled': False,
'thrift_compact_endpoint': 'localhost:6831',
'thrift_binary_enabled': False,
'thrift_binary_endpoint': 'localhost:6832',
'udp_queue_size': 1000,
'udp_max_packet_size': 65000,
'udp_workers': 10,
'udp_socket_buffer_size': 0,
'tls_enabled': False,
'tls_cert_file': '',
'tls_key_file': '',
'tls_client_ca_file': '',
}

rendered = Compiler().compile(template)(ctx)
config = yaml.safe_load(rendered)
protocols = (((config or {}).get('receivers') or {}).get('jaeger') or {}).get('protocols')
assert protocols, 'Expected at least one Jaeger protocol, got none'
```

## Evidence
- `packages/jaeger_input_otel/manifest.yml:7` says: "Enable only the protocols you need; at least one must be enabled."
- `packages/jaeger_input_otel/manifest.yml:30-75` defines all four protocol toggles as optional booleans.
- `packages/jaeger_input_otel/agent/input/input.yml.hbs:4-43` conditionally emits each protocol block, with no guard/fallback for all-disabled state.
- Duplicate check: searched existing issues for `jaeger_input_otel` + protocol-empty variants and found no matching open issue.

> [!NOTE]
>
> 🔒 Integrity filter blocked 1 item
>
> The following item were blocked because they don't meet the GitHub integrity level.
>
> - [#17231](https://github.com/elastic/integrations/pull/17231) `search_pull_requests`: 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/25432832335)

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
> - [x] expires on May 13, 2026, 11:51 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.