Skip to content

Commit

Permalink
Add firstPartyHosts for giraffe and octopus
Browse files Browse the repository at this point in the history
  • Loading branch information
StylianosGakis committed Oct 13, 2023
1 parent 4cac7d2 commit bfbf629
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ private val networkModule = module {
factory<OkHttpClient.Builder> {
val languageService = get<LanguageService>()
val builder: OkHttpClient.Builder = OkHttpClient.Builder()
.addDatadogConfiguration()
.addDatadogConfiguration(get<HedvigBuildConstants>())
.addInterceptor(get<AuthTokenRefreshingInterceptor>())
.addInterceptor { chain ->
chain.proceed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@ package com.hedvig.android.datadog.core

import com.datadog.android.DatadogEventListener
import com.datadog.android.DatadogInterceptor
import com.hedvig.android.code.buildoconstants.HedvigBuildConstants
import okhttp3.OkHttpClient

fun OkHttpClient.Builder.addDatadogConfiguration(): OkHttpClient.Builder {
return addInterceptor(DatadogInterceptor())
fun OkHttpClient.Builder.addDatadogConfiguration(
hedvigBuildConstants: HedvigBuildConstants,
): OkHttpClient.Builder {
return this
.eventListenerFactory(DatadogEventListener.Factory())
.addInterceptor(
DatadogInterceptor(
firstPartyHosts = listOf(
hedvigBuildConstants.urlGiraffeGraphql,
hedvigBuildConstants.urlGraphqlOctopus,
),
),
)
}

0 comments on commit bfbf629

Please sign in to comment.