File tree Expand file tree Collapse file tree 4 files changed +27
-5
lines changed 
tests/sentry/core/endpoints Expand file tree Collapse file tree 4 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ class DSN(TypedDict):
2828    crons : str 
2929    cdn : str 
3030    playstation : str 
31+     integration : str 
3132    otlp_traces : str 
3233    otlp_logs : str 
3334
@@ -98,6 +99,7 @@ def serialize(
9899                "crons" : obj .crons_endpoint ,
99100                "cdn" : obj .js_sdk_loader_cdn_url ,
100101                "playstation" : obj .playstation_endpoint ,
102+                 "integration" : obj .integration_endpoint ,
101103                "otlp_traces" : obj .otlp_traces_endpoint ,
102104                "otlp_logs" : obj .otlp_logs_endpoint ,
103105            },
Original file line number Diff line number Diff line change 1818        "security" : "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/security/?sentry_key=a785682ddda719b7a8a4011110d75598" ,
1919        "minidump" : "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/minidump/?sentry_key=a785682ddda719b7a8a4011110d75598" ,
2020        "playstation" : "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/playstation/?sentry_key=a785682ddda719b7a8a4011110d75598" ,
21+         "integration" : "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/integration/" ,
2122        "otlp_traces" : "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/integration/otlp/v1/traces" ,
2223        "otlp_logs" : "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/integration/otlp/v1/logs" ,
2324        "nel" : "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/nel/?sentry_key=a785682ddda719b7a8a4011110d75598" ,
Original file line number Diff line number Diff line change @@ -266,16 +266,20 @@ def playstation_endpoint(self):
266266        return  f"{ endpoint } { self .project_id } { self .public_key }  
267267
268268    @property  
269-     def  otlp_traces_endpoint (self ):
269+     def  integration_endpoint (self ):
270270        endpoint  =  self .get_endpoint ()
271+         return  f"{ endpoint } { self .project_id }  
271272
272-         return  f"{ endpoint } { self .project_id }  
273+     def  build_integration_endpoint (self , integration_name : str , postfix : str  =  "" ) ->  str :
274+         return  f"{ self .integration_endpoint } { integration_name } { postfix }  
273275
274276    @property  
275-     def  otlp_logs_endpoint (self ):
276-         endpoint   =   self .get_endpoint ( )
277+     def  otlp_traces_endpoint (self ):
278+         return   self .build_integration_endpoint ( "otlp" ,  "v1/traces" )
277279
278-         return  f"{ endpoint } { self .project_id }  
280+     @property  
281+     def  otlp_logs_endpoint (self ):
282+         return  self .build_integration_endpoint ("otlp" , "v1/logs" )
279283
280284    @property  
281285    def  unreal_endpoint (self ) ->  str :
Original file line number Diff line number Diff line change @@ -40,6 +40,21 @@ def test_playstation_dsn(self) -> None:
4040        assert  response .status_code  ==  200 
4141        assert  response .data [0 ]["dsn" ]["playstation" ] ==  key .playstation_endpoint 
4242
43+     def  test_integration_endpoint (self ) ->  None :
44+         project  =  self .create_project ()
45+         key  =  ProjectKey .objects .get_or_create (project = project )[0 ]
46+         self .login_as (user = self .user )
47+         url  =  reverse (
48+             "sentry-api-0-project-keys" ,
49+             kwargs = {
50+                 "organization_id_or_slug" : project .organization .slug ,
51+                 "project_id_or_slug" : project .slug ,
52+             },
53+         )
54+         response  =  self .client .get (url )
55+         assert  response .status_code  ==  200 
56+         assert  response .data [0 ]["dsn" ]["integration" ] ==  key .integration_endpoint 
57+ 
4358    def  test_otlp_traces_endpoint (self ) ->  None :
4459        project  =  self .create_project ()
4560        key  =  ProjectKey .objects .get_or_create (project = project )[0 ]
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments