File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed 
exporters/aws-otel-otlp-udp-exporter/src/amazon/opentelemetry/exporters/otlp/udp Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 11# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 
22# SPDX-License-Identifier: Apache-2.0 
3+ import  os 
34import  base64 
45import  socket 
56from  logging  import  Logger , getLogger 
2930
3031class  UdpExporter :
3132    def  __init__ (self , endpoint : Optional [str ] =  None ):
33+         if  endpoint  is  None  and  "AWS_LAMBDA_FUNCTION_NAME"  in  os .environ :
34+             # If in an AWS Lambda Environment, `AWS_XRAY_DAEMON_ADDRESS` will be defined 
35+             endpoint  =  os .environ .get ("AWS_XRAY_DAEMON_ADDRESS" , DEFAULT_ENDPOINT )
36+ 
3237        self ._endpoint  =  endpoint  or  DEFAULT_ENDPOINT 
3338        self ._host , self ._port  =  self ._parse_endpoint (self ._endpoint )
3439        self ._socket  =  socket .socket (socket .AF_INET , socket .SOCK_DGRAM )
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments