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

36 Commits

Author SHA1 Message Date
darkfeline
69e44a337b
Fix ParentBased comment formatting (#3553)
godoc doesn't have an unordered list syntax
2022-12-24 10:16:11 -08:00
Aaron Clawson
8423364f5a
Update golangci-lint to v1.48.0 (#3105)
* Update golangci-lint to v1.48.0

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2022-08-24 21:42:28 -05:00
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
Tyler Yahn
bd817df68c
Change Options to accept type not pointer (#2558)
* Change trace options to accept type not pointer

Add benchmark to show allocation improvement.

* Update CONTRIBUTING.md guidelines

* Update all Option iface

* Fix grammar in CONTRIBUTING
2022-02-01 15:51:23 -06: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
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
Robert Pająk
d23cc61b93
Refactor configs (#1882)
* trace: Refactor sampling config

* tracer: Refactor TracerProviderConfig

* Update the changelog

* Refactor sdk/metric/controller/basic config

* Refactor sdk/metric/processor/basic config

* Refactor sdk/resource config

* Refactor oteltest config

* Refactor exporters/otlp configs

* Refactor exporters/stdout config

* Refactor exporters/trace/jaeger configs

* Refactor exporters/trace/zipkin config

* Unexport stdout.NewConfig

* Refactor zipkin.go

* Refactor provider.go
2021-05-14 13:28:28 -07:00
Tyler Yahn
20c93b01eb
Update SamplingParameters (#1749)
* Update SamplingParameters

Remove HasRemoteParent fields from SamplingParameters. The
HasRemoteParent field is a duplicate of the Remote field of the parent
span context contained in the ParentContext.

Change the `ParentContext` field from storing a `SpanContext` to a
`context.Context` that holds the parent span. This is to conform with
the OpenTelemetry specification and resolve #1727.

* Update PR number
2021-03-30 10:34:40 -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
Punya Biswal
37688ef676
revent end-users from implementing some interfaces (#1575)
"otel/exporters/otlp/otlphttp".Option
"otel/exporters/stdout".Option
"otel/oteltest".Option
"otel/trace".TracerOption
"otel/trace".SpanOption
"otel/trace".EventOption
"otel/trace".LifeCycleOption
"otel/trace".InstrumentationOption
"otel/sdk/resource".Option
"otel/sdk/trace".ParentBasedSamplerOption
"otel/sdk/trace".ReadOnlySpan
"otel/sdk/trace".ReadWriteSpan

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-02-24 10:03:35 -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
Andrei Ozerov
40f1c0039d
Add Tracestate into the SamplingResult struct (#1432)
* Add Tracestate into the SamplingResult struct

Add `trace.Tracestate` field into the SDK `trace.SamplingResult` struct.

Use ParentContext from SamplingParameters to return Tracestate in
`traceIDRatioSampler`, `alwaysOnSampler` and `alwaysOffSampler`.

Add a new test to check that Tracestate is passed.

* Updated CHANGELOG.md for #1432 PR

Added changes description for #1432.

* Update sdk/trace/sampling_test.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-01-06 11:09:48 -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
José Carlos Chávez
e22a48de5a
chore: adds vanity import for files that don't have it. (#1297) 2020-11-04 09:10:58 -08:00
Tyler Yahn
27c84d689d
Move trace api package into otel (#1229)
* Move trace API to otel

* Move tracetest to oteltest

* Update package documentation

* Remove old api/trace package

* Lint

* Add changes to CHANGELOG

* Add tests for rest of trace API

* Apply suggestions from code review

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

* Documentation fixes

Includes resolutions for review issues.

* Correct CHANGELOG post release

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2020-10-08 19:58:56 -07:00
ET
e7e1dce982
Update sampling decision names (#1192)
* Rename SamplingDecision enum values

As prescribed in
https://github.com/open-telemetry/opentelemetry-specification/pull/938
and https://github.com/open-telemetry/opentelemetry-specification/pull/956.

* Include in Changelog

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-09-22 10:34:43 -07:00
Matej Gera
a12224a454
Ensure exported interfaces have named method parameters (#1172)
* Ensure exported interface types have named arguments

* Update Styling Guide

* update CHANGELOG
2020-09-16 09:09:45 -07:00
Matej Gera
0041e2d26e
Rename ParentOrElse sampler to ParentBased and enhance it according to the spec (#1153)
* Rename ParentOrElse to ParentBased and enhance it according to the spec

- Renaming of type and sampler function
- Enhancing ParentBased with sampler options
- Set default samplers for each applicable parent-based case
- Adjust ShouldSample(...) func accordingly

* Adjust existing tests for ParentBased and add new ones

- add tests for ParentBased sampler options and description
- renaming in trace_test.go

* Update CHANGELOG.md

* PR feedback

- More clearer naming of structs; add comments where missing
- Adhere to the configuration style guide

* PR feedback - punctuation
2020-09-10 12:39:04 -07:00
ET
4d83d5b571
Change name of ProbabilitySampler to TraceIdRatioBased (#1115)
* Change name of ProbabilitySampler to TraceIdRatioBased

* Modify behavior to ignore parent span
* Add test for inclusivity property on TraceIdRatioBased sampler
* Modify tests in `trace_test.go` to reflect change in parent
  span behavior

* Add to CHANGELOG

* Satisfy golint

* Update CHANGELOG.md

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

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-09-03 07:28:01 -07: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
Tyler Yahn
7d5117fafd
Changes AlwaysParentSample to ParentSample(fallback) (#810)
* Changes AlwaysParentSample to ParentSample(fallback)

To match
https://github.com/open-telemetry/opentelemetry-specification/blob/v0.5.0/specification/trace/sdk.md#parentorelse
introduced in
https://github.com/open-telemetry/opentelemetry-specification/pull/609

* Fix lint
2020-06-11 08:27:21 -07:00
Paulo Janotti
b3f17329c8 Remove SpanID from sampling parameters
Update code per latest spec, see:
https://github.com/open-telemetry/opentelemetry-specification/pull/621
2020-05-28 16:08:04 -07:00
Chen Yixiao
1301b6f3e4
Move core and key to kv package (#720)
* Move core to kv

* Move kv.Value to kv.value.Value

* Move key to kv
2020-05-13 16:06:03 -07:00
tensorchen
bae2298a36 Rename trace.TraceID & trace.TraceIDFromHex 2020-05-03 13:48:38 +08:00
tensorchen
c6c155de6f Move SpanContext from core package into trace 2020-05-02 20:17:11 +08:00
Tyler Yahn
a485d0ec64
Update License header for all source files (#586)
* Update License header for all source files

- Add Apache 2.0 header to source files that did not have one.
- Update all existing headers dated to 2019 to be 2020
- Remove comma from License header to comply with the Apache 2.0
  guidelines.

* Update Copyright notice

Use the standard Copyright notices outlined by the
[CNCF](https://github.com/cncf/foundation/blob/master/copyright-notices.md#copyright-notices)
2020-03-23 22:41:10 -07:00
Mike Goldsmith
638b865c90
Update Sampler descriptions (#511)
* update always and never sample descriptions

* fix typo

* rename always on / off sampler files, structs and variables to match

Co-authored-by: Rahul Patel <rahulpa@google.com>
2020-03-13 12:17:52 -07:00
Anthony Mirabella
7a1cbbc191
Update Samplers to conform to Spec (#531)
* Refactor SDK Sampler API to conform to Spec

* Sampler is now an interface rather than a function type
* SamplingParameters include the span Kind, Attributes, and Links
* SamplingResult includes a SamplingDecision with three possible values, as well as Attributes

* Add attributes retruned from a Sampler to the span

* Add SpanKind, Attributes, and Links to API Sampler.ShouldSample() parameters

* Drop "Get" from sdk Sampler.GetDescription to match api Sampler

* Make spanID parameter in API Sampler interface a core.SpanID

* Fix types and printf format per PR feedback from krnowak

* Ensure unit test error messages reflect new reality

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
2020-03-10 08:25:11 -07:00
Rahul Patel
161556aab8
Update provider to use AlwaysSampler instead of ProbabilitySampler (#506)
* update provider to use AlwaysSampler instead of ProbabilitySampler

* remove unused defaultSamplingProbability constant

* fix broken tests

* update failure message in test

* fix test description

Co-authored-by: Rahul Patel <rghetia@yahoo.com>
2020-03-05 13:29:51 -08:00
Amr Hanafi
6051c81493
Add AlwaysParentSample sampler (#455)
* Add AlwaysParentSample

* Update sampler doc

Co-Authored-By: Krzesimir Nowak <qdlacz@gmail.com>

* Address PR comments

Co-authored-by: Krzesimir Nowak <qdlacz@gmail.com>
Co-authored-by: Rahul Patel <rghetia@yahoo.com>
2020-02-03 10:22:52 -08:00
Jonas-Taha El Sesiy
1ab645fedb Consistently use pointer receivers for core.Number (#375)
Change all occurrences of value to pointer receivers
Add meta sys files to .gitignore
Code cleanup e.g.
- Don't capitalize error statements
- Fix ignored errors
- Fix ambiguous variable naming
- Remove unnecessary type casting
- Use named params

Fix #306
2019-12-09 13:03:11 -08:00
rghetia
15bfc5bb12
Namespace import path under "/otel" (#274)
Also fixes example module paths so that they use the vanity URL instead
of the github URL.

[Closes #184]
2019-11-01 11:40:29 -07:00
Edward Muller (SFDC)
f420f7409d sdk/trace: Test the Sampling Probability (#247)
* sdk/trace: Test the Sampling Probability

Closes #163

* Add tests for when the parent is sampled.
2019-10-29 16:53:50 -07:00
Gustavo Silva Paiva
4e545e2ab8 api(trace): change SpanID to byte array (#241)
* api(trace): change SpanID to byte array

* fix doc and create const errors
2019-10-28 10:05:06 -07:00
Gustavo Silva Paiva
a6e139e1d4 api(trace): change trace id to byte array. (#226)
* api(trace): change trace id to byte array.

* fix lint errors

* add helper to create trace id from hex and improve stdout exporter.

* remove comma.

* fix lint

* change TraceIDFromHex to be compliant with w3 trace-context

* revert remove of hex16 regex because its used to parse SpanID

* lint

* fix typo
2019-10-22 23:01:33 -07:00
rghetia
0f32efcdaa
Trace sdk (#65)
* trace sdk initial commit.

* fix imports and comments.

* remove tracestate

* split trace.go

* add attribute over limit test.

* add comments and restructure span.go and tracer.go

* refactor MessageEvent

* defer unlock

* some more cleanup in span.go

* rename *MessageEvent* to *Event*

* cleanup comments in trace_test.go

* fix typos.

* return full string ID for traceID and spanID.
2019-08-02 13:52:55 -07:00