Commit Graph

19 Commits

Author SHA1 Message Date
Taka Nishida d50aa19a4d
Refactor to use testing.T.Setenv in aws:ecs (#4618) 2023-11-27 09:45:09 +01:00
Tyler Yahn 53f4e7ebd6
Update AWS detector and instrumentation semconv to v1.21.0 (#4265)
* Update AWS detector semconv

* Update PR number

* Upgrade otellambda semconv

* Upgrade otelaws
2023-09-05 10:52:40 -07:00
Andrew Hobson e915b7c84c
Do not assume "aws" partition in ecs detector. Fixes #3166 (#3167) 2023-02-23 15:53:43 -05:00
Tyler Yahn c52452d90a
Use semconv creation functions (#3369)
* Use semconv functions

* Update changelog
2023-02-08 09:37:52 -08:00
Tyler Yahn 10abc59659
Upgrade to semconv/v1.17.0 (#3182)
* Upgrade to semconv/v1.17.0

* Add changes to changelog

* Upgrade remaining semconv

* Update changes to changelog

* Remove stale comment

* Update to head of main for semconvs

* Use DialContext instead of Dial for otelgrpc/test

* Verify no goroutine leaks with t.Cleanup

* Use bufconn to stub a ContextDialer

* Add status code to HTTP metrics

* Update instrumentation/github.com/gorilla/mux/otelmux/mux.go

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

---------

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2023-01-28 08:10:45 -08:00
Michele Mancioppi 01b39e7786
Implement aws.ecs.* resource attributes (#2626)
* Implemented aws.ecs.* resource attributes in go.opentelemetry.io/detectors/aws/ecs

* Update detectors/aws/ecs/ecs_test.go

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>

* Update detectors/aws/ecs/ecs_test.go

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>

* fix: lower-case the value of aws.ecs.launchtype

* Add aws.logs.* support, remove spurious /aws prefix from log group

* Add tests for V4 on Fargate launch type

* Rebase

* Fix integration tests, fix behavior on Windows

After a surreal session of debugging, it turns out that httptest.NewServer fails on Windows by failing to bind the server socket unless the GoLang package name contains "test". To deal with that, I split the tests between "integration tests" needing a HTTP server into "ecs/test", and the other in "ecs".

In order to work around the need of being resilient to the lack of /proc/self/cgroup (which happens in our tests but, above all, when running containers on Windows), the ECVS detector is now more lenient to not finding the container id.

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2022-11-23 14:04:43 -05:00
Anthony Mirabella fe241f3098
Update/go1.19 (#2675)
* Make go 1.19 the default version for CI, add to version matrix

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

* Replace uses of io/ioutil package

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

* gofmt fixes

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

* Update CHANGELOG and README

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

* Replace use of unmaintained `esc` with `go:embed`

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

* Ensure open files are closed before cleaning them up

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

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2022-08-18 13:12:45 -04:00
Tyler Yahn 61ea3c1c30
Upgrade to semconv v1.12.0 (#2589)
* Upgrade to semconv v1.12.0

* Add changes to changelog
2022-07-20 11:14:47 -07:00
Tyler Yahn 0dd27453a1
Mirror golangci-lint config from opentelemetry-go (#2297)
* Add copy of golangci-lint conf from opentelemetry-go

* Fix contrib package docs

* Fix internal/util

* Fix detectors/aws/ec2

* Fix detectors/aws/ecs

* Fix detectors/aws/eks

* Fix detectors/aws/lambda

* Fix detectors/gcp

* Fix instrumentation/github.com/astaxie/beego/otelbeego

* Fix instrumentation/github.com/aws/aws-lambda-go/otellambda

* Fix instrumentation/github.com/aws/aws-sdk-go-v2/otelaws

* Fix instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache

* Fix instrumentation/github.com/emicklei/go-restful/otelrestful

* Fix instrumentation/github.com/gin-gonic/gin/otelgin

* Fix instrumentation/github.com/gocql/gocql/otelgocql

* Fix instrumentation/github.com/go-kit/kit/otelkit

* Fix instrumentation/github.com/gorilla/mux/otelmux

* Fix instrumentation/github.com/labstack/echo/otelecho

* Fix instrumentation/github.com/Shopify/sarama/otelsarama

* Fix instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo

* Fix instrumentation/google.golang.org/grpc/otelgrpc

* Fix instrumentation/gopkg.in/macaron.v1/otelmacaron

* Fix instrumentation/host

* Fix instrumentation/net/http/httptrace/otelhttptrace

* Fix instrumentation/net/http/otelhttp

* Fix instrumentation/runtime

* Fix propagators/aws

* Fix propagators/b3

* Fix propagators/jaeger

* Fix propagators/opencensus

* Fix propagators/ot

* Fix samplers/aws

* Fix samplers/jaegerremote

* Fix samplers/probability/consistent

* Fix zpages

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2022-05-24 07:01:50 -07:00
Tyler Yahn aa8e611335
Upgrade semconv to v1.10.0 (#2222)
* Upgrade semconv to v1.10.0

* Update CassKeyspace func

Use the DBNameKey instead of the removed DBCassandraKeyspaceKey. This
comes from
https://github.com/open-telemetry/opentelemetry-specification/pull/1973

* Add changes to changelog
2022-04-28 07:54:31 -07:00
Tyler Yahn bb24bac8a0
Make ECS detector not error when not on platform (#1428)
* Make ECS detector not error when not on platform

The OpenTelemetry specification states "failure to detect any resource
information MUST NOT be considered an error". Update the ECS detector to
not return an error when not running on the ECS platform.

Additionally, return nil instead of an empty resource to accommodate a
quick merge when this detector is used. A nil value means the other
resource this will be merged with will be returned immediately instead
of working through the actual merge.

* Add changes to changelog

* Match ECS detector tests with expected behavior

* Add PR number to changelog

* Remove unused errNotOnECS
2021-11-23 07:35:58 -08:00
Anthony Mirabella 6c86403cea
Update semantic conventions to v1.7.0 (#1385)
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-11-02 14:27:22 -04:00
Abi Hafshin Alfarouq 2c59f627d5
Add cloud.provider and cloud.platform to AWS detectors (#1043)
* Add cloud.provider and cloud.platform to AWS detectors

* Update PR number

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-09-03 11:58:49 -04:00
Anthony Mirabella 2ca6018953
Update to v1.0.0-RC1/v0.21.0 (#822)
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-06-18 16:17:02 -04:00
Anthony Mirabella 839e505a67
Bumping otel version to v0.18.0. Prepare for releasing v0.18.0 (#600)
* Bumping otel version to v0.18.0. Prepare for releasing v0.18.0

* Update CHANGELOG

* Address review feedback
2021-03-04 19:39:40 -05:00
Tyler Yahn 0fe41992b2
Update AWS detector assert dependency (#574)
* Update AWS detector assert dependency

Use the stretchr testify assert package.

* Update Go module dependencies
2021-02-18 08:36:48 -08:00
Bhautik Pipaliya e532370ba2
Fix ECS resource detector bug (#569)
* added failure scenario when getting container fails

* fix test case failure

* add changelog

* fix ecs resource detector bug

* fix struct name as per golint suggestion

* minor changes

* added NewResourceDetector func and interface assertions

* fix golint failure

* minor changes to address review comments

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-02-10 09:01:44 -08:00
Bhautik Pipaliya cc69f93ac0
added failure message - ECS resource detector (#568)
* added failure scenario when getting container fails

* fix test case failure

* add changelog

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-02-05 15:33:09 -05:00
Kelvin Lo 645d23aff8
Add Amazon ECS Resource Detector (#466)
* add ECS resource Detector

* add comments to methods

* refactored naming convention and methods to use mocking client

* added comments to tests

* refactor env variables with more clearer names

* update changelog and rename variables
2020-11-30 12:12:01 -05:00