Skip to content

Commit

Permalink
tbs -> tail sampling
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonip committed Dec 17, 2024
1 parent 1d6a2a3 commit 626d1db
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
required: false
type: boolean
default: false
enableTBS:
enableTailSampling:
description: 'Enable tail-based sampling on the APM server'
required: false
type: boolean
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
TF_VAR_private_key: ./id_rsa_terraform
TF_VAR_public_key: ./id_rsa_terraform.pub
TF_VAR_run_standalone: ${{ inputs.runStandalone || github.event.schedule=='0 5 */5 * *' }}
TF_VAR_apm_server_tbs: ${{ inputs.enableTBS }}
TF_VAR_apm_server_tail_sampling: ${{ inputs.enableTailSampling }}
RUN_STANDALONE: ${{ inputs.runStandalone || github.event.schedule=='0 5 */5 * *' }}
TFVARS_SOURCE: ${{ inputs.profile || 'system-profiles/8GBx1zone.tfvars' }} # // Default to use an 8gb profile
TF_VAR_BUILD_ID: ${{ github.run_id }}
Expand Down
2 changes: 1 addition & 1 deletion testing/benchmark/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ module "ec_deployment" {
drop_pipeline = var.drop_pipeline
apm_server_expvar = true
apm_server_pprof = true
apm_server_tbs = var.apm_server_tbs
apm_server_tail_sampling = var.apm_server_tail_sampling

elasticsearch_size = var.elasticsearch_size
elasticsearch_zone_count = var.elasticsearch_zone_count
Expand Down
2 changes: 1 addition & 1 deletion testing/benchmark/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ variable "drop_pipeline" {
type = bool
}

variable "apm_server_tbs" {
variable "apm_server_tail_sampling" {
default = false
description = "Whether or not to enable APM Server tail-based sampling. Defaults to false"
type = bool
Expand Down
2 changes: 1 addition & 1 deletion testing/infra/terraform/modules/ec_deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ used to configure the module, please refer to the [EC Provider docs](https://reg
| <a name="input_apm_server_expvar"></a> [apm\_server\_expvar](#input\_apm\_server\_expvar) | Whether or not to enable APM Server's expvar endpoint. Defaults to false | `bool` | `false` | no |
| <a name="input_apm_server_pprof"></a> [apm\_server\_pprof](#input\_apm\_server\_pprof) | Whether or not to enable APM Server's pprof endpoint. Defaults to false | `bool` | `false` | no |
| <a name="input_apm_server_size"></a> [apm\_server\_size](#input\_apm\_server\_size) | Optional apm server instance size | `string` | `"1g"` | no |
| <a name="input_apm_server_tbs"></a> [apm\_server\_tbs](#input\_apm\_server\_tbs) | Whether or not to enable APM Server tail-based sampling. Defaults to false | `bool` | `false` | no |
| <a name="input_apm_server_tail_sampling"></a> [apm\_server\_tbs](#input\_apm\_server\_tbs) | Whether or not to enable APM Server tail-based sampling. Defaults to false | `bool` | `false` | no |
| <a name="input_apm_server_zone_count"></a> [apm\_server\_zone\_count](#input\_apm\_server\_zone\_count) | Optional apm server zone count | `number` | `1` | no |
| <a name="input_custom_apm_integration_pkg_path"></a> [custom\_apm\_integration\_pkg\_path](#input\_custom\_apm\_integration\_pkg\_path) | Path to the zipped custom APM integration package, if empty custom apm integration pkg is not installed | `string` | `""` | no |
| <a name="input_deployment_name_prefix"></a> [deployment\_name\_prefix](#input\_deployment\_name\_prefix) | Optional ESS or ECE region. Defaults to GCP US West 2 (Los Angeles) | `string` | `"apmserver"` | no |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ resource "local_file" "enable_features" {
elastic_password = ec_deployment.deployment.elasticsearch_password,
enable_expvar = var.apm_server_expvar
enable_pprof = var.apm_server_pprof
enable_tbs = var.apm_server_tbs
enable_tail_sampling = var.apm_server_tail_sampling
})
filename = "${path.module}/scripts/enable_features.sh"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fi
# Abort early if features are already set as desired
echo $${POLICY} | jq -e '.item | select(.inputs[].policy_template == "apmserver").inputs[].vars.expvar_enabled.value == ${enable_expvar}' &&
echo $${POLICY} | jq -e '.item | select(.inputs[].policy_template == "apmserver").inputs[].vars.pprof_enabled.value == ${enable_pprof}' &&
echo $${POLICY} | jq -e '.item | select(.inputs[].policy_template == "apmserver").inputs[].vars.tail_sampling_enabled.value == ${enable_tbs}' &&
echo $${POLICY} | jq -e '.item | select(.inputs[].policy_template == "apmserver").inputs[].vars.tail_sampling_enabled.value == ${enable_tail_sampling}' &&
echo "Features already set as desired" && exit 0

# Download and modify the APM policy
Expand All @@ -27,7 +27,7 @@ echo $${POLICY} | jq '.item' | \
jq 'select(.inputs[].policy_template == "apmserver").inputs[].vars.expvar_enabled = {type: "bool", value: ${enable_expvar}}' |\
jq 'select(.inputs[].policy_template == "apmserver").inputs[].vars.pprof_enabled = {type: "bool", value: ${enable_pprof}}' |\
jq 'select(.inputs[].policy_template == "apmserver").inputs[].vars.tail_sampling_storage_limit = {"value":"10GB","type":"text"}' |\ # set TBS storage limit to 10GB by default
jq 'select(.inputs[].policy_template == "apmserver").inputs[].vars.tail_sampling_enabled = {type: "bool", value: ${enable_tbs}}' > policy.json
jq 'select(.inputs[].policy_template == "apmserver").inputs[].vars.tail_sampling_enabled = {type: "bool", value: ${enable_tail_sampling}}' > policy.json

# Update the policy
curl -s -H 'content-type: application/json' -H 'kbn-xsrf: true' -X PUT -k [email protected] -u $${KIBANA_AUTH} $${KIBANA_ENDPOINT}
Expand Down
2 changes: 1 addition & 1 deletion testing/infra/terraform/modules/ec_deployment/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ variable "apm_server_pprof" {
type = bool
}

variable "apm_server_tbs" {
variable "apm_server_tail_sampling" {
default = false
description = "Whether or not to enable APM Server tail-based sampling. Defaults to false"
type = bool
Expand Down

0 comments on commit 626d1db

Please sign in to comment.