dokploy_telemetry_provider (Resource)
A telemetry provider (Settings > Logs & Metrics): a destination for the container logs and the host metrics that a Vector agent collects. Select the provider on the Dokploy host with telemetry_provider_ids on dokploy_web_server_settings. Dokploy v0.31.0 added this feature.
~> Dokploy never returns endpoint, api_key, or api_secret. Terraform cannot detect a change of these values outside Terraform, and an import leaves them null. Each update sends all three again.
~> Dokploy checks that the type supports each signal and that each required field of the type has a value. It does not test the connection on create or update.
Example Usage
# Grafana Loki for the container logs. Loki accepts logs only.
resource "dokploy_telemetry_provider" "loki" {
name = "loki"
provider_type = "loki"
signals = ["logs"]
endpoint = "https://logs.example.com/loki/api/v1/push"
# Write-only: Terraform 1.11 or later. Change the version to start an
# update when only the token changed.
api_key_wo = var.loki_token
api_key_wo_version = 1
extra_config = {
tenantId = "dokploy"
}
}
# Datadog for the logs and the host metrics.
resource "dokploy_telemetry_provider" "datadog" {
name = "datadog"
provider_type = "datadog"
signals = ["logs", "metrics"]
api_key_wo = var.datadog_api_key
extra_config = {
site = "datadoghq.eu"
}
}
# Start the Vector agent on the Dokploy host with both providers.
resource "dokploy_web_server_settings" "this" {
telemetry_provider_ids = [
dokploy_telemetry_provider.loki.id,
dokploy_telemetry_provider.datadog.id,
]
}Schema
Required
name(String) Display name. Dokploy does not enforce a unique name.provider_type(String) Destination type:loki,datadog,betterstack,elasticsearch,splunk_hec,aws_cloudwatch,prometheus_remote_write,new_relic, orinfluxdb.signals(Set of String) Data that the Vector agent sends:logs,metrics, or both. Dokploy rejects a signal that the type does not support, for examplemetricsforloki.
Optional
NOTE: Write-only arguments are supported in Terraform 1.11 and later.
api_key(String, Sensitive) API key, token, or password of the destination. Foraws_cloudwatch, the access key id. Dokploy does not return the value. Do not set it together withapi_key_wo.api_key_wo(String, Sensitive, Write-only) Write-only form ofapi_key. Terraform keeps it out of the plan and the state. It needs Terraform 1.11 or later. Do not set it together withapi_key. The server does not return the value, so every update sends it. Changeapi_key_wo_versionto start an update when only this value changed.api_key_wo_version(Number) Version ofapi_key_wo. Change it to start an update when onlyapi_key_wochanged. It needsapi_key_wo.api_secret(String, Sensitive) Second secret of the destination. Onlyaws_cloudwatchuses it, for the secret access key. Dokploy does not return the value. Do not set it together withapi_secret_wo.api_secret_wo(String, Sensitive, Write-only) Write-only form ofapi_secret. Terraform keeps it out of the plan and the state. It needs Terraform 1.11 or later. Do not set it together withapi_secret. The server does not return the value, so every update sends it. Changeapi_secret_wo_versionto start an update when only this value changed.api_secret_wo_version(Number) Version ofapi_secret_wo. Change it to start an update when onlyapi_secret_wochanged. It needsapi_secret_wo.enabled(Boolean) Whether the Vector agents send data to the destination. Defaults totrue.endpoint(String) URL of the destination, for the types that need one, for examplehttps://logs.example.com/loki/api/v1/push. Dokploy does not return the value, so the provider cannot detect a change made outside Terraform.extra_config(Map of String) Fields that only some types use, for exampleregionandlogGroupforaws_cloudwatch,tenantIdandusernameforloki, ororgandbucketforinfluxdb. The keys are the field names of the Dokploy UI form in camel case.
Read-Only
created_at(String) Creation timestamp from the server.id(String) Telemetry provider id.organization_id(String) Id of the organization that owns the provider.
Import
Import is supported using the following syntax:
In Terraform v1.5.0 and later, the import block can be used with the id attribute, for example:
import {
to = dokploy_telemetry_provider.loki
id = "4CdmgsO7zpoBS4Vxm1IAP"
}The terraform import command can be used, for example:
terraform import dokploy_telemetry_provider.loki 4CdmgsO7zpoBS4Vxm1IAP