Skip to content

Script for indexing micro benchmark results #128557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jun 3, 2025

Conversation

idegtiarenko
Copy link
Contributor

This change adds a bash script that indexes micro benchmarks results into elasticsearch so that we could visualize them.

@idegtiarenko idegtiarenko requested a review from a team as a code owner May 28, 2025 09:43
@idegtiarenko idegtiarenko added :Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team v9.1.0 labels May 28, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-delivery (Team:Delivery)

#!/bin/bash

METRICS_HOST=$(vault read -field=es_host /secret/performance/employees/cloud/esbench-metrics)
METRICS_INDEX_NAME="dummy-micro-benchmarks"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The index name is temporary and will be replaced with a data stream soon

Copy link
Contributor

@gbanasiak gbanasiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are Infra Vault paths. We need to copy the necessary fields into esbench-repo Elasticsearch repo location in CI Vault. I suggest to use micro-benchmarks in the name of the secret. We will upate its contents (host, username, password) once this moves into "production". @breskeby Can you help with creating the necessary CI Vault secret?

@nik9000
Copy link
Member

nik9000 commented May 28, 2025

I love it, but get someone who knows more about this to approve it for real.


jq -c '.[]' "benchmarks/build/result.json" | while read -r doc; do
curl -s -X POST "https://$METRICS_HOST/$METRICS_INDEX_NAME/_doc" \
-u "$METRICS_USERNAME:$METRICS_PASSWORD" \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we leak the credentials here to console log? @brianseeders

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like it, but the vault read commands above need to happen inside of .buildkite/hooks/pre-command. If they happen there, then they will get automatically redacted if they are accidentally printed.

Take a look at the other vault commands in that script, there's a few different ways to do it. I usually prefer introducing an env var like USE_ES_BENCH_CREDENTIALS. You can also do it based on something like the step label periodic-micro-benchmarks, but then it will break if you rename the step.

@breskeby
Copy link
Contributor

These are Infra Vault paths. We need to copy the necessary fields into esbench-repo Elasticsearch repo location in CI Vault. I suggest to use micro-benchmarks in the name of the secret. We will upate its contents (host, username, password) once this moves into "production". @breskeby Can you help with creating the necessary CI Vault secret?

@gbanasiak @idegtiarenko I've copied those credentials to secret/ci/elastic-elasticsearch/esbench-metics into the ci-prod vault.

@breskeby breskeby requested a review from brianseeders May 28, 2025 21:18
Copy link
Contributor

@brianseeders brianseeders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@breskeby breskeby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@idegtiarenko idegtiarenko merged commit a84c251 into main Jun 3, 2025
19 checks passed
@idegtiarenko idegtiarenko deleted the index_micro_benchmarks_results branch June 3, 2025 07:28
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Jun 3, 2025
joshua-adams-1 pushed a commit to joshua-adams-1/elasticsearch that referenced this pull request Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure >non-issue Team:Delivery Meta label for Delivery team v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants