File tree Expand file tree Collapse file tree 3 files changed +12
-8
lines changed
Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,11 @@ All notable changes to this project will be documented in this file.
44The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
55and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
66
7- ## Unreleased
8- ## Added
9- - cgroup.v2 PSI metrics are now parsed.
7+ ## [ Unreleased]
8+ ## Changed
9+ - The ` splunk_hec ` generator now only requires responses to have an ` ackId ` when
10+ ` acknowledgements ` are enabled.
11+ - cgroup.v2 PSI metrics are now parsed.
1012
1113## [ 0.25.3]
1214## Changed
Original file line number Diff line number Diff line change @@ -352,7 +352,7 @@ where
352352 counter!( "request_ok" , & status_labels) . increment( 1 ) ;
353353 let body_bytes = body. boxed( ) . collect( ) . await ?. to_bytes( ) ;
354354 let hec_ack_response =
355- serde_json:: from_slice:: <HecAckResponse >( & body_bytes) . expect( "unable to parse response body" ) ;
355+ serde_json:: from_slice:: <HecResponse >( & body_bytes) . expect( "unable to parse response body" ) ;
356356 channel. send( ready( hec_ack_response. ack_id) ) . await ?;
357357 }
358358 Err ( err) => {
@@ -376,11 +376,11 @@ where
376376
377377#[ derive( Deserialize , Serialize , Debug ) ]
378378#[ serde( deny_unknown_fields) ]
379- struct HecAckResponse {
379+ struct HecResponse {
380380 #[ allow( dead_code) ]
381381 text : String ,
382382 #[ allow( dead_code) ]
383383 code : u8 ,
384384 #[ serde( rename = "ackId" ) ]
385- ack_id : u64 ,
385+ ack_id : Option < u64 > ,
386386}
Original file line number Diff line number Diff line change @@ -54,11 +54,13 @@ impl Channel {
5454
5555 pub ( crate ) async fn send < Fut > ( & self , msg : Fut ) -> Result < ( ) , Error >
5656 where
57- Fut : Future < Output = AckId > ,
57+ Fut : Future < Output = Option < AckId > > ,
5858 {
5959 match self {
6060 Self :: NoAck { .. } => Ok ( ( ) ) ,
61- Self :: Ack { tx, .. } => Ok ( tx. send ( msg. await ) . await ?) ,
61+ Self :: Ack { tx, .. } => Ok ( tx
62+ . send ( msg. await . expect ( "acknowledgemnts enabled, should have id" ) )
63+ . await ?) ,
6264 }
6365 }
6466}
You can’t perform that action at this time.
0 commit comments