Skip to content

instance_id tag always 0 exporting traces using OTEL #698

@jriguera

Description

@jriguera

We are using OTEL collector to receive telemetry from loggregator. For metrics and logs, the instace_id tag is the applicacion index (as stated in the docs) but when a span is generated on a gorouter (from an Envelope_Timer) the instance_id is always 0.

Eg:

Otel collector span dump:

    Trace ID       : 572d882b982442f17038cef2b6a7a7e2
    Parent ID      :
    ID             : 7038cef2b6a7a7e2
    Name           : /
    Kind           : Server
    Start time     : 2025-04-23 08:46:18.756613328 +0000 UTC
    End time       : 2025-04-23 08:46:18.76391097 +0000 UTC
    Status code    : Unset
    Status message :
Attributes:
     -> instance_id: Str(0)
     -> source_id: Str(0967492b-e013-4c4c-8607-e423b5e67ca4)
     -> component: Str(route-emitter)
     -> index: Str(09b2820c-76fc-4e22-be43-ceeb8b54b477)
     -> space_name: Str(test)
     -> space_id: Str(937d13ff-dbce-4740-bfdd-494d64727202)
     -> uri: Str(http://go-hello.t.cf.domain/)
     -> organization_id: Str(c1bc891b-1ec2-4131-a599-c6a18b51f90d)
     -> process_id: Str(0967492b-e013-4c4c-8607-e423b5e67ca4)
     -> custom_tag: Str(some_value)
     -> process_instance_id: Str(d5334cfb-a204-47c2-7b9f-8d42)
     -> request_id: Str(572d882b-9824-42f1-7038-cef2b6a7a7e2)
     -> remote_address: Str(x.x.x.16:44156)
     -> app_id: Str(0967492b-e013-4c4c-8607-e423b5e67ca4)
     -> process_type: Str(web)
     -> organization_name: Str(engineering-enablement)
     -> status_code: Str(200)
     -> deployment: Str(cf-test)
     -> method: Str(GET)
     -> app_name: Str(go-hello)
     -> user_agent: Str(curl/7.88.1)
     -> forwarded: Str(x.x.x.39 x.x.x.97)
     -> job: Str(router)
     -> content_length: Str(58)
     -> peer_type: Str(Server)
     -> ip: Str(x.x.x.179)
     -> origin: Str(gorouter)
     -> routing_instance_id: Str()

RTR Access log:

go-hello.t.cf.domain - [2025-04-23T08:46:18.756541129Z] "GET / HTTP/1.1" 200 0 58 "-" "curl/7.88.1" "x.x.x.16:44156" "x.x.x.92:61018" x_forwarded_for:"x.x.x.39, x.x.x.97, x.x.x.16" x_forwarded_proto:"http" vcap_request_id:"572d882b-9824-42f1-7038-cef2b6a7a7e2" response_time:0.007161 gorouter_time:0.000173 app_id:"0967492b-e013-4c4c-8607-e423b5e67ca4" app_index:"2" instance_id:"d5334cfb-a204-47c2-7b9f-8d42" x_cf_routererror:"-" x_forwarded_host:"-" traceparent:"00-572d882b982442f17038cef2b6a7a7e2-7038cef2b6a7a7e2-01" tracestate:"gorouter=7038cef2b6a7a7e2"

I will try to investigate where is the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Pending Review | Discussion

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions