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

Span Attributes are Null #1385

Closed
stevencl1013 opened this issue Jul 16, 2020 · 6 comments
Closed

Span Attributes are Null #1385

stevencl1013 opened this issue Jul 16, 2020 · 6 comments
Assignees
Labels
bug Something isn't working
Projects
Milestone

Comments

@stevencl1013
Copy link

stevencl1013 commented Jul 16, 2020

Describe the bug
Span attributes are null

Steps to reproduce
Send spans with attributes. I used an example similar to the http example in the opentelemetry-go repo, except I'm using the otlp exporter pointing at my collector.

What did you expect to see?
I expect to see values for each of my span attributes, as shown below:
image

What did you see instead?
Attribute values were null. (g.co/agent label was added by the exporter after the fact)
image

What version did you use?
Docker image: otel/opentelemetry-collector-contrib:0.6.0
Also experienced this issue in 0.5.0, but not in 0.4.0.

What config did you use?
Config:

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:55678
exporters:
  stackdriver:
    project: "my-gcp-project-id"
processors:
  batch:
  queued_retry:
extensions:
  pprof:
    endpoint: :1888
service:
  extensions: [pprof]
  pipelines:
    traces:
      receivers: [otlp]
      exporters: [stackdriver]
      processors: [batch, queued_retry]
    metrics:
      receivers: [otlp]
      exporters: [stackdriver]

Environment
Running in GKE. Also experienced this issue using otlp exporter

@stevencl1013 stevencl1013 added the bug Something isn't working label Jul 16, 2020
@stevencl1013
Copy link
Author

@tigrannajaryan

@jufab
Copy link

jufab commented Jul 17, 2020

To add more information in this issue, i have the same problem with Jaeger or Zipkin exporter.
And, the service name is missing.
(Works fine with the 0.4.0 collector)
my config

receivers:
  otlp:
    protocols:
      http:
        endpoint: "0.0.0.0:55680"
        cors_allowed_origins:
        - http://*
        - https://*
exporters:
  jaeger:
    endpoint: jaeger:14250
    insecure: true
  zipkin:
    endpoint: "http://zipkin:9411/api/v2/spans"
processors:
  batch:
    send_batch_size: 1
extensions:
  zpages:
    endpoint: "0.0.0.0:55679"
service:
  extensions : [zpages]
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [jaeger,zipkin]

Payload send to otlp

curl 'http://localhost:55680/v1/trace' \
  --data-binary '{"resourceSpans":[{"resource":{"attributes":[{"key":"service.name","type":0,"stringValue":"example-app"},{"key":"telemetry.sdk.language","type":0,"stringValue":"webjs"},{"key":"telemetry.sdk.name","type":0,"stringValue":"opentelemetry"},{"key":"telemetry.sdk.version","type":0,"stringValue":"0.9.0"}],"droppedAttributesCount":0},"instrumentationLibrarySpans":[{"spans":[{"traceId":"yizf+YkMQrkekwbM0ipIgg==","spanId":"mrAdWyQZC2E=","name":"http://localhost:4200/api/","kind":1,"startTimeUnixNano":1595018191682410000,"endTimeUnixNano":1595018191791799800,"attributes":[{"key":"http.method","type":0,"stringValue":"GET"},{"key":"http.url","type":0,"stringValue":"http://localhost:4200/api/"},{"key":"http.status_code","type":2,"doubleValue":200}],"droppedAttributesCount":0,"events":[{"timeUnixNano":1595018191791530000,"name":"response","attributes":[{"key":"body","type":0,"stringValue":"{\"result\":\"ok\"}"}],"droppedAttributesCount":0}],"droppedEventsCount":0,"status":{"code":0},"links":[],"droppedLinksCount":0}],"instrumentationLibrary":{"name":"opentelemetry - webjs","version":"0.9.0"}}]}]}'

Zipkin result
zipkin-error

Jaeger result
jaeger-error

@flands flands added this to To do in Collector via automation Jul 20, 2020
@flands flands added this to the Beta 0.7.0 milestone Jul 20, 2020
@rmfitzpatrick
Copy link
Contributor

Will be happy to investigate.

@rmfitzpatrick
Copy link
Contributor

@stevencl1013 & @jufab thanks for your patience. I believe you're both running into the breaking change that was introduced w/ opentelemetry-proto v0.4.0 where the trace protocol changed regarding attribute values. This was adopted for the Collector release v0.5.0 so any OTLP exporters should also be using the v0.4.0 version of the protocol.

Collector release - https://github.com/open-telemetry/opentelemetry-collector/releases/tag/v0.5.0
Collector adoption - #1142
protocol release - https://github.com/open-telemetry/opentelemetry-proto/releases/tag/v0.4.0
protocol change - open-telemetry/opentelemetry-proto#157

@jufab the current protocol would be of the form (note the updated attribute value objects):

curl http://localhost:55680/v1/trace -H "Content-Type: application/json" -d '{ "resourceSpans": [ { "resource": { "attributes": [ { "key": "service.name", "value": { "stringValue": "example-app" } }, { "key": "telemetry.sdk.language", "value": { "stringValue": "webjs" } }, { "key": "telemetry.sdk.name", "value": { "stringValue": "opentelemetry" } }, { "key": "telemetry.sdk.version", "value": { "stringValue": "0.9.0" } } ], "droppedAttributesCount": 0 }, "instrumentationLibrarySpans": [ { "spans": [ { "traceId": "yizf+YkMQrkekwbM0ipIgg==", "spanId": "mrAdWyQZC2E=", "name": "http://localhost:4200/api/", "kind": 1, "startTimeUnixNano": 1595018191682410000, "endTimeUnixNano": 1595018191791799800, "attributes": [ { "key": "http.method", "value": { "stringValue": "GET" } }, { "key": "http.url", "value": { "stringValue": "http://localhost:4200/api/" } }, { "key": "http.status_code", "value": { "doubleValue": 200 } } ], "droppedAttributesCount": 0, "events": [ { "timeUnixNano": 1595018191791530000, "name": "response", "attributes": [ { "key": "body", "value": { "stringValue": "{\"result\": \"ok\"}" } } ], "droppedAttributesCount": 0 } ], "droppedEventsCount": 0, "status": { "code": 0 }, "links": [], "droppedLinksCount": 0 } ], "instrumentationLibrary": { "name": "opentelemetry - webjs", "version": "0.9.0" } } ] } ] }'

@jufab
Copy link

jufab commented Jul 28, 2020

@rmfitzpatrick I tried this and it's ok for me.
And, there is a new release in js library (0.10.0) with this implementation and now it works.
Release : https://github.com/open-telemetry/opentelemetry-js/releases/tag/v0.10.0
PR : open-telemetry/opentelemetry-js#1339
Thanks for your help.

@bogdandrutu
Copy link
Member

Closing this issue since @rmfitzpatrick found the issue.

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
No open projects
Collector
  
Done
Development

No branches or pull requests

5 participants