telemetry_rust/middleware/aws/operations/
firehose.rs1use crate::{KeyValue, StringValue, semconv};
5
6use super::*;
7
8pub enum FirehoseSpanBuilder {}
14
15impl AwsSpanBuilder<'_> {
16 pub fn firehose(
27 operation_kind: MessagingOperationKind,
28 method: impl Into<StringValue>,
29 stream_name: Option<impl Into<StringValue>>,
30 ) -> Self {
31 let mut attributes = vec![
32 KeyValue::new(semconv::MESSAGING_SYSTEM, "aws_firehose"),
33 KeyValue::new(semconv::MESSAGING_OPERATION_TYPE, operation_kind.as_str()),
34 ];
35 if let Some(stream_name) = stream_name {
36 attributes.push(KeyValue::new(
37 semconv::MESSAGING_DESTINATION_NAME,
38 stream_name.into(),
39 ))
40 }
41 Self::new(operation_kind.into(), "Firehose", method, attributes)
42 }
43}
44
45macro_rules! firehose_global_operation {
46 ($op: ident) => {
47 impl FirehoseSpanBuilder {
48 #[doc = concat!("Creates a span builder for the Firehose ", stringify!($op), " global operation.")]
49 #[inline]
50 pub fn $op<'a>() -> AwsSpanBuilder<'a> {
51 AwsSpanBuilder::firehose(
52 MessagingOperationKind::Control,
53 stringify_camel!($op),
54 None::<StringValue>,
55 )
56 }
57 }
58 };
59}
60
61macro_rules! firehose_publish_operation {
62 ($op: ident, $kind: expr) => {
63 impl FirehoseSpanBuilder {
64 #[doc = concat!("Creates a span builder for the Firehose ", stringify!($op), " operation.")]
65 pub fn $op<'a>(stream_name: impl Into<StringValue>) -> AwsSpanBuilder<'a> {
70 AwsSpanBuilder::firehose($kind, stringify_camel!($op), Some(stream_name))
71 }
72 }
73 };
74}
75
76macro_rules! firehose_stream_operation {
77 ($op: ident) => {
78 impl FirehoseSpanBuilder {
79 #[doc = concat!("Creates a span builder for the Firehose ", stringify!($op), " stream operation.")]
80 pub fn $op<'a>(stream_name: impl Into<StringValue>) -> AwsSpanBuilder<'a> {
85 AwsSpanBuilder::firehose(
86 MessagingOperationKind::Control,
87 stringify_camel!($op),
88 Some(stream_name),
89 )
90 }
91 }
92 };
93}
94
95firehose_publish_operation!(put_record, MessagingOperationKind::Create);
97firehose_publish_operation!(put_record_batch, MessagingOperationKind::Send);
98
99firehose_global_operation!(list_delivery_streams);
101
102firehose_stream_operation!(create_delivery_stream);
104firehose_stream_operation!(delete_delivery_stream);
105firehose_stream_operation!(describe_delivery_stream);
106firehose_stream_operation!(list_tags_for_delivery_stream);
107firehose_stream_operation!(start_delivery_stream_encryption);
108firehose_stream_operation!(stop_delivery_stream_encryption);
109firehose_stream_operation!(tag_delivery_stream);
110firehose_stream_operation!(untag_delivery_stream);
111firehose_stream_operation!(update_destination);