* Update grpctrace instrumentation span names
Span names MUST not contain the leading slash (`/`) that the grpc
package prepends to all `FullMethod` values. This replaces the
`serviceFromFullMethod` function with a parsing function. This parsing
function returns an span name adhering to the OpenTelemetry semantic
conventions as well as formatted span attributes.
Additionally, the service name needs to include the package if one
exists. This updates that attribute accordingly.
Once #900 is merged the method attributes can be added by uncommenting.
Resolves#916
* Update Changelog
* Update comment to plural
* Switch from regexp to string parsing
* Consolidate attributes before creating span
* Update Changelog with addition of rpc.method in grpctrace
* Fix test spanMap lookup key
* Update instrumentation/grpctrace/interceptor.go
Co-authored-by: ET <evantorrie@users.noreply.github.com>
* Unify on explicit typed return value
* Fix copy paste error
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>
* Avoid applying stale udpates; add a test
* Add Memory option to basic processor
* Always use memory in the pull controller
* Test the memory option
* Precommit
* Add a Prometheus-specific test
* More comment on Memory option
* Link to 862
* Remove sleep
* Update changelog
* Comment on stale and stateless aggregators
* Update sdk/metric/processor/basic/config.go
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Liz Fong-Jones <lizf@honeycomb.io>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.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>
* Update OTLP to v0.4.0
* Update attribute transforms to use new KeyValue
* Update metric transforms
The labels are no longer included in the MetricDescriptor
Use new types.
* Fix OTLP integration tests
* Update example otel-collector go.sum
* Update metric integration testing
* Fix type error introduced in conflict resolution
* Deep clean of go.sum
Recreate go.sum for otel-collector example and OTLP exporter.
Transitive dependency changes sometimes do require a change to go.mod
files as well as go.sum. This is already live in the
opentelemetry-go-contrib repo, and this PR brings it here.
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>