Hi everyone,
Intro
I’m currently developing a Dagger module using the Python SDK to send notifications to Datadog.
dagger call send-event \
--title "Test Event" \
--msg "This is a test" \
--tags "env:test","team:dev" \
--alerte_type "info"
Context:
- Running in a Kubernetes environment.
Datadog agentandDagger engineare running in the cluster.- I want to send events via the agent’s
UDSsocket. - I’ve mounted the Datadog socket in the
dagger-enginecontainer.
Code Example
@function
async def send_event(
self,
title: str,
msg: str,
alerte_type: str,
tags: list[str],
):
"""Send an event to Datadog"""
client = DogStatsd(
statsd_socket_path: "/var/run/datadog/dsd.socket",
)
try:
client.event(
title=title,
message=msg,
alert_type=alerte_type,
tags=tags,
)
except Exception as e:
logger.error(f"Erreur lors de l'envoi : {e}")
Problem:
The Python code runs in a temporary container (spawned by Dagger), not in the dagger-engine container. Therefore, it cannot access the mounted Datadog socket.
Question:
Is there a way to share or mount the dagger-engine container’s socket into the temporary container where the Python module runs?
Thanks in advance! 🙏