Hi! Consider the following queries:
max_over_time(
{job="LDCSEC12"}
| regexp `(?P<time>[^,]*),MinMaxAvg,(?P<category>[^,]*),(?P<name>[^,]*),(?P<count>[^,]*),(?P<min>[^,]*),(?P<avg>[^,]*),`
| unwrap avg [$__auto]
) by (job)
vs:
max_over_time(
{job="LDCSEC12"}
| regexp `(?P<time>[^,]*),MinMaxAvg,(?P<category>[^,]*),(?P<name>[^,]*),(?P<count>[^,]*),(?P<min>[^,]*),(?P<avg>[^,]*),`
| keep job, avg
| unwrap avg [$__auto]
)
Is there a difference between them?
I do not see any difference in the results not in execution time. Are they equivalent? Is actually keep
slightly preferred, as it removes the labels at an “earlier” (execution wise) step?