Skip to content

feat(logging): OpenTelemetry trace/span ID integration for Go logging library#10030

Merged
gkevinzheng merged 8 commits intogoogleapis:mainfrom
gkevinzheng:otel-span-support-go
May 16, 2024
Merged

feat(logging): OpenTelemetry trace/span ID integration for Go logging library#10030
gkevinzheng merged 8 commits intogoogleapis:mainfrom
gkevinzheng:otel-span-support-go

Conversation

@gkevinzheng
Copy link
Copy Markdown
Contributor

Fixes #9302

@gkevinzheng gkevinzheng requested review from a team and daniel-sanche April 23, 2024 20:48
@product-auto-label product-auto-label Bot added the api: logging Issues related to the Cloud Logging API. label Apr 23, 2024
Copy link
Copy Markdown
Contributor

@daniel-sanche daniel-sanche left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread logging/logging_test.go
}
}

func TestToLogEntryOTelIntegration(t *testing.T) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we plan to add system tests to start otel span and compare auto-generated otel spanId with the injected logEntry spanId?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@cindy-peng I just added an integration/system test for the exact same test case, just with different span setups.

@gkevinzheng gkevinzheng added the kokoro:run Add this label to force Kokoro to re-run the tests. label May 3, 2024
@kokoro-team kokoro-team removed the kokoro:run Add this label to force Kokoro to re-run the tests. label May 7, 2024
Comment thread logging/logging_test.go
ctx := context.Background()

// Set up an OTel SDK tracer if integration test, mock noop tracer if not.
if integrationTest {
Copy link
Copy Markdown
Contributor

@cindy-peng cindy-peng May 7, 2024

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think we have any right now, but if enough system tests happen that are kinda different from integration tests controlled by the integrationTest flag I could make a separate file for them.

@gkevinzheng gkevinzheng requested a review from dashpole May 7, 2024 16:58
@gkevinzheng gkevinzheng enabled auto-merge (squash) May 16, 2024 13:46
@gkevinzheng gkevinzheng merged commit c6711b8 into googleapis:main May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: logging Issues related to the Cloud Logging API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

logging: OpenTelemetry spans are ignored as parents for LogRecords

6 participants