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

Update to otel-go v1.0.0-RC1 #173

Merged
merged 7 commits into from Jun 24, 2021
Merged

Conversation

0xc0d
Copy link
Contributor

@0xc0d 0xc0d commented Jun 22, 2021

Since OpenTelemetry has been updated to v1.0.0-RC1 I am sending this PR.

Changes are:

  • exporter now satisfies otel Exporter interface which needs a slice of ReadOnlySpan
ExportSpans(context.Context, []*SpanSnapshot) error
ExportSpans(context.Context, []ReadOnlySpan) error 
  • WithDefaultTraceAttributes function and DefaultTraceAttributes are removed since it is not possible to add attributes to ReadOnlySpan
  • injectLabelsFromResources is removed since you can't inject anything to a ReadOnlySpan. Instead, attributeWithLabelsFromResources returns all attributes with labels from resources.
  • Tests for injectLabelsFromResources are removed since mocking ReadOnlySpan could lead to a problem in future. Although it might be an option to change attributeWithLabelsFromResources's signature to get an interface like this:
type AttributeGetter interface {
    Attributes() []attribute.KeyValue
    Resource() *resource.Resource
}

With this we can mock an interface to be able to test this function.

Copy link
Contributor

@punya punya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing this @0xc0d !

example/trace/http/client/client.go Outdated Show resolved Hide resolved
exporter/trace/cloudtrace.go Outdated Show resolved Hide resolved
0xc0d and others added 2 commits June 24, 2021 19:02
@punya punya merged commit 150c8da into GoogleCloudPlatform:main Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants