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

1470 Commits

Author SHA1 Message Date
Tyler Yahn
1ea6ee3da7
Update W3C Baggage spec link to latest stable (#2413) 2021-11-23 14:50:38 -08:00
Tyler Yahn
18d265c57c
Update project minimum supported Go version to 1.16 (#2412)
* Update project min supported Go ver to 1.16

* Add changes to changelog

* Make lint fixes
2021-11-23 13:38:27 -08:00
csuzhang
915244a661
add new function to exclude span kind 4xx for status code (#2339)
* add new function to exclude span kind 4xx for status code

* add changelog

* make precommit

* add unit test

* feat: redo by reusing validateHTTPStatusCode

* feat: make precommit

* feat: move the judgement to SpanStatusFromHTTPStatusCodeAndSpanKind

* feat: increase unittest coverage

* feat: fix logic

* feat: fix unittest

* fix code style

* Update CHANGELOG.md

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-11-23 09:13:47 -08:00
dependabot[bot]
3a8372e4c1
Bump github.com/benbjohnson/clock from 1.2.0 to 1.3.0 in /sdk/metric (#2410)
* Bump github.com/benbjohnson/clock from 1.2.0 to 1.3.0 in /sdk/metric

Bumps [github.com/benbjohnson/clock](https://github.com/benbjohnson/clock) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/benbjohnson/clock/releases)
- [Commits](https://github.com/benbjohnson/clock/compare/v1.2.0...v1.3.0)

---
updated-dependencies:
- dependency-name: github.com/benbjohnson/clock
  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

* Update sdk/metric/go.mod

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-11-22 10:02:14 -08:00
Tyler Yahn
da3fc12347
Remove span check when testing returned error (#2411) 2021-11-22 09:40:32 -08:00
Aaron Clawson
94367b53b4
Add a go version compatibility to the readme. (#2407)
* Add a go version compatibility to the readme.

* Fix lint

* Update README.md

Co-authored-by: Robert Pająk <rpajak@splunk.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Robert Pająk <rpajak@splunk.com>
2021-11-22 08:09:42 -08:00
Aaron Clawson
051227c9ed
Added Benchmarks around events (#2405)
* Added Benchmarks around events

Also fixed the attribute benchmarks to reflect the # of attributes in the test

* Fix test txt, and too new a version of time

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-11-22 07:59:41 -08:00
Tyler Yahn
7d92434295
Fix goroutine leaks in otlptracegrpc testing (#2409)
* Fail in RunEndToEndTest if collector stop fails

* Use testing T.Cleanup to check shut downs

* Add goroutine leak detection

* Fix TestExporterShutdown go leak

The shutdown tests checking if a context error is honored did not
completely clean up the resources used by the client after the error was
evaluated. Update the connection client to handle multiple calls to
shutdown and make a second call to these clients that must succeed so
the test does not have abandoned goroutines.

* Fix leak in TestNew_WithTimeout

The mockTraceService did not delay with its lock being held. This
resulted in the mockCollector stopping and being able to acquire the
lock. It was assumed that no export was taking place because of this and
the mockTraceService was abandoned without cleaning up resources it held
and goroutines it had spawned. This reworks the export blocking logic to
block on a channel read. This will make the block more deterministic and
not depend on the scheduler timing. Additionally, this blocking is moved
inside the lock acquire. Meaning code will deadlock if the block is not
released before a shutdown (something the developer will immediately be
aware of when they submit a bad patch), and will ensure all resources
are released before shutdown.

Replace TestNew_WithTimeout with TestExportSpansTimeoutHonored which
directly tests if a span export errors when the timeout is reached. This
is the only unique thing that TestNew_WithTimeout, but it also tests the
non-error path. That non-error path is tested in many other tests.

* Guard otlptracehttp client stopCh when stopping

In normal operations the exporter is guaranteed to only ever call the
client Stop method once. However in testing we need to call this
multiple times when checking it returns an error in particular context.
Add a lightweight sync.Once to the closing of the stopCh to ensure tests
do not panic when cleaning up.

* Release export block after export

Prevent deadlock in TestExportSpansTimeoutHonored.
2021-11-22 07:54:32 -08:00
Tyler Yahn
b42ab7d2b4
Make MadVikingGod (Aaron Clawson) a maintainer (#2404) 2021-11-19 07:30:32 -08:00
Hu Shuai
be0d9c6ea1
Fix golint issue (#2403)
Signed-off-by: Hu Shuai <hus.fnst@fujitsu.com>
2021-11-18 01:08:18 -05:00
Aaron Clawson
034956199a
Remove bound metric instruments from the API (new champion) (#2399)
* Remove bound metric instruments from the API

* Removed dead code

* Added changelog message

* Added PR number

Co-authored-by: Joshua MacDonald <jmacd@lightstep.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-11-17 07:51:04 -08:00
Patrice Chalin
b663c7c2bd
[website_docs] Link to website page via path (#2397)
* [website_docs] Link to website page via path

Contributes to https://github.com/open-telemetry/opentelemetry.io/issues/922. /cc @austinlparker

* Make links relative and wrap paragraph text

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-11-17 07:33:59 -08:00
Tyler Yahn
3811e3449f
Handle nil testSpanProcessor (#2400)
Remove nil check on return from NewTestSpanProcessor as it can never be
nil, addressing #2396. Also, add nil checks for testSpanProcessor
methods to prevent panics.
2021-11-16 08:57:10 -08:00
Patrice Chalin
d962ec0eac
[website_docs] Link to latest release (#2398)
Contributes to https://github.com/open-telemetry/opentelemetry.io/issues/905. /cc @austinlparker

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-11-16 07:55:12 -08:00
Joshua MacDonald
b8ae2721ed
Remove metric aggregator Subtract interface (#2350)
* Remove metric aggregator Subtract interface

* Apply suggestions from code review

Co-authored-by: Georg Pirklbauer <georg.pirklbauer@dynatrace.com>

* Apply suggestions from code review

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

* make generate

* update changelog

Co-authored-by: Georg Pirklbauer <georg.pirklbauer@dynatrace.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-11-15 12:50:13 -08:00
Bogdan Drutu
4077cac1e4
Fix header level for Changed in Changelog (#2395)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-11-15 10:47:07 -08:00
Joshua MacDonald
6483b5c114
Remove exact aggregator for histogram instruments (#2348)
* remove exact aggregator

* remove exact kind, including workaround in opencensus

* generate w/ go-1.16

* Apply suggestions from code review

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

* cleanup

* Apply suggestions from code review

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

Co-authored-by: ET <evantorrie@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-11-15 10:05:14 -08:00
Tyler Yahn
5f5280b219
Update go.opentelemetry.io/proto/otel to v0.11.0 (#2394) 2021-11-15 09:53:16 -08:00
Brendan Roy
47203fa36b
Delay evaluation of resource.Default to first call (#2371)
* change resource.Default to be evaluated on first call, rather than on import

* guard defaultResource creation with sync.Once, fallback to emtpyResource

* update CHANGELOG

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-11-15 08:46:11 -08:00
dependabot[bot]
2fa7bce696
Bump github.com/cenkalti/backoff/v4 from 4.1.1 to 4.1.2 in /exporters/otlp/otlpmetric (#2388)
* Bump github.com/cenkalti/backoff/v4 in /exporters/otlp/otlpmetric

Bumps [github.com/cenkalti/backoff/v4](https://github.com/cenkalti/backoff) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/cenkalti/backoff/releases)
- [Commits](https://github.com/cenkalti/backoff/compare/v4.1.1...v4.1.2)

---
updated-dependencies:
- dependency-name: github.com/cenkalti/backoff/v4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Auto-fix go.sum changes in dependent modules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: MrAlias <MrAlias@users.noreply.github.com>
2021-11-15 08:10:59 -08:00
dependabot[bot]
b6597b2f09
Bump github.com/cenkalti/backoff/v4 from 4.1.1 to 4.1.2 in /exporters/otlp/otlptrace (#2385)
* Bump github.com/cenkalti/backoff/v4 in /exporters/otlp/otlptrace

Bumps [github.com/cenkalti/backoff/v4](https://github.com/cenkalti/backoff) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/cenkalti/backoff/releases)
- [Commits](https://github.com/cenkalti/backoff/compare/v4.1.1...v4.1.2)

---
updated-dependencies:
- dependency-name: github.com/cenkalti/backoff/v4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Auto-fix go.sum changes in dependent modules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: MrAlias <MrAlias@users.noreply.github.com>
2021-11-15 07:56:59 -08:00
Bogdan Drutu
196ccd7050
Fix TODO, use sync.Map to avoid blocking calls (#2381)
* Fix TODO, use sync.Map to avoid blocking calls

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Update sdk/metric/controller/basic/controller.go

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

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-11-13 13:27:29 -08:00
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
Patrice Chalin
5e2d218837
[website_docs] Link to website spec pages (#2380)
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-11-12 11:41:36 -08:00
Aaron Clawson
45d259230e
Disable DiesThenReconnects tests that are flaky (#2373) 2021-11-12 09:18:59 -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
ET
3b9e067483
Fix copy-paste error for noop SDK AsyncInstrument (#2376) 2021-11-11 17:21:12 -05:00
Hu Shuai
249accddba
Fix golint issue (#2370)
Signed-off-by: Hu Shuai <hus.fnst@fujitsu.com>
2021-11-11 08:49:28 -08:00
Joseph Woodward
d0e5dd528f
Minor grammatical fix (#2347)
* Minor grammatical fix

* Another minor correction

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-11-10 14:26:18 -08:00
Robert Pająk
43c55c3e5c
Rephrase a sentence with typo in getting-started.md (#2355)
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-11-10 14:15:16 -08:00
Aaron Clawson
05c4f109e4
Add Porto to dependancy list. (#2369) 2021-11-09 08:15:04 -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
dependabot[bot]
7ce58f3558
Bump github.com/openzipkin/zipkin-go from 0.2.5 to 0.3.0 in /exporters/zipkin (#2337)
* Bump github.com/openzipkin/zipkin-go in /exporters/zipkin

Bumps [github.com/openzipkin/zipkin-go](https://github.com/openzipkin/zipkin-go) from 0.2.5 to 0.3.0.
- [Release notes](https://github.com/openzipkin/zipkin-go/releases)
- [Commits](https://github.com/openzipkin/zipkin-go/compare/v0.2.5...v0.3.0)

---
updated-dependencies:
- dependency-name: github.com/openzipkin/zipkin-go
  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

* go mod tidy in example/zipkin

* Revert internal/tools changes

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-11-01 09:27:39 -07: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
ef0cdebc94
Add MapCarrier (#2334)
* Add MapCarrier

* Update CHANGELOG.md

* Lint propagation_test.go

* Remove trailing space in changelog entry

* Revert change to internal/tools/go.sum
2021-10-29 12:04:36 -04:00
Tyler Yahn
4ba964bae7
Correct getting started docs typo (#2333)
Resolve #2332
2021-10-28 12:52:27 -07:00
Ronald Petty
c5773145ae
Update getting-started.md (#2330)
Import path incorrect for signal, added import "os/signal".

Also the current online instructions are broken, ctx is not plumped through, but it is here in the forked markdown, so probably needs to be pushed out.
2021-10-28 09:37:57 -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
0f0bd269c3
Fix getting started example code (#2324) 2021-10-25 12:24:35 -07:00
Tigran Najaryan
36b444a589
Add missing apply_to_spans section support (#2301)
This bug was uncovered during spec review here:
https://github.com/open-telemetry/opentelemetry-specification/pull/2008#discussion_r731359448

apply_to_spans section was missing although it is implied to
be present in the description of how span changes section
is supposed to work.

This fixes the omission by adding apply_to_spans section.
This is not a new feature, just fixing a bug in file format description
and in the corresponding implementation.

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-10-25 12:28:41 -04:00
Tyler Yahn
8324034a21
Add semconv/v1.5.0 package (#2322)
Generated from a modified version of the v1.5.0 release of the
specification using a modified version of the semconvgen tools. The
specification contained capitalized IDs that caused errors from the
semconvgen tool. These errors were manually resolved and the rest of the
Go formatting tools were used to provide consistent code.

Important to note, the Go semconvgen tooling includes new name
capitalization rules for ReplicaSet, StatefulSet, and DaemonSet that
mean code names are not backwards compatible. This is included in the
changelog to help users perform the upgrade.
2021-10-25 12:05:00 -04:00
Tyler Yahn
4c59cc4967
Add semconv/v1.6.1 package (#2321)
Generated from the v1.6.1 release of the specification using the
semconvgen tool manually.

This skips the v1.6.0 release of the specification, with no plans to add
support in the future, due to a backwards in compatibility bug in
included.
2021-10-22 09:13:07 -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
ab08fc1518
Resolve go.sum error when install gojq (#2316) 2021-10-21 12:48:06 -07:00
Tyler Yahn
059b27a6d6
Fix #2299 (#2300)
Explicitly return nil if the wait time and the context deadline expire
simultaneously, instead of indeterminately the context error or nil, for
the retry wait function in the otlptrace/internal package.
2021-10-21 08:38:18 -07:00
Adrian Kostrubiak
474d6a4730
fix typo in Resources usage sample (#2302)
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-10-19 09:27:31 -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
ET
1f4b606be8
Fix IPv6 parsing errors in semconv.NetAttributesFromHTTPRequest (#2285)
* Fix IPv6 handling errors in semconv.NetAttributesFromHTTPRequest

fixes #2283

* Enter PR number in CHANGELOG

* Remove unnecessary creation and then assignment

Standardize order of checks for IP, Name, Port

* Assume happy path when parsing host and port

i.e. assume net.SplitHostPort(input) will succeed

* Get rid of uint64 for port

* Fix git merge of main by adding back strings import

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <codingalias@gmail.com>
2021-10-18 13:13:52 -07:00
Patrice Chalin
43465e8ded
Docs: add aliases (#2297)
* Docs: add aliases

* Normalize alias paths

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-10-18 12:59:16 -07:00