Skip to content

[opentelemetry-php-contrib] Wrong IP in network.peer.address attribute for Laravel auto instrumentation #1537

@LauJosefsen

Description

@LauJosefsen

I think either I am misunderstanding the Http SemConv, or there is a small bug in the Laravel Auto Instrumentation

\Illuminate\Http\Request::ip returns the IP resolved through proxies using x-forwarded-for etc (The TrustProxies middleware). and should thus be the client.address attribute rather than network.peer.address ? Im reading on this site: https://opentelemetry.io/docs/specs/semconv/http/http-spans/

I think the network.peer.address can be resolved from $request->server->get('REMOTE_ADDR') instead.

It would still be great to include $request->ip in the client.address attribute instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions