* Fix instrumentation lib version in spanDataToThrift
* Update CHANGELOG.md
* Use test value for lib version in accordance with the spec
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* Move content length out of basic attributes
semconv.httpBasicAttributesFromHTTPRequest() was including the request's content length,
which is a high-cardinality label. It ended up in metric labels through the use of that function
by semconv.HTTPServerMetricAttributesFromHTTPRequest().
* Add CHANGELOG entry
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
http.ResponseWriters may implement additional interfaces
(http.CloseNotifier, http.Flusher, http.Hijacker, http.Pusher,
io.ReaderFrom) that get lost when the ResponseWriter is wrapped in
another object. This change uses the httpsnoop package to wrap the
ResponseWriter so that the resulting object implements any of the
optional interfaces that the original ResponseWriter implements as
well as using the replacement ResponseWriter methods that gather
information for tracing.
* Remove otel/sdk dependency from grpctrace
Use otel/trace/testtrace instead and cleanup testing code.
* Update httptrace to not depend on the SDK
Update testing to use api/trace/testtrace instead.
* Add changes to Changelog
* Restore check for `http.local` attr on `http.getconn`
* Move grpctrace examples from comment to code
The example use of the interceptors in the grpctrace package includes
invalid syntax and semantics. Instead of doing this, move the example
use to example tests that will be rendered in the godocs.
* Add changes to Changelog
* 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
* 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>
* Adjust Jaeger and Zipkin exporters helper methods
* Update and add tests, examples, various minor improvements
* Update changelog
* Correct the Zipkin example
- wait for the spans to be exported
- rebuild the example
* Zipkin service name as argument
* Rework Jaeger and Zipkin tests
* Include more detailed Changelog
Co-authored-by: ET <evantorrie@users.noreply.github.com>
Co-authored-by: Liz Fong-Jones <lizf@honeycomb.io>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* Import open-telemetry/opentelemetry-proto submodule under internal
* Commit changes in updated/new protobuf files
* Refer to new location of .pb.go files after rewrite from import
* Describe in CHANGELOG
* Add protogen workflow
* Move out protobuf generation to Makefile.proto
* Include in Changelog
* Update Makefile.proto
Move file-local mode variable to line by itself.
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* 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>
* 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