mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
Add HTTP input to Fluent Bit configuration and expose port 8889 for telemetry ingestion
This commit is contained in:
@@ -23,6 +23,8 @@ export default class TelemetryIngest {
|
||||
try {
|
||||
// check header.
|
||||
|
||||
debugger;
|
||||
|
||||
let oneuptimeToken: string | undefined = req.headers[
|
||||
"x-oneuptime-token"
|
||||
] as string | undefined;
|
||||
|
||||
@@ -6,5 +6,6 @@ USER root
|
||||
EXPOSE 24224
|
||||
EXPOSE 24284
|
||||
EXPOSE 2020
|
||||
EXPOSE 8889
|
||||
|
||||
CMD ["/fluent-bit/bin/fluent-bit", "-c", "/fluent-bit/etc/fluent-bit.yaml"]
|
||||
28
FluentBit/README.md
Normal file
28
FluentBit/README.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# Fluentd
|
||||
|
||||
This guide will help you test fluent-bit logs with OneUptime.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Filuentd docker container running on your system (essentially this folder should be running).
|
||||
You can run the container using the command `npm run dev fluent-bit`
|
||||
- OneUptime account
|
||||
- OneUptime project
|
||||
- Telemetry Ingestion Key (Create one from the OneUptime dashboard, Click on More -> Project Settings -> Telemetry Ingestion Key)
|
||||
|
||||
|
||||
## Configuration and Testing
|
||||
|
||||
- Please make sure the correct token and url is in the configuration file located at `FluentBut/etc/fluent-bit.yaml`.
|
||||
- Build the docker image using the command `npm run force-build fluent-bit`
|
||||
- Run the docker image using the command `npm run dev fluent-bit`
|
||||
- Send logs to the Fluentd container using the curl command
|
||||
|
||||
```bash
|
||||
curl -X POST -H "Content-Type: application/json" -d '{"log": "This is a test log message"}' http://localhost:8889
|
||||
```
|
||||
|
||||
You should be able to see the logs in the OneUptime dashboard.
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
service:
|
||||
flush: 1
|
||||
log_level: info
|
||||
http_server: true
|
||||
http_listen: 0.0.0.0
|
||||
http_port: 2020
|
||||
|
||||
pipeline:
|
||||
inputs:
|
||||
- name: random
|
||||
- name: http
|
||||
listen: 0.0.0.0
|
||||
port: 8889
|
||||
|
||||
outputs:
|
||||
- name: stdout
|
||||
match: '*'
|
||||
match: '*'
|
||||
- name: opentelemetry
|
||||
match: '*'
|
||||
host: 'otel-collector'
|
||||
port: 4318
|
||||
header:
|
||||
- x-oneuptime-token aaa670e0-ac15-11ef-9e8b-0bf23dab1c65
|
||||
- x-oneuptime-service-name fluent-bit
|
||||
|
||||
|
||||
|
||||
@@ -88,6 +88,7 @@ class OpenTelemetryRequestMiddleware {
|
||||
}
|
||||
productType = ProductType.Traces;
|
||||
} else if (req.url.includes("/otlp/v1/logs")) {
|
||||
debugger;
|
||||
if (isProtobuf) {
|
||||
req.body = LogsData.decode(req.body);
|
||||
}
|
||||
|
||||
@@ -430,6 +430,7 @@ services:
|
||||
- 24225:24224
|
||||
- 24285:24284
|
||||
- 2020:2020
|
||||
- 8889:8889
|
||||
extends:
|
||||
file: ./docker-compose.base.yml
|
||||
service: fluent-bit
|
||||
|
||||
Reference in New Issue
Block a user