* Make metric test helpers public
* Move everything metric test related to api/metric/metrictest
* Unify metric measurement assertions
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* Add otel/codes package to replace google.golang.org/grpc/codes
* Replace google.golang.org/grpc/codes with otel/codes
* Update opentracing bridge to use OTel codes
* Update semconv to use OTel codes
* Update SDK to convert from OTel codes to gRPC
* go mod tidy
* Add change to CHANGELOG
* Fix word from feedback
* Remove SDK from othttp instrumentation
* Remove dependency on SDK in api/kv pkg
Benchmark the kv package not the SDK here.
* Update api/global benchmarks
Move SDK related tests to SDK where applicable
* Add internal testing SDK implementation
To be used by the API for testing so it does not depend on the actual
SDK.
* Update api/global/internal to use internal/sdk
* Fix lint on sdk/metric benchmark
* Lint internal/sdk
* Merge internal/sdk into api/trace/testtrace
* Update Changelog
* Remove IndexedAttribute from api/label
IndexedAttribute is a synonym for IndexedLabel and a hold over from when
this iterator pattern had multiple implementations. Given it no longer
is uses, remove it to avoid introducing confusion to users.
* Update Changelog
* Update Changelog PR number
* Make the stdout exporter its own package
Follow the pattern of the other exporters.
* Update dependabot with stdout exporter
* Add replace directives for stdout exporter
* Remove outdated example test from metric SDK
* go mod tidy
* Update othttp example test
Remove unused stdout exporter.
* Remove tests in API that depend on stdout exporter
The global package does not need to be validated with the SDK. A more
properly constructed end-to-end integration test should be built if this
is actually needed.
* Add replace clause for otel in stdout go.mod
* Consolidate stdout exporter
* Move config to own file and match project standard
* Abstract Exporter into unified struct
* Rename trace part of the exporter
* Update import paths and configuration
* Update tests
* Update InstallNewPipeline to not return traceProvider
It is a registered global, access it that way.
* Update example_test
* Update docs
* Update example to be for whole package
* Update metric output
Closer match the span output.
* Clean up span output
Print as a batch and cleanup marshaling.
* Correct spelling error in doc
* Add Exporters README
* Update Changelog
* Propagate changes to rest of project
* Lint fixes
* Fix example test in metric SDK
* Add disable config options for trace and metric
Co-authored-by: Liz Fong-Jones <lizf@honeycomb.io>
* Add sem-conv for OS process as resource attr keys
Resolves#891
* Add PR number to Changelog
* Apply suggestions from code review
Co-authored-by: ET <evantorrie@users.noreply.github.com>
* Update comments to Linux
Co-authored-by: ET <evantorrie@users.noreply.github.com>
* Add http content size to standard package
Signed-off-by: Sam Xie <xsambundy@gmail.com>
* Include `http.request_content_length` in HTTP request basic attributes
Signed-off-by: Sam Xie <xsambundy@gmail.com>
* Add test for api.standard package
Signed-off-by: Sam Xie <xsambundy@gmail.com>
* Update CHANGELOG
Signed-off-by: Sam Xie <xsambundy@gmail.com>
* Fix http content size naming
Signed-off-by: Sam Xie <xsambundy@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* Correct B3 propagators and add tests
* Break up external integration and internal unit tests
* Add changes to Changelog.
* Update Changelog with PR number
* Fix lint issues
* Update trace flags
Add a new "not sampled" mask to complement the existing "sampled" one.
Rename `FlagsUnused` to `FlagsUnset`.
Add documentation for each of the flags to help understand their
purpose.
* Update extractSingle to support unset sampling
* Update existing tests to appropriately use FlagsUnset
* Remove bogus debug flag test
The B3 specification states "Debug is encoded as `X-B3-Flags: 1`. Absent
or any other values can be ignored", so testing of other values should
not result in an error.
* B3 Extract now supports parsing both headers
Remove test cases that would fail if the fallback header format was
expected to not be used.
* Feedback
* Switch to bitmask inject encoding field
Add the B3Encoding and valid HTTP based values. Change the B3 propagator
to use these bitmask fields to specify the inject encoding it will
propagate.
* Add comments
* Migrate B3 integration tests to existing testtrace
* Update comment
* Benchmark invalid B3 injects as well
* Update trace flags
Add a FlagsDebug and FlagsDeferred to track the B3 trace state.
Add helper methods to the SpanContext to check the debug and deferred
bit of the trace flags.
Update SpanContext.IsSampled to return if the sampling decision is to
sample rather than if the sample bit is set. This means that if the
debug bit is also set it will return true.
* Revert SpanContext.IsSampled back
* Add comment to b3 test data generation
* Update Changelog
* Fix trace flag name in Changelog
* Fix Changelog formatting
* Update Changelog
* Remove valid check at start of B3 injectg
This check makes sample only headers not propagate.
* Update B3 inject integration tests
Use the passed SpanContext and check directly the span ID.
* Update B3 integration tests
Run update checked SpanID to match sent.
Add tests to validate sample only transmissions and debug flag support.
* Rename injectTest parentSc to sc
This is no longer the parent.
* Update GetAllKeys for B3
* Un-Export the B3 headers
The B3SingleHeader name will conflict with the upcoming change to prefix
the SingleHeader encoding with "B3". There are a few options to address
this conflict, but in the end we do not need to be exporting these
values. They are duplicates of the OpenZipkin package and users should
use those.
* Rename B3 encodings and move support method to B3Encoding
Include a `B3` prefix to scope the encoding names.
Move the related support method to the B3Encoding itself, instead of the
B3 propagator.
Add tests to provide a sanity check for encoding bitmasks.
* Update span_context_test tests
Update test name to better describe how unused bits have no affect on
the sampling decision. Include the inverse of this test as well: not
sampled but has unused bits.
* Use named const for Single Header decoding widths
* Update api/trace/b3_propagator.go
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
* Update B3 header names
Correct the B3 single header name from `X-B3` to `b3`.
Use the lowercase version of the B3 multiple headers. This is based on
the fact that HTTP headers are case-insensitive, however, other
protocols may not be.
* Update Changelog
* Added support array attributes
* Changed function signature for AsArray attribute
* Fixed code comments for array attributes
* Fixed typos in comments in value.go
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
fixes#851
This includes all of the associated methods, such as
AsUint64, AsUint64Atomic, AsUint64Ptr, CoerceToUint64, SetUint64
SetUint64Atomic, SwapUint64, SwapUint64Atomic, AddUint64,
AddUint64Atomic, CompamreAndSwapUint64, CompareUint64
Only significant change as a result was converting the histogram
aggregator's `count` state field into an int64 from a `metric.Number`.
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* Support instrumentation library in metrics
* Update stdout exporter to display instrumentation info
* Fix tests that use the STDOUT exporter
* Refactor to keep SDK out of API
* Update global Meter and test Meter version
* Revert unneeded import syntax change
* Fix Unit comment
* Update comments
* Update comment
* Revert no-op change to import
On slower VMs (like the CI VMs), this test was timing out in 2ms and
failing. Additionally, in the process of failing, the suite tear-down
function would reset the globalHandler and cause a race with the spawned
goroutine that was abandoned.
This increases the pause from 2ms to 10ms, unifies and simplifies the
wait logic, and stops the child goroutine on failure.
* Update Tracer API with instrumentation version
Add option to the `Provider.Tracer` method to specify the
instrumentation version.
Update the global, noop, opentracing bridge, and default SDK
implementations.
This does not propagate the instrumentation library version to the
exported span. That is left for a follow-on PR.
* Revert trace_test.go
This is for the next PR.
* Update SDK to include version for default instrumentation
If the instrumentation library name is empty and the default
instrumentation is uses, include the SDK version.
* Update comments and documentation
* Remove default instrumentation version