1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-01-03 22:52:30 +02:00
Commit Graph

902 Commits

Author SHA1 Message Date
Robert Pająk
7ba796cb39
sdk/log: Document how Processor and Exporter interfaces can be extended (#5347) 2024-05-11 17:21:33 +02: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
Tyler Yahn
9e7d7446c3
Test metric aggregate times (#5323) 2024-05-09 20:11:32 +02:00
Harish
1430e3fcd2
Merge Span.AddLink tests (#5115) 2024-05-09 07:09:30 +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
Tyler Yahn
2f662dbe13
Refactor exemplars to not use generic argument (#5285)
* Refactor exemplars to not use generic argument

* Update internal/aggregate

* Update metric SDK

* Test exemplar value type

* Add TestCollectExemplars

* Fix lint

---------

Co-authored-by: Sam Xie <sam@samxie.me>
2024-05-07 08:12:59 -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
Tyler Yahn
36bee9356a
Use reflect to construct a Record in logtest (#5275)
* Use reflect to construct Record

* Fix merge

* Fix merge
2024-05-06 09:03:14 -07:00
OpenTelemetry Bot
c25eeeadca
dependabot updates Sun May 5 15:58:11 UTC 2024 (#5300)
build(deps): bump google.golang.org/protobuf from 1.33.0 to 1.34.0 in /exporters/otlp/otlptrace/otlptracehttp
build(deps): bump codecov/codecov-action from 4.3.0 to 4.3.1
build(deps): bump google.golang.org/protobuf from 1.33.0 to 1.34.0 in /exporters/otlp/otlptrace
build(deps): bump google.golang.org/protobuf from 1.33.0 to 1.34.0 in /exporters/otlp/otlptrace/otlptracegrpc
build(deps): bump google.golang.org/protobuf from 1.33.0 to 1.34.0 in /exporters/prometheus
build(deps): bump golang.org/x/sys from 0.19.0 to 0.20.0 in /sdk
build(deps): bump github.com/golangci/golangci-lint from 1.57.2 to 1.58.0 in /internal/tools
build(deps): bump google.golang.org/protobuf from 1.33.0 to 1.34.0 in /exporters/otlp/otlpmetric/otlpmetrichttp
build(deps): bump google.golang.org/protobuf from 1.33.0 to 1.34.0 in /exporters/otlp/otlplog/otlploghttp
build(deps): bump github.com/openzipkin/zipkin-go from 0.4.2 to 0.4.3 in /exporters/zipkin
build(deps): bump google.golang.org/protobuf from 1.33.0 to 1.34.0 in /exporters/otlp/otlpmetric/otlpmetricgrpc
2024-05-05 09:16:04 -07:00
Tyler Yahn
1e357c7c9a
Truncate and de-duplicate log attribute values (#5230)
* Truncate and de-duplicate log attr values

* Fix test in otlploghttp

* Remove duplicate decl of assertKV
2024-04-29 07:51:22 -07:00
Tyler Yahn
97948259ec
Use empty resource when RecordFactory.Resource nil (#5264) 2024-04-28 19:07:43 +02:00
Alex Boten
c9c15038ba
docs: update variable name in documentation (#5270)
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-04-26 15:01:19 -07:00
dockercui
24d36d6931
chore: fix function names in comment (#5262)
Signed-off-by: dockercui <dockercui@aliyun.com>
2024-04-26 10:11:23 +02:00
Sam Xie
19ee6d4775
Fix flaky test TestBufferExporter/Shutdown/ContextCancelled (#5261) 2024-04-25 17:46: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
29e1c7e3e4
Add custom ring implementation to the BatchProcessor (#5237) 2024-04-24 12:07:15 +02:00
Robert Pająk
baeb560673
sdk/log: Fix doc for LoggerProvider.ForceFlush and LoggerProvider.Shutdown (#5259) 2024-04-23 20:19:05 +02:00
Tyler Yahn
b34cfc47c4
Default implementation for empty BatchProcessor (#5239)
Ensure an empty BatchProcessor does not panic when any method is called.
Default an empty BatchProcessor as being shut down.
2024-04-22 16:21:49 +02:00
Tyler Yahn
94eb27fb40
Rename batching configuration (#5236)
Match the BatchProcessor and name these decls "batch*."
2024-04-19 18:56:31 +02:00
Robert Pająk
ed666f7713
sdk/log: Rename BatchingProcessor to BatchProcessor (#5229) 2024-04-19 08:34:30 +02:00
Tyler Yahn
4af9c20a80
Implement the BatchingProcessor (#5093)
* [WIP] Implement the BatchingProcessor

* Add TestExportSync

* Add TestChunker

* Test export error default to ErrorHandler

* Fix lint

* Fix chunk smaller than size error

* Add batch tests

* Fix lint

* Update OnEmit test

Check the len of records in eventually assertion given that is what we
are going to measure.

* Revert unneeded change to BatchingProcessor doc

* Add batch type

* Refactor testing of batching config

The BatchingProcessor is not expected to ultimately contain
configuration fields for queue size or export parameters (see #5093).
This will break TestNewBatchingProcessorConfiguration which tests the
configuration by evaluating the BatchingProcessor directly.

Instead, test the batchingConfig and rename the test to
TestNewBatchingConfig to match what is being tested.

* Implement the BatchingProcessor without polling

* Add TestBatchingProcessor

* Add ConcurrentSafe test

* Expand Shutdown tests

* Test context canceled for ForceFlush

* Refactor batch to queue

* Use exportSync

* Update docs and naming

* Split buffered export to its own type

* Update comments and naming

* Fix lint

* Remove redundant triggered type

* Add interval polling

* Refactor test structure

* Add custom ring implimementation

* Add BenchmarkBatchingProcessor

* Fix merge

* Remove custom ring impl

* Remove BenchmarkBatchingProcessor

* Update dev docs

* Test nil exporter

* Update OnEmit test

Ensure the poll goroutine will completely flush the queue of batches.

* Test RetriggerFlushNonBlocking

* Update ascii diagram

* Fix flaky OnEmit

* Revert unnecessary change to test pkg name

* Use batching term in docs

* Document EnqueueExport

* Return from EnqueueExport if blocked

Do not wait for the enqueue to succeed.

* Do not drop failed flush log records

* Use cancelable ctx in concurrency test

* Fix comments

* Apply feedback

Do not spawn a goroutine for the flush operation.

* Return true from EnqueueExport when stopped

* Update sdk/log/batch.go

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

* Remove TODO

* Comment re-trigger in poll

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2024-04-18 07:48:19 -07: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
Robert Pająk
054a63fef2
sdk/log: Add options to NewSimpleProcessor (#5185) 2024-04-10 19:47:40 +02:00
Robert Pająk
b9752eb5dc
sdk/log: Exporter has to be concurrent-safe (#5181) 2024-04-09 10:22:50 +02:00
OpenTelemetry Bot
30487e145c
dependabot updates Sat Apr 6 07:01:47 UTC 2024 (#5171)
build(deps): bump golang.org/x/tools from 0.19.0 to 0.20.0 in /internal/tools
build(deps): bump go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp from 0.49.0 to 0.50.0 in /example/dice
build(deps): bump golang.org/x/sys from 0.18.0 to 0.19.0 in /sdk
2024-04-06 09:08:36 +02:00
Tyler Yahn
98d961b141
Clamp batch size <= queue size (#5157) 2024-04-05 16:02:32 -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
Tyler Yahn
6c6e1e7416
Add queue for BatchingProcessor (#5131) 2024-04-03 13:53:16 +02:00
Tyler Yahn
5449f083aa
Add the bufferExporter (#5119)
* Add the bufferExporter

* Fix TestExportSync

Reset default ErrorHandler

* Comment

* Clean up tests

* Remove context arg from EnqueueExport

* Join wrapped exporter error
2024-04-02 08:36:18 -07:00
Tyler Yahn
c4dffbf888
Add chunkExporter (#5104)
* Add chunker exporter

The batching log processor needs to be able to export payloads in
chuncks. This adds a chunker type that will forward all Shutdown and
ForceFlush calls to the embedded exporter and chunk data passed to
Export.

* Concurrent safe testExporter

* Add test for zero size

* Fix lint

* Refactor chunker into chunkExporter

* Remove ExportTrigger
2024-04-02 07:44:38 -07:00
Tyler Yahn
bddfbc68ca
Add timeoutExporter (#5118) 2024-04-01 09:17:07 -07:00
qcheng
554282d3e4
trace: Add Span.AddLink method (#5032) 2024-03-28 08:35:15 +01:00
Tyler Yahn
321219b2a6
Add export sync (#5105)
* Add export sync

The batching log processor will generate records from 4 different
locations (polling, OnEmit, ForceFlush, Shutdown). In order to ensure an
Exporter is called serially, as is required by the interface, this
function will be used in the processor to centralize the interaction
with its Exporter.

Part of #5063.

See #5093 for the implementation use.

* Concurrent safe testExporter

---------

Co-authored-by: Sam Xie <sam@samxie.me>
2024-03-27 11:45:35 -07:00
Robert Pająk
068b6c87c4
[chore] Remove open issues for design docs (#5112) 2024-03-27 18:34:31 +01:00
Damien Mathieu
edb788bf49
Add READMEs to every package (#5103) 2024-03-26 20:13:54 +01:00
Sam Xie
f1ba32e95e
Add benchmark for logger (#5101) 2024-03-26 17:47:30 +01:00
Tyler Yahn
6033938c87
Refactor testing of batching config (#5106)
The BatchingProcessor is not expected to ultimately contain
configuration fields for queue size or export parameters (see #5093).
This will break TestNewBatchingProcessorConfiguration which tests the
configuration by evaluating the BatchingProcessor directly.

Instead, test the batchingConfig and rename the test to
TestNewBatchingConfig to match what is being tested.
2024-03-26 13:22:53 +01:00
Tyler Yahn
32e3a3d994
Implement the BatchingProcessor configuration (#5088)
* Implement the batching config

* Unify on setting type

* Add setting_test.go

* Test NewBatchingProcessor

* Comment setting

* Fix lint

* Check invalid after envar

---------

Co-authored-by: Sam Xie <sam@samxie.me>
2024-03-25 07:50:19 -07:00
Kevin Burke
8b147470f4
sdk/trace: fix spelling errors (#4996) 2024-03-25 13:10:08 +01:00
Tyler Yahn
a5172ab422
Fix spelling errors in batch.go (#5097) 2024-03-22 08:58:02 -07:00
Sam Xie
b77a5c3968
sdk/log: ObservedTimestamp should be set (#5091)
* Set ObservedTimestamp

* Update sdk/log/logger.go

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

* Reuse value

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2024-03-22 07:39:01 -07:00
Tyler Yahn
12c5651ec7
Do not alloc multiple noop exporters (#5083) 2024-03-19 10:33:57 -07:00
Sam Xie
77d9192803
Implement logger (#5081)
* Implement logger

* Remove todo comment

* Add tests

* Fix

* Check processors in Enabled method
2024-03-18 16:07:43 -07:00
Tyler Yahn
4580e06de0
Implement the LoggerProvider (#5080) 2024-03-18 06:57:43 +01:00
Tyler Yahn
3542ee68a9
Implement the SimpleProcessor (#5079)
* Implement the SimpleProcessor

* Add BenchmarkSimpleProcessorOnEmit

* Remove stale comment

* Run benchmarks in parallel
2024-03-17 07:47:05 -07:00
Robert Pająk
6fb46a1211
Simplify log design docs (#5077) 2024-03-16 11:06:06 +01:00
Tyler Yahn
3a72c5ea94
Implement the providerConfig (#5074)
* Implement the providerConfig

* Add test for NewLoggerProvider configuration

* Add TestLimitValueFailsOpen

* Fix merge
2024-03-15 10:24:32 -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