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

Zipkin exporter and collector do not agree on wire representation of status codes #14965

Closed
mterwill opened this issue Oct 14, 2022 · 5 comments · Fixed by #24659
Closed

Zipkin exporter and collector do not agree on wire representation of status codes #14965

mterwill opened this issue Oct 14, 2022 · 5 comments · Fixed by #24659
Assignees
Labels
bug Something isn't working exporter/zipkin priority:p2 Medium

Comments

@mterwill
Copy link

What happened?

Description

The Zipkin exporter and collector do not agree on wire representation of status codes. And neither of which are in line with the spec. (See open-telemetry/opentelemetry-go#3287)

The Zipkin exporter serializes status codes as Unset, Error, and Ok:

https://github.com/open-telemetry/opentelemetry-go/blob/5568a3072367bb8ac4d2d9e759e7deb5a975b9f5/exporters/zipkin/model.go#L211-L213

https://github.com/open-telemetry/opentelemetry-go/blob/d616df61f5d163589228c5ff3be4aa5415f5a884/codes/codes.go#L38-L42

However, the collector expects STATUS_CODE_UNSET, STATUS_CODE_OK, or STATUS_CODE_ERROR, see here.

Environment

opentelemetry-go v1.11.0
opentelemetry-collector-contrib v0.62.0

Steps To Reproduce

Using Grafana Tempo's local example:

package main

import (
	"context"
	"log"

	"go.opentelemetry.io/otel"
	"go.opentelemetry.io/otel/codes"
	"go.opentelemetry.io/otel/exporters/zipkin"
	sdktrace "go.opentelemetry.io/otel/sdk/trace"
)

func main() {
	ctx := context.Background()

	exporter, err := zipkin.New("")
	if err != nil {
		log.Fatalf("creating exporter: %s", err)
	}

	tp := sdktrace.NewTracerProvider(
		sdktrace.WithSampler(sdktrace.AlwaysSample()),
		sdktrace.WithBatcher(exporter),
	)
	defer tp.Shutdown(ctx)
	otel.SetTracerProvider(tp)

	_, span := otel.Tracer("foo").Start(ctx, "foo")
	log.Printf("trace ID: %s", span.SpanContext().TraceID())
	span.SetStatus(codes.Error, "something went wrong")
	span.End()
}

image

Expected behavior

Status is correctly passed between exporter and collector.

Collector version

v0.62.0

Environment information

No response

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

@mterwill mterwill added bug Something isn't working needs triage New item requiring triage labels Oct 14, 2022
@evan-bradley evan-bradley added priority:p2 Medium exporter/zipkin and removed needs triage New item requiring triage labels Oct 17, 2022
@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@github-actions github-actions bot added the Stale label Dec 19, 2022
@jpkrohling
Copy link
Member

We don't seem to have a Zipkin code owner, it's unlikely that a maintainer is going to work on this. If a PR is sent, tag me and I'll gladly review it.

@github-actions github-actions bot removed the Stale label May 26, 2023
@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Jul 26, 2023
@jpkrohling
Copy link
Member

@jonatan-ivanov, I think you expressed interest in Zipkin in the past. Would you be interested in taking a look at this one?

@github-actions github-actions bot removed the Stale label Jul 27, 2023
@jonatan-ivanov
Copy link
Member

@jpkrohling Thank you for thinking of me but now and in the near future I don't think I will have time to do this.

@MovieStoreGuy MovieStoreGuy self-assigned this Jul 28, 2023
MovieStoreGuy added a commit that referenced this issue Jul 31, 2023
**Description:** 

It looks like there was a difference in expectations when it came to
parsing span status in tags, this looks to resolve this and provide
backwards support for existing implementations

**Link to tracking Issue:** 
Fixes
#14965

**Testing:**

Added new unit test to validate span status is correctly set.

**Documentation:** 
NA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exporter/zipkin priority:p2 Medium
Projects
None yet
5 participants