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

24 Commits

Author SHA1 Message Date
Robert Pająk
01472db75f
Upgrade use of semconv to v1.24.0 (#4754) 2024-01-11 12:56:07 +01:00
Michael Blum
be5064a387
Use url.PathUnescape rather than url.QueryUnescape when parsing OTLP headers and resource attributes env vars (#4698) (#4699) 2023-11-09 12:51:59 -06:00
Tyler Yahn
b7f634a4fe
Decouple use of otel/internal/internaltest (#4424)
* Add internaltest templates

* Generate internaltest using gotmpl

* Generate the sdk/internal/internaltest pkg

* Use sdk/internal/internaltest in sdk module

* Generate exporters/jaeger/internal/internaltest pkg

* Use exporters/jaeger/internal/internaltest in jaeger exporter

* Generate the exporters/zipkin/internal/internaltest pkg

* Use local internaltest in zipkin exporter

* Fix import path name in trace test
2023-08-09 09:15:47 +02:00
Tyler Yahn
9452b93012
Upgrade all use of semconv to v1.21.0 (#4408)
* Upgrade all use of semconv to v1.21.0

* Add change to changelog

* Add AIX and ZOS OS support

* Upgrade semconv for merged changes

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2023-08-07 09:30:40 -07:00
Tyler Yahn
ddf393886c
Use semconv creation functions (#3683) 2023-02-07 13:42:47 -08:00
Tyler Yahn
c7e2679529
Generate the semconv/v1.17.0 package (#3599)
* Generate semconv/v1.17.0

* Update all semconv use to v1.17

* Add changes to changelog
2023-01-24 08:10:41 -08:00
Tyler Yahn
78a55822f8
Upgrade all semconv dependencies to v1.16.0 (#3581)
* Upgrade all semconv ref to v1.16.0

* Add changes to changelog
2023-01-10 10:57:28 -08:00
Luiz Aoqui
05aca23c19
Decode values from OTEL_RESOURCE_ATTRIBUTES (#2963)
* Decode values from OTEL_RESOURCE_ATTRIBUTES

The W3C spec specifies that values must be percent-encoded so when
reading the environment variable `OTEL_RESOURCE_ATTRIBUTES` the SDK
should decode them.

This is done by the `baggage` package, but its behaviour in case of
errors is slightly different from the current implementation of the SDK,
more specifically in cases where a key is missing a value. The SDK
returns a partial resource while the `bagage` package returns nil.

This may be considered a breaking change, so this commit fixes the
current implementation instead of using `baggage.Parse`.

* Add changelog entry for #2963

* Use otel.Handle on OTEL_RESOURCE_ATTRIBUTES decode error

* retain original value when decoding fails

* docs: update CHANGELOG

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2022-10-19 09:13:20 -07:00
Tyler Yahn
5568a30723
Add semconv/v1.12.0 (#3010)
* Add semconv/v1.12.0

* Update all semconv use to v1.12.0

Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
2022-07-13 09:55:43 -04:00
Tyler Yahn
c05c3e237d
Add semconv/v1.10.0 (#2842)
* Add the semconv/v1.10.0 package

* Upgrade semconv used to v1.10.0

* Add changes to changelog
2022-04-22 07:41:28 -07:00
Brad Topol
8574d43509
Add semconv/v1.9.0 package (#2792)
* Add semconv/v1.9.0 package
Closes: #2756

Signed-off-by: Brad Topol <btopol@us.ibm.com>

* Updated PR number in CHANGELOG

Signed-off-by: Brad Topol <btopol@us.ibm.com>
2022-04-18 10:38:55 -07:00
Tyler Yahn
1884de2b4b
Add semconv/v1.8.0 (#2763)
* No wrap RELEASING Semantic Convention Generation section

* Initial generator

* Update template render

* Add exception and schema templates

* Add semconv/internal http unification

* Add http template

* Add licenses header

* Embed the templates

* Update static version in schema tmpl

* Add semconv-generate target to Makefile

Use this target to generate versions of the semconv packages.

* Generate semconv packages

* Update RELEASING to use make semconv-generate

* Add comments to semconvkit

* Generate semconv/v1.8.0

* Use new version of semconv

* Add changes to changelog

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2022-04-16 01:58:24 -04:00
Tyler Yahn
c4ba4811a2
Add semconv/v1.7.0 package (#2320)
* Add semconv/v1.7.0 package

Generated from the v1.7.0 release of the specification using the
semconvgen tool manually. This also updates the project to use this
version of the semconv package.

This does not include the prior, and missing, v1.5.0 and v1.6.0 versions
of the semconv package. They are planned to be added in a follow-on PR.

* Update CHANGELOG.md
2021-10-22 08:43:47 -07:00
Sean Schade
b8561785c0
fix(2138): add guard to constructOTResources to return an empty resource (#2139)
* fix(2138): add guard to constructOTResources to return an empty resource when attributes are not supplied

Fixes: https://github.com/open-telemetry/opentelemetry-go/issues/2138

* Update CHANGELOG.md

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

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-07-29 10:09:07 -07:00
Anthony Mirabella
cdf67ddfa3
Update semantic conventions to v1.4.0, move to versioned package (#1987)
* Update semantic conventions to v1.4.0, move to versioned package

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

* precommit wants explicit import path renaming for semconv/v1.4.0

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

* Fix semconv import path in stdout exporter example

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

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-06-10 13:03:43 -04:00
Tigran Najaryan
46d9687a35
Add Schema URL support to Resource (#1938)
This implements specification requirement:
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/sdk.md#resource-creation

- Changes `resource.NewWithAttributes` to require a schema URL. The old function
  is still available as `resource.NewSchemaless`. This is a breaking change.
  We want to encourage using schema URL and make it a conscious choice to have a
  resource without schema.

- Merge schema URLs acccording to the spec in resource.Merge.

- Several builtin resource detectors now correctly populate the schema URL.

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-06-08 09:46:42 -07:00
Anthony Mirabella
a75ade4edb
sdk/resource: honor OTEL_SERVICE_NAME in fromEnv resource detector (#1969)
* sdk/resource: honor OTEL_SERVICE_NAME in fromEnv resource detector

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

* go fmt is still my friend, even if I forget about it occasionally

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

* Fix import ordering

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-06-04 11:19:15 -07:00
Aaron Clawson
7674eebf56
Removed different types of Detectors for Resources. (#1810)
* Removed different types of Detectors for Resources.

This change simplifies different types of collectors into one list. The
order of this list determines how they are applied.  Defaults are
applied when the user does not supply any detectors.  To achieve
default behavior and additional behavior a DefaultDetectors struct has been
created

* missed prometheus test.

* Changed behavior around WithDetectors(nil)

Added examples of use of WithDetectors.

* Added NoOp example

* Changed test to reflect acutal default case

This changes because WithDetector() no longer is the same as not using WithDetector()

* Unexports the noOp detector

* Updated changelog

* Fixes to spelling mistakes.

* Added NewEmptyResouce and unexported builtin detectors

* Fix for prometheus example

* Resource has two Rs

I need to get a new R key it seems.

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

* Replaced NewEmptyResource() with New()

* Fix test function name

* Comment fixups.

* Apply suggestions from code review

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

Co-authored-by: Sam Xie <xsambundy@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-04-29 11:12:48 -07:00
Punya Biswal
ecf65d7968
Rename otel/label -> otel/attribute (#1541)
* Rename otel/label -> otel/attr

Leave the imported name alone, to avoid a large diff and conflicts

* Better import comment

* Update CHANGELOG.md

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

* otel/attr -> otel/attribute

* Missed the changelog entry

* Get rid of import renaming

* Merge remaining conflicts

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-02-18 12:59:37 -05:00
Eundoo Song
9c949411ce
Rename internal/testing to internal/internaltest (#1449) 2021-01-12 08:56:16 -08:00
Joshua MacDonald
187adeb251
Change resource.New() to use functional options; add builtin attributes for (host.*, telemetry.sdk.*) (#1235)
* Add a resource.Configure() with functional options

* Add a changelog

* Add tests for builtin resources

* Rename to WithoutBuiltin

* Add new test; restore environment after tests

* Apply feedback

* Apply suggestions from code review

❤️

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

* Comment edits

* Rename New, former method NewFromAttributes

* NewFromAttributes->NewWithAttributes

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-10-31 11:16:55 -07:00
Matej Gera
1f7c220652
Don't consider unset env var to be an error during resource detection (#1170)
* Don't consider unset env var an error during detection

* update CHANGELOG
2020-09-14 12:08:05 -04:00
Tyler Yahn
f995380e58
Unify api/label and api/kv in new label package (#1060)
* Move `api/label` to `label`

* Move `api/kv` package contents into `label` package

* Unify label package name

* Move `api/internal/rawhelpers.go` to `internal`

* Propagate replacing `api/kv` with `label` pkg

* golint

* Fix over-aggressive change

* Update Changelog
2020-08-17 20:25:03 -07:00
YANYZP
99c299877d
OT resource detector (#939)
* first

* all included

* constant

* res keys

* env detector

* Update sdk/detect/env.go

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

* new test cases and strings operation to handle labels

* solved conflict

* typo

* corrected comments

* deleted env var handling

* push again

* rerun

* restructuring

* new way to aggregate errors

* all in resources package and verbose comments

* solved merge conflicts

* included new error types

* improved error handling

* updated changelog.md

* updated changelog

* updated changelog.md

* updated changelog

* Update CHANGELOG.md

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Liz Fong-Jones <lizf@honeycomb.io>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-07-20 08:43:51 -07:00