@@ -26,6 +26,7 @@ const axiomValidationSchema = Yup.object().shape({
2626 value : Yup . string ( ) . required ( "Value is required" ) ,
2727 } ) ,
2828 ) ,
29+ ingestUrl : Yup . string ( ) ,
2930} ) ;
3031
3132type Unpacked < T > = T extends ( infer U ) [ ] ? U : never ;
@@ -45,19 +46,22 @@ export function AxiomConfigurationForm({
4546 apiKey : string ;
4647 attributes : Unpacked < AxiomConfig [ "attributes" ] > [ ] ;
4748 version : "1" | "2" ;
49+ ingestUrl : string ;
4850 } > ( {
4951 initialValues : {
5052 datasetName : existingConfig ?. datasetName ?? "" ,
5153 apiKey : existingConfig ?. apiKey ?? "" ,
5254 attributes : existingConfig ?. attributes ?? [ ] ,
5355 version : existingConfig !== null ? ( existingConfig . version ?? "1" ) : "2" ,
56+ ingestUrl : existingConfig ?. ingestUrl ?? "https://api.axiom.co" ,
5457 } ,
5558 onSubmit : async ( values ) => {
5659 await createAxiomIntegration (
5760 values . datasetName ,
5861 values . apiKey ,
5962 values . attributes ,
6063 values . version ,
64+ values . ingestUrl ,
6165 ) ;
6266 onClose ( ) ;
6367 } ,
@@ -66,6 +70,15 @@ export function AxiomConfigurationForm({
6670
6771 const [ showApiKey , setShowApiKey ] = useState ( false ) ;
6872
73+ const regionOptions = [
74+ { value : "https://api.axiom.co" , label : "Default" } ,
75+ { value : "https://us-east-1.aws.edge.axiom.co" , label : "US East 1 (AWS)" } ,
76+ {
77+ value : "https://eu-central-1.aws.edge.axiom.co" ,
78+ label : "EU Central 1 (AWS)" ,
79+ } ,
80+ ] ;
81+
6982 return (
7083 < form onSubmit = { formState . handleSubmit } className = "flex flex-col gap-3" >
7184 { isUsingLegacyFormat && (
@@ -98,13 +111,31 @@ export function AxiomConfigurationForm({
98111 />
99112 </ >
100113 ) }
114+ < div className = "flex flex-col gap-1" >
115+ < Combobox
116+ label = "Region"
117+ labelHidden = { false }
118+ disableSearch
119+ options = { regionOptions }
120+ selectedOption = { formState . values . ingestUrl }
121+ setSelectedOption = { async ( v ) => {
122+ await formState . setFieldValue ( "ingestUrl" , v , false ) ;
123+ } }
124+ allowCustomValue = { false }
125+ />
126+ < p className = "max-w-prose animate-fadeInFromLoading text-xs text-content-secondary" >
127+ Select the region where your Axiom organization is located. This will
128+ determine the URL used to send events to Axiom.
129+ </ p >
130+ </ div >
131+
101132 < TextInput
102133 value = { formState . values . datasetName }
103134 onChange = { formState . handleChange }
104135 label = "Dataset Name"
105136 id = "datasetName"
106137 error = { formState . errors . datasetName }
107- description = "Name of the dataset in Axiom. This is where the logs will be sent ."
138+ description = "Name of the dataset in your Axiom organization . This needs to be an existing dataset, or the configuration will fail ."
108139 />
109140 < TextInput
110141 label = "API Key"
0 commit comments