Use the native Grafana cloud otel endpoint

1. The problem I’m having:

I would like to send caddy tracing info directly do the Grafana cloud Otel entry point.

Apparently Grafana only supports the http entry point with protobuf format, but not the grpc entry point. Is there a way to get caddy to use the http format?

2. Error messages and/or full log output:

{"level":"info","ts":1747357968.8916361,"msg":"traces export: context deadline exceeded: rpc error: code = Unavailable desc = name resolver error: produced zero addresses"}

3. Caddy version:

$ docker compose exec caddy caddy version
v2.10.1-0.20250513211647-a76d005a94ff h1:ww9Pm6Rg67SIbi57+MeSyVpdR6/CdMlzKFYq6S32/A4=
$

4. How I installed and ran Caddy:

$ cat docker-compose.yml
services:
caddy:
container_name: caddy
restart: always
image: jumager/caddy:develop
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/run/tailscale:/var/run/tailscale
- /run/containers:/run/containers
- ./data:/data
- ./config:/config
ports:
- 80:80
- 443:443
- 443:443/udp
- 127.0.0.1:2019:2019
environment:
- CADDY_INGRESS_NETWORKS=caddy
- CADDY_DOCKER_CADDYFILE_PATH=/config/Caddyfile
- CADDY_HOST=redacted
- CADDY_TAILNET_HOST=redacted
- CADDY_REDIS_HOST=redacted
- CF_API_KEY=redacted
- OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp-gateway-prod-us-east-2.grafana.net/otlp
- OTEL_EXPORTER_OTLP_HEADERS=Authorization=Basic redacted_token
- OTEL_RESOURCE_ATTRIBUTES=service.name=caddy,service.namespace=caddy-group,deployment.environment=production
- OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
- GRPC_GO_LOG_VERBOSITY_LEVEL=99
- GRPC_GO_LOG_SEVERITY_LEVEL=info
extra_hosts:
- “host.docker.internal:host-gateway”
networks:
default:
name: caddy
external: true
$

a. System environment:

Oracle Linux 8 arm64 with docker

b. Command:

docker compose up -d

c. Service/unit/compose file:

$ cat docker-compose.yml
services:
  caddy:
    container_name: caddy
    restart: always
    image: jumager/caddy:develop
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /var/run/tailscale:/var/run/tailscale
      - /run/containers:/run/containers
      - ./data:/data
      - ./config:/config
    ports:
      - 80:80
      - 443:443
      - 443:443/udp
      - 127.0.0.1:2019:2019
    environment:
      - CADDY_INGRESS_NETWORKS=caddy
      - CADDY_DOCKER_CADDYFILE_PATH=/config/Caddyfile
      - CADDY_HOST=redacted
      - CADDY_TAILNET_HOST=redacted
      - CADDY_REDIS_HOST=redacted
      - CF_API_KEY=redacted
      - OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp-gateway-prod-us-east-2.grafana.net/otlp
      - OTEL_EXPORTER_OTLP_HEADERS=Authorization=Basic redacted_token
      - OTEL_RESOURCE_ATTRIBUTES=service.name=caddy,service.namespace=caddy-group,deployment.environment=production
      - OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
      - GRPC_GO_LOG_VERBOSITY_LEVEL=99
      - GRPC_GO_LOG_SEVERITY_LEVEL=info
    extra_hosts:
      - "host.docker.internal:host-gateway"
networks:
  default:
    name: caddy
    external: true
$

d. My complete Caddy config:

$ sudo cat config/caddy/Caddyfile.autosave
{
	emailuser@example.org
	cert_issuer acme
	auto_https disable_redirects
	acme_dns cloudflare {env.CF_API_KEY}
	default_sni {env.CADDY_HOST}
	storage redis {
		host {env.CADDY_REDIS_HOST}
	}
	log {
		level INFO
	}
}
(defaulthdr) {
	header {
		Strict-Transport-Security "max-age=15552000; includeSubDomains; preload"
		-Server
	}
	encode zstd gzip
	log
	tracing
}
(robots) {
	import defaulthdr
	handle_path /robots.txt {
		file_server * {
			root /data/web/robots/robots.txt
		}
	}
}
(norobots) {
	import defaulthdr
	handle_path /robots.txt {
		file_server * {
			root /data/robots/norobots.txt
		}
	}
}
(naked) {
	import defaulthdr
	redir https://www.{host}{uri} 308
}
{env.CADDY_TAILNET_HOST} {
	import defaulthdr
	log_skip /health
	handle /health {
		respond `{"status":"up"}`
	}
	handle_errors {
		respond "{uri}: {http.error.status_code} {http.error.status_text}" {http.error.status_code}
	}
	handle_path /watchtower/* {
		reverse_proxy 172.19.0.7:8080
	}
}
test.example.org {
	import norobots
	reverse_proxy unix+h2c//run/containers/slogtest.sock
}
{env.CADDY_HOST} {
	import defaulthdr
	reverse_proxy 172.19.0.3
}
$

5. Links to relevant resources: