Commit Graph

4 Commits

Author SHA1 Message Date
Mikel Blanchard cedda83469
[SDK] Support dependency injection in ResourceBuilder and load envvars from IConfiguration (#3782) 2022-10-19 15:14:07 -04:00
Travis Illig 7ed97be908
Fix analyzers (#3053) 2022-04-01 07:46:32 -07:00
Robert Pająk 24226a58f8
Add support for OTEL_SERVICE_NAME environmental variable (#2209) 2021-08-10 10:36:42 -07:00
Prashant Srivastava 4ab6da0812
Adding support for default resource creation with environment variable (#1436)
* Adding default and envVar resource. Initial commit

* Adding Create method for resource creation with default resource and relevant unit tests.

* Adding isNullOrEmpty check to env var value to remove redundant condition.

* TracerProviderBuilder now calls Resource.Create to get the default resource with EnvVar attributes as well

* The default reource now includes the attributes from env var as well. Refactoring unit tests for the same.

* Adding ResourceDetector interface and public methods to add attributes from default and env var resources

* Missed out new resource files. Adding

* adding some more tests

* Adding missing import

* Updating public api list

* Refactoring method name for new methods

* Making IResourceDetector and corresponding impl internal until spec is official about detectors

* Refactoring return

* Was using wrong Sdk in test. Fixed.

* Adding error handling to OtelEnvResourceDetector

Co-authored-by: Cijo Thomas <cithomas@microsoft.com>
2020-11-12 10:16:05 -08:00