File tree 3 files changed +12
-8
lines changed
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.
4
4
The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
5
5
and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
6
6
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.
10
12
11
13
## [ 0.25.3]
12
14
## Changed
Original file line number Diff line number Diff line change @@ -352,7 +352,7 @@ where
352
352
counter!( "request_ok" , & status_labels) . increment( 1 ) ;
353
353
let body_bytes = body. boxed( ) . collect( ) . await ?. to_bytes( ) ;
354
354
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" ) ;
356
356
channel. send( ready( hec_ack_response. ack_id) ) . await ?;
357
357
}
358
358
Err ( err) => {
@@ -376,11 +376,11 @@ where
376
376
377
377
#[ derive( Deserialize , Serialize , Debug ) ]
378
378
#[ serde( deny_unknown_fields) ]
379
- struct HecAckResponse {
379
+ struct HecResponse {
380
380
#[ allow( dead_code) ]
381
381
text : String ,
382
382
#[ allow( dead_code) ]
383
383
code : u8 ,
384
384
#[ serde( rename = "ackId" ) ]
385
- ack_id : u64 ,
385
+ ack_id : Option < u64 > ,
386
386
}
Original file line number Diff line number Diff line change @@ -54,11 +54,13 @@ impl Channel {
54
54
55
55
pub ( crate ) async fn send < Fut > ( & self , msg : Fut ) -> Result < ( ) , Error >
56
56
where
57
- Fut : Future < Output = AckId > ,
57
+ Fut : Future < Output = Option < AckId > > ,
58
58
{
59
59
match self {
60
60
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 ?) ,
62
64
}
63
65
}
64
66
}
You can’t perform that action at this time.
0 commit comments