1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-10 09:50:58 +02:00
Commit Graph

484 Commits

Author SHA1 Message Date
Bogdan Drutu
4d9d882c38
Fix imports in all files except generated files in jaeger exporter (#2383)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-11-13 08:35:04 -08:00
Anthony Mirabella
a65d50a4c6
Prepare for v1.2.0 release (#2377)
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-11-12 11:43:51 -05:00
Tyler Yahn
dc888a9802
Upgrade packages (#2378)
Bump github.com/golangci/golangci-lint from 1.42.1 to 1.43.0 in /internal/tools.
Bump google.golang.org/grpc from 1.41.0 to 1.42.0 in /exporters/otlp/otlpmetric.
Bump go.opentelemetry.io/proto/otlp from 0.9.0 to 0.10.0 in /exporters/otlp/otlpmetric/otlpmetrichttp.
Bump go.opentelemetry.io/proto/otlp from 0.9.0 to 0.10.0 in /exporters/otlp/otlpmetric.
Bump go.opentelemetry.io/proto/otlp from 0.9.0 to 0.10.0 in /exporters/otlp/otlptrace.
Bump google.golang.org/grpc from 1.41.0 to 1.42.0 in /exporters/otlp/otlpmetric/otlpmetricgrpc.
Bump google.golang.org/grpc from 1.41.0 to 1.42.0 in /exporters/otlp/otlptrace.
Bump go.opentelemetry.io/proto/otlp from 0.9.0 to 0.10.0 in /exporters/otlp/otlptrace/otlptracehttp.
Bump google.golang.org/grpc from 1.41.0 to 1.42.0 in /exporters/otlp/otlptrace/otlptracegrpc.
Bump go.opentelemetry.io/proto/otlp from 0.9.0 to 0.10.0 in /exporters/otlp/otlpmetric/otlpmetricgrpc.
Bump go.opentelemetry.io/proto/otlp from 0.9.0 to 0.10.0 in /exporters/otlp/otlptrace/otlptracegrpc.
Bump github.com/benbjohnson/clock from 1.1.0 to 1.2.0 in /sdk/metric.
Bump google.golang.org/grpc from 1.41.0 to 1.42.0 in /example/otel-collector.
2021-11-11 15:33:55 -08:00
Philip K. Warren
6d2aeb0dc3
Empty queued spans when ForceFlush called (#2335)
* Empty queued spans when ForceFlush called

Update the implementation of ForceFlush() to first ensure that all spans
which are queued are added to the batch before calling export spans.
Create a small ReadOnlySpan implementation which can be used as a marker
that ForceFlush has been invoked and used to notify when all spans are
ready to be exported.

Fixes #2080.

* Add a changelog entry.

* Update CHANGELOG.md

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update sdk/trace/batch_span_processor.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Improve test case to verify multiple flushes.

* Refactor code to use enqueue.

* Be more defensive on waiting for queue.

Update the handling of the force flush span so we only wait on the
channel if we were able to enqueue the span to the queue.

* Fix linter.

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-11-05 11:34:57 -04:00
Pablo Baeyens
19294aab4c
Add vanity imports to internal packages (#2280)
* `porto -w --include-internal .`

* Bump `porto` to 0.4.0 and include internal files

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-10-29 09:34:37 -07:00
Tyler Yahn
4021872f57
Release stable-v1 as 1.1.0 (#2327)
* Version stable-v1 modset to be 1.0.2 for release

* Prepare stable-v1 for version v1.0.2

* Update changelog

Add new 1.0.2 section and move relevant items that the release will
contain to this section.

* Add article to CHANGELOG entry to correct grammar

* Release 1.1.0 instead of 1.0.2

* Prepare stable-v1 for version v1.1.0

* Apply suggestions from code review

Co-authored-by: Robert Pająk <pellared@hotmail.com>

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2021-10-27 12:18:40 -07:00
Tyler Yahn
c4ba4811a2
Add semconv/v1.7.0 package (#2320)
* Add semconv/v1.7.0 package

Generated from the v1.7.0 release of the specification using the
semconvgen tool manually. This also updates the project to use this
version of the semconv package.

This does not include the prior, and missing, v1.5.0 and v1.6.0 versions
of the semconv package. They are planned to be added in a follow-on PR.

* Update CHANGELOG.md
2021-10-22 08:43:47 -07:00
Tyler Yahn
23a33739e9
Fix flaky test TestSimpleSpanProcessorShutdownHonorsContextCancel (#2290)
* Fix flaky test TestSimpleSpanProcessorShutdownHonorsContextCancel

* Add changes to changelog

* Prioritize return of exporter error

* Update changelog description

* Fix deadlock bug
2021-10-19 08:13:37 -07:00
dependabot[bot]
e9db0473aa
Bump github.com/jcchavezs/porto from 0.2.1 to 0.3.0 in /internal/tools (#2288)
* Bump github.com/jcchavezs/porto from 0.2.1 to 0.3.0 in /internal/tools

Bumps [github.com/jcchavezs/porto](https://github.com/jcchavezs/porto) from 0.2.1 to 0.3.0.
- [Release notes](https://github.com/jcchavezs/porto/releases)
- [Commits](https://github.com/jcchavezs/porto/compare/v0.2.1...v0.3.0)

---
updated-dependencies:
- dependency-name: github.com/jcchavezs/porto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Auto-fix go.sum changes in dependent modules

* make precommit

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: MrAlias <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <codingalias@gmail.com>
2021-10-15 11:36:56 -07:00
Joshua MacDonald
6df0de12bc
Metrics: Rename sdk/export/metric.ExportKind to aggregation.Temporality (#2274)
* Rename ExportKind to aggregation.Temporality

* Changelog uhhhhhhh

* Apply suggestions from code review

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* int->uint8

* go generate

* go.sum

* anual edit

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-10-15 11:18:36 -07:00
Tigran Najaryan
e72a235518
Add ability to parse Schema files according to OTEP 0152 (#2267)
* Add ability to parse Schema files according to OTEP 0152

The parser and parsed representation (AST) are placed in a separate
Go module so that they are can be consumed independently without
the need to bring the rest of the SDK.

Ability to use the parsed representation for schema conversions
can be added later.

* Fixes based on PR comments

* Rename "label" to "attributes"

See https://github.com/open-telemetry/oteps/pull/181

* Fixes based on PR comments

* Add README.md

* Wrap the error in Parse()

* Add docs for exporter types

* Use yaml.NewDecoder

* Verify parsed content in the test

* Fix indentation in README example

* Fix README spaces vs tabs

* Correctly space imports

* Add heading to README

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-10-15 09:44:13 -07:00
Joshua MacDonald
478dc4fe40
Metrics: Move the non-API types into sdkapi (#2271)
* move Descriptor to sdkapi, add test

* rename Descriptor to sdkapi

* precommit

* Move the rest of the sdkapi

* use alias for Observation and Measurement

* Changelog

* pr num

* comment Measurement and Observation

* swap comments

* move->moved
2021-10-14 09:06:22 -07:00
Srikanth Chekuri
8ba6da8f3e
Skip links with invalid span context (#2275)
* Skip links with invalid span context

* Add CHANGELOG entry

* Review suggestions
2021-10-12 07:45:10 -07:00
Anthony Mirabella
737275271d
Release prep v1.0.1/v0.24.0 (#2270)
* Update build tools

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Update CHANGELOG and versions.yaml

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Prepare stable-v1 for version v1.0.1

* Prepare experimental-metrics for version v0.24.0

* Prepare bridge for version v0.24.0

* Update releasing documentation and create add-tags make target

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* use multimod from the .tools directory

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* precommit

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-10-01 16:20:32 -04:00
ET
00d8ca5890
Add go-1.17-compatible build directives. (#2263)
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-09-28 09:08:14 -07:00
José Carlos Chávez
099df58e4e
chore: adds vanity import check. (#2255)
* chore: adds vanity import check.

* chore: runs vanity import check on ci.

* fix: set right target on CI.

* fix: fixes install for porto.

* fix: install right proto bin.

* chore: list all files insides the tools directory.

* fix: fixes vanity import target

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* chore(vanity-imports): adds vanity import support.

* fix: fixes internal generation.

* chore: runs go mod tidy in tools.

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-09-27 22:37:26 -04:00
Joshua MacDonald
3c8e1853f0
Separate InstrumentationLibrary from metric.Descriptor (#2197)
* factor instrumentation library out of the instrument descriptor

* SDK tests pass

* checkpoint work

* otlp and opencensus tests passing

* prometheus

* tests pass, working on lint

* lint applied: MetricReader->Reader

* comments

* Changelog

* Apply suggestions from code review

Co-authored-by: alrex <alrex.boten@gmail.com>

* remove an interdependency

* fix build

* re-indent one

* Apply suggestions from code review

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Lint&feedback

* update after rename

* comment fix

* style fix for meter options

* remove libraryReader, let Controller implement the reader API directly

* rename 'impl' field to 'provider'

* remove a type assertion

* move metric/registry into internal; move registry.MeterProvider into metric controller

* add test for controller registry function

* CheckpointSet->Reader everywhere

* lint

* remove two unnecessary accessor methods; Controller implements MeterProvider and InstrumentationLibraryReader directly, no need to get these

* use a sync.Map

* ensure the initOnce is always called; handle multiple errors

* Apply suggestions from code review

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* cleanup locking in metrictest

* Revert "ensure the initOnce is always called; handle multiple errors"

This reverts commit 3356eb5ed0.

* Revert "use a sync.Map"

This reverts commit ea7bc599bd.

* restore the TODO about sync.Map

Co-authored-by: alrex <alrex.boten@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-09-27 08:51:47 -07:00
Tyler Yahn
92551d3933
Prerelease v1.0.0 (#2250)
* Update versions file for 1.0.0 release

* Prepare stable-v1 for version v1.0.0

* Update trace signal status in documentation

* Update changelog

* Update CHANGELOG.md

Co-authored-by: Robert Pająk <pellared@hotmail.com>

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2021-09-20 13:02:46 -07:00
Joshua MacDonald
360d13027e
Add tests for nil *Resource (#2227)
* Add tests for nil *Resource

* Update sdk/resource/resource_test.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-09-09 17:36:38 -07:00
Tyler Yahn
9e7812d1fe
Remove the deprecated oteltest package (#2234)
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-09-09 18:49:39 -04:00
Anthony Mirabella
4bfa00347d
Release prep v1.0.0-RC3 (#2218)
* Update release versions

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Prepare experimental-metrics for version v0.23.0

* Prepare bridge for version v0.23.0

* Prepare stable-v1 for version v1.0.0-RC3

* Update CHANGELOG

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-09-03 11:23:58 -04:00
Tyler Yahn
c7ae470a16
Refactor SDK span creation and implementation (#2213)
* Refactor startSpanInternal into a tracer method

The span creation and configuration process is split across the tracer
Start method and the startSpanInternal function, each living in
different files. This adds confusion when developing. It requires the
developer to remember certain parts of the configuration happen in one
place or the other.

This unifies the creation and configuration of a new span. It makes this
unification by creating a newSpan method on the tracer. This method will
do all the configuration needed for a new span other than setting the
execution task tracker. This remains a part of the Start method to
preserve any existing timing and tracing the already exists.

* Add a non-recording span to the SDK

* Assign returned context from runtime trace task

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-09-02 17:30:12 -04:00
Tyler Yahn
04de34a2d6
Update the website getting started docs (#2203)
* Update the website getting started docs

Add a new example, fib, that contains an application for the computation
of Fibonacci numbers. Use this example to update the website getting
started documentation.

* Revise docs english

* Update example/fib/go.mod

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Add a What's Next section

* Clean up intro

* Apply suggestions from code review

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Apply feedback

* Return from Poll on error

* Update website_docs/getting-started.md

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>

* Add root and parent relationship info

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
2021-09-02 08:22:41 -07:00
Joshua MacDonald
a7b9d02167
Rename metric instruments to match feature-freeze API specification (#2202)
* s/ValueRecorder/Histogram/g

* s/ValueObserver/GaugeObserver/g

* s/UpDownSumObserver/UpDownCounterObserver/g

* s/SumObserver/CounterObserver/g

* changelog

* pr num

* unstable->experimental

* Apply suggestions from code review

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Apply suggestions from code review

* apply feedback from @evantorrie by hand

* Apply suggestions from code review

Thanks

Co-authored-by: ET <evantorrie@users.noreply.github.com>

* Update sdk/export/metric/metric.go

* Apply suggestions from code review

Thank you @evantorrie !

Co-authored-by: ET <evantorrie@users.noreply.github.com>

* revert getting-started fix let tyler's update remove this text

* more variable name fixes

* test repair

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: ET <evantorrie@users.noreply.github.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-09-01 16:38:37 -04:00
Tyler Yahn
1f527a52ab
Update trace API config creation functions (#2212)
* Update trace API config creation funcs

Follow our style guide and return the config struct instead of pointers.

* Update changelog with changes

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-09-01 15:44:13 -04:00
Roni Lichtman
c0c5ef65eb
Fix typos in resource.go. (#2201)
* Fix typos in resource.go.

* Add a line to CHANGELOG.md with an identifier for the relevant PR.

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-08-30 14:22:06 -04:00
Bhautik Pipaliya
dfc866bd03
Support capturing stack trace (#2163)
* capturing stack trace support

* added changelog entry

* remove error package stack trace support

* modified unnecessary changes to go.sum files

* added EventOption to enable stack trace capturing

* added tests

* added runtime.Stack method and minor changes

* minor changes

* remove redundant line

* fix gihub check on linter

* fix tests

* fix tests

* Update sdk/trace/trace_test.go

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Update sdk/trace/trace_test.go

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-08-13 17:44:18 -04:00
Joshua MacDonald
4e8d667f6e
Support a single Resource per MeterProvider in the SDK (#2120)
* Remove resource from export.Record

* fix bridge/opencensus

* partial fixes in exporters/otlp/otlpmetric

* Use go-cmp to simplify exporter_test

* OTLP http/grpc

* prometheus

* fix stdout (pending PR 2015)

* oc bridge cleanups

* Lint and changelog

* pr num

* cleanup

* revert

* fix multiple

* always merge the environment

* lint

* precommit

* qualify package names in changelog
2021-08-12 15:44:58 -07:00
Tyler Yahn
a8bb0bf89f
Make the tracetest.SpanRecorder concurrent safe (#2178)
* Make the tracetest.SpanRecorder concurrent safe

The otelgrpc instrumentation in the contrib repository needs a
concurrent safe implementation as the stream testing is done in a
separate goroutine.

* Refactor concurrency tests
2021-08-12 09:12:31 -07:00
Tyler Yahn
87d09df346
Deprecate Array attribute in favor of *Slice types (#2162)
* Deprecate Array attribute in favor of *Slice types

* Use new attr types in Jaeger exporter

* Use slice attr types in otlpmetric

* Use slice attr types in otlptrace

* Use slice attr types in zipkin exporter

* Remove array attr test from deprectated oteltest func

* Use StringSlice for cmd arg resource attr

* Add changes to the changelog

* Remove use of deprecated Array func
2021-08-12 08:05:42 -07:00
Joshua MacDonald
df384a9a33
Move InstrumentKind into the new metric/sdkapi package (#2091)
* Move InstrumentKind into the new metric/sdkapi package

* remove the alias

* remove the alias (everywhere)

* Changelog

* Add a test

* merge updates

* fix changelog

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-08-11 16:02:28 -07:00
Tyler Yahn
b1d1d52959
Move OC bridge integration tests to own mod (#2165)
Use the default SDK to test the OpenCensus bridge. In order to not add
the SDK as a dependency to the bridge module and require users to depend
on it if they use the bridge these tests are moved to a new dedicated
test module.
2021-08-09 09:24:43 -07:00
Sean Schade
b8561785c0
fix(2138): add guard to constructOTResources to return an empty resource (#2139)
* fix(2138): add guard to constructOTResources to return an empty resource when attributes are not supplied

Fixes: https://github.com/open-telemetry/opentelemetry-go/issues/2138

* Update CHANGELOG.md

Co-authored-by: Robert Pająk <pellared@hotmail.com>

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-07-29 10:09:07 -07:00
Tyler Yahn
11f62640ee
Add a SpanRecorder to the sdk/trace/tracetest (#2132)
* Add a SpanRecorder to the sdk/trace/tracetest

* Add changes to changelog

* Run make precommit

* Rename tests
2021-07-29 10:00:58 -07:00
Anthony Mirabella
7939841868
pre-release v1.0.0-RC2 (#2133)
* update versions for 1.0.0-RC2

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Prepare for versions v1.0.0-RC2

* Update CHANGELOG

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-07-26 15:09:33 -04:00
Tyler Yahn
bbe6ca40a7
Deprecate oteltest.Harness for removal (#2123)
* Deprecate oteltest.Harness for removal

* Add changes to changelog

* Alias oteltest.Harness to internaltest

* Update oteltest/tracer_test.go

remove `oteltest` import.

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-07-26 11:40:36 -04:00
Tyler Yahn
7a624ac21c
Deprecated the oteltest.TraceStateFromKeyValues function (#2122)
* Deprecated the oteltest.TraceStateFromKeyValues func

* Update changelog

* make precommit
2021-07-26 11:12:53 -04:00
Nelson Ghezzi
ece1879fae
Removed dropped link's attributes field from API package (#2118)
* Removed DroppedAttributeCount field from Link struct

* Reintroduced DroppedAttributeCount with a wrapper struct

* Added Link type in otel/sdk package and used it instead of Trace API equivalent

* Added changelog entry

* Linting fix in changelog

* Deleted duplicated changelog section added by mistake

* Expanded changelog entry and moved it under the 'Added' section

* Explicitly mentioned otel/trace library in changelog entry under 'Removed' section to avoid ambiguity
2021-07-26 11:06:41 -04:00
Tyler Yahn
03902d98bb
Rename sdk/trace/tracetest test.go -> exporter.go (#2128) 2021-07-23 13:38:26 -04:00
csuzhang
25d739b0a0
Remove resource.WithBuiltinDetectors() which has not been maintained (#2097)
* remove resource.WithBuiltinDetectors() which has not been maintained

* add changelog file

* Update CHANGELOG.md

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>

* resolved a repeated conflict

* fix unittest error

* fix unittest error

* fix the PR according to suggestion

* fix unittest fail and del repeated testcase in CI system

* Update CHANGELOG.md

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-07-22 06:47:09 -07:00
Joshua MacDonald
d57c5a5604
Remove several metrics test helpers (#2105)
* Remove several metrics test helpers

* Lint

* Changelog

* Lint
2021-07-21 13:06:38 -04:00
Bogdan Drutu
9b1a5f7001
Performance improvement: avoid creating multiple same read-only objects (#2104)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-07-20 08:57:22 -07:00
Anthony Mirabella
647af3a0f9
Pre release experimental metrics v0.22.0 (#2101)
* update metrics version set

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Prepare for releasing v0.22.0

* Update CHANGELOG for metrics v0.22.0 release

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Fixup CHANGELOG linking

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-07-19 16:59:45 -04:00
Nelson Ghezzi
0a56233717
Fixed OS type value for DragonFly BSD (#2092)
* Added explicit mapping between GOOS and semconv OS type attribute value

* Added tests for OS type mappings

* Added changelog entry

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-07-19 11:40:30 -04:00
Nelson Ghezzi
484258eb36
OS description attribute detector (#1840)
* Added Linux-specific detector for the os.description attribute

* Generalized OS description detector with placeholder function for unimplemented OSes

* Extended osDescription function to *nix OSes based on golang.org/x/sys/unix

* Added WithOS resource configuration function to configure all of the OS resource attributes

* Implemented osDescription funtion for Windows OS

* Improved documentation header for *nix version of the osDescription function

* Added support for reading os-release file

* Added/updated documentation headers for *nix implementation of osDescription and related functions

* Changelog update

* Added support for reading macOS version information

* Mock approach to test OS description attribute

* Extracted common function getFirstAvailableFile to read the first available file from a list of candidates

* Upgraded golang.org/x/sys

* Changelog update

* Fixed wrong function name in documentation header for WithOSDescription

* Updated documentation header for platformOSDescription function

* Renamed restoreProcessAttributesProviders test helper function

The function restoreProcessAttributesProviders was renamed to simply
restoreAttributesProviders to better reflect its broader scope, which
not only applies to process attribute's providers.

* Fixed os_linux.go overriding build tags defined inside the file

The suffix on os_linux.go was overriding the build tags already defined
in that file. The file was renamed to os_release_unix.go, reflecting
the main function defined in the file.

For consistency, os_darwin.go was renamed to os_release_darwing.go, as
its primary purpose is to also define the osRelease function.

* Removed use of discontinued function resource.WithoutBuiltin

* Added PR number to changelog entries

* Updated go.sum files after run of make lint

* Linux implementation: ignore lines with an empty key

* Linux implementation: avoid unquoting strings less than two chars

* WIP: added tests for Linux support functions

* WIP: added tests for charsToString and getFirstAvailableFile functions

* Replaced os.CreateTemp with ioutil.TempFile as the former only exists in Go 1.16

* Added unameProvider type to decouple direct reference to unix.Uname function inside Uname()

* Added tests for Uname() function

* Replaced *os.File with io.Reader in parseOSReleaseFile to ease testing

* Added tests for parseOSReleaseFile function

* Darwin implementation: added tests for buildOSRelease function

* Replaced *os.File with io.Reader in parsePlistFile to ease testing

* Darwin implementation: added tests for parsePlistFile function

* Type in documentation header for Linux osRelease function

* Extracted logic for reading specific registry values into helper functions

* Added basic tests for Windows version of platformOSDescription and helper functions

* Manually formatted uint64 to strings to have an uniform interface for test assertions

* Asserts there's no error when opening registry key for testing

Co-authored-by: Robert Pająk <pellared@hotmail.com>

* Simplified subtests by using a single test with multiple asserts

* go.sum update after running make

* Fix typo

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* WIP: added placeholder implementation of platformOSDescription for unsupported OSes

* Fixed typo on osRelease documentation header

Co-authored-by: Chris Bandy <bandy.chris@gmail.com>

* Fixed typo on test case name for ParsePlistFile tests

Co-authored-by: Chris Bandy <bandy.chris@gmail.com>

* Linter fix in changelog

* go.sum updates after running make

* Used strings.Replacer instead of multiple strings.ReplaceAll calls

* Optimized implementation of charsToString

* Safer temporary file deletion with t.TempDir()

* Used t.Cleanup() for safer mocking of runtime providers in OS resource tests

* Handled optionality of DisplayVersion registry key.

For example, CI machine runs on:
Windows Server 2019 Datacenter (1809) [Version 10.0.17763.1999]

So, to not add an extra white space due to missing DisplayVersion,
this value is checked to be not empty, and only in such case a
trailing space is added for that component.

* Workaround to handle the case of DisplayVersion registry key not present

* Excluded unsupported GOOSes by negation of supported ones

* go.sum update after running make

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Chris Bandy <bandy.chris@gmail.com>
2021-07-08 13:35:27 -07:00
David Ashpole
9e8f523d75
when using WithNewRoot, don't use the parent context for sampling (#2032)
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-06-28 09:17:12 -07:00
Ali Josie
311a6396a7
fix documentation for trace.Status (#2029) 2021-06-24 12:41:08 -07:00
csuzhang
d5d4c87f6d
Add HTTP metrics exporter for OTLP (#2022)
* add HTTP support for OTLP metrics exporter

* add to changelog

* fix unit test not covered before

* add otlpmetrichttp module to .github/dependabot.yml

* add test file for client.go

* run make commit to clean repository

* fix err occurs in TestCancelledContext

* fix err in TestCancelledContext which is nil

* fix err in TestCancelledContext which is nil, occurs occasionally

* fix unittest err in TestCancelledContext which occurs occasionally

* fix ineffectual assignment to err when running lint

* Update CHANGELOG.md

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update exporters/otlp/otlpmetric/otlpmetrichttp/doc.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update exporters/otlp/otlpmetric/otlpmetrichttp/doc.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* del options that not used in http exporter metrics

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-06-22 11:45:17 -07:00
Tyler Yahn
51dbe3cb41
Remove deprecated exporters (#2020)
* Remove deprecated exporters

* Remove codecov config entry for Jaeger exporter

* Remove exporters from dependabot config
2021-06-19 17:29:56 -04:00
Anthony Mirabella
ced177b795
Pre-release 1.0.0-RC1 (#2013)
* Add versions.yaml to specify module version sets
* Prepare for releasing v1.0.0-RC1
* Update experimental-metrics and bridge module sets to v0.21.0
* Prepare for releasing v0.21.0
* Fixup go.mod version references
* Update version.go
* Update CHANGELOG
* Update godoc references to "pre-GA phase" for RC1 packages
* Update website_docs for 1.0.0-RC1

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-06-18 11:22:16 -04:00