[8.15] [Otel Onboarding] Adjust snippet and switch to proper release (#187480) (#187611)

# Backport

This will backport the following commits from `main` to `8.15`:
- [[Otel Onboarding] Adjust snippet and switch to proper release
(#187480)](https://github.com/elastic/kibana/pull/187480)
 - https://github.com/elastic/kibana/pull/187674

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Joe
Reuter","email":"johannes.reuter@elastic.co"},"sourceCommit":{"committedDate":"2024-07-04T23:20:44Z","message":"[Otel
Onboarding] Adjust snippet and switch to proper release
(#187480)\n\nThis PR does three things:\r\n* Try to download agent from
the central repository (expected to fail\r\nfor now as 8.15.0 agent
isn't released yet\r\n* Adjust snippet to also set up local data dir
correctly\r\n* Update k8s manifest
via\r\nhttps://github.com/elastic/opentelemetry-dev/pull/299","sha":"322248b496f2918e0df3d4de0e22bc4b30ea60a0","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-logs","Feature:
Observability Onboarding","v8.16.0"],"title":"[Otel Onboarding] Adjust
snippet and switch to proper
release","number":187480,"url":"https://github.com/elastic/kibana/pull/187480","mergeCommit":{"message":"[Otel
Onboarding] Adjust snippet and switch to proper release
(#187480)\n\nThis PR does three things:\r\n* Try to download agent from
the central repository (expected to fail\r\nfor now as 8.15.0 agent
isn't released yet\r\n* Adjust snippet to also set up local data dir
correctly\r\n* Update k8s manifest
via\r\nhttps://github.com/elastic/opentelemetry-dev/pull/299","sha":"322248b496f2918e0df3d4de0e22bc4b30ea60a0"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/187480","number":187480,"mergeCommit":{"message":"[Otel
Onboarding] Adjust snippet and switch to proper release
(#187480)\n\nThis PR does three things:\r\n* Try to download agent from
the central repository (expected to fail\r\nfor now as 8.15.0 agent
isn't released yet\r\n* Adjust snippet to also set up local data dir
correctly\r\n* Update k8s manifest
via\r\nhttps://github.com/elastic/opentelemetry-dev/pull/299","sha":"322248b496f2918e0df3d4de0e22bc4b30ea60a0"}}]}]
BACKPORT-->

---------

Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
Co-authored-by: Joe Reuter <email@johannes-reuter.de>
This commit is contained in:
Kibana Machine 2024-07-05 21:35:49 +02:00 committed by GitHub
parent 0b3c4e184a
commit 6177dab713
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -64,15 +64,16 @@ export const OtelLogsPanel: React.FC = () => {
services: {
share,
http,
// context: { isServerless, stackVersion },
context: { isServerless, stackVersion },
},
} = useKibana<ObservabilityOnboardingAppServices>();
const AGENT_CDN_BASE_URL = 'snapshots.elastic.co/8.15.0-2088c97b/downloads/beats/elastic-agent';
const agentVersion = '8.15.0-SNAPSHOT';
// TODO uncomment before merge
// const AGENT_CDN_BASE_URL = 'artifacts.elastic.co/downloads/beats/elastic-agent';
const AGENT_CDN_BASE_URL = isServerless
? 'snapshots.elastic.co/8.15.0-474afc1d/downloads/beats/elastic-agent'
: 'artifacts.elastic.co/downloads/beats/elastic-agent';
// TODO change once otel flow should be shown on serverless
// const agentVersion = isServerless ? setup?.elasticAgentVersion : stackVersion;
const agentVersion = isServerless ? '8.15.0-SNAPSHOT' : stackVersion;
const allDatasetsLocator =
share.url.locators.get<AllDatasetsLocatorParams>(ALL_DATASETS_LOCATOR_ID);
@ -184,14 +185,11 @@ data:
otel.yaml: |
exporters:
debug:
verbosity: normal
verbosity: basic
elasticsearch:
endpoints:
- \${env:ES_ENDPOINT}
api_key: \${env:ES_API_KEY}
#logs_index: logs-otel.generic-default
# Metrics are not supported yet
#metrics_index: metrics-otel.generic-default
mapping:
mode: ecs
processors:
@ -388,15 +386,10 @@ data:
collection_interval: 20s
endpoint: \${env:K8S_NODE_NAME}:10250
node: '\${env:K8S_NODE_NAME}'
# Verify if this can be removed for all CSPs
#insecure_skip_verify: true
# Required to work for all CSPs without an issue
insecure_skip_verify: true
k8s_api_config:
auth_type: serviceAccount
metric_groups:
- node
- pod
- node
- volume
metrics:
k8s.pod.cpu.node.utilization:
enabled: true
@ -553,7 +546,7 @@ spec:
curl --output elastic-distro-${agentVersion}-linux-$arch.tar.gz --url https://${AGENT_CDN_BASE_URL}/elastic-agent-${agentVersion}-linux-$arch.tar.gz --proto '=https' --tlsv1.2 -fOL && mkdir elastic-distro-${agentVersion}-linux-$arch && tar -xvf elastic-distro-${agentVersion}-linux-$arch.tar.gz -C "elastic-distro-${agentVersion}-linux-$arch" --strip-components=1 && cd elastic-distro-${agentVersion}-linux-$arch
rm ./otel.yml && cp ./otel_samples/platformlogs_hostmetrics.yml ./otel.yml && sed -i 's#\\\${env:ELASTIC_ENDPOINT}#${setup?.elasticsearchUrl}#g' ./otel.yml && sed -i 's/\\\${env:ELASTIC_API_KEY}/${apiKeyData?.apiKeyEncoded}/g' ./otel.yml`,
rm ./otel.yml && cp ./otel_samples/platformlogs_hostmetrics.yml ./otel.yml && mkdir -p ./data/otelcol && sed -i 's#\\\${env:STORAGE_DIR}#'"$PWD"/data/otelcol'#g' ./otel.yml && sed -i 's#\\\${env:ELASTIC_ENDPOINT}#${setup?.elasticsearchUrl}#g' ./otel.yml && sed -i 's/\\\${env:ELASTIC_API_KEY}/${apiKeyData?.apiKeyEncoded}/g' ./otel.yml`,
start: './otelcol --config otel.yml',
type: 'copy',
},
@ -565,7 +558,7 @@ rm ./otel.yml && cp ./otel_samples/platformlogs_hostmetrics.yml ./otel.yml && se
curl --output elastic-distro-${agentVersion}-darwin-$arch.tar.gz --url https://${AGENT_CDN_BASE_URL}/elastic-agent-${agentVersion}-darwin-$arch.tar.gz --proto '=https' --tlsv1.2 -fOL && mkdir "elastic-distro-${agentVersion}-darwin-$arch" && tar -xvf elastic-distro-${agentVersion}-darwin-$arch.tar.gz -C "elastic-distro-${agentVersion}-darwin-$arch" --strip-components=1 && cd elastic-distro-${agentVersion}-darwin-$arch
rm ./otel.yml && cp ./otel_samples/platformlogs_hostmetrics.yml ./otel.yml && sed -i '' 's#\\\${env:ELASTIC_ENDPOINT}#${setup?.elasticsearchUrl}#g' ./otel.yml && sed -i '' 's/\\\${env:ELASTIC_API_KEY}/${apiKeyData?.apiKeyEncoded}/g' ./otel.yml`,
rm ./otel.yml && cp ./otel_samples/platformlogs_hostmetrics.yml ./otel.yml && mkdir -p ./data/otelcol && sed -i '' 's#\\\${env:STORAGE_DIR}#'"$PWD"/data/otelcol'#g' ./otel.yml && sed -i '' 's#\\\${env:ELASTIC_ENDPOINT}#${setup?.elasticsearchUrl}#g' ./otel.yml && sed -i '' 's/\\\${env:ELASTIC_API_KEY}/${apiKeyData?.apiKeyEncoded}/g' ./otel.yml`,
start: './otelcol --config otel.yml',
type: 'copy',
},