* add exemplar support to OpenCensus bridge
* expand set of translated exemplar attributes
---------
Co-authored-by: Robert Pająk <pellared@hotmail.com>
* Add WithExplicitBucketBoundaries Histogram option to the metric api
* Add note that the option is advisory
---------
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
* add summary datatype
* support comparing summaries
* update wording based on SIG meeting feedback
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* 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>
* Add options to opencensus bridge, and install tracer instead of returning
* add unit test
* update unit tests
* fix example
* import ordering
---------
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* 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
* add WithWriter and WithPrettyOptions to stdoutmetric
* add changelog
* make WithWriter a shortcut to WithEncoder
* Update exporters/stdout/stdoutmetric/config.go
---------
Co-authored-by: Robert Pająk <pellared@hotmail.com>
* 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
* 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>
* 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>
* 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
* 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>
* 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>
* Stop generating otlptrace/internal and deprecate
* Remove the tracetransform templates
They are no longer used.
* Add change stub to changelog
* Add PR number to changelog
* Deprecate the otlpmetric/internal package and sub-packages
* Add stub to changelog
* Add PR number to changelog stubs
---------
Co-authored-by: Robert Pająk <pellared@hotmail.com>
* Deprecate the otlp/internal package and all sub-packages
* Add deprecation to changelog
* No lint deprecated pkg use in otlpmetric
* Remove the unused header*.go files from otlptrace
* Use template wrappederror in otlptrace
* Add back removed header.go
* Replace use of WrapTracesError with fmt.Errorf
* Revert otlptrace/internal to main
* Deprecate retry module
* handle no content responses for otlpmetric exporter
* handle no content responses for otlptraces http exporter
* add changelog entry
* add a ResponseStatus attribute rather than using error
* accept any status code between 200 and 299
* rename i to code
* switch require to assert
* shutdown the client in defer
---------
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* 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>
* 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>
* Generate otlpmetrichttp/internal with gotmpl
* Use local internal pkg for otlpmetrichttp
* Add changes to changelog
* Fix rendered envconfig_test.go file name
* 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>
* Add shared otlpmetric templates
* Generate otlpmetricgrpc/internal with gotmpl
* Use local internal in otlpmetricgrpc
* Add decoupling change to changelog
* Use template retry pkg in otlpconfig
* Template out all otlptrace internal
* Add envconfig pkg to otlptrace/internal
* Generate otlptrace/internal/otlpconfig
* Revert templatizing otlptracegrpc
* Add changes to changelog
* Add partialsuccess to internal shared
* Use gotmpl to generate otlptracegrpc/internal
* Add changes to changelog
* otlpmetricgrpc - no block temp/agg selection with export
* otlpmetrichttp - no block temp/agg selection with export
* Add test Export doesn't block Temporality or Aggregation
* Deprecate internal New and Exporter
* Add changes to changelog
* Apply suggestions from code review
* 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
* 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
* 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
* 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
* 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>
* 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>
* Concurrent collect bugfix
* Used sync.Mutex and code cleanup
* Revert "Concurrent collect bugfix"
This reverts commit 1a30f233b6.
* Used sync.Mutex and re-grouped protected members
* Added test and updated changelog
* Updated changelog
* Take care of potential panic in otel.Handle
* Extracted critical section in a separate method and fixed nil scope info
* Lock the whole scope of the func
* Moved otel.Handle out of the critical section
* Fixed calling createScopeInfoMetric twice and updated changelog
* Fixed markdown linter errors
* Added test for nil scopeinfo
* Fix merge artifacts
* Fixed linter errors
* Protect the whole validateMetrics method wity mutex
* Update CHANGELOG.md
* Update exporters/prometheus/exporter.go
Co-authored-by: Robert Pająk <pellared@hotmail.com>
* Update CHANGELOG.md
* Document that Collect is concurrent-safe
* Update exporter_test.go
* Update exporters/prometheus/exporter_test.go
* Update exporters/prometheus/exporter.go
Co-authored-by: David Ashpole <dashpole@google.com>
---------
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: David Ashpole <dashpole@google.com>
* Format log message before logging with logr
Fixes#4141
The logr calling convention does not support fmt semantics for message
formatting. Format the message before it is sent to logr for logging.
* Add change to changelog
* Fix lint
Don't shadow the log pkg.
* Replace buflogr with funcr
* Run make
* Update exporters/zipkin/zipkin_test.go
Co-authored-by: Robert Pająk <pellared@hotmail.com>
---------
Co-authored-by: Robert Pająk <pellared@hotmail.com>
* 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>
* Add semconv/v1.19.0
Includes adding semconv/internal/v3/ to support the move of
the semantic convention HTTPUserAgentKey to the new key
UserAgentOriginalKey
* Update CHANGELOG.md
Co-authored-by: Robert Pająk <pellared@hotmail.com>
* format http.go.tmpl using tabs instead of spaces
* update http.go.tmpl to use v3 of semconv/internal
* Generate attribute_group.go
---------
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* Revert "Move global metric back to `otel/metric/global` for minor release (#3986)"
This reverts commit 8dba38e02f.
* Add changes to changelog
* Fix versions and go mod tidy
* Run go-mod-tidy