Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

service.instance.id not working #1831

Closed
madchap opened this issue May 10, 2021 · 2 comments · Fixed by #1834
Closed

service.instance.id not working #1831

madchap opened this issue May 10, 2021 · 2 comments · Fixed by #1834
Labels
bug Something isn't working

Comments

@madchap
Copy link

madchap commented May 10, 2021

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.
@srikanthccv
Copy link
Member

@madchap You need to make that service.instance.id to string. Resource attributes must follow this specification https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/common.md#attributes.

@madchap
Copy link
Author

madchap commented May 10, 2021

Huh 🤦 Thanks.

@madchap madchap closed this as completed May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants