1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-01-16 02:47:20 +02:00
Commit Graph

2498 Commits

Author SHA1 Message Date
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
Tyler Yahn
727395ad0e
Add example test to otlploghttp (#5235) 2024-04-20 11:51:04 +02:00
Tyler Yahn
1ea4ee2717
Add the otlploghttp HTTP client (#5224)
* Add the HTTP client

* Add client tests

* Clean up

* Fix merge
2024-04-19 10:17:11 -07:00
Tyler Yahn
94eb27fb40
Rename batching configuration (#5236)
Match the BatchProcessor and name these decls "batch*."
2024-04-19 18:56:31 +02:00
Tyler Yahn
ed2e2b0225
Add environment variable support to otlploghttp (#5223)
* Add the setting type

* Implement options

* Add fallbacks

* Test config defaults

* Support envars

* Test envars

* Test OTLP envars

* Test options having precedence

* Fix lint

* Test envars errs

* Comment

* Fix imports

* Fix path expectation

* Fix alt path parsing

* Parse none compression
2024-04-19 07:32:53 -07:00
Robert Pająk
1f76264a2e
[chore] Rebuild .tools as they can be outdated (#5220) 2024-04-19 09:02:14 +02:00
Kevin Burke
906c4909fa
baggage: more efficient member validation (#5214) 2024-04-19 08:45:54 +02:00
Robert Pająk
ed666f7713
sdk/log: Rename BatchingProcessor to BatchProcessor (#5229) 2024-04-19 08:34:30 +02:00
Alex Boten
e055c7d315
[chore] fix typo in baggage.NewMember docs (#5231)
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-04-18 23:09:51 +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
Robert Pająk
fe3de7059e
otlploghttp: Use go.opentelemetry.io/proto/slim/otlp (#5216) 2024-04-17 12:20:47 +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
OpenTelemetry Bot
e518c7e784
dependabot updates Sun Apr 14 07:10:26 UTC 2024 (#5210)
build(deps): bump google.golang.org/grpc from 1.63.0 to 1.63.2 in /exporters/otlp/otlptrace/otlptracehttp
build(deps): bump google.golang.org/grpc from 1.63.0 to 1.63.2 in /bridge/opentracing/test
build(deps): bump google.golang.org/grpc from 1.63.0 to 1.63.2 in /exporters/otlp/otlptrace/otlptracegrpc
build(deps): bump google.golang.org/grpc from 1.63.0 to 1.63.2 in /exporters/otlp/otlpmetric/otlpmetrichttp
build(deps): bump google.golang.org/grpc from 1.63.0 to 1.63.2 in /exporters/otlp/otlpmetric/otlpmetricgrpc
build(deps): bump go.opentelemetry.io/proto/otlp from 1.1.0 to 1.2.0 in /exporters/otlp/otlplog/otlploghttp
build(deps): bump google.golang.org/grpc from 1.63.0 to 1.63.2 in /example/otel-collector
2024-04-14 09:19:48 +02:00
dependabot[bot]
3b6043b2f7
build(deps): bump codecov/codecov-action from 4.2.0 to 4.3.0 (#5205)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v4.2.0...v4.3.0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-14 09:06:27 +02:00
Tyler Yahn
c971888ee6
Add otlploghttp transform package (#5191)
* Add otlploghttp transform pkg

* Rename TestTransformations to TestResourceLogs

* Add TestAttrTransforms

* Add TestLogAttrs

* Add TestSeverityNumber

* Update go mod

* Fix comments

* Apply feedback
2024-04-12 07:28:25 -07:00
Tyler Yahn
7da00d94ac
Add base implementation of otlploghttp configuration (#5167) 2024-04-11 20:53:17 +02:00
Robert Pająk
1297d5f034
[chore] Move #5134 changlog entry to Unreleased (#5193) 2024-04-11 10:16:03 +02:00
Sam Xie
7092c1f71d
stdoutlog: Add exporter (#5172) 2024-04-11 09:18:42 +02:00
Damien Mathieu
fb029273a7
Add caching to lychee links checker (#5160) 2024-04-10 22:58:21 +02:00
Robert Pająk
054a63fef2
sdk/log: Add options to NewSimpleProcessor (#5185) 2024-04-10 19:47:40 +02:00
Tyler Yahn
727f03e220
otlploghttp: Implement Exporter.Export (#5182) 2024-04-10 16:47:24 +02:00
Tyler Yahn
b13ee4ae39
Add concurrency test for Exporter to otlploghttp (#5183)
* Add concurrency test for Exporter to otlploghttp

* Update exporters/otlp/otlplog/otlploghttp/exporter_test.go

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

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2024-04-10 07:11:21 -07: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
Robert Pająk
b9752eb5dc
sdk/log: Exporter has to be concurrent-safe (#5181) 2024-04-09 10:22:50 +02:00
Kevin Burke
a4a9e24d8c
propagation: fix grammar in TraceContext.Inject doc (#5166) 2024-04-09 09:16:33 +02:00
dependabot[bot]
e028d07d0d
build(deps): bump google.golang.org/protobuf (#5180)
Bumps google.golang.org/protobuf from 1.32.0 to 1.33.0.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-08 09:56:49 -07:00
Tyler Yahn
b237a1ccbf
otlploghttp: Implement Exporter.Shutdown (#5163) 2024-04-08 18:14:58 +02:00
Tyler Yahn
014c6fc332
otlploghttp: Generate internal/retry (#5165) 2024-04-08 10:19:44 +02:00
Tyler Yahn
d66a6618c2
otelloghttp: Implement Exporter.ForceFlush (#5164)
It holds no state, already implemented.
2024-04-08 09:47:11 +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
Sam Xie
d65da34984
Add config and doc for stdoutlog exporter (#5158) 2024-04-06 08:02:26 +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
Robert Pająk
82b49b4487
Add otlploghttp package documentation (#5150) 2024-04-05 08:29:49 +02:00
OpenTelemetry Bot
5bd5582904
dependabot updates Thu Apr 4 20:43:44 UTC 2024 (#5155)
build(deps): bump github.com/itchyny/gojq from 0.12.14 to 0.12.15 in /internal/tools
build(deps): bump google.golang.org/grpc from 1.62.1 to 1.63.0 in /exporters/otlp/otlpmetric/otlpmetricgrpc
build(deps): bump google.golang.org/grpc from 1.62.1 to 1.63.0 in /bridge/opentracing/test
build(deps): bump google.golang.org/grpc from 1.62.1 to 1.63.0 in /example/otel-collector
build(deps): bump google.golang.org/grpc from 1.62.1 to 1.63.0 in /exporters/otlp/otlptrace/otlptracegrpc
build(deps): bump github.com/prometheus/client_model from 0.6.0 to 0.6.1 in /exporters/prometheus

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2024-04-04 23:19:55 +02: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
dependabot[bot]
e6e4e4a3d1
build(deps): bump benchmark-action/github-action-benchmark (#5142)
Bumps [benchmark-action/github-action-benchmark](https://github.com/benchmark-action/github-action-benchmark) from 1.19.3 to 1.20.1.
- [Release notes](https://github.com/benchmark-action/github-action-benchmark/releases)
- [Changelog](https://github.com/benchmark-action/github-action-benchmark/blob/master/CHANGELOG.md)
- [Commits](https://github.com/benchmark-action/github-action-benchmark/compare/v1.19.3...v1.20.1)

---
updated-dependencies:
- dependency-name: benchmark-action/github-action-benchmark
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-04 10:39:53 +02:00
dependabot[bot]
73ee3bbf37
build(deps): bump codecov/codecov-action from 4.1.1 to 4.2.0 (#5140)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.1.1 to 4.2.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v4.1.1...v4.2.0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-04 08:29:57 +02:00
Tyler Yahn
14e3f6b65c
Add otlploghttp exporter skeleton (#5138) 2024-04-04 08:25:22 +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
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
Robert Pająk
e6e44dee90
log: Add String method to Value and KeyValue (#5117) 2024-04-02 10:50:07 +02:00
dependabot[bot]
b7fdeb9f3a
build(deps): bump github.com/golangci/golangci-lint in /internal/tools (#5126)
Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.57.1 to 1.57.2.
- [Release notes](https://github.com/golangci/golangci-lint/releases)
- [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/golangci/golangci-lint/compare/v1.57.1...v1.57.2)

---
updated-dependencies:
- dependency-name: github.com/golangci/golangci-lint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2024-04-01 14:05:35 -07:00