File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -879,6 +879,15 @@ mod tests {
879879 assert ! ( err. contains( "drop" ) , "unexpected error: {}" , err) ;
880880 }
881881
882+ #[ test]
883+ fn metric_drop_labels_ignore_line_format ( ) {
884+ let expr = LogqlParser
885+ . parse ( "{job=\" api\" } | line_format \" {{.message}}\" " )
886+ . unwrap ( ) ;
887+ let drops = expr. pipeline . metric_drop_labels ( ) . unwrap ( ) ;
888+ assert ! ( drops. is_empty( ) ) ;
889+ }
890+
882891 #[ test]
883892 fn duration_literal_with_multiple_segments ( ) {
884893 let value = DurationValue :: parse_literal ( "1h30m15s" ) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ impl Pipeline {
3636 for stage in & self . stages {
3737 match stage {
3838 PipelineStage :: Drop ( stage) => labels. extend ( stage. targets . iter ( ) . cloned ( ) ) ,
39+ PipelineStage :: LineFormat ( _) => {
40+ continue ;
41+ }
3942 _ => {
4043 return Err (
4144 "metric queries only support `drop` stages inside the selector pipeline"
You can’t perform that action at this time.
0 commit comments