To allow Prometheus to scrape metrics from Fluent Bit, you need to create a Service in OpenShift.
Sample YAML file for create a Service:
apiVersion: v1
kind: Service
metadata:
name: <service-name>
namespace: <namespace>
labels:
app: <fluent-bit-pod-name>
fepclustername: <fepcluster-name>
spec:
ports:
- name: prometheus-metrics
port: 80
targetPort: 24231
protocol: TCP
selector:
app: <fluent-bit-pod-name>
name: The name of the Service.
namespace: The namespace in which this Service is deployed.
ports: Maps the Service port (`80`) to the target port (`24231`) used by Fluent Bit’s Prometheus Exporter.