im using the below script to send log message(“This is a test log message”)to loki,
my doubt is , is it possible to send our own logs to loki using xk6 extention?.
if yes is this script is correct?
but it is pushing auto generated logs to loki.
kindly help me to resolve this issue
import loki from ‘k6/x/loki’;
const conf = loki.Config(“http://localhost:3100”);
const client = loki.Client(conf);
export default function () {
const msg = “This is a test log message”;
const labels = {
“label_name”: “label_value”,
“label_name_2”: “label_value_2”
};
client.push(msg, labels);
}