out_opentelemetry: option to exclude specific body keys from log attributes (avoid duplication with logs_*_message_key)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- c
- Área
- observability
Línea de trabajo
Start by reading log_record_set_attributes() and the handling of logs_body_key and the logs_*_message_key accessors in the OpenTelemetry output plugin. Check the related tests for body fields converted into log attributes, then determine how excluded keys should be configured and skipped. Done means mapped fields no longer appear twice while other body fields remain attributes; add coverage for that behavior.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
When logs_body_key_attributes: true is used together with a
logs_*_message_key, a record field that is mapped into a first-class
OTLP field is also emitted as a log attribute, so the same value
appears twice on the wire.
logs_body_key is the only key that gets "consumed":
log_record_set_attributes() removes it via flb_mp_accessor_keys_remove()
before the leftover body fields are converted into attributes. The
logs_trace_id_message_key, logs_severity_text_message_key and
logs_span_id_message_key accessors (and the resource accessor
$resource['attributes']) only read the field — they never remove it —
so it is swept into attributes as well.
Repro
outputs:
- name: opentelemetry
match: "*"
logs_body_key: message
logs_body_key_attributes: true
# defaults:
# logs_trace_id_message_key: $TraceId
# logs_severity_text_message_key: $SeverityText
Given a record {message, Timestamp, TraceId, SeverityText, thread, logger, filename},
the exported LogRecord is:
body= messagetrace_id=severity_text=attributes= [Timestamp, TraceId, SeverityText, thread, logger, filename, ...]
TraceId, SeverityText (and Timestamp) appear both as the first-class
field and as an attribute, inflating backend storage and surfacing as
duplicate columns.
Why logs_body_key_attributes: false is not an acceptable workaround
Setting it to false removes the duplicated attributes, but it also drops
every other field we intentionally want as attributes — e.g. thread,
logger, filename. There is no way to keep a subset:
logs_body_key: message
logs_body_key_attributes: false # also loses thread/logger/filename
We keep logs_body_key_attributes: true precisely so that those fields
are preserved as attributes, but this is what causes TraceId /
SeverityText to be re-emitted. There is no option to say
"keep attributes, but exclude these keys".
Expected
A way to prevent the mapped keys from being re-emitted as attributes,
mirroring how logs_body_key is removed — while keeping the remaining
body fields as attributes.
Proposal
Add e.g. logs_body_key_attributes_exclude (comma-separated keys) whose
entries are skipped during the leftover-attributes sweep — or let the
logs_*_message_key accessors consume their matched key when
logs_body_key_attributes: true.
Current workaround
Move the keys into metadata.otlp.* via a 5-argument Lua filter;
log_record_set_attributes() skips the otlp metadata key entirely, so
those values are not emitted as attributes. This works, but it requires a
5-arg Lua callback and per-field bookkeeping that the proposed option
would make unnecessary.
Version
Fluent Bit v5.2.0 (master)
- Lenguaje dominante
- C
- Estrellas
- 8.2k
- Forks
- 2k
- Merge medio
- 3 d 20 h
- PR fusionados (30 d)
- 99
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de fluent/fluent-bit
-
in_tail: files falsely detected as rotated on macOS with threaded inputs, causing duplicate recordsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
fluent/fluent-bit#12780 ·
Los mantenedores suelen responder en 1 día
-
status: waiting-for-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
fluent/fluent-bit#12683 · 2 comentarios · 6 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
fluent/fluent-bit#12657 ·
Los mantenedores suelen responder en 1 día
-
http: Transfer-Encoding chunked plus Content-Length hangs forever (CL branch shadows the chunked path)Posiblemente ocupada @sarankumar1325 la tomó hace 14 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
fluent/fluent-bit#12656 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
fluent/fluent-bit#12649 ·
Los mantenedores suelen responder en 1 día
Todos los issues de fluent/fluent-bit
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
micropython/micropython#19942 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 3 días
-
快速入门那里会不会对新手不太友好,提出优化方案Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
-
-disable-symbolserver is ignored on macOS/Linux: PDBs are still downloaded from msdl.microsoft.comAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100