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

20 Commits

Author SHA1 Message Date
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
dependabot[bot]
435a63b3c5
Bump github.com/google/go-cmp from 0.5.5 to 0.5.6 (#1954)
* Bump github.com/google/go-cmp from 0.5.5 to 0.5.6

Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.5.5 to 0.5.6.
- [Release notes](https://github.com/google/go-cmp/releases)
- [Commits](https://github.com/google/go-cmp/compare/v0.5.5...v0.5.6)

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

* Auto-fix go.sum changes in dependent modules

* Auto-fix go.sum changes in dependent modules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-06-01 11:53:02 -07:00
dependabot[bot]
150b868d02
Bump github.com/google/go-cmp from 0.5.4 to 0.5.5 (#1667)
* Bump github.com/google/go-cmp from 0.5.4 to 0.5.5

Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.5.4 to 0.5.5.
- [Release notes](https://github.com/google/go-cmp/releases)
- [Commits](https://github.com/google/go-cmp/compare/v0.5.4...v0.5.5)

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

* Auto-fix go.sum changes in dependent modules

* Auto-fix go.sum changes in dependent modules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-03-08 12:15:49 -08:00
Punya Biswal
9b242bc401
Organize API into Go modules based on stability and dependencies (#1528)
* Add a tool to auto-generate replace directives

* Auto-generated changes from previous commit

* Create new modules required for trace release

* otel/metric
* otel/trace
* otel/oteltest
* otel/sdk/export/metric
* otel/sdk/metric

Relates to #1467

* Move metric-related public API out of otel/ pkg

Move GetMeterProvider, Meter and SetMeterProvider to new package
otel/metric/global in the otel/metric module.

This will allow otel/ module to be released as v1.0.

* Include PR references in CHANGELOG

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

* Check for root dir

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-02-12 08:23:51 -08:00
dependabot[bot]
979ff51f22
Bump github.com/stretchr/testify from 1.6.1 to 1.7.0 (#1453)
* Bump github.com/stretchr/testify from 1.6.1 to 1.7.0

Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.6.1 to 1.7.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.6.1...v1.7.0)

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

* Auto-fix go.sum changes in dependent modules

* Auto-fix go.sum changes in dependent modules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-01-14 12:52:19 -08:00
dependabot[bot]
4c30a90a45
Bump github.com/stretchr/testify from 1.6.1 to 1.7.0 in /sdk (#1455)
* Bump github.com/stretchr/testify from 1.6.1 to 1.7.0 in /sdk

Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.6.1 to 1.7.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.6.1...v1.7.0)

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: dependabot[bot] <dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-01-14 11:40:11 -08:00
Joshua MacDonald
49f699d657
Remove Quantile aggregation, DDSketch aggregator; add Exact timestamps (#1412)
* Remove quantile definition

* Complete removal of Quantile-related function

* Comment in selector/simple/simple.go

* Remove 'quantile' in mmsc

* Rename array->exact

* Update changelog

* Add PR number

* Rename exact benchmark

* New test for exact timestamps

* Add timestamp tests

* More test

* From feedback

* Apply suggestions from code review

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

* Samples->Points

* Rename

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-01-12 10:19:13 -08:00
dependabot[bot]
e1ff2d15cf
Bump github.com/google/go-cmp from 0.5.3 to 0.5.4 (#1374)
* Bump github.com/google/go-cmp from 0.5.3 to 0.5.4

Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.5.3 to 0.5.4.
- [Release notes](https://github.com/google/go-cmp/releases)
- [Commits](https://github.com/google/go-cmp/compare/v0.5.3...v0.5.4)

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

* Auto-fix go.sum changes in dependent modules

* Auto-fix go.sum changes in dependent modules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-11-30 10:31:41 -08:00
dependabot[bot]
20c78fed0a
Bump github.com/google/go-cmp from 0.5.2 to 0.5.3 (#1339)
* Bump github.com/google/go-cmp from 0.5.2 to 0.5.3

Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.5.2 to 0.5.3.
- [Release notes](https://github.com/google/go-cmp/releases)
- [Commits](https://github.com/google/go-cmp/compare/v0.5.2...v0.5.3)

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: dependabot[bot] <dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-11-16 09:11:53 -08:00
Tyler Yahn
577b21745b
Update codes to match specification (#1214)
* Update codes to match specification

* Add changes to changelog

* go mod tidy

* Add unit tests for codes

* Update SetStatus methods to only filter Unset

* Update apitest code being tested
2020-10-05 11:36:03 -07:00
dependabot[bot]
9a4981cc67
Bump google.golang.org/grpc from 1.31.1 to 1.32.0 in /sdk (#1145)
* Bump google.golang.org/grpc from 1.31.1 to 1.32.0 in /sdk

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.31.1 to 1.32.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.31.1...v1.32.0)

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

* Auto-fix go.sum changes in dependent modules

* Auto-fix go.sum changes in dependent modules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>
Co-authored-by: Aneurysm9 <Aneurysm9@users.noreply.github.com>
Co-authored-by: Anthony J Mirabella <a9@aneurysm9.com>
2020-09-09 13:25:27 -04:00
dependabot[bot]
5d9daf0654
Bump google.golang.org/grpc from 1.31.0 to 1.31.1 in /sdk (#1105)
* Bump google.golang.org/grpc from 1.31.0 to 1.31.1 in /sdk

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.31.0 to 1.31.1.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.31.0...v1.31.1)

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: dependabot[bot] <dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-08-27 12:19:01 -07:00
dependabot[bot]
737d81208b
Bump github.com/google/go-cmp from 0.5.1 to 0.5.2 (#1093)
* Bump github.com/google/go-cmp from 0.5.1 to 0.5.2

Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.5.1 to 0.5.2.
- [Release notes](https://github.com/google/go-cmp/releases)
- [Commits](https://github.com/google/go-cmp/compare/v0.5.1...v0.5.2)

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

* Auto-fix go.sum changes in dependent modules

* Auto-fix go.sum changes in dependent modules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-08-26 11:39:41 -07:00
Tyler Yahn
8f9f2d84cf
Move OTLP to the OTLP exporter (#1050)
* Move proto to OTLP exporter

* Update OTLP exporter import of proto

* Use gogo protobuf

To stop using the deprecated github.com/golang/protobuf and match what
the collector is doing, switch to generating OTLP with the
github.com/gogo/protobuf/proto instead of
github.com/golang/protobuf/proto.

* Clean dependencies

Remove all protobuf dependencies from otel package and all of its
dependencies.

* Update CHANGELOG

* Clean OTLP exporter go mod

Remove submodule beforehand to avoid unneeded direct dependencies.

* Use default ref for GitHub workflow

* Update path that triggers proto gen action

* Correct license-check exclusion for OTLP

* Update commented location of the OTLP and code
2020-08-10 19:55:52 -07:00
Tyler Yahn
1dbc75bc2f
Clean stale indirect dependency requirements (#1041)
* Clean stale indirect dependency requirements

In the recent changes to isolate the main `otel` package there were many
indirect dependencies of the package that were removed, however, the
go.mod was not automatically cleaned of these. This removes those (and
similar ones in the otel-collector example and otel exporter) and prunes
the go.sum files accordingly.

* Run in a clean system to reproduce build
2020-08-07 09:05:22 -07:00
Tyler Yahn
799c178925
Make opentracing bridge into own Go module (#1038)
* Make opentracing bridge into own Go module

* Update dependabot config

* Clean dependencies of project

Now the bridge is a module, clean all upstream modules that no longer
implicitly depend on it.

* Update Changelog

* go mod tidy
2020-08-06 07:59:41 -07:00
Anthony Mirabella
ae278e9186
Remove othttp and httptrace instrumentations that have moved to contrib (#1032) 2020-08-04 23:30:23 -07:00
dependabot[bot]
ea0720c05e
Bump google.golang.org/grpc from 1.30.0 to 1.31.0 (#1004)
* Bump google.golang.org/grpc from 1.30.0 to 1.31.0

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.30.0 to 1.31.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.30.0...v1.31.0)

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

* Auto-fix go.sum changes in dependent modules

* Auto-fix go.sum changes in dependent modules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>
Co-authored-by: MrAlias <MrAlias@users.noreply.github.com>
2020-08-04 14:08:36 -07:00
Andy Schweig
5438916f62
Expose optional ResponseWriter interfaces. (#979)
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.
2020-07-30 10:30:47 -07:00
Tyler Yahn
8fbaa9d432
Make the SDK into its own Go module (#985)
* 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

* Make the SDK its own Go module

* Upgrade go.mod to 1.14 project wide

* go mod tidy
2020-07-29 15:54:26 -07:00