Skip to content

Commit

Permalink
chore: Set 20% otel sample rate for all apps in yt01 (#1737)
Browse files Browse the repository at this point in the history
  • Loading branch information
oskogstad authored Jan 27, 2025
1 parent 75c7a24 commit 09c9ce9
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .azure/applications/graphql/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ param appConfigurationName string
@secure()
param environmentKeyVaultName string

@description('The ratio of traces to sample (between 0.0 and 1.0). Lower values reduce logging volume.')
@minLength(1)
param otelTraceSamplerRatio string

var namePrefix = 'dp-be-${environment}'
var baseImageUrl = 'ghcr.io/altinn/dialogporten-'

Expand Down Expand Up @@ -84,6 +88,14 @@ var containerAppEnvVars = [
name: 'AZURE_CLIENT_ID'
value: managedIdentity.properties.clientId
}
{
name: 'OTEL_TRACES_SAMPLER'
value: 'parentbased_traceidratio'
}
{
name: 'OTEL_TRACES_SAMPLER_ARG'
value: otelTraceSamplerRatio
}
]

var port = 8080
Expand Down
2 changes: 2 additions & 0 deletions .azure/applications/graphql/prod.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ param apimIp = '51.120.88.54'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

param otelTraceSamplerRatio = '1'

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
param containerAppEnvironmentName = readEnvironmentVariable('AZURE_CONTAINER_APP_ENVIRONMENT_NAME')
Expand Down
2 changes: 2 additions & 0 deletions .azure/applications/graphql/staging.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ param apimIp = '51.13.86.131'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

param otelTraceSamplerRatio = '1'

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
param containerAppEnvironmentName = readEnvironmentVariable('AZURE_CONTAINER_APP_ENVIRONMENT_NAME')
Expand Down
2 changes: 2 additions & 0 deletions .azure/applications/graphql/test.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ param apimIp = '51.120.88.69'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

param otelTraceSamplerRatio = '1'

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
param containerAppEnvironmentName = readEnvironmentVariable('AZURE_CONTAINER_APP_ENVIRONMENT_NAME')
Expand Down
2 changes: 2 additions & 0 deletions .azure/applications/graphql/yt01.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ param apimIp = '51.13.85.197'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

param otelTraceSamplerRatio = '0.2'

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
param containerAppEnvironmentName = readEnvironmentVariable('AZURE_CONTAINER_APP_ENVIRONMENT_NAME')
Expand Down
12 changes: 12 additions & 0 deletions .azure/applications/web-api-eu/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ param appConfigurationName string
@secure()
param environmentKeyVaultName string

@description('The ratio of traces to sample (between 0.0 and 1.0). Lower values reduce logging volume.')
@minLength(1)
param otelTraceSamplerRatio string

var namePrefix = 'dp-be-${environment}'
var baseImageUrl = 'ghcr.io/altinn/dialogporten-'
var tags = {
Expand Down Expand Up @@ -87,6 +91,14 @@ var containerAppEnvVars = [
name: 'AZURE_CLIENT_ID'
value: managedIdentity.properties.clientId
}
{
name: 'OTEL_TRACES_SAMPLER'
value: 'parentbased_traceidratio'
}
{
name: 'OTEL_TRACES_SAMPLER_ARG'
value: otelTraceSamplerRatio
}
]

@description('The scaling configuration for the container app')
Expand Down
2 changes: 2 additions & 0 deletions .azure/applications/web-api-eu/prod.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ param apimIp = '51.120.88.54'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

param otelTraceSamplerRatio = '1'

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
param containerAppEnvironmentName = readEnvironmentVariable('AZURE_CONTAINER_APP_ENVIRONMENT_NAME')
Expand Down
2 changes: 2 additions & 0 deletions .azure/applications/web-api-eu/staging.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ param apimIp = '51.13.86.131'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

param otelTraceSamplerRatio = '1'

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
param containerAppEnvironmentName = readEnvironmentVariable('AZURE_CONTAINER_APP_ENVIRONMENT_NAME')
Expand Down
2 changes: 2 additions & 0 deletions .azure/applications/web-api-eu/test.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ param apimIp = '51.120.88.69'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

param otelTraceSamplerRatio = '1'

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
param containerAppEnvironmentName = readEnvironmentVariable('AZURE_CONTAINER_APP_ENVIRONMENT_NAME')
Expand Down
2 changes: 2 additions & 0 deletions .azure/applications/web-api-eu/yt01.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ param apimIp = '51.13.85.197'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

param otelTraceSamplerRatio = '0.2'

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
param containerAppEnvironmentName = readEnvironmentVariable('AZURE_CONTAINER_APP_ENVIRONMENT_NAME')
Expand Down
12 changes: 12 additions & 0 deletions .azure/applications/web-api-so/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ param appConfigurationName string
@secure()
param environmentKeyVaultName string

@description('The ratio of traces to sample (between 0.0 and 1.0). Lower values reduce logging volume.')
@minLength(1)
param otelTraceSamplerRatio string

@description('The scaling configuration for the container app')
param scale Scale = {
minReplicas: 2
Expand Down Expand Up @@ -115,6 +119,14 @@ var containerAppEnvVars = [
name: 'AZURE_CLIENT_ID'
value: managedIdentity.properties.clientId
}
{
name: 'OTEL_TRACES_SAMPLER'
value: 'parentbased_traceidratio'
}
{
name: 'OTEL_TRACES_SAMPLER_ARG'
value: otelTraceSamplerRatio
}
]

resource environmentKeyVaultResource 'Microsoft.KeyVault/vaults@2023-07-01' existing = {
Expand Down
2 changes: 2 additions & 0 deletions .azure/applications/web-api-so/prod.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ param apimIp = '51.120.88.54'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

param otelTraceSamplerRatio = '1'

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
param containerAppEnvironmentName = readEnvironmentVariable('AZURE_CONTAINER_APP_ENVIRONMENT_NAME')
Expand Down
2 changes: 2 additions & 0 deletions .azure/applications/web-api-so/staging.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ param apimIp = '51.13.86.131'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

param otelTraceSamplerRatio = '1'

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
param containerAppEnvironmentName = readEnvironmentVariable('AZURE_CONTAINER_APP_ENVIRONMENT_NAME')
Expand Down
2 changes: 2 additions & 0 deletions .azure/applications/web-api-so/test.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ param apimIp = '51.120.88.69'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

param otelTraceSamplerRatio = '1'

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
param containerAppEnvironmentName = readEnvironmentVariable('AZURE_CONTAINER_APP_ENVIRONMENT_NAME')
Expand Down
2 changes: 2 additions & 0 deletions .azure/applications/web-api-so/yt01.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ param apimIp = '51.13.85.197'
param imageTag = readEnvironmentVariable('IMAGE_TAG')
param revisionSuffix = readEnvironmentVariable('REVISION_SUFFIX')

param otelTraceSamplerRatio = '0.2'

// secrets
param environmentKeyVaultName = readEnvironmentVariable('AZURE_ENVIRONMENT_KEY_VAULT_NAME')
param containerAppEnvironmentName = readEnvironmentVariable('AZURE_CONTAINER_APP_ENVIRONMENT_NAME')
Expand Down

0 comments on commit 09c9ce9

Please sign in to comment.