Feature Request: Allow relativeCreated to be formatted as seconds instead of milliseconds
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- observability-sre
Research direction
Start by reading FluentRecordFormatter and Python's LogRecord relativeCreated attribute to understand how formatter fields are resolved. The feature is complete when a relativeCreatedInSeconds field can be used in the shown configuration and produces the relative creation time in seconds.
Written by the indexing model from the issue text.
Description
Python LogRecord has the attribute relativeCreated
Time in milliseconds when the LogRecord was created, relative to the time the logging module was loaded.
It's currently possible to use FluentRecordFormatter to include that in the fluent events
version: 1
formatters:
fluent_fmt:
'()': fluent.handler.FluentRecordFormatter
format:
"host.hostname": '%(hostname)s'
"host.id": '%(hostname)s'
"host.uptime": '%(relativeCreated)d'
"log.logger": '%(name)s'
"log.level": '%(levelname)s'
"log.origin.file.name": '%(pathname)s'
"log.origin.file.line": '%(lineno)d'
"log.origin.function": '%(funcName)s'
but relativeCreated is in milliseconds, it would be very convenient to be able to convert that to seconds right in FluentRecordFormatter hence this feature request, please considering allowing something like
"host.uptime": '%(relativeCreatedInSeconds)d'
were the relativeCreatedInSeconds would be something added by FluentRecordFormatter.
- Dominant language
- Python
- Stars
- 457
- Forks
- 138
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fluent/fluent-logger-python
-
support of `asctime` Open
Difficulty 3/5 1-2 days Newbie friendliness 48/100
fluent/fluent-logger-python#210 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
fluent/fluent-logger-python#196 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
fluent/fluent-logger-python#194 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
fluent/fluent-logger-python#193 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
fluent/fluent-logger-python#190 ·
All issues in fluent/fluent-logger-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
syfoud/Simulated_Scepter#172 ·
-
A cancelled tests run makes the coverage comment workflow fail and reports it as a red check on main Openarea: ci bug perceived difficulty: 3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Nitjsefnie-Harness-Commons/daedalus#921 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
EleutherAI/lm-evaluation-harness#4207 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ClickHouse/clickhouse-connect#1057 ·