Opentelemetry-go: Update otlp exporter to be in sync with changes on opentelemetry-colletor v0.14.0

Created on 16 Nov 2020  路  7Comments  路  Source: open-telemetry/opentelemetry-go

Description

It's my first issue on opentelemetry org, I appreciate any feedback and I'm glad to add more details. I would like to run my app with opentelemetry collector sending spans to Jaeger (instead of directly running jaeger collector) to be platform agnostic and potentially change it to Google Cloud Tracing later on.

Issue

All spans are being sent with error tag when using otel-collector with jaeger exporter. otel-collector logs:

otel-collector       | 2020-11-16T08:47:36.052Z DEBUG   loggingexporter/logging_exporter.go:370 ResourceSpans #0
otel-collector       | Resource labels:
otel-collector       |      -> service.name: STRING(oltp-exporter-app)
otel-collector       | InstrumentationLibrarySpans #0
otel-collector       | InstrumentationLibrary go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp
otel-collector       | Span #0
otel-collector       |     Trace ID       : eeaeb90b4167969c87ba539648fb0484
otel-collector       |     Parent ID      : fa674910a1b231f7
otel-collector       |     ID             : c5429a01f97b2fd3
otel-collector       |     Name           : GET
otel-collector       |     Kind           : SPAN_KIND_CLIENT
otel-collector       |     Start time     : 2020-11-16 08:47:35.6464 +0000 UTC
otel-collector       |     End time       : 2020-11-16 08:47:35.835430537 +0000 UTC
otel-collector       |     Status code    : STATUS_CODE_UNSET
otel-collector       |     Status message : HTTP status code: 200
otel-collector       | Attributes:
otel-collector       |      -> http.method: STRING(GET)
otel-collector       |      -> http.url: STRING(https://github.com)
otel-collector       |      -> http.scheme: STRING(http)
otel-collector       |      -> http.host: STRING(github.com)
otel-collector       |      -> http.flavor: STRING(1.1)
otel-collector       |      -> http.status_code: INT(200)
otel-collector       | InstrumentationLibrarySpans #1
otel-collector       | InstrumentationLibrary oltp-exporter-app
otel-collector       | Span #0
otel-collector       |     Trace ID       : eeaeb90b4167969c87ba539648fb0484
otel-collector       |     Parent ID      :
otel-collector       |     ID             : fa674910a1b231f7
otel-collector       |     Name           : send event
otel-collector       |     Kind           : SPAN_KIND_INTERNAL
otel-collector       |     Start time     : 2020-11-16 08:47:35.646332 +0000 UTC
otel-collector       |     End time       : 2020-11-16 08:47:35.835475035 +0000 UTC
otel-collector       |     Status code    : STATUS_CODE_UNSET
otel-collector       |     Status message :
otel-collector       |

Screenshot 2020-11-16 at 09 50 26

Expected behaviour

No errors being showed on Jaeger UI which is what I get using jaeger collector:
Screenshot 2020-11-16 at 09 50 44

Steps to reproduce

https://github.com/neemiasjnr/otel-playground

  1. Run otel-collector and jaeger-all-in-one
git clone https://github.com/neemiasjnr/otel-playground
docker-compose up
  1. Run oltp-exporter app and check oltp-exporter-app trace on http://localhost:16686/
cd oltp-exporter
go run main.go
  1. (Optional) Run jaeger-exporter app and check jaeger-exporter-app trace on http://localhost:16686/
cd jaeger-exporter
go run main.go
bug question

Most helpful comment

I confirm that the 0.14.0 release solved this issue, therefore I'm closing this.

All 7 comments

I opened the issue here because I'm following the examples folder from this repo and it didn't work for me, if you think this belongs to https://github.com/open-telemetry/opentelemetry-collector I can close it here and reopen there. Any thoughts?

I'm not sure yet whether this is an issue with the collector or the exporter, but the issue does not exist using v0.13.0 of the collector. I suspect this is related to the change to the status code enumeration and that we may need to update the OTLP definitions used here.

I am using v0.13.0 in my previous example and didn't work. Since open telemetry is distributed into multiple services, what's the best approach to debug problems like this?

v0.13.0 of the SDK or of the collector? Your docker-compose.yaml in the repro repo was referencing otel/opentelemetry-collector:latest and I made this change and stopped seeing the errors:

diff --git a/docker-compose.yaml b/docker-compose.yaml
index 6d24b44..e7eafee 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -11,7 +11,7 @@ services:
       - LOG_LEVEL=debug

   otel-collector:
-    image: otel/opentelemetry-collector:latest
+    image: otel/opentelemetry-collector:0.13.0
     container_name: otel-collector
     command: ["--config=/conf/otel-collector-config.yaml", "--log-level=DEBUG"]
     volumes:

I think we have some known issues in this project relating to updated OTLP protocol versions, so it is possible we're not doing the right thing in the exporter, but it's also possible something in the v0.14.0 collector. Perhaps opening an issue in the collector repo and linking this one will get eyes on it from both ends and a quicker resolution.

Yes you are right, here is the difference on otel-collector receiving the span:
using 0.13.0: Status code : STATUS_CODE_OK
using 0.14.0: Status code : STATUS_CODE_UNSET

Looking into these PRs opentelemetry-collector#2031 and opentelemetry-proto#224 looks like we need to update proto version to v0.6 and send DEPRECATED_STATUS_CODE_OK on otlp exporter according to this instruction: https://github.com/open-telemetry/opentelemetry-proto/blob/master/opentelemetry/proto/trace/v1/trace.proto#L245

The Go SDK has already been updated to use the Unset/Ok/Error codes, so I think we'd want to update to proto v0.6 and just use the new fields. I wonder if there is a bug in the collector jaeger exporter, though, as an unset code should not be interpreted as an error.

I confirm that the 0.14.0 release solved this issue, therefore I'm closing this.

Was this page helpful?
0 / 5 - 0 ratings