elastic / elastic/connectors

using `--filebeat` skips the first logs

Open
#897 0 comments 0 reactions 0 assignees View on GitHub
bug effort:low general good first issue priority:low
Dominant language
Python
Stars
133
Forks
205
Avg merge
16h 3m
Merged PRs (30d)
102

Description

when you run with `--filebeat` the service will still emit a few lines in plain text before it starts spitting proper JSON

```
% bin/elastic-ingest --filebeat
[FMWK][10:31:29][INFO] Running connector service version 8.9.0.0
[FMWK][10:31:29][INFO] Loading config from /Users/tarekziade/Dev/connectors-python/connectors/../config.yml
{"@timestamp":"2023-05-10T17:31:29.188Z","log.level":"info","message":"Preflight checks...","ecs":{"version":"1.6.0"},"labels":{"index_date":"2023.05.10"},"log":{"logger":"connectors","origin":{"file":{"line":37,"name":"preflight_check.py"},"function":"run"},"original":"Preflight checks..."},"process":{"name":"MainProcess","pid":86910,"thread":{"id":140704442393408,"name":"MainThread"}},"service":{"type":"connectors-python","version":"8.9.0.0"}}
[..]
```

We should make sure the logger is activated before the first log line is emited

Contributor guide

Open the contributing guide

Research direction

Start by running `bin/elastic-ingest --filebeat` and tracing startup from that entry point to where the logger is activated. Confirm which messages appear before JSON logging begins; done means the first emitted log lines use the expected JSON format without the plain-text preamble.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.