Skip to content

Commit 92558f9

Browse files
committed
Changed signature of the Span RecordError, replace EventOption by ErrorOption (open-telemetry#1677)
* Change signature of the Span `RecordError, replace EventOption by ErrorOption * Add WithEventOpts, WithErrorStatus * Set status when WithErrorStatus is passed to RecordError Signed-off-by: lastchiliarch <lastchiliarch@163.com>
2 parents 364ad1e + ca130e5 commit 92558f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1897
-1763
lines changed
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
### Problem Statement
11+
12+
A clear and concise description of what the problem is.
13+
Ex. I'm always frustrated when [...]
14+
15+
### Proposed Solution
16+
17+
A clear and concise description of what you want to happen.
18+
19+
#### Alternatives
20+
21+
A clear and concise description of any alternative solutions or features you've considered.
22+
23+
#### Prior Art
24+
25+
A clear and concise list of any similar and existing solutions from other projects that provide context to possible solutions.
26+
27+
### Additional Context
28+
29+
Add any other context or screenshots about the feature request here.

.github/workflows/ci.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ jobs:
2424
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
2525
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
2626
- name: Module cache
27-
uses: actions/cache@v2.1.4
27+
uses: actions/cache@v2.1.5
2828
env:
2929
cache-name: go-mod-cache
3030
with:
3131
path: ~/go/pkg/mod
3232
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }}
3333
- name: Tools cache
34-
uses: actions/cache@v2.1.4
34+
uses: actions/cache@v2.1.5
3535
env:
3636
cache-name: go-tools-cache
3737
with:
@@ -58,7 +58,7 @@ jobs:
5858
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
5959
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
6060
- name: Module cache
61-
uses: actions/cache@v2.1.4
61+
uses: actions/cache@v2.1.5
6262
env:
6363
cache-name: go-mod-cache
6464
with:
@@ -81,7 +81,7 @@ jobs:
8181
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
8282
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
8383
- name: Module cache
84-
uses: actions/cache@v2.1.4
84+
uses: actions/cache@v2.1.5
8585
env:
8686
cache-name: go-mod-cache
8787
with:
@@ -134,7 +134,7 @@ jobs:
134134
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
135135
shell: bash
136136
- name: Module cache
137-
uses: actions/cache@v2.1.4
137+
uses: actions/cache@v2.1.5
138138
env:
139139
cache-name: go-mod-cache
140140
with:

.markdownlint.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Default state for all rules
2+
default: true
3+
4+
# ul-style
5+
MD004: false
6+
7+
# hard-tabs
8+
MD010: false
9+
10+
# line-length
11+
MD013: false
12+
13+
# no-duplicate-header
14+
MD024:
15+
siblings_only: true
16+
17+
# ol-prefix
18+
MD029:
19+
style: ordered
20+
21+
# no-inline-html
22+
MD033: false
23+
24+
# fenced-code-language
25+
MD040: false
26+

CHANGELOG.md

+73-24
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,44 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
1010

1111
### Added
1212

13+
### Changed
14+
15+
- Make `NewSplitDriver` from `go.opentelemetry.io/otel/exporters/otlp` take variadic arguments instead of a `SplitConfig` item.
16+
`NewSplitDriver` now automically implements an internal `noopDriver` for `SplitConfig` fields that are not initialized. (#1798)
17+
18+
### Deprecated
19+
20+
### Removed
21+
22+
### Fixed
23+
24+
### Security
25+
26+
## [0.20.0] - 2021-04-23
27+
28+
### Added
29+
30+
- The OTLP exporter now has two new convenience functions, `NewExportPipeline` and `InstallNewPipeline`, setup and install the exporter in tracing and metrics pipelines. (#1373)
31+
- Adds semantic conventions for exceptions. (#1492)
1332
- Added Jaeger Environment variables: `OTEL_EXPORTER_JAEGER_AGENT_HOST`, `OTEL_EXPORTER_JAEGER_AGENT_PORT`
1433
These environment variables can be used to override Jaeger agent hostname and port (#1752)
15-
- The OTLP exporter now has two new convenience functions, `NewExportPipeline` and `InstallNewPipeline`, setup and install the exporter in tracing and metrics pipelines. (#1373)
16-
- Adds test to check BatchSpanProcessor ignores `OnEnd` and `ForceFlush` post `Shutdown`. (#1772)
1734
- Option `ExportTimeout` was added to batch span processor. (#1755)
18-
- Adds semantic conventions for exceptions. (#1492)
35+
- `trace.TraceFlags` is now a defined type over `byte` and `WithSampled(bool) TraceFlags` and `IsSampled() bool` methods have been added to it. (#1770)
36+
- The `Event` and `Link` struct types from the `go.opentelemetry.io/otel` package now include a `DroppedAttributeCount` field to record the number of attributes that were not recorded due to configured limits being reached. (#1771)
37+
- The Jaeger exporter now reports dropped attributes for a Span event in the exported log. (#1771)
38+
- Adds test to check BatchSpanProcessor ignores `OnEnd` and `ForceFlush` post `Shutdown`. (#1772)
39+
- Extract resource attributes from the `OTEL_RESOURCE_ATTRIBUTES` environment variable and merge them with the `resource.Default` resource as well as resources provided to the `TracerProvider` and metric `Controller`. (#1785)
40+
- Added `WithOSType` resource configuration option to set OS (Operating System) type resource attribute (`os.type`). (#1788)
41+
- Added `WithProcess*` resource configuration options to set Process resource attributes. (#1788)
42+
- `process.pid`
43+
- `process.executable.name`
44+
- `process.executable.path`
45+
- `process.command_args`
46+
- `process.owner`
47+
- `process.runtime.name`
48+
- `process.runtime.version`
49+
- `process.runtime.description`
50+
- Adds `k8s.node.name` and `k8s.node.uid` attribute keys to the `semconv` package. (#1789)
1951
- Added support for configuring OTLP/HTTP and OTLP/gRPC Endpoints, TLS Certificates, Headers, Compression and Timeout via Environment Variables. (#1758, #1769 and #1811)
2052
- `OTEL_EXPORTER_OTLP_ENDPOINT`
2153
- `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`
@@ -32,10 +64,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
3264
- `OTEL_EXPORTER_OTLP_CERTIFICATE`
3365
- `OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE`
3466
- `OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE`
35-
- `trace.TraceFlags` is now a defined type over `byte` and `WithSampled(bool) TraceFlags` and `IsSampled() bool` methods have been added to it. (#1770)
36-
- The `Event` and `Link` struct types from the `go.opentelemetry.io/otel` package now include a `DroppedAttributeCount` field to record the number of attributes that were not recorded due to configured limits being reached. (#1771)
37-
- The Jaeger exporter now reports dropped attributes for a Span event in the exported log. (#1771)
38-
- Adds `k8s.node.name` and `k8s.node.uid` attribute keys to the `semconv` package. (#1789)
67+
- Adds `otlpgrpc.WithTimeout` option for configuring timeout to the otlp/gRPC exporter. (#1821)
3968

4069
### Fixed
4170

@@ -46,32 +75,39 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
4675
Additionally, this tag is overridden, as specified in the OTel specification, if the event contains an attribute with that key. (#1768)
4776
- Zipkin Exporter: Ensure mapping between OTel and Zipkin span data complies with the specification. (#1688)
4877
- Fixed typo for default service name in Jaeger Exporter. (#1797)
78+
- Fix flaky OTLP for the reconnnection of the client connection. (#1527, #1814)
4979

5080
### Changed
5181

52-
- Modify Zipkin Exporter default service name, use default resouce's serviceName instead of empty. (#1777)
53-
- Updated Jaeger Environment Variables: `JAEGER_ENDPOINT`, `JAEGER_USER`, `JAEGER_PASSWORD`
54-
to `OTEL_EXPORTER_JAEGER_ENDPOINT`, `OTEL_EXPORTER_JAEGER_USER`, `OTEL_EXPORTER_JAEGER_PASSWORD`
55-
in compliance with OTel spec (#1752)
5682
- Span `RecordError` now records an `exception` event to comply with the semantic convention specification. (#1492)
5783
- Jaeger exporter was updated to use thrift v0.14.1. (#1712)
5884
- Migrate from using internally built and maintained version of the OTLP to the one hosted at `go.opentelemetry.io/proto/otlp`. (#1713)
5985
- Migrate from using `github.com/gogo/protobuf` to `google.golang.org/protobuf` to match `go.opentelemetry.io/proto/otlp`. (#1713)
6086
- The storage of a local or remote Span in a `context.Context` using its SpanContext is unified to store just the current Span.
6187
The Span's SpanContext can now self-identify as being remote or not.
6288
This means that `"go.opentelemetry.io/otel/trace".ContextWithRemoteSpanContext` will now overwrite any existing current Span, not just existing remote Spans, and make it the current Span in a `context.Context`. (#1731)
89+
- Improve OTLP/gRPC exporter connection errors. (#1737)
6390
- Information about a parent span context in a `"go.opentelemetry.io/otel/export/trace".SpanSnapshot` is unified in a new `Parent` field.
6491
The existing `ParentSpanID` and `HasRemoteParent` fields are removed in favor of this. (#1748)
6592
- The `ParentContext` field of the `"go.opentelemetry.io/otel/sdk/trace".SamplingParameters` is updated to hold a `context.Context` containing the parent span.
6693
This changes it to make `SamplingParameters` conform with the OpenTelemetry specification. (#1749)
94+
- Updated Jaeger Environment Variables: `JAEGER_ENDPOINT`, `JAEGER_USER`, `JAEGER_PASSWORD`
95+
to `OTEL_EXPORTER_JAEGER_ENDPOINT`, `OTEL_EXPORTER_JAEGER_USER`, `OTEL_EXPORTER_JAEGER_PASSWORD` in compliance with OTel specification. (#1752)
6796
- Modify `BatchSpanProcessor.ForceFlush` to abort after timeout/cancellation. (#1757)
68-
- Improve OTLP/gRPC exporter connection errors. (#1737)
6997
- The `DroppedAttributeCount` field of the `Span` in the `go.opentelemetry.io/otel` package now only represents the number of attributes dropped for the span itself.
7098
It no longer is a conglomerate of itself, events, and link attributes that have been dropped. (#1771)
7199
- Make `ExportSpans` in Jaeger Exporter honor context deadline. (#1773)
100+
- Modify Zipkin Exporter default service name, use default resource's serviceName instead of empty. (#1777)
72101
- The `go.opentelemetry.io/otel/sdk/export/trace` package is merged into the `go.opentelemetry.io/otel/sdk/trace` package. (#1778)
73102
- The prometheus.InstallNewPipeline example is moved from comment to example test (#1796)
74-
- Convenience functions for stdout exporter have been updated to return the `TracerProvider` implementation and enable the shutdown of the exporter. (#1800)
103+
- The convenience functions for the stdout exporter have been updated to return the `TracerProvider` implementation and enable the shutdown of the exporter. (#1800)
104+
- Replace the flush function returned from the Jaeger exporter's convenience creation functions (`InstallNewPipeline` and `NewExportPipeline`) with the `TracerProvider` implementation they create.
105+
This enables the caller to shutdown and flush using the related `TracerProvider` methods. (#1822)
106+
- Updated the Jaeger exporter to have a default endpoint, `http://localhost:14250`, for the collector. (#1824)
107+
- Changed the function `WithCollectorEndpoint` in the Jaeger exporter to no longer accept an endpoint as an argument.
108+
The endpoint can be passed with the `CollectorEndpointOption` using the `WithEndpoint` function or by setting the `OTEL_EXPORTER_JAEGER_ENDPOINT` environment variable value appropriately. (#1824)
109+
- The Jaeger exporter no longer batches exported spans itself, instead it relies on the SDK's `BatchSpanProcessor` for this functionality. (#1830)
110+
- The Jaeger exporter creation functions (`NewRawExporter`, `NewExportPipeline`, and `InstallNewPipeline`) no longer accept the removed `Option` type as a variadic argument. (#1830)
75111

76112
### Removed
77113

@@ -90,6 +126,21 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
90126
- The `trace.FlagsDebug` and `trace.FlagsDeferred` constants have been removed and will be localized to the B3 propagator. (#1770)
91127
- Remove `Process` configuration, `WithProcessFromEnv` and `ProcessFromEnv`, and type from the Jaeger exporter package.
92128
The information that could be configured in the `Process` struct should be configured in a `Resource` instead. (#1776, #1804)
129+
- Remove the `WithDisabled` option from the Jaeger exporter.
130+
To disable the exporter unregister it from the `TracerProvider` or use a no-operation `TracerProvider`. (#1806)
131+
- Removed the functions `CollectorEndpointFromEnv` and `WithCollectorEndpointOptionFromEnv` from the Jaeger exporter.
132+
These functions for retrieving specific environment variable values are redundant of other internal functions and
133+
are not intended for end user use. (#1824)
134+
- Removed the Jaeger exporter `WithSDKOptions` `Option`.
135+
This option was used to set SDK options for the exporter creation convenience functions.
136+
These functions are provided as a way to easily setup or install the exporter with what are deemed reasonable SDK settings for common use cases.
137+
If the SDK needs to be configured differently, the `NewRawExporter` function and direct setup of the SDK with the desired settings should be used. (#1825)
138+
- The `WithBufferMaxCount` and `WithBatchMaxCount` `Option`s from the Jaeger exporter are removed.
139+
The exporter no longer batches exports, instead relying on the SDK's `BatchSpanProcessor` for this functionality. (#1830)
140+
- The Jaeger exporter `Option` type is removed.
141+
The type is no longer used by the exporter to configure anything.
142+
All the previous configurations these options provided were duplicates of SDK configuration.
143+
They have been removed in favor of using the SDK configuration and focuses the exporter configuration to be only about the endpoints it will send telemetry to. (#1830)
93144

94145
## [0.19.0] - 2021-03-18
95146

@@ -161,7 +212,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
161212

162213
### Changed
163214

164-
- Changed signature of the Span `RecordError` , replace EventOption by ErrorOption
215+
- Changed signature of the Span `RecordError`, replace EventOption with ErrorOption. (#1817)
165216
- Replaced interface `oteltest.SpanRecorder` with its existing implementation
166217
`StandardSpanRecorder`. (#1542)
167218
- Default span limit values to 128. (#1535)
@@ -172,7 +223,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
172223
- Stagger timestamps in exact aggregator tests. (#1569)
173224
- Changed all examples to use `WithBatchTimeout(5 * time.Second)` rather than `WithBatchTimeout(5)`. (#1621)
174225
- Prevent end-users from implementing some interfaces (#1575)
175-
```
226+
227+
```
176228
"otel/exporters/otlp/otlphttp".Option
177229
"otel/exporters/stdout".Option
178230
"otel/oteltest".Option
@@ -185,7 +237,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
185237
"otel/sdk/trace".ParentBasedSamplerOption
186238
"otel/sdk/trace".ReadOnlySpan
187239
"otel/sdk/trace".ReadWriteSpan
188-
```
240+
```
241+
189242
### Removed
190243

191244
- Removed attempt to resample spans upon changing the span name with `span.SetName()`. (#1545)
@@ -767,7 +820,7 @@ This release implements the v0.5.0 version of the OpenTelemetry specification.
767820
- Rename `Observer` instrument to `ValueObserver`. (#734)
768821
- The push controller now has a method (`Provider()`) to return a `metric.Provider` instead of the old `Meter` method that acted as a `metric.Provider`. (#738)
769822
- Replace `Measure` instrument by `ValueRecorder` instrument. (#732)
770-
- Rename correlation context header from `"Correlation-Context"` to `"otcorrelations"` to match the OpenTelemetry specification. 727)
823+
- Rename correlation context header from `"Correlation-Context"` to `"otcorrelations"` to match the OpenTelemetry specification. (#727)
771824

772825
### Fixed
773826

@@ -870,7 +923,6 @@ This release implements the v0.5.0 version of the OpenTelemetry specification.
870923
- Create a new recorder rather than reuse when multiple observations in same epoch for asynchronous instruments. #610
871924
- The default port the OTLP exporter uses to connect to the OpenTelemetry collector is updated to match the one the collector listens on by default. (#611)
872925

873-
874926
## [0.4.2] - 2020-03-31
875927

876928
### Fixed
@@ -930,7 +982,7 @@ There is still a possibility of breaking changes.
930982
- Simplified export setup pipeline for the jaeger exporter to match other exporters. (#459)
931983
- The zipkin trace exporter. (#495)
932984
- The OTLP exporter to export metric and trace telemetry to the OpenTelemetry collector. (#497) (#544) (#545)
933-
- The `StatusMessage` field was add to the trace `Span`. (#524)
985+
- Add `StatusMessage` field to the trace `Span`. (#524)
934986
- Context propagation in OpenTracing bridge in terms of OpenTelemetry context propagation. (#525)
935987
- The `Resource` type was added to the SDK. (#528)
936988
- The global API now supports a `Tracer` and `Meter` function as shortcuts to getting a global `*Provider` and calling these methods directly. (#538)
@@ -1023,14 +1075,12 @@ There is still a possibility of breaking changes.
10231075
- `AlwaysParentSample` sampler to the trace API. (#455)
10241076
- `WithNewRoot` option function to the trace API to specify the created span should be considered a root span. (#451)
10251077

1026-
10271078
### Changed
10281079

10291080
- Renamed `WithMap` to `ContextWithMap` in the correlation package. (#481)
10301081
- Renamed `FromContext` to `MapFromContext` in the correlation package. (#481)
10311082
- Move correlation context propagation to correlation package. (#479)
10321083
- Do not default to putting remote span context into links. (#480)
1033-
- Propagators extrac
10341084
- `Tracer.WithSpan` updated to accept `StartOptions`. (#472)
10351085
- Renamed `MetricKind` to `Kind` to not stutter in the type usage. (#432)
10361086
- Renamed the `export` package to `metric` to match directory structure. (#432)
@@ -1178,7 +1228,6 @@ There is still a possibility of breaking changes.
11781228
This allowed distinct label sets through, but any metrics sharing a label set could be overwritten or merged incorrectly.
11791229
This was corrected. (#333)
11801230

1181-
11821231
## [0.1.2] - 2019-11-18
11831232

11841233
### Fixed
@@ -1238,8 +1287,8 @@ It contains api and sdk for trace and meter.
12381287
- CircleCI build CI manifest files.
12391288
- CODEOWNERS file to track owners of this project.
12401289

1241-
1242-
[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v0.19.0...HEAD
1290+
[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v0.20.0...HEAD
1291+
[0.20.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.20.0
12431292
[0.19.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.19.0
12441293
[0.18.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.18.0
12451294
[0.17.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.17.0

CONTRIBUTING.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ You can view and edit the source code by cloning this repository:
1919
git clone https://github.com/open-telemetry/opentelemetry-go.git
2020
```
2121

22-
Run `make test` to run the tests instead of `go test`.
22+
Run `make test` to run the tests instead of `go test`.
2323

2424
There are some generated files checked into the repo. To make sure
2525
that the generated files are up-to-date, run `make` (or `make
@@ -43,7 +43,7 @@ To create a new PR, fork the project in GitHub and clone the upstream
4343
repo:
4444

4545
```sh
46-
$ go get -d go.opentelemetry.io/otel
46+
go get -d go.opentelemetry.io/otel
4747
```
4848

4949
(This may print some warning about "build constraints exclude all Go
@@ -53,7 +53,7 @@ This will put the project in `${GOPATH}/src/go.opentelemetry.io/otel`. You
5353
can alternatively use `git` directly with:
5454

5555
```sh
56-
$ git clone https://github.com/open-telemetry/opentelemetry-go
56+
git clone https://github.com/open-telemetry/opentelemetry-go
5757
```
5858

5959
(Note that `git clone` is *not* using the `go.opentelemetry.io/otel` name -
@@ -66,20 +66,20 @@ current working directory.
6666
Enter the newly created directory and add your fork as a new remote:
6767

6868
```sh
69-
$ git remote add <YOUR_FORK> git@github.com:<YOUR_GITHUB_USERNAME>/opentelemetry-go
69+
git remote add <YOUR_FORK> git@github.com:<YOUR_GITHUB_USERNAME>/opentelemetry-go
7070
```
7171

7272
Check out a new branch, make modifications, run linters and tests, update
7373
`CHANGELOG.md`, and push the branch to your fork:
7474

7575
```sh
76-
$ git checkout -b <YOUR_BRANCH_NAME>
76+
git checkout -b <YOUR_BRANCH_NAME>
7777
# edit files
7878
# update changelog
79-
$ make precommit
80-
$ git add -p
81-
$ git commit
82-
$ git push <YOUR_FORK> <YOUR_BRANCH_NAME>
79+
make precommit
80+
git add -p
81+
git commit
82+
git push <YOUR_FORK> <YOUR_BRANCH_NAME>
8383
```
8484

8585
Open a pull request against the main `opentelemetry-go` repo. Be sure to add the pull
@@ -140,8 +140,8 @@ It is preferable to have contributions follow the idioms of the
140140
language rather than conform to specific API names or argument
141141
patterns in the spec.
142142

143-
For a deeper discussion, see:
144-
https://github.com/open-telemetry/opentelemetry-specification/issues/165
143+
For a deeper discussion, see
144+
[this](https://github.com/open-telemetry/opentelemetry-specification/issues/165).
145145

146146
## Style Guide
147147

0 commit comments

Comments
 (0)