Este producto no es compatible con el
sitio Datadog seleccionado. (
).
Disponible para:
Registros
Descripción general
Utilice la fuente Socket de Observability Pipelines para enviar registros al Worker a través de una conexión de socket (TCP o UDP).
Requisitos previos
If your forwarders are globally configured to enable SSL, you need the appropriate TLS certificates and the password for your private key.
Configuración
Para la gestión de secretos: solo ingrese los identificadores para la dirección del socket y, si corresponde, la contraseña de la clave TLS. No ingrese los valores reales.
Configure esta fuente cuando configure una canalización. Puede configurar una canalización en la interfaz de usuario, utilizando la API o con Terraform. Las instrucciones de esta sección son para configurar la fuente en la interfaz de usuario.
Nota: El Worker solo puede recibir registros a través de TCP o UDP. Si su aplicación escribe en un socket de dominio UNIX, consulte sockets de dominio UNIX para obtener más información.
Después de seleccionar la fuente Socket en la interfaz de usuario de la canalización:
- Ingrese el identificador para su dirección de socket. Si lo deja en blanco, se utiliza el predeterminado.
- En el menú desplegable Mode, seleccione el tipo de socket que desea utilizar.
- En el menú desplegable Framing, seleccione cómo delimitar el flujo de eventos.
| MÉTODO DE ENMARCADO | DESCRIPCIÓN |
|---|
newline_delimited | Los marcos de bytes están delimitados por un carácter de nueva línea. |
bytes | Los marcos de bytes se pasan tal cual según los límites de E/S subyacentes (por ejemplo, divididos entre mensajes o segmentos de flujo). |
character_delimited | Los marcos de bytes están delimitados por un carácter elegido. |
chunked_gelf | Los marcos de bytes son mensajes GELF fragmentados. |
octet_counting | Los marcos de bytes están delimitados según el formato de conteo de octetos. |
If you enter secret identifiers and then choose to use environment variables, the environment variable is the identifier entered and prepended with DD_OP_. For example, if you entered PASSWORD_1 for a password identifier, the environment variable for that password is DD_OP_PASSWORD_1.
Configuración de TLS opcional
Toggle the switch to Enable TLS.
- If you are using Secrets Management, enter the identifier for the key pass. See Secret defaults for the default used if the field is left blank.
- Enter the following certificate and key files:
Server Certificate Path: The path to the certificate file that has been signed by your Certificate Authority (CA) root file in DER, PEM, or CRT (X.509).- (Optional)
CA Certificate Path: The path to the certificate file that is your Certificate Authority (CA) root file in DER, PEM, or CRT (X.509). - (Optional)
Private Key Path: The path to the .key private key file that belongs to your Server Certificate Path in DER, PEM, or CRT (PKCS #8) format. - Notes:
- The configuration data directory
/var/lib/observability-pipelines-worker/config/ is automatically appended to the file paths. See Advanced Worker Configurations for more information. - The file must be readable by the
observability-pipelines-worker group and user.
- (Optional) Toggle Verify certificate to require connecting clients to present a valid client certificate. This enforces mutual TLS (mTLS), where the Worker verifies the identity of each connecting client.
Sockets de dominio UNIX
La fuente Socket solo admite la recepción de registros a través de TCP o UDP. Si su aplicación escribe en un socket de dominio UNIX, utilice socat para conectarlo a un socket TCP o UDP y enviar los registros al Worker.
Puente independiente
Ejecute socat junto con su aplicación para reenviar desde el socket UNIX al Worker:
socat UNIX-RECV:/var/run/app.sock TCP:<OPW_HOST>
Reemplace <OPW_HOST> con la dirección IP del servidor o la URL del balanceador de carga asociada con el Observability Pipelines Worker.
Sidecar de Kubernetes
En Kubernetes, el Worker normalmente se ejecuta como un StatefulSet detrás de un Service, por lo que no es accesible a través de localhost. Ejecute socat como un contenedor sidecar en el mismo pod que su aplicación y comparta un volumen para el archivo de socket. Por ejemplo:
volumes:
- name: app-socket
emptyDir: {}
initContainers:
# Remove any stale socket file before the sidecar starts
- name: socket-cleanup
image: busybox:1.36
command: ["sh", "-c", "rm -f /var/run/app/app.sock"]
volumeMounts:
- name: app-socket
mountPath: /var/run/app
containers:
# Your application container
- name: app
# ...
volumeMounts:
- name: app-socket
mountPath: /var/run/app
# socat sidecar: bridges the UNIX socket to the Worker's Service
- name: socat-opw-bridge
image: alpine/socat:1.8.0.0
args:
- UNIX-RECV:/var/run/app/app.sock,fork
- TCP:<RELEASE_NAME>-observability-pipelines-worker.<NAMESPACE>.svc.cluster.local:5000
volumeMounts:
- name: app-socket
mountPath: /var/run/app
# Monitor and adjust resources as necessary
resources:
requests:
cpu: 10m
memory: 16Mi
securityContext:
runAsNonRoot: true
runAsUser: 1000
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
Apunte el argumento TCP al punto de conexión del servicio de Kubernetes del Worker en lugar de localhost. No se garantiza que los pods del StatefulSet del Worker se ejecuten en cada nodo, por lo que es posible que el pod del Worker no sea accesible en localhost. Esto es especialmente cierto si tiene grupos de nodos dedicados para el Worker y sus cargas de trabajo.
Valores predeterminados de Secret
These are the defaults used for secret identifiers and environment variables.
- Identificador de dirección de socket:
- Hace referencia a la dirección y el puerto donde el Observability Pipelines Worker escucha los registros entrantes.
- El identificador predeterminado es
SOURCE_SOCKET_ADDRESS.
- Identificador de frase de contraseña TLS del socket (cuando TLS está habilitado):
- El identificador predeterminado es
SOURCE_SOCKET_KEY_PASS.