Skip to content

service.instance.id not working #1831

@madchap

Description

@madchap

Describe your environment
Django 3.1 and uWSGI.

In my requirements.txt

opentelemetry-sdk==1.1.0
opentelemetry-instrumentation-django==0.20b0
opentelemetry-instrumentation-wsgi==0.20b0
opentelemetry-exporter-jaeger==1.1.0
opentelemetry-exporter-otlp==1.1.0
opentelemetry-api==1.1.0
uwsgidecorators==1.1.0

I use 2 exporters to tinker around: console and jaeger.

Per https://github.com/madchap/django-DefectDojo/blob/poc-telemetry/dojo/wsgi.py#L71, if service.instance.id is enabled, the console exporter will just not report anything anymore and the jaeger exporter simply ignores the field (at least it never showed up).

E.g. in jaeger, it would be missing:
image

And harder to see what does not appear in console, but otherwise works without it:

uwsgi_1         | {
uwsgi_1         |     "name": "^test/(?P<tid>\\d+)$",
uwsgi_1         |     "context": {
uwsgi_1         |         "trace_id": "0xe4db977a3a789cc631a6a959e3ae6290",
uwsgi_1         |         "span_id": "0xacf20d199787ac67",
uwsgi_1         |         "trace_state": "[]"
uwsgi_1         |     },
uwsgi_1         |     "kind": "SpanKind.SERVER",
uwsgi_1         |     "parent_id": null,
uwsgi_1         |     "start_time": "2021-05-10T05:27:53.730149Z",
uwsgi_1         |     "end_time": "2021-05-10T05:27:58.066896Z",
uwsgi_1         |     "status": {
uwsgi_1         |         "status_code": "UNSET"
uwsgi_1         |     },
uwsgi_1         |     "attributes": {
uwsgi_1         |         "http.method": "GET",
uwsgi_1         |         "http.server_name": "",
uwsgi_1         |         "http.scheme": "http",
uwsgi_1         |         "net.host.port": 8080,
uwsgi_1         |         "http.host": "localhost:8080",
uwsgi_1         |         "http.target": "/test/29",
uwsgi_1         |         "net.peer.ip": "172.90.6.1",
uwsgi_1         |         "http.user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
uwsgi_1         |         "net.peer.port": "38754",
uwsgi_1         |         "http.flavor": "1.1",
uwsgi_1         |         "http.route": "^test/(?P<tid>\\d+)$",
uwsgi_1         |         "http.status_code": 200
uwsgi_1         |     },
uwsgi_1         |     "events": [],
uwsgi_1         |     "links": [],
uwsgi_1         |     "resource": {
uwsgi_1         |         "telemetry.sdk.language": "python",
uwsgi_1         |         "telemetry.sdk.name": "opentelemetry",
uwsgi_1         |         "telemetry.sdk.version": "1.1.0",
uwsgi_1         |         "service.name": "DefectDojo",
uwsgi_1         |         "service.version": "2.0.0-dev"
uwsgi_1         |     }
uwsgi_1         | }

Steps to reproduce

  • Create a resource with attribute service.instance.id used by the TracerProvider.

What is the expected behavior?

  • I'd expect the console to work and show the attribute and not fail (?) silently
  • I'd expect Jaeger to show the attribute as well.

What is the actual behavior?

  • console exporter silently fails it seems, not outputting anything onto the screen.
  • jaeger never shows the attribute even when it's set.

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