Skip to content

feat: switch to autoexport for OpenTelemetry span exporter#7317

Merged
mholt merged 1 commit intocaddyserver:masterfrom
PKeidel:fix-otel
Oct 23, 2025
Merged

feat: switch to autoexport for OpenTelemetry span exporter#7317
mholt merged 1 commit intocaddyserver:masterfrom
PKeidel:fix-otel

Conversation

@PKeidel
Copy link
Contributor

@PKeidel PKeidel commented Oct 23, 2025

This PR is about OTEL_EXPORTER_OTLP_PROTOCOL beeing ignored by caddy otel exporter #6483.

I used the Dockerfile provided by trajano (#6483 (comment)) to build with my changes and tested them with these files:

docker-compose.yml
services:
  caddy:
    image: caddy-fix
    #image: caddy:alpine
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile
    ports:
      - "80:80"
      - "443:443"
    environment:
      OTEL_SERVICE_NAME: 'my-app'
      OTEL_EXPORTER_OTLP_PROTOCOL: 'http/protobuf'
      OTEL_EXPORTER_OTLP_ENDPOINT: 'http://otel-collector:4318'

  otel-collector:
    image: otel/opentelemetry-collector-contrib:latest
    command: [ '--config=/etc/otel-collector-config.yaml' ]
    volumes:
      - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
otel-collector-config.yml
receivers:
  # Data sources: traces, metrics, logs
  otlp:
    protocols:
      http:
        endpoint: 0.0.0.0:4318

exporters:
  debug:
    verbosity: detailed

service:
  pipelines:
    traces:
      receivers: [ otlp ]
      processors: [ ]
      exporters: [ debug ]
Caddyfile
:80 {
    tracing {
        span frankenphp
    }
    root .
}

I used these commands:

go get go.opentelemetry.io/contrib/exporters/autoexport
go mod tidy

No AI was used.

@CLAassistant
Copy link

CLAassistant commented Oct 23, 2025

CLA assistant check
All committers have signed the CLA.

@francislavoie
Copy link
Member

Does this also resolve everything in #5743 ?

@trajano
Copy link

trajano commented Oct 23, 2025

IIRC correctly it should its been a while since I created the original PR which was blocked by linting issues due to some Go lang update or something.

Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alrighty, thanks -- let's see how this goes

@mholt mholt merged commit b54e870 into caddyserver:master Oct 23, 2025
27 of 28 checks passed
@trajano
Copy link

trajano commented Oct 24, 2025

Awesome, can't wait to drop my fork.

@PKeidel PKeidel deleted the fix-otel branch October 24, 2025 09:28
@PKeidel
Copy link
Contributor Author

PKeidel commented Oct 24, 2025

Hi, thank you for that really great and fast contribution experience :)

@mholt
Copy link
Member

mholt commented Oct 24, 2025

We're looking for more collaborators & maintainers, so feel free to keep it up! Including reviewing existing PRs or addressing issues and such. If you want 🙂

@mohammed90 mohammed90 mentioned this pull request Oct 25, 2025
46 tasks
@github-actions github-actions bot mentioned this pull request Dec 3, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants