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

28 Commits

Author SHA1 Message Date
Tyler Yahn
fdfc821bac
Add godot linter to golangci (#2845)
Comment should be complete sentences outside of lists with sentence
fragments. This adds the godot linter to check these complete sentences
end with punctuation. If they do not, running fix will append a period.
2022-04-25 13:22:49 -07:00
Nelson Ghezzi
ece1879fae
Removed dropped link's attributes field from API package (#2118)
* Removed DroppedAttributeCount field from Link struct

* Reintroduced DroppedAttributeCount with a wrapper struct

* Added Link type in otel/sdk package and used it instead of Trace API equivalent

* Added changelog entry

* Linting fix in changelog

* Deleted duplicated changelog section added by mistake

* Expanded changelog entry and moved it under the 'Added' section

* Explicitly mentioned otel/trace library in changelog entry under 'Removed' section to avoid ambiguity
2021-07-26 11:06:41 -04:00
Bhautik Pipaliya
abe2243718
API: create new linked span from current context (#2115)
* API: create new linked span from current context

* ran make precommit

* Update trace/trace.go

* Updated CHANGELOG

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-07-22 11:39:27 -07:00
Tyler Yahn
694c9a413d
Interface stability documentation (#2012)
* Interface stability documentation

* Update versioning policy

* Update CONTRIBUTING

* Document how to extend immutable interfaces

* Markdown format VERSIONING changes
2021-06-18 07:56:11 -07:00
Anthony Mirabella
39fe8092ed
Add span.TracerProvider() (#2009)
* Ensure that no-op tracer still progates non-recording spans

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

* Add `TracerProvider` to the `trace.Span` interface

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

* Remove config from oteltest.Tracer as it can be accessed through the provider

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-06-17 12:05:44 -04:00
Anderson Queiroz
7a0cee7b3a
Replaces golint by revive and fix newly reported linter issues (#1946)
* replaces golint by revive and fix newly reported linter issues

* add pull request ID to CHANGELOG.md

* Update internal/matchers/temporal_matcher.go

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

* fix pull request issues

* explains why the linter is disabled

* Update semconv/http.go

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

* Update metric/unit/unit.go

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

* restores 'example/passthrough/go.sum' to original state

* fix after rebase

* export ErrInvalidAsyncRunner again and add nolint

* Update trace/tracestate.go

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

* Update sdk/metric/sdk.go

Co-authored-by: Aaron Clawson <Aaron.Clawson@gmail.com>

* Fix ContextWithoutBaggage comment

* Fix SpanEndOption comment

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Aaron Clawson <Aaron.Clawson@gmail.com>
Co-authored-by: Tyler Yahn <codingalias@gmail.com>
2021-06-08 10:10:01 -07:00
Aaron Clawson
c1f460e097
Update API configs. (#1921)
* Added Reason to Contributing and Updated TracerConfig

* PR comment fixup

* Changed how span Options work.

* Fix Markdown linting

* Added meter configs.

* Fixes from PR comments

* fix for missing instrument

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-05-27 07:53:56 -07:00
Nelson Ghezzi
270cc6030a
Small fixes on some Span method's documentation headers (#1950) 2021-05-26 07:33:54 -07:00
Tyler Yahn
0eeb8f87e9
Refactor Tracestate (#1931)
* Refactor TraceState

* Update tracecontext propagator to use new TraceState

* Add TraceStateFromKeyValues to oteltest

* Use oteltest to test TraceState

* Replace IsEmpty with Len for TraceState

* Replace ParseTraceState with ParseTraceStateString

* Clean up naming

* Add immutability test for TraceState

* Add changes to changelog

* Fixes

* Document argument type change in changelog

* Address feedback

Remove circularity of TestTraceStateLen.
2021-05-24 07:53:26 -07:00
Tyler Yahn
b6d5442ff6
Remove the Tracer method from the Span API (#1900)
* Remove the Tracer method from the Span API

* Update CHANGELOG with changes

* Update CHANGELOG.md

* Fix misspell

* Address feedback
2021-05-12 11:19:50 -04:00
Iris Song
42a845093e
Unembed SpanContext (#1877)
* Unembed SpanContext

rebase branch

* Update CHANGELOG
2021-05-03 20:10:02 -04:00
Tyler Yahn
b7d02db147
Add Status type to SDK (#1874)
Add Status type to SDK

Use this type to encapsulate the Span status similar to the Event type
encapsulating a Span event and the Link type a span link.

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-05-03 12:00:54 -07:00
Anthony Mirabella
08f4c2707f
Add documentation for tracer.Start() (#1864)
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-04-29 18:22:59 -04:00
Tyler Yahn
8e55f10ad5
Move the Event type from the API to the SDK (#1846)
* Move the Event type from the API to the SDK

This type is not used in the API. It is used in the SDK and then through
the processing pipelines. Move it to the package that originates its use.

* Add changes to changelog

* Update CHANGELOG.md

Co-authored-by: Gustavo Silva Paiva <guustavo.paiva@gmail.com>

Co-authored-by: Gustavo Silva Paiva <guustavo.paiva@gmail.com>
2021-04-29 10:29:48 -07:00
Tyler Yahn
e9aaa04b8f
Record links/events attribute drops independently (#1771)
* Record links/events attribute drops independently

* Update PR number

* Remove unneeded span.droppedAttributeCount
2021-04-06 07:51:15 -07:00
Anthony Mirabella
c6b92d5b20
Make TraceFlags spec-compliant (#1770)
* Make TraceFlags spec-compliant

* Remove `trace.FlagsDebug` and `trace.FlagsDeferred`
  * These are used only by the B3 propagator and will be handled there in the `context.Context`
* Make `trace.TraceFlags` a defined type, aliasing `byte`
* Move `IsSampled` method from `trace.SpanContext` to `trace.TraceFlags`
* Add `Sampled(bool)` method to `trace.TraceFlags`
* Implement `Stringer` and `json.Marshaler` for `trace.TraceFlags`

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

* Rename `TraceFlags.Sampled()` to `TraceFlags.WithSampled()` for consistency

* Restore `SpanContext.IsSampled()` method.

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-04-05 10:21:42 -07:00
Jack Wink
33699d242d
Adds semantic conventions for exceptions (#1492)
Adds support for the opentelemetry exceptions semantic conventions. In
short, this has RecordError produce an exception event with exception
attributes instead of using the error event and error attributes.

While golang does not have exceptions, the spec itself does not
differentiate between errors and exceptions for recording purposes.
RecordError was kept as the method name, both for backwards
compatibility and to reduce confusion (the method signature takes in a
golang error object). The spec appears to allow this, as it suggests the
method is optional and signature may reflect whatever is most appropriate
for the language implementing it.

It may seem non-intuitive to log an exception event from a method called
RecordError, but it's beneficial to have consistent behavior across all
opentelemetry SDKs. Downstream projects like the opentelemetry-collector
can build off of the published API and not special case behaviors from
individual languages.
2021-04-01 13:07:46 -07:00
Tyler Yahn
604b05cbcf
Store current Span instead of local and remote SpanContext in context.Context (#1731)
* Store Span instead of local/remote SpanContext in Context

Now that the SpanContext has a remote identifier, storing a Span's
SpanContext two separate ways in a Context (one for local another for
remote) is unnecessary and adds complication throughout the project when
determining heredity of a Span. This moves to storing the Span directly
in the Context uniformly (for both local and remote) as current Span. In
the process, it updates the getter/setter functionality the `trace`
package provides and replaces the distributed heredity logic throughout
the project with just using the current Span as the parent if it exists.

* Update trace/context.go

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

* Assert propagators context remote state

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-03-29 08:55:44 -07:00
Sam Xie
862a5a68a8
Remove setting error status while recording error with Span from oteltest package (#1729)
* Remove setting error status while recording error

* Update CHANGELOG

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-03-25 08:22:48 -07:00
Anthony Mirabella
860d5d86e7
Add flag to determine whether SpanContext is remote (#1701)
* Add remote property to SpanContext

* Set SpanContext.remote when extracting context in TraceContext propagator

* Ensure remote flag is set when inserting remote SpanContext into context

* Ensure tests are expecting remote flag in SpanContext where appropriate

* Update CHANGELOG.md

* Apply PR feedback

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

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-03-18 09:05:37 -07:00
Anthony Mirabella
e88a091a72
Make SpanContext Immutable (#1573)
* Make SpanContext Immutable

* Adds NewSpanContext() constructor and SpanContextConfig{} struct for
constructing a new SpanContext when all fields are known
* Adds With<field>() methods to SpanContext for deriving a SpanContext
with a single field changed.
* Updates all uses of SpanContext to use the new API

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

* Update CHANGELOG.md

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

* Add tests for new SpanContext constructor and derivation

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

* Address PR feedback

* Fix new uses of SpanContext from main
2021-03-09 08:17:29 -08:00
Tyler Yahn
992837f195
Add TracerProvider tests to oteltest harness (#1607)
* Add TracerProvider tests to oteltest harness

* Update Tracer method docs

* Fix grammar
2021-03-03 12:09:58 -08:00
Tyler Yahn
e499ca86b7
Fix validation for tracestate with vendor and add tests (#1581)
* Fix validation for tracestate with vendor

* Add changes to changelog
2021-02-25 07:36:37 -08: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
Tyler Yahn
fe363be399
Move Span Event to API (#1452)
* Move Span Event to API

* Add changes to CHANGELOG
2021-01-14 09:07:25 -08:00
Matej Gera
439cd31389
Add TraceState to SpanContext in API (#1340)
* Add TraceState to API

* Add tests for TraceState

* Update related tests

- stdout exporter test
- SDK test

* Update OTLP span transform

* Update CHANGELOG

* Change TraceState to struct instead of pointer

- Adjust tests for trace API
- Adjust adjacent parts of codebase (test utils, SDK etc.)

* Add methods to assert equality

- for type SpanContext, if SpanID, TraceID, TraceFlag and TraceState are
equal
- for type TraceState, if entries of both respective trace states are
equal

Signed-off-by: Matej Gera <matejgera@gmail.com>

* Copy values for new TraceState, adjust tests

* Use IsEqualWith in remaining tests instead of assertion func

* Further feedback, minor improvements

- Move IsEqualWith method to be only in test package
- Minor improvements, typos etc.

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-12-21 13:11:48 -08:00
Tyler Yahn
757030dc78
Update Span End method documentation (#1310)
* Update Span End method documentation

Updates to the Span after End is called result it potentially
inconsistent views of the Span between the code defining it and the
ultimate receiver of the Span data. This corrects the documented
language of the API to prevent this from happening.

* Add changes to changelog
2020-11-09 10:57:34 -08:00
Krzesimir Nowak
3268501910
Move tracing code to trace package (#1307)
* Move tracing code to trace package

* Update changelog
2020-11-06 17:13:31 -05:00