-
Notifications
You must be signed in to change notification settings - Fork 19
feat: support propagation of OpenTelemetry context from clients #568
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
base: develop
Are you sure you want to change the base?
feat: support propagation of OpenTelemetry context from clients #568
Conversation
… never defined [-Wunused-function]
…ry context from clients
…ry context from clients
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enables the propagation of OpenTelemetry context from clients to Steampipe FDW by extracting and forwarding tracing information.
- Adds new functions and tests to parse and propagate trace context in hub and FDW layers.
- Updates function signatures and logging for better trace context handling and debugging.
- Integrates trace context extraction from PostgreSQL session variables into the FDW plan state.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
types/pathkeys_test.go | Removed an unnecessary blank line. |
hub/trace_context_test.go | Introduced tests for tracing context parsing and verification. |
hub/scan_iterator_base.go | Added debug logging for creating and validating trace carriers. |
hub/hub_remote.go & hub/hub_local.go | Updated trace context function calls to incorporate new options. |
hub/hub_base.go | Modified trace context propagation and parsing, with improved logging. |
fdw/fdw_helpers.h, fdw/fdw.c, fdw/common.h, fdw.go | Added functions to extract and integrate trace context from session variables. |
Comments suppressed due to low confidence (1)
hub/hub_base.go:434
- The 'strings' package is used in parseTraceContext but is not imported. Please add "import "strings"" to the import block.
parts := strings.Split(traceContextString, ";")
@@ -9,8 +9,6 @@ package main | |||
#include "nodes/pg_list.h" | |||
#include "utils/timestamp.h" | |||
|
|||
static Name deserializeDeparsedSortListCell(ListCell *lc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also done separately in #567
*/ | ||
static char *extractTraceContextFromSession(void) | ||
{ | ||
const char *traceparent = GetConfigOption("steampipe.traceparent", true, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to fix indentation...
This PR allows forwarding OpenTelemetry context from clients to Steampipe FDW.
From client perspective, it can be used like this (python with psycopg):
When traces are ingested in an OpenTelemetry compatible solution such as Google Cloud Tracing, traces are properly grouped, e.g.: