-
Notifications
You must be signed in to change notification settings - Fork 85
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
PoC: Custom SDK #1045
PoC: Custom SDK #1045
Conversation
0847e51
to
9b8c7b9
Compare
We can overcome this by using a Regarding my other comment, I think we should have this working example include an auto span in the same trace (HTTP). |
trace.go
Outdated
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.
This needs to be in it's own module. Otherwise there will be a module cycle when we import otel
and it imports this.
Use the collector pdata package to serialize the span data.
…etry#1063) Bumps golang from 1.23.0 to 1.23.1. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…pen-telemetry#1057) * Bump golang from 1.23.0 to 1.23.1 in /internal/test/e2e/databasesql Bumps golang from 1.23.0 to 1.23.1. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Bump expected test output --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tyler Yahn <[email protected]>
…-telemetry#1058) * Bump golang from 1.23.0 to 1.23.1 in /internal/test/e2e/nethttp Bumps golang from 1.23.0 to 1.23.1. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Bump expected test output --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tyler Yahn <[email protected]>
open-telemetry#1065) * Bump golang from 1.23.0 to 1.23.1 in /internal/test/e2e/nethttp_custom Bumps golang from 1.23.0 to 1.23.1. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Bump expected test output --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tyler Yahn <[email protected]>
* Update generated offsets * Add changelog entry --------- Co-authored-by: MrAlias <[email protected]> Co-authored-by: Tyler Yahn <[email protected]> Co-authored-by: Tyler Yahn <[email protected]>
…lemetry#1067) * Bump golang from 1.23.0 to 1.23.1 in /internal/test/e2e/grpc Bumps golang from 1.23.0 to 1.23.1. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Bump expected test output --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tyler Yahn <[email protected]>
…pen-telemetry#1068) * Bump golang from 1.23.0 to 1.23.1 in /internal/test/e2e/otelglobal Bumps golang from 1.23.0 to 1.23.1. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Bump expected test output --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tyler Yahn <[email protected]>
…emetry#1070) * Bump golang from 1.23.0 to 1.23.1 in /internal/test/e2e/gin Bumps golang from 1.23.0 to 1.23.1. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Bump expected test output --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tyler Yahn <[email protected]>
…n-telemetry#1072) * Bump golang from 1.23.0 to 1.23.1 in /internal/test/e2e/kafka-go Bumps golang from 1.23.0 to 1.23.1. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Bump expected test output --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tyler Yahn <[email protected]>
* Bump golang.org/x/sys from 0.24.0 to 0.25.0 Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.24.0 to 0.25.0. - [Commits](golang/sys@v0.24.0...v0.25.0) --- updated-dependencies: - dependency-name: golang.org/x/sys dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Run go mod tidy --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tyler Yahn <[email protected]> Co-authored-by: Tyler Yahn <[email protected]>
* Flatten config pkg into auto * Update to use flattened pkg * Unexport the NewNoopConfigProvider func * Unexport unneeded sampling types
* Log the CLI version To help debug issues, include information about the CLI version when starting. Include the release version, a git hash, and information about the Go setup. * Add changelog entry * Update Makefile Build the cli pkg, not just main.go.
* Add gRPC Status object to offsets * Add ClientConn_Invoke_Returns ebpf probe * Add status code to span event * make docker-generate * Set grpc.status.code attribute * Generate status code fixture * Add changelog entry * Generate error span in grpc test * Switch to int32 and change offset logic * Check argument 2 and use bpf_probe_read_user * Add error struct to pointer chain * Update verify.bats * lint * Fix span status * Skip error checks if resp==nil * Use u32 * Update changelog * Add call to stop_tracking_span * Make docker-offsets * Update changelog for new offsets * make fixture-grpc * Update bats test
* Update generated offsets * Add change log entry --------- Co-authored-by: MrAlias <[email protected]> Co-authored-by: Tyler Yahn <[email protected]>
* Add the auto-instrumentation SDK wireframe Adds a new go.opentelemetry.io/auto/sdk module that holds the OpenTelemetry SDK implementation used by auto-instrumentation. Part of open-telemetry#954 Split from open-telemetry#1045 * Add dependabot entry * Ignore the sdk module until it is finished * Set Go mod go directive to 1.21.0 * Fix lint
…0.55.0 (open-telemetry#1096) * Bump go.opentelemetry.io/contrib/exporters/autoexport Bumps [go.opentelemetry.io/contrib/exporters/autoexport](https://github.com/open-telemetry/opentelemetry-go-contrib) from 0.54.0 to 0.55.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md) - [Commits](open-telemetry/opentelemetry-go-contrib@zpages/v0.54.0...zpages/v0.55.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/contrib/exporters/autoexport dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Run go mod tidy --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tyler Yahn <[email protected]>
…pen-telemetry#1085) Bumps [go.opentelemetry.io/otel/trace](https://github.com/open-telemetry/opentelemetry-go) from 1.29.0 to 1.30.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](open-telemetry/opentelemetry-go@v1.29.0...v1.30.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/otel/trace dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…y#1086) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.66.0 to 1.66.2. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](grpc/grpc-go@v1.66.0...v1.66.2) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…pen-telemetry#1087) Bumps [go.opentelemetry.io/otel/trace](https://github.com/open-telemetry/opentelemetry-go) from 1.29.0 to 1.30.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](open-telemetry/opentelemetry-go@v1.29.0...v1.30.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/otel/trace dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…etry#1094) Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.60.3 to 1.61.0. - [Release notes](https://github.com/golangci/golangci-lint/releases) - [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md) - [Commits](golangci/golangci-lint@v1.60.3...v1.61.0) --- updated-dependencies: - dependency-name: github.com/golangci/golangci-lint dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 27.2.0+incompatible to 27.2.1+incompatible. - [Release notes](https://github.com/docker/docker/releases) - [Commits](moby/moby@v27.2.0...v27.2.1) --- updated-dependencies: - dependency-name: github.com/docker/docker dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tyler Yahn <[email protected]>
* Switch SpanEvent times to use time.Time Use `time.Time`, a timestamp, to identify the start and end time of the `SpanEvent` instead of representing them as nanoseconds since boot time in a built-in `int64`. This is motivate by the need to support things that report timestamps for start/end times directly. Things like the custom SDK (see #1045). To support the conversion for probes, the `utils.BootOffsetToTime` function is added. This converts between the measured nanoseconds since boot-time that an eBPF program measures, and a timestamp. * Update internal/pkg/instrumentation/utils/kernel.go Co-authored-by: Ron Federman <[email protected]> --------- Co-authored-by: Ron Federman <[email protected]>
PoC for #954
This is a proof-of-concept for an SDK fully implemented by the auto-instrumentation. This supports all span functionality:
sample
method needs to be instrumented)Start
optionsWithLinks
WithNewRoot
WithSpanKind
(defaults to probeSpanKind
if not set)WithTimestamp
WithAttributes
AddEvent
method, including all optionsWithStacktrace
WithAttributes
WithTimestamp
AddLink
methodIsRecording
method (TODO: based on sampling support)SpanContext
methodSetStatus
methodSetAttribute
methodTracerProvider
methodEnd
optionsWithTimestamp
Design
auto.GetTracerProvider
There is only one function exported publicly. This is
GetTracerProvider
ingo.opentelemetry.io/auto
.This function returns a singleton instance of an opentelemetry-go
trace.TracerProvider
that is held in theinternal/sdk
package.internal/sdk
The
go.opentelemetry.io/auto/internal/sdk
package is added. This is a "full feature" OTel trace SDK from the perspective of theTracer
andSpan
.All data about any
Span
created will be built in userspace. This is stored (mostly) in the collector'sptrace.Traces
type.When the
Span
is ended theptrace.Traces
is marshaled into a proto binary encoding and passed as a buffer to theended
method of theSpan
. This method does nothing and is expecting a uprobe to be inserted at its call site.auto/sdk
probeA simple probe is added to instrument the
go.opentelemetry.io/auto/internal/sdk
package. This probe does not rely on any offsets from thesdk
types and simply routes the encoded span data fromended
to the events eBPF map.From there the
ptrace.Traces
data is unmarshaled and parsed into aSpanEvent
that theController
processes in the normal fashion.Demo
Run Jaeger
Run the example
Run the auto-instrumentation
You can also run with debug logging:
Let this run for a bit and then stop the example. Stopping the example while there is a span active means you will get an error. E.g.
(notice the
^C
is before the seconddone
)Review the span
Overview
Spans with recorded errors (via events)
Span links
Open Issues/Questions
412
is only supportedbpf_probe_read
: https://github.com/open-telemetry/opentelemetry-go-instrumentation/actions/runs/10605550069/job/29394558469?pr=1045SpanEvent
start and end times are relative offsets to the eBPF process time. This is changed in this PR, thereby breaking all other probes.ptrace
from the collector as the serialization format? Do we want to build our own?bpf_probe_write_user
. Can we use pinned eBPF maps to bypass this and communicate across processes?