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