@@ -7,18 +7,16 @@ pub mod grpc_agent;
77pub mod processor;
88pub mod transform;
99
10- /// Check if the HTTP OTLP agent should be enabled.
1110#[ must_use]
12- pub fn should_enable_http ( config : & Arc < Config > ) -> bool {
11+ pub fn should_enable_otlp_http ( config : & Arc < Config > ) -> bool {
1312 config. otlp_config_traces_enabled
1413 && config
1514 . otlp_config_receiver_protocols_http_endpoint
1615 . is_some ( )
1716}
1817
19- /// Check if the gRPC OTLP agent should be enabled.
2018#[ must_use]
21- pub fn should_enable_grpc ( config : & Arc < Config > ) -> bool {
19+ pub fn should_enable_otlp_grpc ( config : & Arc < Config > ) -> bool {
2220 config. otlp_config_traces_enabled
2321 && config
2422 . otlp_config_receiver_protocols_grpc_endpoint
@@ -34,7 +32,7 @@ mod tests {
3432 use crate :: config:: get_config;
3533
3634 #[ test]
37- fn test_should_enable_http_from_yaml ( ) {
35+ fn test_should_enable_otlp_http_from_yaml ( ) {
3836 figment:: Jail :: expect_with ( |jail| {
3937 jail. clear_env ( ) ;
4038 jail. create_file (
@@ -50,15 +48,15 @@ mod tests {
5048
5149 let config = Arc :: new ( get_config ( Path :: new ( "" ) ) ) ;
5250
53- assert ! ( should_enable_http ( & config) ) ;
54- assert ! ( !should_enable_grpc ( & config) ) ;
51+ assert ! ( should_enable_otlp_http ( & config) ) ;
52+ assert ! ( !should_enable_otlp_grpc ( & config) ) ;
5553
5654 Ok ( ( ) )
5755 } ) ;
5856 }
5957
6058 #[ test]
61- fn test_should_enable_http_from_env_vars ( ) {
59+ fn test_should_enable_otlp_http_from_env_vars ( ) {
6260 figment:: Jail :: expect_with ( |jail| {
6361 jail. clear_env ( ) ;
6462 jail. set_env (
@@ -68,8 +66,8 @@ mod tests {
6866
6967 let config = Arc :: new ( get_config ( Path :: new ( "" ) ) ) ;
7068
71- assert ! ( should_enable_http ( & config) ) ;
72- assert ! ( !should_enable_grpc ( & config) ) ;
69+ assert ! ( should_enable_otlp_http ( & config) ) ;
70+ assert ! ( !should_enable_otlp_grpc ( & config) ) ;
7371
7472 Ok ( ( ) )
7573 } ) ;
@@ -87,14 +85,14 @@ mod tests {
8785
8886 let config = Arc :: new ( get_config ( Path :: new ( "" ) ) ) ;
8987
90- assert ! ( !should_enable_http ( & config) ) ;
88+ assert ! ( !should_enable_otlp_http ( & config) ) ;
9189
9290 Ok ( ( ) )
9391 } ) ;
9492 }
9593
9694 #[ test]
97- fn test_should_enable_grpc_from_env_vars ( ) {
95+ fn test_should_enable_otlp_grpc_from_env_vars ( ) {
9896 figment:: Jail :: expect_with ( |jail| {
9997 jail. clear_env ( ) ;
10098 jail. set_env (
@@ -104,8 +102,8 @@ mod tests {
104102
105103 let config = Arc :: new ( get_config ( Path :: new ( "" ) ) ) ;
106104
107- assert ! ( should_enable_grpc ( & config) ) ;
108- assert ! ( !should_enable_http ( & config) ) ;
105+ assert ! ( should_enable_otlp_grpc ( & config) ) ;
106+ assert ! ( !should_enable_otlp_http ( & config) ) ;
109107
110108 Ok ( ( ) )
111109 } ) ;
@@ -126,8 +124,8 @@ mod tests {
126124
127125 let config = Arc :: new ( get_config ( Path :: new ( "" ) ) ) ;
128126
129- assert ! ( should_enable_http ( & config) ) ;
130- assert ! ( should_enable_grpc ( & config) ) ;
127+ assert ! ( should_enable_otlp_http ( & config) ) ;
128+ assert ! ( should_enable_otlp_grpc ( & config) ) ;
131129
132130 Ok ( ( ) )
133131 } ) ;
@@ -145,7 +143,7 @@ mod tests {
145143
146144 let config = Arc :: new ( get_config ( Path :: new ( "" ) ) ) ;
147145
148- assert ! ( !should_enable_grpc ( & config) ) ;
146+ assert ! ( !should_enable_otlp_grpc ( & config) ) ;
149147
150148 Ok ( ( ) )
151149 } ) ;
0 commit comments