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

844 Commits

Author SHA1 Message Date
renovate[bot]
7c5e64cccc
chore(deps): update dependency codespell to v2.3.0 (#5409)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
2024-05-24 18:09:31 +02:00
Tyler Yahn
5661ff0ded
Release v1.27.0/v0.49.0/v0.3.0 (#5392)
This release includes the first beta release of the OpenTelemetry Logs
Bridge API and SDK for Go.

### Added

- Add example for `go.opentelemetry.io/otel/exporters/stdout/stdoutlog`.
(#5242)
- Add `RecordFactory` in `go.opentelemetry.io/otel/sdk/log/logtest` to
facilitate testing exporter and processor implementations. (#5258)
- Add `RecordFactory` in `go.opentelemetry.io/otel/log/logtest` to
facilitate testing bridge implementations. (#5263)
- The count of dropped records from the `BatchProcessor` in
`go.opentelemetry.io/otel/sdk/log` is logged. (#5276)
- Add metrics in the `otel-collector` example. (#5283)
- Add the synchronous gauge instrument to
`go.opentelemetry.io/otel/metric`. (#5304)
- An `int64` or `float64` synchronous gauge instrument can now be
created from a `Meter`.
- All implementations of the API
(`go.opentelemetry.io/otel/metric/noop`,
`go.opentelemetry.io/otel/sdk/metric`) are updated to support this
instrument.
- Add logs to `go.opentelemetry.io/otel/example/dice`. (#5349)

### Changed

- The `Shutdown` method of `Exporter` in
`go.opentelemetry.io/otel/exporters/stdout/stdouttrace` ignores the
context cancellation and always returns `nil`. (#5189)
- The `ForceFlush` and `Shutdown` methods of the exporter returned by
`New` in `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` ignore
the context cancellation and always return `nil`. (#5189)
- Apply the value length limits to `Record` attributes in
`go.opentelemetry.io/otel/sdk/log`. (#5230)
- De-duplicate map attributes added to a `Record` in
`go.opentelemetry.io/otel/sdk/log`. (#5230)
- `go.opentelemetry.io/otel/exporters/stdout/stdoutlog` won't print
timestamps when `WithoutTimestamps` option is set. (#5241)
- The `go.opentelemetry.io/otel/exporters/stdout/stdoutlog` exporter
won't print `AttributeValueLengthLimit` and `AttributeCountLimit` fields
now, instead it prints the `DroppedAttributes` field. (#5272)
- Improved performance in the `Stringer` implementation of
`go.opentelemetry.io/otel/baggage.Member` by reducing the number of
allocations. (#5286)
- Set the start time for last-value aggregates in
`go.opentelemetry.io/otel/sdk/metric`. (#5305)
- The `Span` in `go.opentelemetry.io/otel/sdk/trace` will record links
without span context if either non-empty `TraceState` or attributes are
provided. (#5315)
- Upgrade all dependencies of `go.opentelemetry.io/otel/semconv/v1.24.0`
to `go.opentelemetry.io/otel/semconv/v1.25.0`. (#5374)

### Fixed

- Comparison of unordered maps for
`go.opentelemetry.io/otel/log.KeyValue` and
`go.opentelemetry.io/otel/log.Value`. (#5306)
- Fix the empty output of `go.opentelemetry.io/otel/log.Value` in
`go.opentelemetry.io/otel/exporters/stdout/stdoutlog`. (#5311)
- Split the behavior of `Recorder` in
`go.opentelemetry.io/otel/log/logtest` so it behaves as a
`LoggerProvider` only. (#5365)
- Fix wrong package name of the error message when parsing endpoint URL
in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`.
(#5371)
- Identify the `Logger` returned from the global `LoggerProvider` in
`go.opentelemetry.io/otel/log/global` with its schema URL. (#5375)
2024-05-21 10:59:36 -07:00
Tyler Yahn
999c6a07b3
Update all semconv use to v1.25.0 (#5374)
Resolve #5373
2024-05-19 07:16:33 +02:00
Tyler Yahn
14441aefdf
Identify logger with schemaURL in global logger provider (#5375)
Fix #5366
2024-05-18 11:00:00 +02:00
Damien Mathieu
ebd0adee35
Split log/logtest into a recorder and a logger (#5365)
The current logtest.Recorder implementation is wrong. We have a single
`Recorder`, which acts as both a `LoggerProvider`, and a `Logger`,
making it possible to emit a log entry with the root recorder, which
shouldn't be possible with the API.

This change introduces a new private struct, `logger` that acts as the
recording logger, while `Recorder` becomes only a LoggerProvider and not
a Logger anymore.

Closes #5357.

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2024-05-17 07:28:40 -07:00
Sam Xie
0d1e77c854
Fix package prefix of error in otlploghttp (#5371) 2024-05-17 09:23:39 +02:00
Sam Xie
76c06107b6
Collector example: add metrics (#5283)
Resolves #5243
2024-05-16 19:33:17 +02:00
Tyler Yahn
dafe137bbe
Add the synchronous gauge to the metric API and SDK (#5304)
Resolve #5225 

The specification has [added a synchronous gauge
instrument](https://github.com/open-telemetry/opentelemetry-specification/pull/3540).
That instrument has now been
[stabilized](https://github.com/open-telemetry/opentelemetry-specification/pull/4019),
and that stabilization is included in the [next
release](https://github.com/open-telemetry/opentelemetry-specification/pull/4034).

This adds the new synchronous gauge instrument to the metric API and all
implementation we publish.

This change will be a breaking change for any SDK developer. The
`embedded` package is updated to ensure our compatibility guarantees are
meet.

---------

Co-authored-by: David Ashpole <dashpole@google.com>
2024-05-16 09:56:40 -07:00
Damien Mathieu
08c8b3224a
log: Fix comparison of unordered map values (#5306) 2024-05-15 12:28:23 +02:00
Tyler Yahn
56bb4cf63e
Add logs to dice example (#5349)
* Add logs to dice example

Use slog to log a message on the server handler.

* Add changelog entry

* Split impl for 1.22 and 1.21
2024-05-14 13:00:49 -07:00
Tyler Yahn
69800ee189
Support Delta & Cumulative temporality for LastValue aggregates (#5305)
* Add delta/cumulative/precomputed LastValue agg

* Add cumulative testing

* Add precomputed testing

* Add changelog entry
2024-05-10 07:19:46 -07:00
Anton Manakin
c00a51af86
Record links with empty span context (#5315)
* record links with empty span context

* add global trace state

* fix test comments and changelog

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2024-05-09 13:25:02 -07:00
Sam Xie
9f1de8415e
Fix empty log body printed by stdoutlog exporter (#5311) 2024-05-09 21:41:36 +02:00
Tyler Yahn
ae06a80417
Log records dropped by the BatchProcessor (#5276)
* Add dropped count to queue

* Log dropped records

* Add changelog entry

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2024-05-08 07:42:09 -07:00
Damien Mathieu
f8b9fe3dbe
Emit attributes slices as their json representation (#5159)
* emit slices as their json representation

* add changelog

* fix resource tests

* indicate invalid slice if we couldn't turn them into json

* move changelog entry to the unreleased section

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2024-05-07 07:42:07 -07:00
Moises Vega
0fc35e0e93
feat: opt for concatenation instead of using fmt.Sprintf (#5286)
* feat: opt for concatenation instead of using fmt.Sprintf

* Update Changelog

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Damien Mathieu <damien.mathieu@elastic.co>
2024-05-07 07:19:08 -07:00
Sam Xie
dbfc75817a
Use docker compose in otel collector example (#5244)
* Remove k8s files

* Add docker compose file

* Update endpoint in main.go

* Update README to use docker compose

* Update CHANGELOG

* Add Shutting down section for cleanup steps

* Replace logging exporter with debug exporter

---------

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2024-05-02 07:44:54 -07:00
Sam Xie
d5945a9dba
The stdoutlog exporter prints DroppedAttributes field instead of Limits fields (#5272)
* Add tests for resource, scope, dropped attributes

* Update CHANGELOG

* Apply suggestions from code review

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2024-04-30 10:26:26 -07:00
Tyler Yahn
d1d390e739
Add changelog entry for #5230 (#5277) 2024-04-30 07:24:56 -07:00
Prasad Shirodkar
fd6d4db8c3
Remove context check on stdout exporters (#5189) 2024-04-25 17:11:45 +02:00
Sam Xie
37619eada9
Add example for stdoutlog (#5242) 2024-04-25 12:24:31 +02:00
Sam Xie
27e0344491
stdoutlog: Do not print timestamps when WithoutTimestamps is set (#5241) 2024-04-25 10:19:18 +02:00
Damien Mathieu
f33d40886d
log/logtest: add Record Factory (#5263) 2024-04-25 07:22:39 +02:00
Robert Pająk
df455db04d
sdk/log/logtest: Add RecordFactory (#5258) 2024-04-25 07:09:34 +02:00
Sam Xie
9656d0afa7
Release 1.26.0/0.48.0/0.2.0-alpha (#5260)
* Bump versions in versions.yaml

* Prepare stable-v1 for version v1.26.0

* Prepare experimental-metrics for version v0.48.0

* Prepare experimental-logs for version v0.2.0-alpha

* Prepare experimental-schema for version v0.0.9

* Update CHANGELOG

* Unbump experimental-schema

* 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>
2024-04-24 07:27:22 -07:00
Tyler Yahn
fe8e3a1b42
Semconv v1.25.0 (#5254) 2024-04-23 17:29:17 +02:00
Sam Xie
bf37c5a3a4
Revert the usage of go.opentelemetry.io/proto/slim (#5253)
* Revert "otlpmetrichttp: Use go.opentelemetry.io/proto/slim/otlp (#5222)"

This reverts commit 6e92163d6a.

* Revert "otlploghttp: Use go.opentelemetry.io/proto/slim/otlp (#5216)"

This reverts commit fe3de7059e.

* Remove slim dep

* Fix CI
2024-04-23 07:12:25 +02:00
Robert Pająk
6e92163d6a
otlpmetrichttp: Use go.opentelemetry.io/proto/slim/otlp (#5222) 2024-04-22 13:07:29 +02:00
Tyler Yahn
48f028ffd3
Add sdk/log, stdoutlog, and otlploghttp to next release (#5240)
* Add sdk/log, stdoutlog, and otlploghttp to next release

Include go.opentelemetry.io/otel/sdk/log,
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp, and
go.opentelemetry.io/otel/exporters/stdout/stdoutlog in the
experimental-logs module set.

* Add releases to changelog

* Remove unreleased module changes
2024-04-20 13:24:51 +02:00
Kevin Burke
906c4909fa
baggage: more efficient member validation (#5214) 2024-04-19 08:45:54 +02:00
Tyler Yahn
dbe27d4147
Replace Record limit methods with DroppedAttributes (#5190)
* Replace Record lim methods with DroppedAttributes

* Add changelog entry

* Add TestRecordDroppedAttributes

* Add TestRecordCompactAttr

* Add an indexPool

* Fix gramatical error

* Apply feedback

Reduce indentation level.

* Apply feedback

Comment compactAttr and deduplicate.

* Deduplicate all attributes when added

* Comment why head is not used

* Clarify comments

* Move TestAllocationLimits to new file

Do not run this test when the race detector is on.

* Comment follow-up task
2024-04-16 11:48:17 -07:00
Damien Mathieu
1ff2e71e7d
Add span flags to OTLP exported data (#5194)
* add trace flags to OTLP export

* add changelog entry

* add span flags to links too

* rely on the parent span context for span flags

* test BuildSpanFlags, not with an actual span

* Update exporters/otlp/otlptrace/internal/tracetransform/span.go

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

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2024-04-15 07:33:25 -07:00
Robert Pająk
1297d5f034
[chore] Move #5134 changlog entry to Unreleased (#5193) 2024-04-11 10:16:03 +02:00
Damien Mathieu
648b40eae1
Bump proto-go to v1.2.0 (#5177)
* upgrade the generated otlp proto to 1.2.0

* add changelog entry

* mod tidy in collector example

* fix changelog entry

* 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>
2024-04-09 07:06:46 -07:00
Damien Mathieu
8d1d62b905
logtest: Add Recorder (#5134)
* introduce in-memory log exporter

* add changelog entry

* move logtest into a recorder within the api

* rename GetRecords to Result

* rename InMemoryRecorder to Recorder

* name the struct r

* ensure Logger creates a struct copy

* replace severity with enabledFn

* Update CHANGELOG.md

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

* kUpdate log/logtest/config.go

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

* store all scope records, so we can retrieve everything with `Result()`

* store child loggers instead of all scope records

* no need to explicitly create a new slice

* add concurrent safe test

* handle default enabled function if the struct was manually created

* rename WithEnabledFn to WithEnabledFunc

* test result/reset with child loggers

* add enabled to concurrent safe

* fix lint missing period

* rename defaultEnabledFn to defaultEnabledFunc

* merge recorder.go and config.go

* Update log/logtest/recorder_test.go

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

* create empty recorder in concurrent safe test

* Update log/logtest/recorder_test.go

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

* fix lint

* Update log/logtest/recorder.go

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

* Update log/logtest/recorder.go

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

* Update log/logtest/recorder.go

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

* Update log/logtest/recorder.go

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

* Update log/logtest/recorder.go

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

* Update log/logtest/recorder.go

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

* Update log/logtest/recorder.go

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

* Update log/logtest/recorder.go

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

* make enabledFunc callable from outside the package

* replace expected with want

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Sam Xie <sam@samxie.me>
2024-04-09 06:45:25 -07:00
Tyler Yahn
66284071de
Release v1.25.0/v0.47.0/v0.0.8/v0.1.0-alpha (#5154)
* Bump versions in versions.yaml

* Prepare stable-v1 for version v1.25.0

* Prepare experimental-metrics for version v0.47.0

* Prepare experimental-logs for version v0.1.0-alpha

* Prepare experimental-schema for version v0.0.8

* Update changelog

* Run go mod tidy

* Update CHANGELOG.md

---------

Co-authored-by: Damien Mathieu <damien.mathieu@elastic.co>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
2024-04-05 07:34:02 -07:00
Benjamin Sanabria Carr
6394b029fe
semconv: Add metric generation (#4880)
* Adds some basic constants for metrics utilizing a new jinja template

* Updates generated comments with more explicit nomenclature; Adds Unit and Description consts for each metric; append 'Name' to metric const instead of 'Key'

* Update CHANGELOG

* fix overlooked merge conflict

* change the types of generated consts to string; format generation to handle empty stability and descriptions

* trim trailing (repeated) periods in the description

* manual formatting of some proper nouns; simplify the license header

* update metrics file with concise generated license header

* revert special formatting logic for JVM and ASPNETCore

* Update CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: Damien Mathieu <42@dmathieu.com>

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Sam Xie <sam@samxie.me>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2024-04-04 14:04:18 -07:00
Tyler Yahn
35c9570974
Prevent default ErrorHandler self-delegation (#5137) 2024-04-04 22:36:34 +02:00
Robert Pająk
98fd439f96
Bump bump google.golang.org/grpc from 1.62.1 to 1.63.0 and use grpc.NewClient instead of grpc.DialContext (#5151) 2024-04-04 20:45:16 +02:00
David Ashpole
016843786a
Add exemplar support to the prometheus exporter (#5111) 2024-04-04 19:43:49 +02:00
Tyler Yahn
afb6af0419
Address GO-2024-2687 (#5139)
* Bump Go versions used in CI systems

The latest releases of Go 1.22 and 1.21 contain security fixes for
`net/http`. Explicitly set the CI system to not use vulnerable versions
when testing so our vulnerable checker does not fail (and we aren't
vulnerable).

* Upgrade golang.org/x/net to v0.23.0

* Add changelog entry
2024-04-04 08:03:38 +02:00
Robert Pająk
e6e44dee90
log: Add String method to Value and KeyValue (#5117) 2024-04-02 10:50:07 +02:00
David Ashpole
7667f7ba25
Add support for AddLink to the OpenCensus bridge (#5116)
* add support for AddLink to the OpenCensus bridge

* Update CHANGELOG.md

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

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2024-04-01 10:30:34 -04:00
qcheng
554282d3e4
trace: Add Span.AddLink method (#5032) 2024-03-28 08:35:15 +01:00
Piotr Kiełkowicz
9e34895a3e
exporters/zipkin: Add use new scope attributes (#5108)
Co-authored-by: Robert Pająk <pellared@hotmail.com>
2024-03-27 08:02:52 +01:00
David Ashpole
540663b064
add summary support to the OTLP exporter (#5100)
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2024-03-25 08:15:02 -07:00
Tyler Yahn
335f4de960
Add global log package (#5085)
* Add the log/global package

* Implement the stubbed features

* Add ConcurrentSafe tests

* Restructure with internal implementation

* Add internal global state

* Use internal state in log/global

* Add TestDelegation

* Fix lint

* Clean log_test.go

* Clean up

* Add changelog entry

* Simplify TestMultipleGlobalLoggerProvider

* Shorten log.go

* Fix comment text wrapping

* Shorten state_test.go

* Don't pollute output in TestSetLoggerProvider
2024-03-19 11:28:11 -07:00
Damien Mathieu
ca5bb1f54c
Run compatibility tests on arm64 with actuated (#4994)
* try running compatibility tests on arm64 with actuated

* try nested matrix

* setup vmmeter

* try less cpu and less gb with actuated

* add comment about vmmeter

* Update .github/workflows/ci.yml

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

* Update .github/workflows/ci.yml

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

* Update .github/workflows/ci.yml

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

* Update .github/workflows/ci.yml

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

* Update .github/workflows/ci.yml

* update compatibility matrix

* use linux name for arm builds

* add changelog entry

* add link to actuated doc

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2024-03-19 07:35:16 -07:00
Tyler Yahn
da047e70ef
Add the Enabled method to the Logger (#5071)
* Add the Enabled method to the Logger

* Add a changelog entry

* Rename enabled.go to min_sev.go

* Remove MinSeverityProcessor

* Document lack of interaction between OnEmit and Enabled

* Update sdk/log/processor.go

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2024-03-15 08:15:44 -07:00
Sam Xie
47ac0d4df8
logs: Add empty value for KeyValue (#5076)
* Add empty value for KeyValue

* Update CHANGELOG

* Apply suggestions from code review

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Fix comments

* Update log/keyvalue.go

Co-authored-by: Damien Mathieu <42@dmathieu.com>

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
2024-03-15 07:52:24 -07:00