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

1512 Commits

Author SHA1 Message Date
Phillip Carter
1e46549f61
Update relref link for manual instrumentation (#2478)
Looks like this was missed in https://github.com/open-telemetry/opentelemetry-go/pull/2437
2021-12-21 08:33:35 -08:00
Phillip Carter
69326eaef8
Add sections to docs for current span and nested spans (#2452)
* Add sections to docs for current span and nested spans

* Apply suggestions from code review

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

* Update based on review

* satisfy linter

* Apply suggestions from code review

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

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-12-20 14:00:14 -08:00
Aaron Clawson
8849597744
Dependabot bump (#2477)
* Bump github.com/go-logr/stdr from 1.2.0 to 1.2.2

Bumps [github.com/go-logr/stdr](https://github.com/go-logr/stdr) from 1.2.0 to 1.2.2.
- [Release notes](https://github.com/go-logr/stdr/releases)
- [Commits](https://github.com/go-logr/stdr/compare/v1.2.0...v1.2.2)

---
updated-dependencies:
- dependency-name: github.com/go-logr/stdr
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Bump github.com/go-logr/logr from 1.2.1 to 1.2.2

Bumps [github.com/go-logr/logr](https://github.com/go-logr/logr) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/go-logr/logr/releases)
- [Changelog](https://github.com/go-logr/logr/blob/master/CHANGELOG.md)
- [Commits](https://github.com/go-logr/logr/compare/v1.2.1...v1.2.2)

---
updated-dependencies:
- dependency-name: github.com/go-logr/logr
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Bump github.com/go-logr/stdr from 1.2.0 to 1.2.2 in /example/namedtracer

Bumps [github.com/go-logr/stdr](https://github.com/go-logr/stdr) from 1.2.0 to 1.2.2.
- [Release notes](https://github.com/go-logr/stdr/releases)
- [Commits](https://github.com/go-logr/stdr/compare/v1.2.0...v1.2.2)

---
updated-dependencies:
- dependency-name: github.com/go-logr/stdr
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Bump google.golang.org/grpc in /example/otel-collector

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.42.0 to 1.43.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.42.0...v1.43.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Bump google.golang.org/grpc in /exporters/otlp/otlpmetric/otlpmetricgrpc

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.42.0 to 1.43.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.42.0...v1.43.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Bump google.golang.org/grpc in /exporters/otlp/otlptrace

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.42.0 to 1.43.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.42.0...v1.43.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Bump google.golang.org/grpc in /exporters/otlp/otlptrace/otlptracegrpc

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.42.0 to 1.43.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.42.0...v1.43.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Bump google.golang.org/grpc in /exporters/otlp/otlpmetric

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.42.0 to 1.43.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.42.0...v1.43.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Aaron Clawson <MadVikingGod@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-12-20 08:54:44 -08:00
Chester Cheung
7aba6f796f
update wrong doc comment with attribute value (#2476) 2021-12-20 08:10:34 -08:00
Aaron Clawson
134a610440
Fixes because of removal of exact type. (#2459)
Co-authored-by: Aaron Clawson <MadVikingGod@users.noreply.github.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-12-16 15:22:53 -05:00
Bogdan Drutu
4654d78104
Move Aggregator interface to aggregator package (#2444)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-12-15 08:13:48 -08:00
Bogdan Drutu
4702f6fd6f
Deprecate and add warning to remove AtomicFieldOffsets, unnecessary public func (#2445)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-12-15 08:01:14 -08:00
Bogdan Drutu
8f4a47732f
nit: Simplify test condition in trace_test.go (#2448)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-12-15 07:42:37 -08:00
Sam Xie
24aecc561d
Update affiliation for Sam Xie (#2458) 2021-12-15 08:45:53 -06:00
Bogdan Drutu
44bb795e78
nit: Change metrics configs to have funcs on pointers (#2451)
This avoids copying the whole object, also consistent with trace.

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

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-12-14 13:15:53 -08:00
Bogdan Drutu
db762533f9
Remove unused internal interfaces (#2447)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-12-14 12:27:23 -08:00
Phillip Carter
43daab9cab
Add 'Using instrumentation libraries' page for docs (#2437)
* Add automatic instrumentation page for docs

* Update website_docs/automatic_instrumentation.md

Co-authored-by: Sam Xie <xsambundy@gmail.com>

* Updates as per feedback

* Apply suggestions from code review

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

* Update website_docs/using_instrumentation_libraries.md

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

* fix docs build

Co-authored-by: Sam Xie <xsambundy@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
2021-12-14 08:46:15 -08:00
Bogdan Drutu
01fe5328f7
Small nit in comments (#2446)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-12-14 08:27:56 -08:00
Bogdan Drutu
6cafa6a060
Remove sdk/export/metric module, embed into the sdk/metric (#2382)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-12-13 12:13:03 -08:00
Anthony Mirabella
aedef05e95
Release prep v1.3.0 (#2441)
* Update versions.yaml for release

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

* Prepare stable-v1 for version v1.3.0

* Prepare experimental-metrics for version v0.26.0

* Prepare bridge for version v0.26.0

* Update CHANGELOG

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-12-10 11:44:16 -05:00
Tyler Yahn
b46019a0b0
Fix Jaeger exporter status conversion (#2440)
* Fix Jaeger exporter status conversion

The status tag needs to be a string of value `ERROR` or `OK` for Error
and Ok statuses respectively according to the OTel spec.

* Add PR number to changelog
2021-12-10 11:36:56 -05:00
Tyler Yahn
931266483d
Fix per-signal endpoint parsing in OTLP exporters (#2433)
* Fix per-signal endpoint parsing in otlptrace

* Add distinguishing non-per-signal env var value

* Fix per-signal endpoint parsing in otlpmetric

* Add changes to changelog

* Use else if to prevent unnecessary work

* Add spec link to otlptrace README
2021-12-09 10:40:30 -08:00
Tyler Yahn
b177541239
Use host root CA set by default for OTLP exporter (#2432)
* Use host CA set by default for otlptrace

* Remove test for invalid default certs

* Default to host CA for otlpmetric

* Add changes to changelog

* Update CHANGELOG.md

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

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-12-09 08:44:20 -08:00
Aaron Clawson
2b7c650672
Merge pull request #2424 from MadVikingGod/refactor-errorhandler
Refactor ErrorHandler
2021-12-06 15:24:43 -06:00
Aaron Clawson
c3513021f4 Merge branch 'main' into refactor-errorhandler 2021-12-06 20:37:09 +00:00
Chester Cheung
a4f183be31
Remove metric MinMaxSumCount kind aggregation (#2423)
* remove metric MinMaxSumCount kind aggregation

* remove related files

* fix unittest

* fix changelog

* remove reference the removed aggregation type

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-12-06 11:47:40 -08:00
dependabot[bot]
ee60bcc31b
Bump github.com/itchyny/gojq from 0.12.5 to 0.12.6 in /internal/tools (#2430)
* Bump github.com/itchyny/gojq from 0.12.5 to 0.12.6 in /internal/tools

Bumps [github.com/itchyny/gojq](https://github.com/itchyny/gojq) from 0.12.5 to 0.12.6.
- [Release notes](https://github.com/itchyny/gojq/releases)
- [Changelog](https://github.com/itchyny/gojq/blob/main/CHANGELOG.md)
- [Commits](https://github.com/itchyny/gojq/compare/v0.12.5...v0.12.6)

---
updated-dependencies:
- dependency-name: github.com/itchyny/gojq
  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-12-06 08:51:55 -08:00
dependabot[bot]
a7b3c37988
Bump golang.org/x/tools from 0.1.7 to 0.1.8 in /internal/tools (#2429)
* Bump golang.org/x/tools from 0.1.7 to 0.1.8 in /internal/tools

Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.1.7 to 0.1.8.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.1.7...v0.1.8)

---
updated-dependencies:
- dependency-name: golang.org/x/tools
  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-12-06 08:09:04 -08:00
dependabot[bot]
ae76e71024
Bump github.com/go-logr/logr from 1.2.0 to 1.2.1 (#2428)
* Bump github.com/go-logr/logr from 1.2.0 to 1.2.1

Bumps [github.com/go-logr/logr](https://github.com/go-logr/logr) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/go-logr/logr/releases)
- [Changelog](https://github.com/go-logr/logr/blob/master/CHANGELOG.md)
- [Commits](https://github.com/go-logr/logr/compare/v1.2.0...v1.2.1)

---
updated-dependencies:
- dependency-name: github.com/go-logr/logr
  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-12-06 07:59:58 -08:00
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
bd3c3b20b7 Removed unsued test structure 2021-12-01 17:05:18 +00:00
Aaron Clawson
0f2b54b746 Minor PR fixes 2021-12-01 16:47:46 +00:00
Aaron Clawson
cbf8bad66c Removed benchmark that doesn't test anything anymore 2021-11-30 15:00:27 +00:00
Aaron Clawson
3090ceacdc Migrated to a global errorHandler delegate 2021-11-30 15:00:27 +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