In the Deployments as chart annotations changelog, we introduced how to use log events as annotations on dashboards.
But how do you create these deployment events when you use Terraform? terraform apply is often the exact moment a deployment happens, but marking that moment in Dash0 used to mean stepping outside Terraform: the CLI, a CI step, a webhook. The dash0_deployment_event and dash0_log_event actions, introduced in the Terraform provider for Dash0 v1.16.0, close that gap.
deployment.hcl1234567891011121314151617181920resource "kubernetes_deployment" "checkout_api" {# ... deployment configuration ...lifecycle {action_trigger {events = [after_create, after_update]actions = [action.dash0_deployment_event.release]}}}action "dash0_deployment_event" "release" {config {service_name = "checkout-api"service_version = var.image_tagdeployment_environment_name = "production"deployment_status = "succeeded"dataset = "production"}}
dash0_deployment_event sends a dash0.deployment event that shows up as a dashboard annotation, so "what changed right before this graph moved?" has an answer.
dash0_log_event is its general-purpose sibling: send an arbitrary log event, mirroring the dash0 logs send CLI command.
Both need Terraform 1.14 or later and the provider's new otlp_url attribute (or DASH0_OTLP_URL), which points at the OTLP ingress endpoint rather than the API.
Learn more about actions via our documentation.