Open titaneric opened 1 month ago
Update here:
I have tried the replace
stage in log.process
component, and replace the event_data_name
with parsed URL path. As as result, I could adopt the logfmt
stage successfully since the paramater is removed from the event_data_name
.
loki.process "parse" {
stage.replace {
expression = "event_data_name=\"(?P<extracted_event_url>[^\"]+)\""
replace = "{{ index (urlParse .Value) \"path\" }}"
}
stage.logfmt {
mapping = {
"app_name" = "",
"app_version" = "",
"app_environment" = "",
}
}
stage.labels {
values = {
app_name = "",
app_version = "",
app_environment = "",
}
}
forward_to = [loki.echo.example.receiver]
}
loki.echo "example" {
}
I think this is a workaround solution, and I really want I could configure the json
log format for faro.receiver
.
Update again:
I have updated Grafana Alloy to v1.3.0
, and I could adopt logfmt
stage directly for performance resource log.
Request
Present log format for
faro.receiver
component islogfmt
, which is fixed and not consistent toformat
setting inlogging
configuration block.I want to request a new option to set the log format for
faro.receiver
, either define infaro.receiver
component orfaro.receiver
component could send the consistent log format in thelogging
block.Use case
Faro v1.4.0 introduces the performance metrics to send
event
type tofaro.receiver.
.The request payload is similar to the following one.
faro.receiver
would digest the events and serialize them withlogfmt
, similar to the following one.Here comes the issue, since
event_data_name="https://test-domain.com/?_rsc=1nmqd"
would have the paramaters, and it has the equal sign (=
) inside the url. If I adoptlog.process
to pre-process the log with the following component, I would have the error.The error is
The position 442 is EXACTLY the position of equal sign in the
event_data_name
label.I want to pre-process the
event_data_name
label and remove the domain name and parametes, replace the GET single resource path (e.g.,/post/xxxx
) with/post/*
, and adopt logql to demonstrate the query Loki datasource on Grafana.Hope the use case is clear enough.