Skip to content

Commit

Permalink
finops: Enable by default traces sampling
Browse files Browse the repository at this point in the history
doc: Add sampling
  • Loading branch information
clemlesne committed Dec 10, 2024
1 parent e07f249 commit 87704b9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
APPLICATIONINSIGHTS_CONNECTION_STRING=xxx
# Service Principal (optional)
AZURE_CLIENT_ID=xxx
AZURE_CLIENT_SECRET=xxx
AZURE_TENANT_ID=xxx

# Application Insights (optional)
APPLICATIONINSIGHTS_CONNECTION_STRING=xxx
OTEL_TRACES_SAMPLER_ARG=0.5
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ Optional costs totalizing $343.02 /month, with the following breakdown:

| Region | Metric | Cost | Total (monthly $) | Note |
|-|-|-|-|-|
| Sweden Central | Basic logs ingestion | $0.645 /GB | $322.5 | 500GB of logs with sampling enabled |
| Sweden Central | Basic logs ingestion | $0.645 /GB | $322.5 | 500GB of logs [with sampling enabled](https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-configuration?tabs=python#enable-sampling) |

### What would it require to make it production ready?

Expand Down
4 changes: 4 additions & 0 deletions cicd/bicep/app.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ resource containerApp 'Microsoft.App/containerApps@2024-02-02-preview' = {
name: 'APPLICATIONINSIGHTS_CONNECTION_STRING'
value: applicationInsights.properties.ConnectionString
}
{
name: 'OTEL_TRACES_SAMPLER_ARG'
value: '0.2' // 20% sampling
}
]
resources: {
cpu: 1
Expand Down

0 comments on commit 87704b9

Please sign in to comment.