-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DT-732 AWS X-Ray tracing via OpenTelemetry
- Loading branch information
1 parent
9a5217e
commit 9207645
Showing
28 changed files
with
446 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
LDAP_AUTH_SERVICE_USER_PASSWORD=Get from auth-service-ldap-user-password-test in Secrets Manager | ||
# AZ_SSO_CLIENTS_JSON=[{"internalId":"dev","azTenantId":"example","azClientId":"example","azClientSecret":""}] | ||
|
||
# Set to enable Telemetry, uploading traces to AWS X-Ray via OTel collector | ||
# Run `docker compose --profile tracing up` after filling this in | ||
# AUTH_TELEMETRY_PREFIX=local | ||
# AWS_ACCESS_KEY_ID=User with AWSXRayDaemonWriteAccess | ||
# AWS_SECRET_ACCESS_KEY= | ||
# AWS_REGION=eu-west-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
auth-service/src/main/kotlin/uk/gov/communities/delta/auth/config/TracingConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package uk.gov.communities.delta.auth.config | ||
|
||
import org.slf4j.spi.LoggingEventBuilder | ||
|
||
class TracingConfig(val prefix: String?) { | ||
companion object { | ||
fun fromEnv(): TracingConfig { | ||
val prefix = Env.getEnv("AUTH_TELEMETRY_PREFIX") | ||
return TracingConfig(if (prefix.isNullOrEmpty()) null else prefix) | ||
} | ||
} | ||
|
||
val enabled = prefix != null | ||
val serviceName = if (prefix != null) "$prefix-auth-service" else null | ||
|
||
fun log(logger: LoggingEventBuilder) { | ||
logger | ||
.addKeyValue("TracingEnabled", enabled).addKeyValue("TelemetryServiceName", serviceName) | ||
.log("Tracing config") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.