Skip to content

Commit

Permalink
fix(application-insight.json): configured the right json file for Azu…
Browse files Browse the repository at this point in the history
…re AI
  • Loading branch information
jacopocarlini committed Sep 26, 2024
1 parent 2d8dd5d commit b57a262
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
22 changes: 15 additions & 7 deletions docker/applicationinsights.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,20 @@
"level": "INFO"
},
"sampling": {
"percentage": 5,
"overrides": [
{
"telemetryType": "exception",
"percentage": 100
}
]
"requestsPerSecond": 5
},
"preview": {
"sampling": {
"overrides": [
{
"telemetryKind": "request",
"percentage": 100
},
{
"telemetryKind": "exception",
"percentage": 100
}
]
}
}
}
13 changes: 8 additions & 5 deletions docker/run_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,27 @@ if test -f "$FILE"; then
rm .env
fi
config=$(yq -r '."microservice-chart".envConfig' ../helm/values-$ENV.yaml)
for line in $(echo $config | jq -r '. | to_entries[] | select(.key) | "\(.key)=\(.value)"'); do
echo $line >> .env
IFS=$'\n'
for line in $(echo "$config" | yq -r '. | to_entries[] | select(.key) | "\(.key)=\(.value)"'); do
echo "$line" >> .env
done

keyvault=$(yq -r '."microservice-chart".keyvault.name' ../helm/values-$ENV.yaml)
secret=$(yq -r '."microservice-chart".envSecret' ../helm/values-$ENV.yaml)
for line in $(echo $secret | jq -r '. | to_entries[] | select(.key) | "\(.key)=\(.value)"'); do
for line in $(echo "$secret" | yq -r '. | to_entries[] | select(.key) | "\(.key)=\(.value)"'); do
IFS='=' read -r -a array <<< "$line"
response=$(az keyvault secret show --vault-name $keyvault --name "${array[1]}")
value=$(echo $response | jq -r '.value')
response=$(echo "$response" | tr -d '\n')
value=$(echo "$response" | yq -r '.value')
value=$(echo "$value" | sed 's/\$/\$\$/g')
value=$(echo "$value" | tr -d '\n')
echo "${array[0]}=$value" >> .env
done


stack_name=$(cd .. && basename "$PWD")
docker compose -p "${stack_name}" up -d --remove-orphans --force-recreate --build


# waiting the containers
printf 'Waiting for the service'
attempt_counter=0
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@
</exclusions>
</dependency>

<!-- ECS logging agent -->
<dependency>
<groupId>co.elastic.logging</groupId>
<artifactId>logback-ecs-encoder</artifactId>
<version>1.6.0</version>
</dependency>

<!-- Dependency to SOAP web service - START - -->
<dependency>
Expand Down

0 comments on commit b57a262

Please sign in to comment.