-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FluentBit - Collector - Loki : Failed to transform logs into Loki log streams #16368
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This is happening because there are no labels for the items that were exported. I see you had two batches, one with 1000 records and one with 829. Only the smaller batch seems to have failed. Perhaps that one didn't contain the expected log attributes? The Loki exporter has been changed recently to export data even if no labels exist. This requires configuring the exporter in a slightly different way, like the following: receivers:
otlp:
protocols:
grpc:
http:
fluentforward:
endpoint: 0.0.0.0:24224
processors:
attributes:
actions:
- action: insert
key: loki.attribute.labels
value: [container_name, container_id]
resource:
attributes:
- action: insert
key: collector.name
value: "${KUBE_POD_NAME}"
batch:
send_batch_max_size: 1000
timeout: 15s
send_batch_size : 800
# Data sources: traces, metrics, logs
memory_limiter:
limit_percentage: 90
spike_limit_percentage: 30
check_interval: 5s
exporters:
logging:
loglevel: info
# https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/lokiexporter/README.md
loki:
endpoint: http://loki-gateway.logging.svc.cluster.local:80/loki/api/v1/push
headers:
X-Scope-OrgID: homelab
tls:
insecure: true
extensions:
health_check:
memory_ballast:
size_in_percentage: 20
pprof:
endpoint: :1888
zpages:
endpoint: :55679
service:
telemetry:
logs:
level: info
metrics:
level: detailed
address: 0.0.0.0:8888
extensions:
- health_check
- memory_ballast
- pprof
- zpages
pipelines:
logs:
receivers:
- fluentforward
# - otlp
processors:
- batch
- memory_limiter
- resource
# - attributes
exporters:
- logging
- loki With your current configuration, you see this in the logs:
With the new configuration, you should see something different. Note that we do NOT encourage you to use trace IDs in labels, as those are inherently high cardinality and go against the best practices for Loki. We have removed native ways of setting this value. |
cc @mar4uk |
Thanks @jpkrohling i will try This configuration |
thanks @jpkrohling it works now :
I've got another problem/question : in Loki, i can choose only one filter : |
You'd have to add a hint with the attributes to be promoted to labels:
After that, add it to the pipeline:
For more details on this, refer to the readme part of the Loki exporter. I'm closing this, but feel free if you think the original problem hasn't been addressed. |
Component(s)
exporter/loki, receiver/fluentforward
What happened?
Description
I deploy on a Kubernetes cluster FluentBit, OpenTelemetry Collector and Loki. It seems i can't send logs to Loki
Steps to Reproduce
Expected Result
Actual Result
With debug output :
Configuration :
Collector version
0.64.0
Environment information
Environment
OS: (e.g., "Ubuntu 20.04") Kubernetes 1.22
Compiler(if manually compiled): (e.g., "go 14.2")
OpenTelemetry Collector configuration
Log output
Additional context
No response
The text was updated successfully, but these errors were encountered: