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

849 Commits

Author SHA1 Message Date
David Ashpole
b2bb2ad00f
Implement WithExplicitBucketBoundaries option in the metric SDK (#4605) 2023-10-31 08:41:27 +01:00
OpenTelemetry Bot
fcc1129d0a
dependabot updates Sun Oct 29 15:19:32 UTC 2023 (#4678)
Bump go.uber.org/goleak from 1.2.1 to 1.3.0 in /exporters/otlp/otlptrace/otlptracegrpc
Bump github.com/golangci/golangci-lint from 1.55.0 to 1.55.1 in /internal/tools
Bump github.com/go-logr/logr from 1.2.4 to 1.3.0 in /exporters/zipkin
Bump github.com/go-logr/logr from 1.2.4 to 1.3.0 in /sdk
Bump github.com/go-logr/logr from 1.2.4 to 1.3.0 in /sdk/metric
Bump github.com/go-logr/logr from 1.2.4 to 1.3.0
2023-10-29 08:33:40 -07:00
David Ashpole
cdd9353641
Add summary data type to metricdata (#4622)
* add summary datatype

* support comparing summaries

* update wording based on SIG meeting feedback

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-10-25 09:38:19 -05:00
Tyler Yahn
1e1cc901a5
Add embedded package to trace API (#4620)
* Add trace/embedded

* Update trace impl to use trace/embedded

* Add noop pkg to replace no-op impl in trace pkg

* Use trace/embedded in global impl

* Use trace/embedded in SDK impl

* Update opencensus bridge

* Update opentracing bridge

* Add changes to changelog

* Update trace/doc.go

Co-authored-by: David Ashpole <dashpole@google.com>

---------

Co-authored-by: David Ashpole <dashpole@google.com>
2023-10-19 10:16:24 -07:00
Robert Pająk
5b28921940
[chore] Add gosec via golangci-lint (#4645) 2023-10-19 08:47:07 +02:00
Tyler Yahn
5dff273a1e
Use gofumpt instead of gofmt (#4623)
* Use gofumpt instead of gofmt in golangci-lint conf

* Run gofumpt fixes

* Format generated templates

---------

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2023-10-16 10:02:21 -07:00
OpenTelemetry Bot
c047088605
dependabot updates Sun Oct 15 14:43:01 UTC 2023 (#4637)
Bump github.com/google/go-cmp from 0.5.9 to 0.6.0 in /trace
Bump google.golang.org/grpc from 1.58.2 to 1.58.3 in /exporters/otlp/otlpmetric/otlpmetrichttp
Bump github.com/google/go-cmp from 0.5.9 to 0.6.0 in /exporters/otlp/otlpmetric/otlpmetrichttp
Bump google.golang.org/grpc from 1.58.2 to 1.58.3 in /example/otel-collector
Bump google.golang.org/grpc from 1.58.2 to 1.58.3 in /exporters/otlp/otlptrace/otlptracegrpc
Bump google.golang.org/grpc from 1.58.2 to 1.58.3 in /exporters/otlp/otlpmetric/otlpmetricgrpc
Bump github.com/google/go-cmp from 0.5.9 to 0.6.0 in /exporters/otlp/otlpmetric/otlpmetricgrpc
Bump github.com/google/go-cmp from 0.5.9 to 0.6.0 in /exporters/zipkin
Bump github.com/google/go-cmp from 0.5.9 to 0.6.0 in /exporters/otlp/otlptrace
Bump google.golang.org/grpc from 1.58.2 to 1.58.3 in /bridge/opentracing/test
Bump google.golang.org/grpc from 1.58.2 to 1.58.3 in /exporters/otlp/otlptrace/otlptracehttp
Bump github.com/google/go-cmp from 0.5.9 to 0.6.0
Bump github.com/google/go-cmp from 0.5.9 to 0.6.0 in /sdk
2023-10-15 07:53:27 -07:00
Robert Pająk
d943f0fd1b
sdk/trace: Fix ParentBased comment (#4604) 2023-10-13 19:51:11 +02:00
Aaron Clawson
8a923d0c7a
Update the benchmarks to only record/display select benchmarks. (#4560)
* Add a benchmark target to makefile

* update CI to reflect how the benchmarks will be used

* Add auto-push to benchmarks branch.

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2023-10-12 12:00:18 -05:00
OpenTelemetry Bot
1c2fbf50df
dependabot updates Mon Oct 9 08:29:23 UTC 2023 (#4596)
Bump codespell from 2.2.5 to 2.2.6
Bump golang.org/x/sys from 0.12.0 to 0.13.0 in /sdk
Bump stefanzweifel/git-auto-commit-action from 4 to 5
Bump github.com/jcchavezs/porto from 0.4.0 to 0.5.1 in /internal/tools
Bump golang.org/x/tools from 0.13.0 to 0.14.0 in /internal/tools
Bump github.com/prometheus/client_model from 0.4.1-0.20230718164431-9a2bf3000d16 to 0.5.0 in /exporters/prometheus
2023-10-09 10:44:40 +02:00
Tyler Yahn
60666c5540
Release v1.19.0/v0.42.0/v0.0.7 (#4568)
* Bump versions

* Prepare stable-v1 for version v1.19.0

* Prepare experimental-metrics for version v0.42.0

* Prepare experimental-schema for version v0.0.7

* Update changelog
2023-09-28 12:28:51 -07:00
Charlie Le
612208d046
Fix typos in comments (#4553) 2023-09-26 10:05:53 +02:00
Robert Pająk
10b9f90fe4
sdk/metric: Update package example (#4540) 2023-09-22 08:04:06 +02:00
Robert Pająk
bf54101e32
Fix comment in ExampleNewView_attributeFilter (#4529)
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-09-19 07:38:39 -07:00
Robert Pająk
4738218c03
sdk/metric: Refine NewView wildcard comment (#4530) 2023-09-19 07:30:26 -07:00
Robert Pająk
be43b929aa
Add ExampleNewView_attributeFilter and refine ExampleNewView_drop (#4527) 2023-09-19 08:06:11 +02:00
Robert Pająk
a5190f632f
Add Base2ExponentialHistogram example (#4518) 2023-09-18 10:05:33 +02:00
Tyler Yahn
2ee71fdd4e
Release v1.19.0-rc.1/v0.42.0-rc.1 (#4510)
* Bump versions.yaml

Move go.opentelemetry.io/otel/sdk/metric to stable-v1.

* Prepare stable-v1 for version v1.19.0-rc.1

* Prepare experimental-metrics for version v0.42.0-rc.1

* Update changelog
2023-09-14 12:57:45 -07:00
Robert Pająk
e3d6c8eec2
Add and refine metrics examples (#4504) 2023-09-14 08:17:20 +02:00
Aaron Abbott
bcbee2ac1a
Allow '/' character in instrument names (#4501)
* Allow '/' character in instrument names

* Add changelog

* Update CHANGELOG.md

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

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-09-13 09:01:34 -07:00
Tyler Yahn
4242228103
Release v1.18.0/v0.41.0/v0.0.6 (#4489)
* Bump versions

* Prepare stable-v1 for version v1.18.0

* Prepare experimental-metrics for version v0.41.0

* Prepare experimental-schema for version v0.0.6

* Update changelog

* Update CHANGELOG.md

---------

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2023-09-12 07:54:37 -07:00
Damien Mathieu
ac4fca2260
Use a TB interface in metricdatatest (#4483)
* use testing.TB interface in metricdatatest

* add changelog entry

* use our own TB interface

* Update CHANGELOG.md

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

* rename TB to TestingT

* SIG meeting feedback

* ensure *testing.T implements TestingT

* Update sdk/metric/metricdata/metricdatatest/assertion.go

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

* change formatting for last testing.TB too

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2023-09-11 07:26:21 -07:00
Tyler Yahn
9737995cdb
Drop support for Go 1.19 (#4481)
* Drop support for Go 1.19

* Add change to changelog

* Bump all modules to 1.20

* Update exponential_histogram_test.go

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2023-09-07 12:18:29 -05:00
Tyler Yahn
76c370f1b1
Document public metric SDK interfaces to remain stable (#4396)
* Document public ifaces to remain stable

Resolve #3673

* Revert changes to aggregation pkg

* Document reader as an interface that can be extended

* Address feedback

---------

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
2023-09-06 13:55:56 -07:00
Rangel Reale
fc70923e53
Ignore value option for metricdatatest (#4447) 2023-09-05 19:00:06 +02:00
OpenTelemetry Bot
b17ad41a00
dependabot updates Tue Sep 5 06:35:43 UTC 2023 (#4477)
Bump golang.org/x/sys from 0.11.0 to 0.12.0 in /sdk
2023-09-05 09:04:55 +02:00
Tyler Yahn
d702e92c2b
Remove the deprecated sdk/metric/aggregation package (#4468)
* Remove the deprecated sdk/metric/aggregation package

* Update PR number
2023-08-29 13:19:33 -07:00
Tyler Yahn
3c476ce181
Release v1.17.0/v0.40.0/v0.0.5 (#4464)
* Bump versions.yaml

* Prepare stable-v1 for version v1.17.0

* Prepare experimental-metrics for version v0.40.0

* Prepare experimental-schema for version v0.0.5

* Update changelog

* Update changelog release header
2023-08-28 07:50:03 -07:00
Tyler Yahn
69611bd01a
Switch Stream back to having an AttributeFilter field and add New*Filter functions (#4444)
* Add allow/deny attr filters

* Revert "Replace `Stream.AttributeFilter` with `AllowAttributeKeys` (#4288)"

This reverts commit 1633c74aea.

* Rename new attr filter funcs

Do not include the term "Attribute" in a creation function of the
"attribute" pkg.

* Update the AttributeFilter field documentation

* Add tests for filter creation funcs

* Add change to changelog

* Apply feedback

* Use NewDenyKeysFilter for allow-all and deny-list filters

* Remove links from field docs

These links do not render.

---------

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2023-08-25 07:39:43 -07:00
Umut Tezduyar Lindskog
f15ae160c4
Fix the broken sentence (#4456)
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-08-18 07:24:32 -07:00
Tyler Yahn
16ce491d38
Fix guard of measured value to not record empty (#4452)
A guard was added in #4446 to prevent non-normal float64 from being
recorded. This was added in the low-level `record` method meaning that
the higher-level `measure` method will still keep a record of the
invalid value measurement, just with a zero-value.

This fixes that issue by moving the guard to the `measure` method.
2023-08-18 06:43:09 -07:00
Tyler Yahn
9b47674bc5
Make getBin and scaleChange methods of expoHistogramDataPoint (#4451)
Both functions receive parameters from an expoHistogramDataPoint and are
only ever used by other methods of an expoHistogramDataPoint. Make the
functions methods of expoHistogramDataPoint so the parameter arguments
can be dropped and the functions are scoped to the type they are used
for.

Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
2023-08-17 15:06:46 -07:00
Tyler Yahn
9d9b71f58d
Remove the expoHistogramValues type (#4450)
The types only use is being embedded in the expoHistogram. Just
explicitly define the fields for the expoHistogram given that is their
only use.
2023-08-17 12:31:02 -05:00
Tyler Yahn
a5ff7af3f3
Ignore +/- Inf and NaN for exponential histogram measurement (#4446)
* Add acceptance test

* Ignore +/- Inf and NaN for expo hist record
2023-08-16 07:11:13 -07:00
Tyler Yahn
3904523917
Flatten sdk/metric/aggregation into sdk/metric (#4435)
* Deprecate the aggregation pkg

* Decouple the internal/aggregate from aggregation pkg

* Add Aggregation to the metric pkg

* Do not use sdk/metric/aggregation in stdoutmetric exporter

* Update all generated templates

* Update prom exporter

* Fix view example

* Add changes to changelog

* Update CHANGELOG.md

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

* Rename Sum to AggregationSum

* Fix comments

* Centralize validation of aggregation in pipeline

* Remove validation of agg in manual_reader selector opt

* Fix merge

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2023-08-14 08:15:15 -07:00
David Ashpole
fe51391dc6
Change metric.Producer to be an Option on Reader (#4346)
* metric.Producer can be passed as an argument to Reader using
WithProducer

* reproduce data race

* revert to atomic.Value
2023-08-11 12:40:39 -07:00
Tyler Yahn
e9014a287c
Increase instrument name maximum length from 63 to 255 characters (#4434) 2023-08-11 09:49:47 +02:00
Robert Pająk
a9552aaffa
sdk/metric: Remove Reader.ForceFlush and ManualReader.ForceFlush (#4375) 2023-08-11 09:22:21 +02:00
Tyler Yahn
c513972985
Generate internal/matchers (#4430) 2023-08-10 16:00:53 -07:00
Tyler Yahn
10d9038059
Use first-seen instrument name for name conflicts (#4428)
* Add acceptance test

* Return the first-seen for instrument name conflicts

* Add changes to changelog
2023-08-10 09:58:30 -07:00
Tyler Yahn
b44a2bbc36
Remove commented out method in exponential_histogram.go (#4429) 2023-08-10 09:23:25 +02:00
Tyler Yahn
b7f634a4fe
Decouple use of otel/internal/internaltest (#4424)
* Add internaltest templates

* Generate internaltest using gotmpl

* Generate the sdk/internal/internaltest pkg

* Use sdk/internal/internaltest in sdk module

* Generate exporters/jaeger/internal/internaltest pkg

* Use exporters/jaeger/internal/internaltest in jaeger exporter

* Generate the exporters/zipkin/internal/internaltest pkg

* Use local internaltest in zipkin exporter

* Fix import path name in trace test
2023-08-09 09:15:47 +02:00
Robert Pająk
663151966d
Minor refactoring (#4417) 2023-08-08 14:26:44 +02:00
Jared Jenkins
b221025a4c
sdk/resource: Fix data race with emptyAttributes (#4409)
* Fix ASAN bug with emptyAttributes.

If mutliple instantiations of a Resources struct are happening
in parallel, they can end up modifying the same underlying resource.

* Capture literal

* add test

* remove unwanted change

* Update sdk/resource/resource_test.go

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

* Update sdk/resource/resource_test.go

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

* Update sdk/resource/resource_test.go

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

* Update sdk/resource/resource_test.go

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

* Add changelog.

* 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>
2023-08-07 10:22:48 -07:00
Tyler Yahn
9452b93012
Upgrade all use of semconv to v1.21.0 (#4408)
* Upgrade all use of semconv to v1.21.0

* Add change to changelog

* Add AIX and ZOS OS support

* Upgrade semconv for merged changes

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2023-08-07 09:30:40 -07:00
OpenTelemetry Bot
ac6cd49ae2
dependabot updates Sun Aug 6 09:27:21 UTC 2023 (#4416)
Bump golang.org/x/sys from 0.10.0 to 0.11.0 in /sdk
Bump golang.org/x/tools from 0.11.0 to 0.11.1 in /internal/tools
Bump go.opentelemetry.io/build-tools/crosslink from 0.10.0 to 0.11.0 in /internal/tools
Bump go.opentelemetry.io/build-tools/semconvgen from 0.10.0 to 0.11.0 in /internal/tools
Bump go.opentelemetry.io/build-tools/dbotconf from 0.10.0 to 0.11.0 in /internal/tools
Bump go.opentelemetry.io/build-tools/multimod from 0.10.0 to 0.11.0 in /internal/tools
2023-08-06 11:37:32 +02:00
Aaron Clawson
248413d654
Add the Exponential Histogram Aggregator. (#4245)
* Adds Exponential Histograms aggregator

* Added aggregation to the pipeline.

Adjust to new bucket

* Add no allocation if cap is available.

* Expand tests

* Fix lint

* Fix 64 bit math on 386 platform.

* Fix tests to work in go 1.19.
Fix spelling error

* fix codespell

* Add example

* Update sdk/metric/aggregation/aggregation.go

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

* Update sdk/metric/aggregation/aggregation.go

* Update sdk/metric/aggregation/aggregation.go

* Changelog

* Fix move

* Address feedback from the PR.

* Update expo histo to new aggregator format.

* Fix lint

* Remove Zero Threshold from config of expo histograms

* Remove DefaultExponentialHistogram()

* Refactor GetBin, and address PR Feedback

* Address PR feedback

* Fix comment in wrong location

* Fix misapplied PR feedback

* Fix codespell

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2023-08-04 11:57:44 -07:00
Robert Pająk
c4d2d7c9b8
sdk/metric: Add unit tests for Shutdown WithTimeout (#4379)
* sdk/metric: Improve WithTimeout doc

* Add tests
2023-08-02 07:52:04 -07:00
Tyler Yahn
2899fcfdca
Document the Reader and Exporter concurrent safe requirements (#4381) 2023-07-30 22:26:17 +02:00
Tyler Yahn
9418aca877
Use PeriodicReader timeout for ForceFlush (#4377)
* Use PeriodicReader timeout for ForceFlush

Prioritize the user passed context deadline if it has one.

* Update changelog
2023-07-29 07:33:48 -07:00
Tyler Yahn
859a87098c
Simplify the histogram implementation (#4370) 2023-07-27 14:06:22 -07:00
Robert Pająk
4f0d73cbc2
sdk/trace: Refine context cancellation in batchSpanProcessor.ForceFlush (#4369) 2023-07-27 10:05:52 +02:00
Tyler Yahn
b4264c53bc
Simplify the sum aggregators (#4357)
* Simplify the sum aggregators

* Comment how memory reuse misses are handled
2023-07-26 13:32:45 -07:00
Robert Pająk
d5d631852a
Remove redundant TestBatchSpanProcessorForceFlushCancellation (#4367) 2023-07-26 13:51:21 +02:00
Robert Pająk
e557e74cc2
Improve readers Collect docs (#4361) 2023-07-26 12:14:44 +02:00
Aaron Clawson
d423bd4cf2
Add tests for malformed selectors in readers (#4350) 2023-07-25 11:25:38 +02:00
David Ashpole
c1a644a10c
PeriodicReader.Shutdown now applies the periodic reader's timeout by default (#4356) 2023-07-25 11:00:16 +02:00
Robert Pająk
d8d3502efc
sdk/metric: Fix goroutine leaks in tests (#4352) 2023-07-25 10:54:08 +02:00
Robert Pająk
088ac8e179
Fix panic, deadlock and race in BatchSpanProcessor (#4353) 2023-07-25 10:13:45 +02:00
Tyler Yahn
e26d8bd8f8
Remove benchmark dev files mistakenly added in #4349 (#4358) 2023-07-24 11:03:09 -07:00
Tyler Yahn
ab61991465
Log a view suggestion for duplicate instrument conflicts (#4349)
* Log a view suggestion for duplicate instrument conflicts

* Add change to changelog

* Update changelog entry
2023-07-24 07:47:56 -07:00
Robert Pająk
fd5284f75c
styleguide: tests goroutine leaks and naming (#4348)
* internal/global: Fix goroutine leaks in tests
2023-07-24 09:35:06 +02:00
Tyler Yahn
cbc5890d9c
Simplify the last-value aggregate (#4343)
Instead of treating the returned *lastValue as an aggregator from
newLastValue, just use the type directly to construct the Measure and
ComputeAggregation functions returned from the Builder.

Accept a destination type for the underlying computeAggregation. This
allows memory reuse for collections which adds a considerable
optimization.

Simplify the integration testing of the last-value aggregate.

Update benchmarking.
2023-07-21 08:30:11 +02:00
Tyler Yahn
a37cb0504a
Replace filter aggregator with direct filter on measure (#4342)
* Replace filter aggregator with direct filter on measure

Part of #4220

Instead of using an aggregator to filter measured attributes, directly
filter the attributes in the constructed Measure function the Builder
creates.

Include unit and integration testing of new filtering.

* Update sdk/metric/internal/aggregate/aggregate.go

Co-authored-by: David Ashpole <dashpole@google.com>

---------

Co-authored-by: David Ashpole <dashpole@google.com>
2023-07-20 13:53:50 -07:00
Tyler Yahn
e08359f30c
Detect duplicate instruments for case-insensitive names (#4338)
* Detect dup inst for case-insensitive names

Resolve #3835

Detect duplicate instrument registrations for instruments that have the
same case-insensitive names. Continue to return the instruments with
different names, but log a warning. This is the solution proposed in
https://github.com/open-telemetry/opentelemetry-specification/pull/3606.

* Add changes to changelog

* Reset global logger after test
2023-07-19 10:17:38 -07:00
Tyler Yahn
84b2e54671
Use inst ID for agg cache key (#4337)
* Use inst ID for agg cache key

Resolve #4201

The specification requires the duplicate instrument conflicts to be
identified based on the instrument identifying fields:

- name
- instrument kind
- unit
- description
- language-level features such as the number type (int64 and float64)

Currently, the conflict detection and aggregation caching are done based
on the stream IDs which include an aggregation name, monotonicity, and
temporality instead of the instrument kind.

This changes the conflict detection and aggregation caching to use the
OpenTelemetry specified fields. This is effectively a no-op given there
is a 1-to-1 mapping of aggregation-name/monotonicity/temporality to
instrument kind (they are all resolved based on the instrument kind).

Additionally, this adds a stringer representation of the
`InstrumentKind`. This is needed for the logging of duplicate instrument
conflicts.

* Add changes to changelog
2023-07-19 09:59:07 -07:00
David Ashpole
c197fe9305
Metric SDK: Sum duplicate async observations regardless of filtering (#4289)
* Metric SDK: Remove the distinction between filtered and unfiltered attributes.
2023-07-19 10:52:11 -05:00
Tyler Yahn
f2a9f2f2be
Restrict Meters to only register and collect instruments it created (#4333)
* Add acceptance test

* Update Meter Register and collect only inst from itself

* Add change to changelog

* Fix spelling error

* Update changelog entry wording

* Simplify the partial success code path
2023-07-19 07:31:11 -07:00
Tyler Yahn
f194fb0c6c
Allow histogram for all instruments (#4332)
* Allow histogram for all instruments

Any instrument that can record negative values, do not include a sum in
the produced aggregation (like the specification recommends).

Resolves #4161

* Add changes to changelog

* Fix TestBucketsSum
2023-07-19 07:12:00 -07:00
Matthew Wear
9b0c4d2caf
Fix empty host.id (#4317) 2023-07-18 17:37:20 +02:00
Aaron Clawson
f6a658c6c2
Remove out of date example of internal usage. (#4334) 2023-07-18 10:10:34 +02:00
Tyler Yahn
63dfc4c2f1
Update the instrument agg comp table (#4330)
Use a check mark to indicate compatible instead of an "X" which can be
misinterpreted as incompatible.
2023-07-17 11:17:35 -07:00
Tyler Yahn
7467923a51
Add info/debug logging to the metric SDK (#4315)
* Add debug logging to the metric SDK

Resolves #3722

* Log MeterProvider and Meter setup at info level

* Add changelog entry

---------

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
2023-07-17 07:57:01 -07:00
Tyler Yahn
d18f20179e
Replace internal aggregate Aggregator with Measure/ComputeAggregation and a Builder (#4304) 2023-07-17 16:15:50 +02:00
Tyler Yahn
55fb2bb57b
Log an error for an empty view criteria (#4307)
* Log an error for an empty view

Resolves #4149

* Add changelog entry
2023-07-12 15:10:40 -07:00
Tyler Yahn
fcc67096b5
Add test for multi-inst view error (#4308) 2023-07-12 15:01:14 -07:00
David Ashpole
de26aaa52e
Metric SDK: Do not export non-observed attribute sets for async instruments (#4290)
* drop non-observed attribute sets

* fix test comment

* add documentation for async callbacks dropping unobserved attributes
2023-07-11 07:19:38 -07:00
OpenTelemetry Bot
8b7bffc8b9
dependabot updates Sun Jul 9 14:40:56 UTC 2023 (#4301)
Bump google.golang.org/grpc from 1.56.1 to 1.56.2 in /bridge/opentracing/test
Bump google.golang.org/grpc from 1.56.1 to 1.56.2 in /exporters/otlp/otlptrace/otlptracegrpc
Bump golang.org/x/tools from 0.10.0 to 0.11.0 in /internal/tools
Bump google.golang.org/grpc from 1.56.1 to 1.56.2 in /exporters/otlp/otlptrace
Bump benchmark-action/github-action-benchmark from 1.17.0 to 1.18.0
Bump google.golang.org/grpc from 1.56.1 to 1.56.2 in /exporters/otlp/otlpmetric/otlpmetricgrpc
Bump google.golang.org/grpc from 1.56.1 to 1.56.2 in /example/otel-collector
Bump google.golang.org/grpc from 1.56.1 to 1.56.2 in /exporters/otlp/otlpmetric
Bump golang.org/x/sys from 0.9.0 to 0.10.0 in /sdk
2023-07-09 20:25:46 +02:00
Tyler Yahn
1633c74aea
Replace Stream.AttributeFilter with AllowAttributeKeys (#4288)
* Replace Stream AttributeFilter with AttributeKeys

* Rename Stream field AttributeKeys to AllowAttributeKeys

Ensure forward compatibility if a deny-list of attribute keys is ever
added.

* Add change to changelog

* Update PR number in changelog

* Update CHANGELOG.md

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

---------

Co-authored-by: Damien Mathieu <42@dmathieu.com>
2023-07-08 08:01:47 -07:00
Tyler Yahn
10c3445543
Move aggs to internal/aggregate (#4283) 2023-07-03 10:53:00 +02:00
Tyler Yahn
97273da7c9
Use newPipeline instead of direct construction (#4285)
* Use newPipeline instead of direct construction

The newPipeline function exists to create a new pipeline, but it is not
currently used. This switches to using that as the default creation
method and removes the test for construction of a pipeline directly.

* Update sdk/metric/pipeline.go
2023-07-02 07:17:46 -07:00
Damien Mathieu
64e76f8be4
Document and test honoring context in metric readers Collect (#4267) 2023-06-29 13:20:47 +02:00
Damien Mathieu
3b124b39d1
Count the Collect duration towards the PeriodicReader timeout, and document the behavior (#4221) 2023-06-26 08:47:39 +02:00
Robert Pająk
0396b9b7ac
sdk/metric: Document concurrent safety (#4252) 2023-06-23 16:25:54 +02:00
Robert Pająk
6b262b44ac
sdk/metric: Reader factories return structs (#4244) 2023-06-22 09:09:00 +02:00
OpenTelemetry Bot
e3f547fedd
dependabot updates Tue Jun 20 09:20:10 UTC 2023 (#4240)
Bump google.golang.org/grpc from 1.55.0 to 1.56.0 in /bridge/opentracing/test
Bump github.com/prometheus/client_golang from 1.15.1 to 1.16.0 in /example/view
Bump github.com/golangci/golangci-lint from 1.53.2 to 1.53.3 in /internal/tools
Bump github.com/prometheus/client_golang from 1.15.1 to 1.16.0 in /exporters/prometheus
Bump golang.org/x/tools from 0.9.3 to 0.10.0 in /internal/tools
Bump google.golang.org/grpc from 1.55.0 to 1.56.0 in /exporters/otlp/otlpmetric/otlpmetricgrpc
Bump google.golang.org/grpc from 1.55.0 to 1.56.0 in /exporters/otlp/otlpmetric
Bump google.golang.org/grpc from 1.55.0 to 1.56.0 in /exporters/otlp/otlptrace/otlptracegrpc
Bump google.golang.org/grpc from 1.55.0 to 1.56.0 in /exporters/otlp/otlptrace
Bump github.com/prometheus/client_golang from 1.15.1 to 1.16.0 in /example/prometheus
Bump google.golang.org/grpc from 1.55.0 to 1.56.0 in /example/otel-collector
Bump golang.org/x/sys from 0.8.0 to 0.9.0 in /sdk
2023-06-20 11:38:28 +02:00
Aaron Clawson
b757c7083b
Exponential Histogram Datatypes (#4165)
* Adds the Exponential histogram data type.

* Changelog

* Updated comments

* Apply suggestions from code review

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

* Split Exponential Buckets into it's own type

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-06-14 07:36:13 -07:00
Damien Mathieu
844b107e98
Validate instrument names when creating them (#4210)
* validate instrument names when creating them

* add changelog entry

* remove now invalid instrument name from prometheus test

* fix invalid names in meter_test

* keep returning the instrument even if its name is invalid

* make invalid instrument name a known error

* bring back prometheus invalid instrument name test

* remove warning

* fix lint

* move name validation into the lookup method

* fix lint again

* Revert "move name validation into the lookup method"

This reverts commit ec8ccc5fa0.

* rename ErrInvalidInstrumentName to ErrInstrumentName

* switch to explicit validations, instead of a regexp

* Update CHANGELOG.md

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

* remove double check for empty name

* test validation shortcut with a single character

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
2023-06-09 08:32:56 -07:00
Tyler Yahn
ce46eb5f85
Warn instead of Info log instrument conflict (#4202)
* Warn instead of Info log instrument conflict

* Add change to changelog
2023-06-06 15:22:34 -07:00
OpenTelemetry Bot
135c64f289
dependabot updates Mon Jun 5 09:32:52 UTC 2023 (#4198)
Bump go.opentelemetry.io/build-tools/crosslink from 0.7.0 to 0.8.0 in /internal/tools
Bump go.opentelemetry.io/build-tools/dbotconf from 0.7.0 to 0.8.0 in /internal/tools
Bump go.opentelemetry.io/build-tools/multimod from 0.7.0 to 0.8.0 in /internal/tools
Bump go.opentelemetry.io/build-tools/semconvgen from 0.7.0 to 0.8.0 in /internal/tools
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/otlp/otlptrace
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/zipkin
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/otlp/otlptrace/otlptracehttp
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /bridge/opentracing/test
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/otlp/internal/retry
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/otlp/otlpmetric/otlpmetrichttp
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/otlp/otlptrace/otlptracegrpc
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/jaeger
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/stdout/stdouttrace
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/stdout/stdoutmetric
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/otlp/otlpmetric
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /schema
Bump github.com/itchyny/gojq from 0.12.12 to 0.12.13 in /internal/tools
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /metric
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /trace
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/prometheus
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/otlp/otlpmetric/otlpmetricgrpc
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /bridge/opencensus
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /sdk/metric
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /bridge/opentracing
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /sdk
2023-06-05 11:41:23 +02:00
Damien Mathieu
be82610b44
Return noop meters once the provider has been shutdown (#4154) 2023-06-05 09:51:21 +02:00
Robert Pająk
8cddf8cf1f
sdk/metric: Log empty meter name (#4153)
* sdk/metric: Log empty meter name

* Avoid magic numbers

* Lint

* Apply suggestions from code review

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

* Update log message

* Apply suggestion

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-06-01 09:56:17 +02:00
Robert Pająk
f9565872df
sdk/metrics: Fix MeterProvider.Meter Go doc (#4152) 2023-06-01 09:28:29 +02:00
Tyler Yahn
e0852d609c
Release v1.16.0/v0.39.0 -- Stable Metric API (#4100)
* Update versions

* Prepare stable-v1 for version v1.16.0

* Prepare experimental-metrics for version v0.39.0

* Update changelog
2023-05-22 12:06:21 -07:00
OpenTelemetry Bot
3fca55af7a
dependabot updates Sun May 21 15:20:04 UTC 2023 (#4126)
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/zipkin
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /bridge/opentracing/test
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /schema
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/otlp/internal/retry
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/prometheus
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/stdout/stdoutmetric
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/otlp/otlptrace
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/otlp/otlpmetric
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/otlp/otlpmetric/otlpmetricgrpc
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/otlp/otlpmetric/otlpmetrichttp
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/otlp/otlptrace/otlptracegrpc
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/stdout/stdouttrace
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/otlp/otlptrace/otlptracehttp
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /metric
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /trace
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/jaeger
Bump codecov/codecov-action from 3.1.3 to 3.1.4
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /sdk/metric
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /bridge/opencensus
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /bridge/opentracing
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /sdk
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3
2023-05-21 08:45:32 -07:00
Andrew Womeldorf
987422d55f
sdk/metric: Fix import comments (#4086)
* Resolve inconsistent import comments in sdk/metric

* update changelog

* Apply suggestions from code review

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

* Update CHANGELOG.md

---------

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
2023-05-19 09:25:11 -07:00
Mikhail Mazurskiy
f95bee22b9
Use strings.Cut() instead of string.SplitN() (#4049)
strings.Cut() generates less garbage as it does not allocate the slice to hold parts.
2023-05-17 09:28:44 -07:00
Chen Xu
fadd3d6a63
[SDK][Trace] Add tests for default id generator (#4043)
Signed-off-by: Chen Xu <chen.x@uber.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-05-15 07:18:43 -07:00
Robert Pająk
24e8d2e574
sdk/resource: Add Telemetry Stability label (#4080)
* Add Telemetry Stability label

* Update sdk/resource/doc.go

* Update doc.go

---------

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2023-05-11 07:25:32 -07:00
Robert Pająk
7dea2225a2
sdk/resource: Fix build for BSD OSes (#4077)
* sdk/resource: Fix build for BSD OSes

* Add changelog

* Update header in changelog

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-05-10 07:47:41 -07:00