[8.16] Enable Kubernetes Otel flow (#196531) (#196687)

# Backport

This will backport the following commits from `main` to `8.16`:
- [Enable Kubernetes Otel flow
(#196531)](https://github.com/elastic/kibana/pull/196531)

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

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

<!--BACKPORT [{"author":{"name":"Thom
Heymann","email":"190132+thomheymann@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-10-17T12:26:56Z","message":"Enable
Kubernetes Otel flow
(#196531)\n\nResolves\r\n[#4035](https://github.com/elastic/observability-dev/issues/4035)\r\n\r\n##
Summary\r\n\r\nEnable Kubernetes Otel flow\r\n\r\n##
Screenshot\r\n\r\n<img width=\"1189\" alt=\"Screenshot 2024-10-16 at 13
21
24\"\r\nsrc=\"https://github.com/user-attachments/assets/d1e87756-bfee-497a-9861-9912542e13a9\">\r\n\r\n---------\r\n\r\nCo-authored-by:
Joe Reuter
<johannes.reuter@elastic.co>","sha":"e92e0202b0856c1c7377a9d9327cf4ebc8bb6685","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-logs","Feature:
Observability Onboarding","v8.16.0"],"title":"Enable Kubernetes Otel
flow","number":196531,"url":"https://github.com/elastic/kibana/pull/196531","mergeCommit":{"message":"Enable
Kubernetes Otel flow
(#196531)\n\nResolves\r\n[#4035](https://github.com/elastic/observability-dev/issues/4035)\r\n\r\n##
Summary\r\n\r\nEnable Kubernetes Otel flow\r\n\r\n##
Screenshot\r\n\r\n<img width=\"1189\" alt=\"Screenshot 2024-10-16 at 13
21
24\"\r\nsrc=\"https://github.com/user-attachments/assets/d1e87756-bfee-497a-9861-9912542e13a9\">\r\n\r\n---------\r\n\r\nCo-authored-by:
Joe Reuter
<johannes.reuter@elastic.co>","sha":"e92e0202b0856c1c7377a9d9327cf4ebc8bb6685"}},"sourceBranch":"main","suggestedTargetBranches":["8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196531","number":196531,"mergeCommit":{"message":"Enable
Kubernetes Otel flow
(#196531)\n\nResolves\r\n[#4035](https://github.com/elastic/observability-dev/issues/4035)\r\n\r\n##
Summary\r\n\r\nEnable Kubernetes Otel flow\r\n\r\n##
Screenshot\r\n\r\n<img width=\"1189\" alt=\"Screenshot 2024-10-16 at 13
21
24\"\r\nsrc=\"https://github.com/user-attachments/assets/d1e87756-bfee-497a-9861-9912542e13a9\">\r\n\r\n---------\r\n\r\nCo-authored-by:
Joe Reuter
<johannes.reuter@elastic.co>","sha":"e92e0202b0856c1c7377a9d9327cf4ebc8bb6685"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Thom Heymann <190132+thomheymann@users.noreply.github.com>
Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
This commit is contained in:
Kibana Machine 2024-10-19 01:15:15 +11:00 committed by GitHub
parent e42cc1f8a4
commit 6fb9643ecb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 355 additions and 594 deletions

View file

@ -56,7 +56,7 @@ export const OnboardingFlowForm: FunctionComponent = () => {
'Monitor your host and the services running on it, set-up SLO, get alerted, remediate performance issues',
}
),
logos: ['kubernetes', 'opentelemetry', 'apache', 'mysql'],
logos: ['opentelemetry', 'apache', 'mysql'],
},
{
id: 'kubernetes',
@ -86,7 +86,7 @@ export const OnboardingFlowForm: FunctionComponent = () => {
'Monitor the frontend and backend application that you have developed, set-up synthetic monitors',
}
),
logos: ['opentelemetry', 'java', 'javascript', 'dotnet'],
logos: ['opentelemetry', 'java', 'ruby', 'dotnet'],
},
{
id: 'cloud',

View file

@ -33,6 +33,10 @@ export function useCustomCardsForCategory(
const { href: autoDetectUrl } = reactRouterNavigate(history, `/auto-detect/${location.search}`);
const { href: otelLogsUrl } = reactRouterNavigate(history, `/otel-logs/${location.search}`);
const { href: kubernetesUrl } = reactRouterNavigate(history, `/kubernetes/${location.search}`);
const { href: otelKubernetesUrl } = reactRouterNavigate(
history,
`/otel-kubernetes/${location.search}`
);
const apmUrl = `${getUrlForApp?.('apm')}/${isServerless ? 'onboarding' : 'tutorial'}`;
const otelApmUrl = isServerless ? `${apmUrl}?agent=openTelemetry` : apmUrl;
@ -44,9 +48,14 @@ export function useCustomCardsForCategory(
id: 'auto-detect-logs',
name: 'auto-detect-logs-virtual',
type: 'virtual',
title: 'Auto-detect Integrations with Elastic Agent',
title: i18n.translate(
'xpack.observability_onboarding.useCustomCardsForCategory.autoDetectTitle',
{
defaultMessage: 'Auto-detect Integrations with Elastic Agent',
}
),
description: i18n.translate(
'xpack.observability_onboarding.useCustomCardsForCategory.scanYourHostForLabel',
'xpack.observability_onboarding.useCustomCardsForCategory.autoDetectDescription',
{
defaultMessage: 'Scan your host for log and metric files, auto-install integrations',
}
@ -75,8 +84,19 @@ export function useCustomCardsForCategory(
id: 'otel-logs',
name: 'custom-logs-virtual',
type: 'virtual',
title: 'Elastic Distribution for OTel Collector',
description: 'Collect logs and host metrics using the Elastic Distro for OTel Collector ',
title: i18n.translate(
'xpack.observability_onboarding.useCustomCardsForCategory.logsOtelTitle',
{
defaultMessage: 'Host monitoring with EDOT Collector',
}
),
description: i18n.translate(
'xpack.observability_onboarding.useCustomCardsForCategory.logsOtelDescription',
{
defaultMessage:
'Collect logs and host metrics with the Elastic Distro for OTel Collector',
}
),
extraLabelsBadges: [
<EuiFlexItem grow={false}>
<LogoIcon logo="apple" size="m" />
@ -105,8 +125,19 @@ export function useCustomCardsForCategory(
id: 'kubernetes-quick-start',
name: 'kubernetes-quick-start',
type: 'virtual',
title: 'Elastic Agent',
description: 'Monitor your Kubernetes cluster with Elastic Agent, collect container logs',
title: i18n.translate(
'xpack.observability_onboarding.useCustomCardsForCategory.kubernetesTitle',
{
defaultMessage: 'Kubernetes monitoring with Elastic Agent',
}
),
description: i18n.translate(
'xpack.observability_onboarding.useCustomCardsForCategory.kubernetesDescription',
{
defaultMessage:
'Monitor your Kubernetes cluster with Elastic Agent, collect container logs',
}
),
extraLabelsBadges: [
<EuiFlexItem grow={false}>
<LogoIcon logo="kubernetes" size="m" />
@ -125,11 +156,22 @@ export function useCustomCardsForCategory(
isQuickstart: true,
},
{
id: 'otel-logs',
name: 'custom-logs-virtual',
id: 'otel-kubernetes',
name: 'otel-kubernetes-virtual',
type: 'virtual',
title: 'Elastic Distribution for OTel Collector',
description: 'Collect logs, metrics and traces for Kubernetes cluster monitoring',
title: i18n.translate(
'xpack.observability_onboarding.useCustomCardsForCategory.kubernetesOtelTitle',
{
defaultMessage: 'Kubernetes monitoring with EDOT Collector',
}
),
description: i18n.translate(
'xpack.observability_onboarding.useCustomCardsForCategory.kubernetesOtelDescription',
{
defaultMessage:
'Unified Kubernetes observability with Elastic Distro for OTel Collector',
}
),
extraLabelsBadges: [
<EuiFlexItem grow={false}>
<LogoIcon logo="kubernetes" size="m" />
@ -142,9 +184,10 @@ export function useCustomCardsForCategory(
src: http?.staticAssets.getPluginAssetHref('opentelemetry.svg') ?? '',
},
],
url: otelLogsUrl,
url: otelKubernetesUrl,
version: '',
integration: '',
isQuickstart: true,
},
];
@ -153,8 +196,18 @@ export function useCustomCardsForCategory(
{
id: 'apm-virtual',
type: 'virtual',
title: 'Elastic APM',
description: 'Collect distributed traces from your applications with Elastic APM',
title: i18n.translate(
'xpack.observability_onboarding.useCustomCardsForCategory.apmTitle',
{
defaultMessage: 'Elastic APM',
}
),
description: i18n.translate(
'xpack.observability_onboarding.useCustomCardsForCategory.apmDescription',
{
defaultMessage: 'Collect distributed traces from your applications with Elastic APM',
}
),
name: 'apm',
categories: ['observability'],
icons: [
@ -170,8 +223,18 @@ export function useCustomCardsForCategory(
{
id: 'otel-virtual',
type: 'virtual',
title: 'OpenTelemetry',
description: 'Collect distributed traces with OpenTelemetry',
title: i18n.translate(
'xpack.observability_onboarding.useCustomCardsForCategory.apmOtelTitle',
{
defaultMessage: 'OpenTelemetry',
}
),
description: i18n.translate(
'xpack.observability_onboarding.useCustomCardsForCategory.apmOtelDescription',
{
defaultMessage: 'Collect distributed traces with OpenTelemetry',
}
),
name: 'otel',
categories: ['observability'],
icons: [
@ -187,8 +250,18 @@ export function useCustomCardsForCategory(
{
id: 'synthetics-virtual',
type: 'virtual',
title: 'Synthetic monitor',
description: 'Monitor endpoints, pages, and user journeys',
title: i18n.translate(
'xpack.observability_onboarding.useCustomCardsForCategory.syntheticsTitle',
{
defaultMessage: 'Synthetic monitor',
}
),
description: i18n.translate(
'xpack.observability_onboarding.useCustomCardsForCategory.syntheticsDescription',
{
defaultMessage: 'Monitor endpoints, pages, and user journeys',
}
),
name: 'synthetics',
categories: ['observability'],
icons: [
@ -208,8 +281,18 @@ export function useCustomCardsForCategory(
{
id: 'azure-logs-virtual',
type: 'virtual',
title: 'Azure',
description: 'Collect logs from Microsoft Azure',
title: i18n.translate(
'xpack.observability_onboarding.useCustomCardsForCategory.azureTitle',
{
defaultMessage: 'Azure',
}
),
description: i18n.translate(
'xpack.observability_onboarding.useCustomCardsForCategory.azureDescription',
{
defaultMessage: 'Collect logs from Microsoft Azure',
}
),
name: 'azure',
categories: ['observability'],
icons: [],
@ -222,8 +305,18 @@ export function useCustomCardsForCategory(
{
id: 'aws-logs-virtual',
type: 'virtual',
title: 'AWS',
description: 'Collect logs from Amazon Web Services (AWS)',
title: i18n.translate(
'xpack.observability_onboarding.useCustomCardsForCategory.awsTitle',
{
defaultMessage: 'AWS',
}
),
description: i18n.translate(
'xpack.observability_onboarding.useCustomCardsForCategory.awsDescription',
{
defaultMessage: 'Collect logs from Amazon Web Services (AWS)',
}
),
name: 'aws',
categories: ['observability'],
icons: [],
@ -236,8 +329,18 @@ export function useCustomCardsForCategory(
{
id: 'gcp-logs-virtual',
type: 'virtual',
title: 'Google Cloud Platform',
description: 'Collect logs from Google Cloud Platform',
title: i18n.translate(
'xpack.observability_onboarding.useCustomCardsForCategory.gcpTitle',
{
defaultMessage: 'Google Cloud Platform',
}
),
description: i18n.translate(
'xpack.observability_onboarding.useCustomCardsForCategory.gcpDescription',
{
defaultMessage: 'Collect logs from Google Cloud Platform',
}
),
name: 'gcp',
categories: ['observability'],
icons: [],

View file

@ -30,6 +30,10 @@ import { CopyToClipboardButton } from '../shared/copy_to_clipboard_button';
import { ObservabilityOnboardingContextValue } from '../../../plugin';
import { useKubernetesFlow } from '../kubernetes/use_kubernetes_flow';
const OTEL_HELM_CHARTS_REPO = 'https://open-telemetry.github.io/opentelemetry-helm-charts';
const OTEL_KUBE_STACK_VERSION = '0.3.0';
const OTEL_KUBE_STACK_VALUES_FILE_URL =
'https://raw.githubusercontent.com/elastic/opentelemetry/refs/heads/main/resources/kubernetes/operator/helm/values.yaml';
const CLUSTER_OVERVIEW_DASHBOARD_ID = 'kubernetes_otel-cluster-overview';
export const OtelKubernetesPanel: React.FC = () => {
@ -48,10 +52,7 @@ export const OtelKubernetesPanel: React.FC = () => {
}
const namespace = 'opentelemetry-operator-system';
const valuesFile =
'https://raw.githubusercontent.com/elastic/opentelemetry/refs/heads/main/resources/kubernetes/operator/helm/values.yaml';
const addRepoCommand = `helm repo add open-telemetry 'https://open-telemetry.github.io/opentelemetry-helm-charts' --force-update`;
const addRepoCommand = `helm repo add open-telemetry '${OTEL_HELM_CHARTS_REPO}' --force-update`;
const installStackCommand = data
? `kubectl create namespace ${namespace}
kubectl create secret generic elastic-secret-otel \\
@ -60,8 +61,8 @@ kubectl create secret generic elastic-secret-otel \\
--from-literal=elastic_api_key='${data.apiKeyEncoded}'
helm install opentelemetry-kube-stack open-telemetry/opentelemetry-kube-stack \\
--namespace ${namespace} \\
--create-namespace \\
--values '${valuesFile}'`
--values '${OTEL_KUBE_STACK_VALUES_FILE_URL}' \\
--version '${OTEL_KUBE_STACK_VERSION}'`
: undefined;
return (
@ -143,7 +144,7 @@ helm install opentelemetry-kube-stack open-telemetry/opentelemetry-kube-stack \\
<EuiFlexItem grow={false}>
<EuiButtonEmpty
iconType="download"
href={valuesFile}
href={OTEL_KUBE_STACK_VALUES_FILE_URL}
flush="left"
target="_blank" // The `download` attribute does not work cross-origin so it's better to open the file in a new tab
data-test-subj="observabilityOnboardingOtelKubernetesPanelDownloadValuesFileButton"
@ -218,7 +219,7 @@ kind: Pod
metadata:
name: my-app
annotations:
instrumentation.opentelemetry.io/inject-${idSelected}: "true"
instrumentation.opentelemetry.io/inject-${idSelected}: "${namespace}/elastic-instrumentation"
spec:
containers:
- name: my-app
@ -227,7 +228,7 @@ spec:
<EuiSpacer />
<CopyToClipboardButton
textToCopy={`annotations:
instrumentation.opentelemetry.io/inject-${idSelected}: "true"`}
instrumentation.opentelemetry.io/inject-${idSelected}: "${namespace}/elastic-instrumentation"`}
data-test-subj={`observabilityOnboardingOtelKubernetesInstrumentApplicationCopyToClipboard-${idSelected}`}
/>
<EuiSpacer />

View file

@ -88,458 +88,6 @@ export const OtelLogsPanel: React.FC = () => {
}, [getDeeplinks]);
const installTabContents = [
{
id: 'kubernetes',
name: 'Kubernetes',
prompt: (
<>
<EuiText>
<p>
{i18n.translate(
'xpack.observability_onboarding.otelLogsPanel.kubernetesApplyCommandPromptLabel',
{
defaultMessage:
'From the directory where the manifest is downloaded, run the following command to install the collector on every node of your cluster:',
}
)}
</p>
</EuiText>
<CopyableCodeBlock
content={`kubectl create secret generic elastic-secret-otel --from-literal=es_endpoint='${setup?.elasticsearchUrl}' --from-literal=es_api_key='${apiKeyData?.apiKeyEncoded}'
kubectl apply -f otel-collector-k8s.yml`}
/>
</>
),
firstStepTitle: i18n.translate(
'xpack.observability_onboarding.otelLogsPanel.steps.downloadManifest',
{ defaultMessage: 'Download the manifest:' }
),
content: `apiVersion: v1
kind: ServiceAccount
metadata:
name: elastic-otel-collector-agent
namespace: default
labels:
app.kubernetes.io/name: elastic-opentelemetry-collector
app.kubernetes.io/version: "${agentVersion}"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: elastic-otel-collector-agent
labels:
app.kubernetes.io/name: elastic-opentelemetry-collector
app.kubernetes.io/version: "${agentVersion}"
rules:
- apiGroups: [""]
resources: ["pods", "namespaces", "nodes"]
verbs: ["get", "watch", "list"]
- apiGroups: ["apps"]
resources: ["daemonsets", "deployments", "replicasets", "statefulsets"]
verbs: ["get", "list", "watch"]
- apiGroups: ["extensions"]
resources: ["daemonsets", "deployments", "replicasets"]
verbs: ["get", "list", "watch"]
- apiGroups: [ "" ]
resources: [ "nodes/stats" ]
verbs: [ "get", "watch", "list" ]
- apiGroups: [ "" ]
resources: [ "nodes/proxy" ]
verbs: [ "get" ]
- apiGroups: [ "" ]
resources: ["configmaps"]
verbs: ["get"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: elastic-otel-collector-agent
labels:
app.kubernetes.io/name: elastic-opentelemetry-collector
app.kubernetes.io/version: "${agentVersion}"
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: elastic-otel-collector-agent
subjects:
- kind: ServiceAccount
name: elastic-otel-collector-agent
namespace: default
---
apiVersion: v1
kind: ConfigMap
metadata:
name: elastic-otel-collector-agent
namespace: default
labels:
app.kubernetes.io/name: elastic-opentelemetry-collector
app.kubernetes.io/version: "${agentVersion}"
data:
otel.yaml: |
exporters:
debug:
verbosity: basic
elasticsearch:
endpoints:
- \${env:ES_ENDPOINT}
api_key: \${env:ES_API_KEY}
logs_dynamic_index:
enabled: true
mapping:
mode: ecs
processors:
elasticinframetrics:
add_system_metrics: true
add_k8s_metrics: true
resourcedetection/eks:
detectors: [env, eks]
timeout: 15s
override: true
eks:
resource_attributes:
k8s.cluster.name:
enabled: true
resourcedetection/gcp:
detectors: [env, gcp]
timeout: 2s
override: false
resource/k8s:
attributes:
- key: service.name
from_attribute: app.label.component
action: insert
attributes/k8s_logs_dataset:
actions:
- key: data_stream.dataset
value: "kubernetes.container_logs"
action: upsert
attributes/dataset:
actions:
- key: event.dataset
from_attribute: data_stream.dataset
action: upsert
resource/cloud:
attributes:
- key: cloud.instance.id
from_attribute: host.id
action: insert
resource/process:
attributes:
- key: process.executable.name
action: delete
- key: process.executable.path
action: delete
resourcedetection/system:
detectors: ["system", "ec2"]
system:
hostname_sources: [ "os" ]
resource_attributes:
host.name:
enabled: true
host.id:
enabled: false
host.arch:
enabled: true
host.ip:
enabled: true
host.mac:
enabled: true
host.cpu.vendor.id:
enabled: true
host.cpu.family:
enabled: true
host.cpu.model.id:
enabled: true
host.cpu.model.name:
enabled: true
host.cpu.stepping:
enabled: true
host.cpu.cache.l2.size:
enabled: true
os.description:
enabled: true
os.type:
enabled: true
ec2:
resource_attributes:
host.name:
enabled: false
host.id:
enabled: true
k8sattributes:
filter:
node_from_env_var: K8S_NODE_NAME
passthrough: false
pod_association:
- sources:
- from: resource_attribute
name: k8s.pod.ip
- sources:
- from: resource_attribute
name: k8s.pod.uid
- sources:
- from: connection
extract:
metadata:
- "k8s.namespace.name"
- "k8s.deployment.name"
- "k8s.statefulset.name"
- "k8s.daemonset.name"
- "k8s.cronjob.name"
- "k8s.job.name"
- "k8s.node.name"
- "k8s.pod.name"
- "k8s.pod.uid"
- "k8s.pod.start_time"
labels:
- tag_name: app.label.component
key: app.kubernetes.io/component
from: pod
extensions:
file_storage:
directory: /var/lib/otelcol
receivers:
filelog:
retry_on_failure:
enabled: true
start_at: end
exclude:
- /var/log/pods/default_elastic-otel-collector-agent*_*/elastic-opentelemetry-collector/*.log
include:
- /var/log/pods/*/*/*.log
include_file_name: false
include_file_path: true
storage: file_storage
operators:
- id: container-parser
type: container
hostmetrics:
collection_interval: 10s
root_path: /hostfs
scrapers:
cpu:
metrics:
system.cpu.utilization:
enabled: true
system.cpu.logical.count:
enabled: true
memory:
metrics:
system.memory.utilization:
enabled: true
process:
mute_process_exe_error: true
mute_process_io_error: true
mute_process_user_error: true
metrics:
process.threads:
enabled: true
process.open_file_descriptors:
enabled: true
process.memory.utilization:
enabled: true
process.disk.operations:
enabled: true
network:
processes:
load:
disk:
filesystem:
exclude_mount_points:
mount_points:
- /dev/*
- /proc/*
- /sys/*
- /run/k3s/containerd/*
- /var/lib/docker/*
- /var/lib/kubelet/*
- /snap/*
match_type: regexp
exclude_fs_types:
fs_types:
- autofs
- binfmt_misc
- bpf
- cgroup2
- configfs
- debugfs
- devpts
- devtmpfs
- fusectl
- hugetlbfs
- iso9660
- mqueue
- nsfs
- overlay
- proc
- procfs
- pstore
- rpc_pipefs
- securityfs
- selinuxfs
- squashfs
- sysfs
- tracefs
match_type: strict
kubeletstats:
auth_type: serviceAccount
collection_interval: 20s
endpoint: \${env:K8S_NODE_NAME}:10250
node: '\${env:K8S_NODE_NAME}'
# Required to work for all CSPs without an issue
insecure_skip_verify: true
k8s_api_config:
auth_type: serviceAccount
metrics:
k8s.pod.cpu.node.utilization:
enabled: true
k8s.container.cpu_limit_utilization:
enabled: true
k8s.pod.cpu_limit_utilization:
enabled: true
k8s.container.cpu_request_utilization:
enabled: true
k8s.container.memory_limit_utilization:
enabled: true
k8s.pod.memory_limit_utilization:
enabled: true
k8s.container.memory_request_utilization:
enabled: true
k8s.node.uptime:
enabled: true
k8s.node.cpu.usage:
enabled: true
k8s.pod.cpu.usage:
enabled: true
extra_metadata_labels:
- container.id
service:
extensions: [file_storage]
pipelines:
logs:
exporters:
- elasticsearch
- debug
processors:
- k8sattributes
- resourcedetection/system
- resourcedetection/eks
- resourcedetection/gcp
- resource/k8s
- resource/cloud
- attributes/k8s_logs_dataset
receivers:
- filelog
metrics:
exporters:
- debug
- elasticsearch
processors:
- k8sattributes
- elasticinframetrics
- resourcedetection/system
- resourcedetection/eks
- resourcedetection/gcp
- resource/k8s
- resource/cloud
- attributes/dataset
- resource/process
receivers:
- kubeletstats
- hostmetrics
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: elastic-otel-collector-agent
namespace: default
labels:
app.kubernetes.io/name: elastic-opentelemetry-collector
app.kubernetes.io/version: "${agentVersion}"
spec:
selector:
matchLabels:
app.kubernetes.io/name: elastic-opentelemetry-collector
app.kubernetes.io/version: "${agentVersion}"
template:
metadata:
labels:
app.kubernetes.io/name: elastic-opentelemetry-collector
app.kubernetes.io/version: "${agentVersion}"
spec:
serviceAccountName: elastic-otel-collector-agent
securityContext:
runAsUser: 0
runAsGroup: 0
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: elastic-opentelemetry-collector
command: [/usr/share/elastic-agent/elastic-agent]
args: ["otel", "-c", "/etc/elastic-agent/otel.yaml"]
image: docker.elastic.co/beats/elastic-agent:${agentVersion}
imagePullPolicy: IfNotPresent
env:
- name: MY_POD_IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
- name: K8S_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: ES_ENDPOINT
valueFrom:
secretKeyRef:
key: es_endpoint
name: elastic-secret-otel
- name: ES_API_KEY
valueFrom:
secretKeyRef:
key: es_api_key
name: elastic-secret-otel
volumeMounts:
- mountPath: /etc/elastic-agent/otel.yaml
name: opentelemetry-collector-configmap
readOnly: true
subPath: otel.yaml
- name: varlogpods
mountPath: /var/log/pods
readOnly: true
- name: varlibdockercontainers
mountPath: /var/lib/docker/containers
readOnly: true
- name: varlibotelcol
mountPath: /var/lib/otelcol
- name: hostfs
mountPath: /hostfs
readOnly: true
mountPropagation: HostToContainer
volumes:
- name: opentelemetry-collector-configmap
configMap:
name: elastic-otel-collector-agent
defaultMode: 0640
- name: varlogpods
hostPath:
path: /var/log/pods
- name: varlibdockercontainers
hostPath:
path: /var/lib/docker/containers
- name: varlibotelcol
hostPath:
path: /var/lib/otelcol
type: DirectoryOrCreate
- name: hostfs
hostPath:
path: /`,
type: 'download',
fileName: 'otel-collector-k8s.yml',
},
{
id: 'linux',
name: 'Linux',
@ -613,39 +161,20 @@ rm ./otel.yml && cp ./otel_samples/platformlogs_hostmetrics.yml ./otel.yml && mk
</EuiFlexItem>
<EuiFlexItem align="left">
<EuiFlexGroup>
{selectedContent.type === 'download' ? (
<EuiButton
iconType="download"
color="primary"
href={`data:application/yaml;base64,${Buffer.from(
selectedContent.content,
'utf8'
).toString('base64')}`}
download={selectedContent.fileName}
target="_blank"
data-test-subj="obltOnboardingOtelDownloadConfig"
>
{i18n.translate(
'xpack.observability_onboarding.installOtelCollector.configStep.downloadConfigButton',
{ defaultMessage: 'Download manifest' }
)}
</EuiButton>
) : (
<EuiCopy textToCopy={selectedContent.content}>
{(copy) => (
<EuiButton
data-test-subj="observabilityOnboardingOtelLogsPanelButton"
iconType="copyClipboard"
onClick={copy}
>
{i18n.translate(
'xpack.observability_onboarding.installOtelCollector.configStep.copyCommand',
{ defaultMessage: 'Copy to clipboard' }
)}
</EuiButton>
)}
</EuiCopy>
)}
<EuiCopy textToCopy={selectedContent.content}>
{(copy) => (
<EuiButton
data-test-subj="observabilityOnboardingOtelLogsPanelButton"
iconType="copyClipboard"
onClick={copy}
>
{i18n.translate(
'xpack.observability_onboarding.installOtelCollector.configStep.copyCommand',
{ defaultMessage: 'Copy to clipboard' }
)}
</EuiButton>
)}
</EuiCopy>
</EuiFlexGroup>
</EuiFlexItem>
</EuiFlexGroup>
@ -673,35 +202,28 @@ rm ./otel.yml && cp ./otel_samples/platformlogs_hostmetrics.yml ./otel.yml && mk
}
)}
</p>
{selectedTab !== 'kubernetes' && (
<p>
{i18n.translate(
'xpack.observability_onboarding.otelLogsPanel.historicalDataDescription2',
{
defaultMessage:
'The default log path is /var/log/*. You can change this path in the otel.yml file if needed.',
}
)}
</p>
)}
<p>
{i18n.translate(
'xpack.observability_onboarding.otelLogsPanel.historicalDataDescription2',
{
defaultMessage:
'The default log path is /var/log/*. You can change this path in the otel.yml file if needed.',
}
)}
</p>
</EuiCallOut>
{selectedContent.prompt}
{selectedContent.start && (
<>
<EuiText>
<p>
{i18n.translate(
'xpack.observability_onboarding.otelLogsPanel.p.startTheCollectorLabel',
{
defaultMessage: 'Run the following command to start the collector',
}
)}
</p>
</EuiText>
<CopyableCodeBlock content={selectedContent.start} />
</>
)}
<EuiText>
<p>
{i18n.translate(
'xpack.observability_onboarding.otelLogsPanel.p.startTheCollectorLabel',
{
defaultMessage: 'Run the following command to start the collector',
}
)}
</p>
</EuiText>
<CopyableCodeBlock content={selectedContent.start} />
</EuiFlexGroup>
),
},

View file

@ -27,6 +27,7 @@ export type SupportedLogo =
| 'mysql'
| 'postgresql'
| 'redis'
| 'ruby'
| 'haproxy'
| 'rabbitmq'
| 'kafka'
@ -54,6 +55,7 @@ export function isSupportedLogo(logo: string): logo is SupportedLogo {
'mysql',
'postgresql',
'redis',
'ruby',
'haproxy',
'rabbitmq',
'kafka',

View file

@ -1,3 +1,7 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5.95038 12.3734C3.49039 13.0607 7.44711 14.4805 10.5795 13.1385C10.0664 12.939 9.69843 12.709 9.69843 12.709C8.30167 12.973 7.65373 12.9938 6.3858 12.8489C5.33935 12.7291 5.95038 12.3734 5.95038 12.3734ZM10.2045 11.0327C8.35307 11.3889 7.28368 11.3775 5.92923 11.2377C4.88189 11.1294 5.56751 10.6218 5.56751 10.6218C2.85822 11.5211 7.07578 12.5416 10.8624 11.434C10.4599 11.2922 10.2045 11.0327 10.2045 11.0327ZM11.6553 3.26828C11.6554 3.26828 6.17815 4.63581 8.794 7.65029C9.56615 8.53921 8.59148 9.3384 8.59148 9.3384C8.59148 9.3384 10.5512 8.32695 9.65138 7.05978C8.81067 5.87862 8.16619 5.29182 11.6553 3.26828ZM12.9368 13.6691C12.9368 13.6691 13.3892 14.0421 12.4385 14.3304C10.6309 14.878 4.91368 15.0431 3.32568 14.3523C2.75529 14.1039 3.82545 13.7595 4.16217 13.6868C4.51325 13.6108 4.71372 13.6247 4.71372 13.6247C4.07898 13.1777 0.610361 14.5027 2.9523 14.8827C9.33825 15.9179 14.593 14.4165 12.9368 13.6691ZM10.7421 9.78112C11.049 9.57168 11.473 9.3898 11.473 9.3898C11.473 9.3898 10.2651 9.60578 9.06164 9.70691C7.58836 9.83047 6.00806 9.85483 5.21477 9.74869C3.3367 9.49759 6.24442 8.80684 6.24442 8.80684C6.24442 8.80684 5.11491 8.73045 3.72649 9.4021C2.08428 10.1962 7.78858 10.5581 10.7421 9.78112ZM11.461 11.7224C11.4472 11.7595 11.401 11.8013 11.401 11.8013C15.4095 10.7476 13.9357 8.08687 12.0191 8.76031C11.8509 8.81979 11.7627 8.95809 11.7627 8.95809C11.7627 8.95809 11.869 8.91528 12.106 8.86581C13.0749 8.66393 14.4631 10.1628 11.461 11.7224ZM8.07352 8.77788C7.4821 7.44111 5.47663 6.27161 8.07441 4.22C11.3136 1.66324 9.65151 0 9.65151 0C10.3219 2.64149 7.2865 3.4394 6.19084 5.08443C5.44472 6.20535 6.55704 7.40983 8.07352 8.77788ZM11.5694 15.4108C9.11009 15.8738 6.07651 15.8198 4.27779 15.5229C4.27779 15.5229 4.64617 15.8279 6.53961 15.9498C9.42054 16.134 13.8457 15.8473 13.9503 14.484C13.9505 14.484 13.7491 15.0008 11.5694 15.4108Z" fill="#EA2D2E"/>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.79677 18.5601C8.79677 18.5601 7.86464 19.0934 9.46083 19.2736C11.3951 19.4908 12.3831 19.4595 14.514 19.0631C14.514 19.0631 15.075 19.4085 15.8581 19.7074C11.0799 21.7207 5.04419 19.5909 8.79677 18.5601ZM8.21267 15.9327C8.21267 15.9327 7.16697 16.6938 8.76457 16.8563C10.8309 17.0661 12.4619 17.0832 15.286 16.5489C15.286 16.5489 15.6759 16.9381 16.2896 17.1507C10.5132 18.8121 4.07988 17.2815 8.21267 15.9327Z" fill="#3174B9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.1343 11.4754C14.3122 12.8087 12.8256 14.0078 12.8256 14.0078C12.8256 14.0078 15.8151 12.4905 14.442 10.5898C13.16 8.81813 12.1767 7.93796 17.4996 4.90265C17.4994 4.90245 9.14399 6.95386 13.1343 11.4754Z" fill="#CA3132"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.4537 20.504C19.4537 20.504 20.1437 21.0634 18.6937 21.496C15.9364 22.3173 7.21545 22.5649 4.79303 21.5287C3.92286 21.156 5.55549 20.6393 6.06913 20.5302C6.60483 20.4164 6.91055 20.4371 6.91055 20.4371C5.94218 19.7665 0.651323 21.754 4.22351 22.3242C13.9642 23.8774 21.98 21.625 19.4537 20.504ZM9.2451 13.2104C9.2451 13.2104 4.80963 14.2467 7.67463 14.6234C8.88472 14.7825 11.2952 14.7458 13.5423 14.5605C15.3782 14.409 17.221 14.0848 17.221 14.0848C17.221 14.0848 16.5741 14.3578 16.1054 14.672C11.6005 15.8372 2.89923 15.2945 5.40445 14.1033C7.52258 13.0957 9.2451 13.2104 9.2451 13.2104ZM17.2026 17.5839C21.7816 15.2445 19.6645 12.996 18.1863 13.299C17.8249 13.3733 17.6627 13.4374 17.6627 13.4374C17.6627 13.4374 17.7976 13.2299 18.0539 13.1407C20.9776 12.1304 23.2257 16.1215 17.1112 17.7021C17.111 17.7021 17.1815 17.6396 17.2026 17.5839Z" fill="#3174B9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.442 0C14.442 0 16.9775 2.49481 12.0366 6.32991C8.07427 9.40747 11.1332 11.1617 12.0354 13.1667C9.72209 11.1147 8.02527 9.30792 9.1635 7.62679C10.8346 5.15906 15.4651 3.96232 14.442 0Z" fill="#CA3132"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.69564 23.9247C14.0902 24.201 20.8401 23.7711 21.0002 21.7257C21.0002 21.7257 20.6929 22.501 17.3679 23.1161C13.6165 23.8106 8.98886 23.7297 6.24512 23.2843C6.24512 23.2843 6.80735 23.7419 9.69564 23.9247Z" fill="#3174B9"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Before After
Before After

View file

@ -0,0 +1,130 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_214_4664)">
<g clip-path="url(#clip1_214_4664)">
<path d="M18.5108 15.7263L4.86963 23.8264L22.5325 22.6277L23.8928 4.81757L18.5107 15.7262L18.5108 15.7263Z" fill="url(#paint0_linear_214_4664)"/>
<path d="M22.5613 22.6158L21.0431 12.1376L16.908 17.5981L22.5613 22.6159V22.6158Z" fill="url(#paint1_linear_214_4664)"/>
<path d="M22.5819 22.6157L11.4598 21.7427L4.92847 23.8037L22.5819 22.6157Z" fill="url(#paint2_linear_214_4664)"/>
<path d="M4.94433 23.806L7.72282 14.7038L1.60864 16.011L4.94423 23.8059L4.94433 23.806Z" fill="url(#paint3_linear_214_4664)"/>
<path d="M16.9071 17.628L14.3505 7.6142L7.03418 14.4723L16.9071 17.6282V17.628Z" fill="url(#paint4_linear_214_4664)"/>
<path d="M23.3128 7.75521L16.3968 2.10675L14.4709 8.33284L23.3128 7.75521Z" fill="url(#paint5_linear_214_4664)"/>
<path d="M20.0785 0.0928351L16.0109 2.34075L13.4446 0.0627441L20.0785 0.0929288V0.0928351Z" fill="url(#paint6_linear_214_4664)"/>
<path d="M0 19.0644L1.70393 15.9568L0.325563 12.2546L0 19.0644Z" fill="url(#paint7_linear_214_4664)"/>
<path d="M0.233887 12.1376L1.62069 16.0713L7.64666 14.7193L14.5263 8.32553L16.4679 2.15858L13.4108 0L8.21332 1.94513C6.57576 3.46824 3.39821 6.48183 3.28366 6.53845C3.17024 6.59638 1.18536 10.348 0.233887 12.1376Z" fill="white"/>
<path d="M5.10338 5.07089C8.65242 1.55203 13.2276 -0.526963 14.9834 1.24456C16.7383 3.01608 14.8773 7.32114 11.3283 10.8389C7.77923 14.3565 3.26071 16.5501 1.50607 14.7785C-0.249706 13.0082 1.55434 8.58862 5.10338 5.07089Z" fill="url(#paint8_linear_214_4664)"/>
<path d="M4.94434 23.8024L7.70108 14.6712L16.8563 17.6124C13.5461 20.7165 9.86444 23.3406 4.94434 23.8024Z" fill="url(#paint9_linear_214_4664)"/>
<path d="M14.5386 8.30753L16.8889 17.6172C19.6541 14.7098 22.1357 11.5841 23.3512 7.7179L14.5387 8.30753H14.5386Z" fill="url(#paint10_linear_214_4664)"/>
<path d="M23.3272 7.76482C24.2679 4.92616 24.4849 0.85377 20.0494 0.0976562L16.4099 2.10793L23.3272 7.76482Z" fill="url(#paint11_linear_214_4664)"/>
<path d="M0 19.0234C0.1303 23.7085 3.51042 23.7783 4.95028 23.8194L1.62435 16.052L0 19.0234Z" fill="#9E1209"/>
<path d="M14.5515 8.32206C16.6764 9.62804 20.9588 12.2509 21.0456 12.2991C21.1805 12.375 22.8918 9.41338 23.2802 7.73956L14.5515 8.32206Z" fill="url(#paint12_radial_214_4664)"/>
<path d="M7.69727 14.6712L11.3825 21.7813C13.5616 20.5995 15.2681 19.1596 16.8309 17.6173L7.69727 14.6712Z" fill="url(#paint13_radial_214_4664)"/>
<path d="M1.60979 16.0615L1.08765 22.2793C2.07287 23.6251 3.42837 23.7421 4.85005 23.6372C3.82142 21.077 1.76652 15.9578 1.60979 16.0615Z" fill="url(#paint14_linear_214_4664)"/>
<path d="M16.3884 2.12361L23.7095 3.15101C23.3187 1.49536 22.1188 0.426895 20.0736 0.0928955L16.3884 2.12361Z" fill="url(#paint15_linear_214_4664)"/>
</g>
</g>
<defs>
<linearGradient id="paint0_linear_214_4664" x1="20.9918" y1="25.9932" x2="15.9571" y2="17.091" gradientUnits="userSpaceOnUse">
<stop stop-color="#FB7655"/>
<stop offset="0.41" stop-color="#E42B1E"/>
<stop offset="0.99" stop-color="#990000"/>
<stop offset="1" stop-color="#990000"/>
</linearGradient>
<linearGradient id="paint1_linear_214_4664" x1="23.5026" y1="18.5179" x2="16.4252" y2="17.1354" gradientUnits="userSpaceOnUse">
<stop stop-color="#871101"/>
<stop offset="0.99" stop-color="#911209"/>
<stop offset="1" stop-color="#911209"/>
</linearGradient>
<linearGradient id="paint2_linear_214_4664" x1="18.3052" y1="26.263" x2="18.214" y2="21.774" gradientUnits="userSpaceOnUse">
<stop stop-color="#871101"/>
<stop offset="0.99" stop-color="#911209"/>
<stop offset="1" stop-color="#911209"/>
</linearGradient>
<linearGradient id="paint3_linear_214_4664" x1="4.66646" y1="15.3622" x2="6.77074" y2="21.5326" gradientUnits="userSpaceOnUse">
<stop stop-color="white"/>
<stop offset="0.23" stop-color="#E57252"/>
<stop offset="0.46" stop-color="#DE3B20"/>
<stop offset="0.99" stop-color="#A60003"/>
<stop offset="1" stop-color="#A60003"/>
</linearGradient>
<linearGradient id="paint4_linear_214_4664" x1="11.5929" y1="9.25128" x2="11.9746" y2="15.9299" gradientUnits="userSpaceOnUse">
<stop stop-color="white"/>
<stop offset="0.23" stop-color="#E4714E"/>
<stop offset="0.56" stop-color="#BE1A0D"/>
<stop offset="0.99" stop-color="#A80D00"/>
<stop offset="1" stop-color="#A80D00"/>
</linearGradient>
<linearGradient id="paint5_linear_214_4664" x1="17.7393" y1="3.07765" x2="18.2974" y2="7.92811" gradientUnits="userSpaceOnUse">
<stop stop-color="white"/>
<stop offset="0.18" stop-color="#E46342"/>
<stop offset="0.4" stop-color="#C82410"/>
<stop offset="0.99" stop-color="#A80D00"/>
<stop offset="1" stop-color="#A80D00"/>
</linearGradient>
<linearGradient id="paint6_linear_214_4664" x1="14.3474" y1="1.39187" x2="15.1343" y2="-1.94476" gradientUnits="userSpaceOnUse">
<stop stop-color="white"/>
<stop offset="0.54" stop-color="#C81F11"/>
<stop offset="0.99" stop-color="#BF0905"/>
<stop offset="1" stop-color="#BF0905"/>
</linearGradient>
<linearGradient id="paint7_linear_214_4664" x1="0.470695" y1="13.6938" x2="2.52852" y2="14.9837" gradientUnits="userSpaceOnUse">
<stop stop-color="white"/>
<stop offset="0.31" stop-color="#DE4024"/>
<stop offset="0.99" stop-color="#BF190B"/>
<stop offset="1" stop-color="#BF190B"/>
</linearGradient>
<linearGradient id="paint8_linear_214_4664" x1="-2.23775" y1="18.7044" x2="16.2545" y2="-0.365098" gradientUnits="userSpaceOnUse">
<stop stop-color="#BD0012"/>
<stop offset="0.07" stop-color="white"/>
<stop offset="0.17" stop-color="white"/>
<stop offset="0.27" stop-color="#C82F1C"/>
<stop offset="0.33" stop-color="#820C01"/>
<stop offset="0.46" stop-color="#A31601"/>
<stop offset="0.72" stop-color="#B31301"/>
<stop offset="0.99" stop-color="#E82609"/>
<stop offset="1" stop-color="#E82609"/>
</linearGradient>
<linearGradient id="paint9_linear_214_4664" x1="11.9476" y1="20.6252" x2="6.71444" y2="18.4272" gradientUnits="userSpaceOnUse">
<stop stop-color="#8C0C01"/>
<stop offset="0.54" stop-color="#990C00"/>
<stop offset="0.99" stop-color="#A80D0E"/>
<stop offset="1" stop-color="#A80D0E"/>
</linearGradient>
<linearGradient id="paint10_linear_214_4664" x1="21.5286" y1="13.9301" x2="16.1381" y2="10.1013" gradientUnits="userSpaceOnUse">
<stop stop-color="#7E110B"/>
<stop offset="0.99" stop-color="#9E0C00"/>
<stop offset="1" stop-color="#9E0C00"/>
</linearGradient>
<linearGradient id="paint11_linear_214_4664" x1="23.3493" y1="5.78071" x2="20.8143" y2="3.20735" gradientUnits="userSpaceOnUse">
<stop stop-color="#79130D"/>
<stop offset="0.99" stop-color="#9E120B"/>
<stop offset="1" stop-color="#9E120B"/>
</linearGradient>
<radialGradient id="paint12_radial_214_4664" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(17.3448 9.57351) scale(6.07279 3.17318)">
<stop stop-color="#A80D00"/>
<stop offset="0.99" stop-color="#7E0E08"/>
<stop offset="1" stop-color="#7E0E08"/>
</radialGradient>
<radialGradient id="paint13_radial_214_4664" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(8.93478 17.5764) scale(8.07284 6.28431)">
<stop stop-color="#A30C00"/>
<stop offset="0.99" stop-color="#800E08"/>
<stop offset="1" stop-color="#800E08"/>
</radialGradient>
<linearGradient id="paint14_linear_214_4664" x1="3.21604" y1="23.7971" x2="-1.32907" y2="20.0244" gradientUnits="userSpaceOnUse">
<stop stop-color="#8B2114"/>
<stop offset="0.43" stop-color="#9E100A"/>
<stop offset="0.99" stop-color="#B3100C"/>
<stop offset="1" stop-color="#B3100C"/>
</linearGradient>
<linearGradient id="paint15_linear_214_4664" x1="18.6484" y1="1.18155" x2="19.9385" y2="4.44502" gradientUnits="userSpaceOnUse">
<stop stop-color="#B31000"/>
<stop offset="0.44" stop-color="#910F08"/>
<stop offset="0.99" stop-color="#791C12"/>
<stop offset="1" stop-color="#791C12"/>
</linearGradient>
<clipPath id="clip0_214_4664">
<rect width="24" height="24" fill="white"/>
</clipPath>
<clipPath id="clip1_214_4664">
<rect width="24" height="23.904" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 7.8 KiB

View file

@ -21,10 +21,7 @@ export function createInstallApiKey(name: string): CreateAPIKeyParams {
},
kibana_role_descriptors: {
can_install_integrations: {
elasticsearch: {
cluster: [],
indices: [],
},
elasticsearch: {},
kibana: [
{
feature: {

View file

@ -6,9 +6,9 @@
*/
import { ElasticsearchClient } from '@kbn/core/server';
import { cluster, indices } from './monitoring_config';
import { MONITOR_CLUSTER, INDEX_LOGS_AND_METRICS, WRITE_APM_EVENTS } from './privileges';
export function createShipperApiKey(esClient: ElasticsearchClient, name: string) {
export function createShipperApiKey(esClient: ElasticsearchClient, name: string, withAPM = false) {
// Based on https://www.elastic.co/guide/en/fleet/master/grant-access-to-elasticsearch.html#create-api-key-standalone-agent
return esClient.security.createApiKey({
body: {
@ -19,8 +19,9 @@ export function createShipperApiKey(esClient: ElasticsearchClient, name: string)
},
role_descriptors: {
standalone_agent: {
cluster,
indices,
cluster: [MONITOR_CLUSTER],
indices: [INDEX_LOGS_AND_METRICS],
applications: withAPM ? [WRITE_APM_EVENTS] : undefined,
},
},
},

View file

@ -6,13 +6,14 @@
*/
import { ElasticsearchClient } from '@kbn/core/server';
import { cluster, indices } from './monitoring_config';
import { MONITOR_CLUSTER, INDEX_LOGS_AND_METRICS, WRITE_APM_EVENTS } from './privileges';
export async function hasLogMonitoringPrivileges(esClient: ElasticsearchClient) {
export async function hasLogMonitoringPrivileges(esClient: ElasticsearchClient, withAPM = false) {
const res = await esClient.security.hasPrivileges({
body: {
index: indices,
cluster: [...cluster, 'manage_own_api_key'],
cluster: [MONITOR_CLUSTER, 'manage_own_api_key'],
index: [INDEX_LOGS_AND_METRICS],
application: withAPM ? [WRITE_APM_EVENTS] : undefined,
},
});

View file

@ -1,17 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
export const cluster = ['monitor'];
export const privileges = ['auto_configure', 'create_doc'];
export const indices = [
{
names: ['logs-*-*', 'metrics-*-*'],
privileges,
},
];

View file

@ -0,0 +1,26 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { estypes } from '@elastic/elasticsearch';
/**
* Grants all cluster read-only operations, like cluster health and state, hot threads, node info, node and cluster stats, and pending cluster tasks.
*/
export const MONITOR_CLUSTER: estypes.SecurityClusterPrivilege = 'monitor';
// https://www.elastic.co/guide/en/fleet/master/grant-access-to-elasticsearch.html#create-api-key-standalone-agent
export const INDEX_LOGS_AND_METRICS: estypes.SecurityIndicesPrivileges = {
names: ['logs-*-*', 'metrics-*-*'],
privileges: ['auto_configure', 'create_doc'],
};
// https://www.elastic.co/guide/en/observability/master/apm-api-key.html#apm-create-api-key-workflow-es
export const WRITE_APM_EVENTS: estypes.SecurityApplicationPrivileges = {
application: 'apm',
privileges: ['event:write', 'config_agent:read'],
resources: ['*'],
};

View file

@ -45,7 +45,7 @@ const createKubernetesOnboardingFlowRoute = createObservabilityOnboardingServerR
elasticsearch: { client },
} = await context.core;
const hasPrivileges = await hasLogMonitoringPrivileges(client.asCurrentUser);
const hasPrivileges = await hasLogMonitoringPrivileges(client.asCurrentUser, true);
if (!hasPrivileges) {
throw Boom.forbidden(
@ -57,7 +57,7 @@ const createKubernetesOnboardingFlowRoute = createObservabilityOnboardingServerR
const packageClient = fleetPluginStart.packageService.asScoped(request);
const [{ encoded: apiKeyEncoded }, elasticAgentVersion] = await Promise.all([
createShipperApiKey(client.asCurrentUser, 'kubernetes_onboarding'),
createShipperApiKey(client.asCurrentUser, `${params.body.pkgName}_onboarding`, true),
getAgentVersion(fleetPluginStart, kibanaVersion),
// System package is always required
packageClient.ensureInstalledPackage({ pkgName: 'system' }),

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { cluster, indices } from '../../lib/api_key/monitoring_config';
import { MONITOR_CLUSTER, INDEX_LOGS_AND_METRICS } from '../../lib/api_key/privileges';
export enum ObservabilityOnboardingUsername {
noAccessUser = 'no_access_user',
@ -21,8 +21,8 @@ export enum ObservabilityOnboardingCustomRolename {
export const customRoles = {
[ObservabilityOnboardingCustomRolename.logMonitoringUser]: {
elasticsearch: {
cluster: [...cluster, 'manage_own_api_key'],
indices,
cluster: [MONITOR_CLUSTER, 'manage_own_api_key'],
indices: [INDEX_LOGS_AND_METRICS],
},
},
};

View file

@ -32025,7 +32025,6 @@
"xpack.observability_onboarding.installElasticAgent.troubleshooting": "Résolution des problèmes",
"xpack.observability_onboarding.installIntegration.error.unauthorized": "Le privilège Kibana {requiredKibanaPrivileges} requis est manquant. Veuillez ajouter le privilège requis au rôle de l'utilisateur authentifié.",
"xpack.observability_onboarding.installOtelCollector.configStep.copyCommand": "Copier dans le presse-papiers",
"xpack.observability_onboarding.installOtelCollector.configStep.downloadConfigButton": "Télécharger le manifeste",
"xpack.observability_onboarding.otelLogs.status.failed": "Échec de l'installation de l'intégration",
"xpack.observability_onboarding.otelLogs.status.failedDetails": "Les données entrantes peuvent ne pas être indexées correctement. Détails :",
"xpack.observability_onboarding.otelLogsPanel.choosePlatform": "Choisissez une plateforme",
@ -32036,11 +32035,9 @@
"xpack.observability_onboarding.otelLogsPanel.feedbackButtons.title": "Donner un retour",
"xpack.observability_onboarding.otelLogsPanel.historicalDataDescription": "Les nouveaux messages de log sont collectés à partir de la configuration.",
"xpack.observability_onboarding.otelLogsPanel.historicalDataDescription2": "Le chemin des logs par défaut est /var/log/*. Vous pouvez si nécessaire modifier ce chemin dans le fichier otel.yml.",
"xpack.observability_onboarding.otelLogsPanel.kubernetesApplyCommandPromptLabel": "À partir du répertoire où le manifeste est téléchargé, exécutez la commande suivante pour installer le collecteur sur chaque nœud de votre cluster :",
"xpack.observability_onboarding.otelLogsPanel.limitationTitle": "Informations sur la configuration",
"xpack.observability_onboarding.otelLogsPanel.p.runTheCommandOnYourHostLabel": "Exécutez la commande suivante sur votre hôte pour télécharger et configurer le collecteur.",
"xpack.observability_onboarding.otelLogsPanel.p.startTheCollectorLabel": "Exécutez la commande suivante pour lancer le collecteur",
"xpack.observability_onboarding.otelLogsPanel.steps.downloadManifest": "Télécharger le manifeste :",
"xpack.observability_onboarding.otelLogsPanel.steps.platform": "Sélectionnez votre plateforme",
"xpack.observability_onboarding.otelLogsPanel.steps.start": "Lancez le collecteur",
"xpack.observability_onboarding.otelLogsPanel.techPreviewBadge.label": "Version d'évaluation technique",
@ -47532,4 +47529,4 @@
"xpack.watcher.watchEdit.thresholdWatchExpression.aggType.fieldIsRequiredValidationMessage": "Ce champ est requis.",
"xpack.watcher.watcherDescription": "Détectez les modifications survenant dans vos données en créant, gérant et monitorant des alertes."
}
}
}

View file

@ -31770,7 +31770,6 @@
"xpack.observability_onboarding.installElasticAgent.troubleshooting": "トラブルシューティング",
"xpack.observability_onboarding.installIntegration.error.unauthorized": "必要なkibana権限{requiredKibanaPrivileges}がありません。認証されたユーザーのロールに必要な権限を追加してください。",
"xpack.observability_onboarding.installOtelCollector.configStep.copyCommand": "クリップボードにコピー",
"xpack.observability_onboarding.installOtelCollector.configStep.downloadConfigButton": "マニフェストのダウンロード",
"xpack.observability_onboarding.otelLogs.status.failed": "統合のインストールに失敗しました",
"xpack.observability_onboarding.otelLogs.status.failedDetails": "受信データは正しくインデックス化されていない可能性があります。詳細:",
"xpack.observability_onboarding.otelLogsPanel.choosePlatform": "プラットフォームを選択",
@ -31781,11 +31780,9 @@
"xpack.observability_onboarding.otelLogsPanel.feedbackButtons.title": "フィードバックを作成する",
"xpack.observability_onboarding.otelLogsPanel.historicalDataDescription": "今後、新しいログメッセージはセットアップから収集されます。",
"xpack.observability_onboarding.otelLogsPanel.historicalDataDescription2": "デフォルトのログのパスは/var/log/*です。必要に応じて、otel.ymlファイルでこのパスを変更できます。",
"xpack.observability_onboarding.otelLogsPanel.kubernetesApplyCommandPromptLabel": "マニフェストがダウンロードされるディレクトリから、次のコマンドを実行し、クラスターのすべてのノードでコレクターをインストールします。",
"xpack.observability_onboarding.otelLogsPanel.limitationTitle": "構成情報",
"xpack.observability_onboarding.otelLogsPanel.p.runTheCommandOnYourHostLabel": "ホストで次のコマンドを実行して、コレクターをダウンロード、構成します。",
"xpack.observability_onboarding.otelLogsPanel.p.startTheCollectorLabel": "コレクターを開始するには、次のコマンドを実行してください",
"xpack.observability_onboarding.otelLogsPanel.steps.downloadManifest": "マニフェストをダウンロード:",
"xpack.observability_onboarding.otelLogsPanel.steps.platform": "プラットフォームを選択",
"xpack.observability_onboarding.otelLogsPanel.steps.start": "コレクターを開始",
"xpack.observability_onboarding.otelLogsPanel.techPreviewBadge.label": "テクニカルプレビュー",
@ -47270,4 +47267,4 @@
"xpack.watcher.watchEdit.thresholdWatchExpression.aggType.fieldIsRequiredValidationMessage": "フィールドを選択してください。",
"xpack.watcher.watcherDescription": "アラートの作成、管理、監視によりデータへの変更を検知します。"
}
}
}

View file

@ -31812,7 +31812,6 @@
"xpack.observability_onboarding.installElasticAgent.troubleshooting": "故障排除",
"xpack.observability_onboarding.installIntegration.error.unauthorized": "缺失所需的 Kibana 权限 {requiredKibanaPrivileges},请将所需权限添加到已通过身份验证的用户的角色。",
"xpack.observability_onboarding.installOtelCollector.configStep.copyCommand": "复制到剪贴板",
"xpack.observability_onboarding.installOtelCollector.configStep.downloadConfigButton": "下载清单",
"xpack.observability_onboarding.otelLogs.status.failed": "集成安装失败",
"xpack.observability_onboarding.otelLogs.status.failedDetails": "传入数据可能未正确索引。详情:",
"xpack.observability_onboarding.otelLogsPanel.choosePlatform": "选择平台",
@ -31823,11 +31822,9 @@
"xpack.observability_onboarding.otelLogsPanel.feedbackButtons.title": "反馈",
"xpack.observability_onboarding.otelLogsPanel.historicalDataDescription": "将从设置完成后收集新的日志消息。",
"xpack.observability_onboarding.otelLogsPanel.historicalDataDescription2": "默认日志路径为 /var/log/*。如果需要,可以在 otel.yml 文件中更改此路径。",
"xpack.observability_onboarding.otelLogsPanel.kubernetesApplyCommandPromptLabel": "从下载清单的目录中,运行以下命令以在您集群的每个节点上安装收集器:",
"xpack.observability_onboarding.otelLogsPanel.limitationTitle": "配置信息",
"xpack.observability_onboarding.otelLogsPanel.p.runTheCommandOnYourHostLabel": "在您的主机上运行以下命令,以下载和配置收集器。",
"xpack.observability_onboarding.otelLogsPanel.p.startTheCollectorLabel": "运行以下命令以启动收集器",
"xpack.observability_onboarding.otelLogsPanel.steps.downloadManifest": "下载清单:",
"xpack.observability_onboarding.otelLogsPanel.steps.platform": "选择平台",
"xpack.observability_onboarding.otelLogsPanel.steps.start": "启动收集器",
"xpack.observability_onboarding.otelLogsPanel.techPreviewBadge.label": "技术预览",
@ -47323,4 +47320,4 @@
"xpack.watcher.watchEdit.thresholdWatchExpression.aggType.fieldIsRequiredValidationMessage": "此字段必填。",
"xpack.watcher.watcherDescription": "通过创建、管理和监测警报来检测数据中的更改。"
}
}
}