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

1485 Commits

Author SHA1 Message Date
Tyler Yahn
31661dd6be
Centralize the retry package for the otlp exporters (#2427)
* Centralize the retry package for the otlp exporters

* Add dependabot config

* Use unified internal/retry module in otlp exporters

* Remove otlpmetric and otlptrace internal/retry module

* Run go mod tidy in otlp{metric,trace}
2021-12-06 07:47:49 -08:00
Tyler Yahn
f4b63f184d
Use gRPC ClientConn for otlpmetricgrpc client connection handling (#2425)
* Use gRPC ClientConn for otlpmetricgrpc conn handling

* Update PR number

* Update otlpmetrichttp to use retry package

* Remove old commented code

* Add all other external changes to changelog
2021-12-03 13:59:07 -08:00
Aaron Clawson
a1f9c9772b
Merge pull request #2343 from MadVikingGod/internal_logging
Internal Logging
2021-12-02 22:35:30 -06:00
Aaron Clawson
7e76cd8dd3 Merge remote-tracking branch 'upstream/main' into internal_logging 2021-12-02 19:59:57 +00:00
Aaron Clawson
0f2b54b746 Minor PR fixes 2021-12-01 16:47:46 +00:00
dependabot[bot]
5ea9171d5f
Bump actions/cache from 2.1.6 to 2.1.7 (#2420)
Bumps [actions/cache](https://github.com/actions/cache) from 2.1.6 to 2.1.7.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v2.1.6...v2.1.7)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 07:44:27 -08:00
Tyler Yahn
f1971b3f81
Use the grpc.ClientConn to handle connections for the otlptracegrpc client (#2329)
* POC using the grpc.ClientConn to handle connections

* Update invalid client security test

* Update client start test for a bad endpoint

* Use any ClientConn a user provides

* Connect ReconnectionPeriod to gRPC conn retries

* Replace connection retry handling direct in otlptracegrpc

* Fix client comments

* Fix comment for NewGRPCConfig

* Replace reconnection test

* Fix grammar

* Remove unrelated changes

* Remove connection pkg

* Rename evaluate to retryable

* POC using the grpc.ClientConn to handle connections

* Replace connection retry handling direct in otlptracegrpc

* Add ClientConn use changes to changelog

* Update otlptracegrpc options

* Only close ClientConn that the Client create

* Remove listener wrapper from mock_collector_test

This is not needed now that no tests relies on the listener to wait for
a connection to be established before continuing.

* Fix spelling error

* Do not use deprecated options in the otel-collector example

* Add unit tests for retryable and throttleDelay funcs

* Add unit tests for context heredity

* Add test that exporter stop is linked to context cancel

* go mod tidy

* Update exporters/otlp/otlptrace/otlptracegrpc/client.go

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

* Fix go.mod from rebase

* Remove wrong comment about client stop closing gRPC conn

* Fix shutdown test cleanup

Do not check the second call to the client Stop. There is no guarantee
it will not error in normal operation.

* Make lint fixes

* Fix flaky unit test

Use the internals of the client to explicit cancel the context returned
from exportContext. This gets around the bug where the select in Stop
may randomly choose the non-context Done case and avoid returning an
error (also failing to cancel the context).

* Remove deprecation

To configure the client/exporter with environment variables these
options are used. There is no way to fully remove these options without
removing support for configuration with environment variables. Leave
that decision and strategy determination to a separate PR.

* Fix grammatical error in comment

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-11-25 08:06:21 -08:00
Aaron Clawson
d467ac529a Fixes race, moved into global 2021-11-24 20:06:39 +00:00
Aaron Clawson
8901b22c4f Moved the SetLogger api into otel 2021-11-24 15:54:30 +00:00
Aaron Clawson
a14b53f9b8 Reverted the changes to the error handler. 2021-11-24 15:43:30 +00:00
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
Aaron Clawson
0c553a4ce3 Fix lint, test, and example issues
Removed dead code.
Merged main to fix tests.
2021-11-19 15:34:11 +00:00
Aaron Clawson
0081b5ef09 Merge branch 'main' into internal_logging 2021-11-19 15:31:04 +00:00
Tyler Yahn
b42ab7d2b4
Make MadVikingGod (Aaron Clawson) a maintainer (#2404) 2021-11-19 07:30:32 -08:00
Aaron Clawson
890eb63dcc Removed unused func, added doc strings 2021-11-18 14:51:49 +00: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
8b210d20d4 simplifies error handling, uses internal logger by default 2021-11-17 16:17:04 +00: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
Aaron Clawson
8d0b098602 Creates a internal facing logging interface
This is a simple loggin interface to be used interally for the sdk.
Included is an exmaple in `namedtracer` run:
```
cd example/namedtracer
go run . >/dev/null
```
2021-11-12 15:23:18 +00: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