adding push path to the url contacted by lokiwritter.Write

This commit is contained in:
pb 2024-07-25 12:35:14 +02:00
parent 6f6cb7c489
commit 2891dc8a68

View File

@ -76,7 +76,7 @@ func (w *LokiWriter) Write(p []byte) (n int, err error) {
//fmt.Printf("Sending payload to Loki: %s\n", string(payloadBytes)) //fmt.Printf("Sending payload to Loki: %s\n", string(payloadBytes))
req, err := http.NewRequest("POST", w.url, bytes.NewReader(payloadBytes)) req, err := http.NewRequest("POST", w.url + "/loki/api/v1/push", bytes.NewReader(payloadBytes))
if err != nil { if err != nil {
return 0, fmt.Errorf("failed to create HTTP request: %w", err) return 0, fmt.Errorf("failed to create HTTP request: %w", err)
} }