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

798 Commits

Author SHA1 Message Date
Ziqi Zhao
a8b9ddc7f6
attribute: fix slice related function bug (#3252)
* attribute: fix slice related function bug

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2022-10-13 09:34:02 -05:00
Bogdan Drutu
e4bdfe7b56
Fix sdktrace.TraceProvider Shutdown/ForceFlush when no processor register (#3268)
* Fix sdktrace.TraceProvider Shutdown/ForceFlush when no processor register

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Update CHANGELOG.md

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2022-10-12 13:44:18 -07:00
Tyler Yahn
4a3adaafd4
Replace meterRegistry with cache (#3255) 2022-10-12 12:54:51 -07:00
Tyler Yahn
ff18552791
Release v1.11.0/v0.32.3 (#3275)
* Bump stable-v1 and experimental-metrics vers

* Prepare stable-v1 for version v1.11.0

* Prepare experimental-metrics for version v0.32.3

* Update changelog for release

* Retract v0.32.2 of otlpmetric{http,grpc}
2022-10-12 10:19:51 -07:00
Tyler Yahn
29511a0078
Release Metric v0.32.2 (#3270)
* Bump experimental-metrics version to v0.32.2

* Prepare experimental-metrics for version v0.32.2

* Update changelog
2022-10-11 14:55:18 -07:00
Tyler Yahn
b5292b8459
Handle duplicate Aggregators and log instrument conflicts (#3251)
* Add the cache type

* Add cache unit tests

* Test cache concurrency

* Add the instrumentCache

* Use the instrumentCache to deduplicate creation

* Drop unique check from addAggregator

* Fix aggregatorCache* docs

* Update cachedAggregator and aggregator method docs

* Remove unnecessary type constraint

* Remove unused errAlreadyRegistered

* Rename to not shadow imports

* Add changes to changelog

* Fix changelog English

* Store resolvers in the meter instead of caches

* Test all Aggregator[N] impls are comparable

* Fix lint

* Add documentation that Aggregators need to be comparable

* Update sdk/metric/internal/aggregator.go

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Update sdk/metric/instrument.go

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Update sdk/metric/instrument.go

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Update sdk/metric/internal/aggregator_test.go

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Fix pipeline_test.go use of newInstrumentCache

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2022-10-11 15:41:47 -04:00
Tyler Yahn
c5ebbc4d4b
Use default view if instrument does not match any pipeline view (#3237)
* Use default view if inst matches no other

Fix #3224

* Test default view applied if no match

* Add changes to changelog

* Remove unneeded views len check in WithReader

* Do not return agg if adding err-ed

* Revert "Do not return agg if adding err-ed"

This reverts commit b56efb06a7.
2022-10-07 00:40:54 -04:00
Damien Mathieu
697d245b9c
Update bucket default bounds (#3222)
* update bucket default bounds to match the specification

* add changelog entry

* test custom boundaries with valid histogram

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2022-10-04 15:41:18 -07:00
Tyler Yahn
3675379e73
Remove the unused Resource field from the MeterProvider (#3253) 2022-10-03 09:57:27 -07:00
Tyler Yahn
aca054b075
Refactor Pipeline (#3233)
* Add views field to pipeline

Redundant maps tracking readers to views and readers to pipelines exist
in the pipelineRegistry. Unify these maps by tracing views in pipelines.

* Rename newPipelineRegistries->newPipelineRegistry

* Add Reader as field to pipeline

* Replace createAggregators with resolver facilitator

* Replace create agg funcs with inserter facilitator

* Correct documentation

* Replace pipelineRegistry with []pipeline type

* Rename newPipelineRegistry->newPipelines

* Fix pipeline_registry_test

* Flatten isMonotonic into only use

* Update FIXME into TODO

* Rename instrument provider resolver field to resolve

* Fix comment English

* Fix drop aggregator detection
2022-09-28 08:47:20 -07:00
Tyler Yahn
12e16d41e7
Bump golang.org/x/sys/unix (#3235)
* Bump golang.org/x/sys/unix

Fix #3234

Address GO-2022-0493 by upgrading golang.org/x/sys/unix from
v0.0.0-20210423185535-09eb48e85fd7 to
v0.0.0-20220919091848-fb04ddd9f9c8.

* Add changes to changelog
2022-09-27 09:08:34 -07:00
Tyler Yahn
111a1d7bbd
Flush pending telemetry when ForceFlush or Shutdown are called on a PeriodicReader (#3220)
* Flush pending telemetry when ForceFlush called

* Test flush of periodic reader

* Flush pending telemetry on Shutdown

* Fix things

* Rename pHolder to p

* Add testing for Shutdown

* Fix doc for collect method

* Fix collectAndExport doc

* Fix collectAndExport English

* Remove stdoutmetric example expected output

* Add changes to changelog

* Revert inadvertent change to golangci conf

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2022-09-27 08:05:41 -07:00
Tyler Yahn
529049bd03
Remove unused meterRegistry Range method (#3230)
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2022-09-26 07:33:57 -07:00
wdullaer
b369e59ba1
Improve trace status handling (#3214)
* Implement specification compliant trace status handling

* Update trace/trace.go

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

* Update CHANGELOG.md

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* chore: Make linter happy

Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2022-09-23 11:39:53 -07:00
Aaron Clawson
d7bfe6675f
Prerelease metrics/v0.32.1 (#3228)
* Prepare for v0.32.1 release

* Prepare experimental-metrics for version v0.32.1

* Update Changelog

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2022-09-22 14:47:08 -05:00
Aaron Clawson
c979be08e4
Update sdk/metric go.mod version to latest (#3216)
* update the metric mod version to latest

* update additional go.mods

* Unify the Fixed section of Unreleased

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tyler Yahn <codingalias@gmail.com>
2022-09-22 09:36:24 -07:00
Tyler Yahn
4eea5db998
Set MeterProvider resource for all pipelines (#3218)
* Set MeterProvider resource for all pipelines

Resolves #3208

* Add change to changelog
2022-09-22 09:18:18 -07:00
Bogdan Drutu
f535b1e65f
Remove unnecessary build restrictions for go1.18 (#3197)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-09-21 10:00:00 -07:00
Aaron Clawson
b6d4335a72
Removes go1.17, replaces with go1.18 (#3179)
* Removes go1.17, replaces with go1.18

* Update Changelog

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2022-09-19 17:22:40 -07:00
Tyler Yahn
f215b8dbe6
Release v0.32.0 -- Revised Metric SDK (Alpha) (#3184)
* Bump experimental-metrics to v0.32.0

* Update opencensus bridge modules in versions.yaml

* Prepare experimental-metrics for version v0.32.0

* Add changelog update

* Remove changes to unreleased code
2022-09-19 10:28:37 -07:00
Tyler Yahn
b1e5e35b5c
Merge metric SDK development branch "new_sdk/main" into "main" (#3175)
* Remove Old SDK and dependent code on that SDK (#2802)

* Remove prometheus example code

* Remove prometheus exporter code

* Remove stdoutmetric code

* Remove sdk/metric/* packages

* Remove opencensus example code

* Remove otlpmetric exporter code

* Remove OpenCensus bridge code

* go mod tidy

* Remove empty modules

* Remove the number and aggregator from the metric SDK (#2840)

* Add MeterProvider/meter structure to new SDK (#2822)

* Remove prometheus example code

* Remove prometheus exporter code

* Remove stdoutmetric code

* Remove sdk/metric/* packages

* Remove opencensus example code

* Remove otlpmetric exporter code

* Remove OpenCensus bridge code

* go mod tidy

* Remove empty modules

* Add MeterProvider/meter structure to new SDK

* Add vanity imports

* go mod tidy

* Add MeterProvider Flush/Shutdown required by spec

* Cast nil ptr instead of alloc for comp time check

* Apply suggestions from code review

Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>

* Apply suggested Shutdown comment

* Apply fixes from feedback

Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>

* Add sdk/metric/view structure (#2838)

* Add sdk/metric/view package structure

* Vanity import

* Define the reader interface, and create a manual reader  (#2885)

* Add the manual reader to the sdk.

* Incoperate feedback from PR.

* additional PR comments

* Fix lint

* Fixes for PR.

* Unexport ManualReader
fix a few comments

* Refactor reader testing into a harness (#2910)

* Refactor reader testing into a harness

* Run lint

* Removed merge leftover

* Use opentracing bridge from main

* go mod tidy

* crosslink

* Remove Prometheus exporter from README for now

* Run make with new tool set

* Replace testReaderHarness with testify suite (#2915)

* Add the periodic reader (#2909)

* Add the metric.Exporter interface

* Move the reader errors to reader.go

* Update Reader.Collect docs

Remove TODO being addressed in this PR and restate purpose of method.

* Initial draft of the periodic reader

* Refer to correct config in periodic reader opts

* Refactor reader testing into a harness

* Move wait group handling out of run

* Refactor ticker creation to allow testing

* Honor export timeout in run

* Fix wait group wait bug

* Add periodic reader tests

* Fix lint

* Update periodic reader comments

* Add concurrency test for readers

* Simplify the ticker stop deferral

* Only register once

* Restrict build of metric sdk to Go>1.16

* Clean up ShutdownBeforeRegister test

* Test duplicate Reader registration (#2914)

The specification requires the SDK prevent duplicate registrations for
readers. This adds a test for that and fixes this for the manualReader.

* Add WithReader and WithResource Options (#2905)

* Add WithReader and WithResource Options

* Run lint

* Update WithReader fn signature based on feedback

* crosslink

* Remove zero-len check in unify

* Restrict build to Go > 1.16

* Add bench test for reader collect methods (#2922)

* Unify reader implementations (#2923)

* Unify reader implementations

Use an atomic.Value to manage concurrency without a lock.

* Lint

* Merge main into new sdk main (#2925)

* Use already enabled revive linter and add depguard (#2883)

* Refactor golangci-lint conf

Order settings alphabetically.

* Add revive settings to golangci conf

* Check blank imports

* Check bool-literal-in-expr

* Check constant-logical-expr

* Check context-as-argument

* Check context-key-type

* Check deep-exit

* Check defer

* Check dot-imports

* Check duplicated-imports

* Check early-return

* Check empty-block

* Check empty-lines

* Check error-naming

* Check error-return

* Check error-strings

* Check errorf

* Stop ignoring context first arg in tests

* Check exported comments

* Check flag-parameter

* Check identical branches

* Check if-return

* Check increment-decrement

* Check indent-error-flow

* Check deny list of go imports

* Check import shadowing

* Check package comments

* Check range

* Check range val in closure

* Check range val address

* Check redefines builtin id

* Check string-format

* Check struct tag

* Check superfluous else

* Check time equal

* Check var naming

* Check var declaration

* Check unconditional recursion

* Check unexported return

* Check unhandled errors

* Check unnecessary stmt

* Check unnecessary break

* Check waitgroup by value

* Exclude deep-exit check in example*_test.go files

* Move the minimum version to go 1.17 (#2917)

* Move the minimum version to go 1.17

* Update readme and changelog

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>

* Make lint

Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>

* Add view to metrics. (#2926)

* WIP views public

* Add attribute filters and comments.

* Fixes for lint

* Address comments

* Fix lint

* Changed view matching to expand end

Removed the dscriptor, it was moved in previous patch

* change wildcards into regex

* Update comments

* address comments.

* Address more PR comments

* renamed WithDescription to WithSetDescription.

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>

* Implement MeterProvider's Meter method (#2945)

* Implement stubbed meter create method

* Rename return value to avoid comment

* Encapsulate meterRegistry tests with identifying name

* Run lint fix

* Comment meterRegistry being concurrent safe

* Remove ordered meter tracking in the meterRegistry

* Test range completeness instead of order

* Remove provider field from meter

* Initialize MeterProvider readers field for new (#2948)

* Introduce Temporality, WithTemporality Reader options and InstrumentKind (#2949)

* Introduce Temporality and InstrumentKind

Because Temporality is the responsibility of the Reader additional methods
are added to the Reader interface.  And New options are created to
configure the temporality selector.

* Addresses comments, and adds tests.

* Fix addition PR comment

* Add aggregation package and reader/view options (#2958)

* Add aggregation pkg and options

* Update documentation for the aggregation pkg

* Test Aggregation.Err

* Fix aggregation pkg comment

* Add WithAggregation comment

* Add default aggregation

* Rename WithAggregation and add AggregationSelector

* Fix DefaultAggregationSelector use and decl

* Replace Aggregation struct with iface

* Add Copy method to hist and fix Err method

* Additional test for monotonic bounds

* Add aggregation method to Reader

* Use AggregationSelector instead of inline func type

* Switch RecordMinMax to NoMinMax

* Deep copy and validate in options

* Test the DefaultAggregationSelector

* nolint for import-shadow of method

* Fix Default aggregation comment

* Test the explicit bucket histogram deep copy

* Update temporality selector option (#2967)

Match the WithAggregationSelector option pattern: define a
TemporalitySelector type, export the DefaultTemporalitySelector
function, and name the option with a Selector suffix.

* Minor NewMeterProvider and producer docs fix (#2983)

* Add internal package structure for aggregation (#2954)

* Add the aggtor package

* Restrict to Go 1.18

* Add missing build block to view_test.go

* Comment Aggregator iface

* Use Go 1.18 as the default ci version

* Update Aggregator iface from feedback

* Accept hist conf

* Flatten aggtor into just internal

* Add Cycler interface

Separate the duties of aggregation and maintaining state across
aggregation periods.

* Remove build flags for doc.go

* Clarify Cycler documentation

* Remove aggregation fold logic

* Rename Number to Atomic

* Add tests for Atomic impls

* Remove unneeded Atomic implementation

Add back when filling in structures.

* Fix article in Float64 docs

* Remove Atomic

This is an implementation detail.

* Add aggregator_example_test

* Fix hist example

* Add issue numbers to all TODO and FIXME

* Remove zero parameter comment

* Combine the cycler into the aggregators

* Remove the drop aggregator

* Fix lint

* Use attribute.Set instead of ptr to it

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Merge main into new_sdk/main (#2996)

* Use already enabled revive linter and add depguard (#2883)

* Refactor golangci-lint conf

Order settings alphabetically.

* Add revive settings to golangci conf

* Check blank imports

* Check bool-literal-in-expr

* Check constant-logical-expr

* Check context-as-argument

* Check context-key-type

* Check deep-exit

* Check defer

* Check dot-imports

* Check duplicated-imports

* Check early-return

* Check empty-block

* Check empty-lines

* Check error-naming

* Check error-return

* Check error-strings

* Check errorf

* Stop ignoring context first arg in tests

* Check exported comments

* Check flag-parameter

* Check identical branches

* Check if-return

* Check increment-decrement

* Check indent-error-flow

* Check deny list of go imports

* Check import shadowing

* Check package comments

* Check range

* Check range val in closure

* Check range val address

* Check redefines builtin id

* Check string-format

* Check struct tag

* Check superfluous else

* Check time equal

* Check var naming

* Check var declaration

* Check unconditional recursion

* Check unexported return

* Check unhandled errors

* Check unnecessary stmt

* Check unnecessary break

* Check waitgroup by value

* Exclude deep-exit check in example*_test.go files

* Move the minimum version to go 1.17 (#2917)

* Move the minimum version to go 1.17

* Update readme and changelog

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>

* Use ByteSliceToString from golang.org/x/sys/unix (#2924)

Use unix.ByteSliceToString to convert Utsname []byte fields to strings.

This also allows to drop the charsToString helper which serves the same
purpose and matches ByteSliceToString's implementation.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

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

* docs: fix typo (#2935)

* add timeout to grpc connection in otel-collector example (#2939)

* Closes: #2951 (#2952)

This PR updates the example listed in the getting started doc
so that it will compile without error.  It also makes this
example consistent with the code found in
https://github.com/open-telemetry/opentelemetry-go/blob/main/example/fib/main.go

Signed-off-by: Brad Topol <btopol@us.ibm.com>

* fix data-model link (#2955)

* Bump go.opentelemetry.io/proto/otlp from v0.16.0 to v0.18.0 (#2960)

* Move to using Instrumentation Scope (#2976)

* Move to using Instrumentation Scope

* Use type alias, not definition

* Add a changelog entry

* docs(website_docs): fix exporting_data.md and getting-started.md toc (#2930)

* docs(website_docs): fix toc

* docs(website_docs): fix toc

* update exporting_data.md for rerun check-links

* update exporting_data.md for rerun check-links

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update getting-started.md (#2984)

grammar edit for line 175 of readme

* fix typo (#2986)

* fix typo

* spell fix

* typo fix (#2991)

* added traces.txt to gitignore for fib (#2993)

* Deprecate Library and move all uses to Scope (#2977)

* Deprecate Library and move all uses to Scope

* Add PR number to changelog

* Don't change signatures in stable modules

* Revert some changes

* Rename internal struct names

* A bit more renaming

* Update sdk/trace/span.go

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

* Update based on feedback

* Revert change

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

* Feat/bridge support text map (#2911)

* feat: support TextMap

* doc: add comment

* test: support for ot.TextMap

* Retrieve lost code due to merge

* fix: retrieve lost code due to merge. test: support for ot.HTTPHeaders

* go mod tidy

* Optimized code style, add changelog

* doc: Restore comments

* wip: add test cases

* test: fix args error

* delete empty line

* Fix syntax and changelog errors

* Fix formatting errors

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Add a release template (#2863)

* Add a release template

* Update the about field

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

* Fix linting Issues

* Add ignore for template link

Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Fix merge of CHANGELOG.md

Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tobias Klauser <tobias.klauser@gmail.com>
Co-authored-by: petrie <244236866@qq.com>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Brad Topol <btopol@us.ibm.com>
Co-authored-by: Craig Pastro <pastro.craig@gmail.com>
Co-authored-by: Kshitija Murudi <kmurudi@ncsu.edu>
Co-authored-by: Petrie Liu <lpfvip2008@gmail.com>
Co-authored-by: Guangya Liu <gyliu513@gmail.com>
Co-authored-by: Craig Pastro <craig.pastro@auth0.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: ttoad <qq530901331@outlook.com>

* Add structure to the export data. (#2961)

* Add structure to the export data.

* Fix comments.

* Apply suggestions from code review

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

* Address PR comments.

* Updated optional historgram parameters.

* Address PR comments.

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>

* Use export.Aggregation instead of internal.Aggregation (#3007)

* Use export.Aggregation instead of internal

* Return an export.Aggregation instead of a slice

* Use attribute Sets instead of KeyValues for export data (#3012)

Attribute Sets have stronger guarantees about the uniqueness of their
keys and more functionality. We already ensure attributes are stored as
Sets by the aggregator which will produce these data types. Instead of
converting to a KeyValue slice, keep the data as a Set.

Any user of the data can always call the ToSlice method to use the data
as a slice of KeyValues.

* Change Instrument Library to Instrument Scope (#3016)

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

* move temporality to export/temporality (#3017)

* move temporality to export/temporality

* fix lint errors

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

* Rename Package sdk/metric/export into sdk/metric/metricdata (#3014)

* fix unrelated changes

* fix quote code

* fix format

* rebase pr

* rebase pr

* change usage of export to metricdata

* Add metricdatatest package (#3025)

* Use export.Aggregation instead of internal

* Return an export.Aggregation instead of a slice

* Use attribute Sets instead of KeyValues for export data

Attribute Sets have stronger guarantees about the uniqueness of their
keys and more functionality. We already ensure attributes are stored as
Sets by the aggregator which will produce these data types. Instead of
converting to a KeyValue slice, keep the data as a Set.

Any user of the data can always call the ToSlice method to use the data
as a slice of KeyValues.

* Add export data type comparison testing API

* Add Aggregation and Value comparison funcs

* Move export testing to own pkg

* Move exporttest to metricdatatest

* Add licenses headers to files missing them

* Use metricdata instead of export

Fix merge of new_sdk/main

* Rename exporttest pkg to metricdatatest

* Fix spelling errors

* Fix lint issues

* Use testing pkg to error directly

Include Helper() method calls to correct the call-stack.

* Fix CompareAggregations

Set equal to true by default

* Generalize assertions and unexport equal checks

* Abstract assert tests

* Rename all exp var to r

* Test AssertAggregationsEqual

* Comment why Value and Aggregation are separate

* Test AssertValuesEqual

* Revert changes to metricdata/temporality.go

* Expand pkg doc sentence

* Add license header to assertion.go

* Update assertion docs

* Consolidate comparisons funcs into one file

* Consolidate and fix docs

* Consolidate assertion.go

* Consolidate comparisons.go

* make lint

* Test with relatively static times

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

Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>

* Drop equal return from comparison funcs

* Refactor AssertEqual

* Remove reasN from testDatatype func params

* Consolidate AssertEqual type conversions

* Fix assertion error message

* Add assertion failure tests

* Remove unneeded strings join

* Make comment include a possessive

Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>

* Adds a pipeline for creating reader's output (#3026)

* Adds a pipeline for creating reader's output

* fix metricdata move

* fix lint

* Apply suggestions from code review

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

* Address PR comments

* Added resource test

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

* Use generic Sum, Gauge, and DataPoint value removing Value, Int64, and Float64 from metricdata (#3036)

* Use generic DataPoint value

* Fix assertion_fail_test.go

* Declare Sum and DataPoints type in pipeline_test

* Add MatchInstrumentKind filter for Views. (#3037)

* Move InstrumentKind to view, Add view filter

* remove TODO

* Add the Option function, fix lint

* use local var over 0

* Fix missing undefinedInstrumnet

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

* Change View Attribute Filter to detect if not set. (#3039)

* Change View Attribute Filter to detect if not set.

* Fix PR comments.

* Rework test for no filter logic.

* Add implementation of last-value aggregator (#3008)

* Add last-value aggregator

* Add test of last-value reset of unseen attrs

* Add benchmark

* Use generic DataPoint value

* Fix assertion_fail_test.go

* Fix tests

* Remove unused test increment values

* View.New() miss InstrumentKind check (#3043)

Signed-off-by: liupengfei <lpfvip2008@gmail.com>

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

* Add delta/cumulative histogram implementation (#3045)

* Add delta/cumulative histogram implementation

* Add histogram unit tests

* Fix histValues Aggregate

Store the new buckets value back to the values map.

Ensure min/max are measured values, not zero values.

* Fix lint

* Add benchmarks

* Test histograms internal functionality

* Fix lint

* Add TODO to look at memory use for cumu hist

* Update sdk/metric/internal/histogram.go

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>

* use TemporalitySelector (#3050)

Signed-off-by: Petrie <lpfvip2008@gmail.com>

Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>

* Add implementation of Sum aggregators (#3000)

* Implement the sum aggregators

* Add unit tests for delta/cumulative sums

* Add benchmarks

* Merge sum tests into one

* Remove unused start time from cumulative sum

* Refactor benchmark tests

Split benchmarks for the Aggregations and Aggregate methods so
computational resource use can be determined.

* goimports

* Move timestamp out of lock

* Refactor testing

* Fix spelling mistake

* Name param of expectFunc

* Reset delta sum to zero instead of delete

* Revert to deleting unused attr sets

* Refactor testing to allow use across other aggs

* Add TODO to bound cumulative sum mem usage

* Fix misspelling

* Unify aggregator benchmark code in aggregator_test

* Use generic DataPoint value

* Fix assertion_fail_test.go

* Use generic metricdata types

* Fix tests

* Fix benchmarks

* Fix lint

* Update sum documentation

* Remove leftover encapsulating test run

* Use t.Cleanup to mock time

* Consolidate expecter logic into funcs

* Move errNegVal closer to use

* Run the agg test

* Add tests for monotonic sum Aggregate err

* Run make lint

* Make monotonic an arg of creation funcs

* Remove Aggregate monotonic validation

* Rename sum to valueMap

The term sum is a good variable name that we do not want to take and
valueMap better describes the type as the storage of the aggregator.

* Adds a filter Aggregator. (#3040)

* Adds a filter Aggregator.

* Add lock and tests

* Add Concurrency tests

* fix lint errors

* Add memory constrained todo.

* Update filter comment.

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

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Add back the stdoutmetric exporter (#3057)

* PoC stdoutmetric exporter

* Use stringer to generate String for Temporality

* Add vanity imports

* Update Temporality string expected output

* Do not return error from newConfig

* Add shutdown unit tests

* Fix spelling error

* Unify testing of ctx errors and test ForceFlush

* Add unit test for Export handle of ctx errs

* Clarify documentation about alt OTLP exporter

* Remove unused ErrUnrecognized

A third party encoder can produce their own errors. This code does
nothing unique with this error, therefore, it is removed.

* Lint exporter_test.go

* Refactor example_test.go removing FIXME

* Add test for Export shutdown err

* Add a discard encoder for testing

* Acknowledged error is returned from Shutdown

* Remove unexpected SchemaURL from stdouttrace test

* Remove unneeded *testing.T arg from testEncoderOption

* Fix the location of now

* Revise and edit docs

Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>

* Remove stale TODO from metricdata/data.go (#3064)

* Merge main into new_sdk/main (#3082)

* Use already enabled revive linter and add depguard (#2883)

* Refactor golangci-lint conf

Order settings alphabetically.

* Add revive settings to golangci conf

* Check blank imports

* Check bool-literal-in-expr

* Check constant-logical-expr

* Check context-as-argument

* Check context-key-type

* Check deep-exit

* Check defer

* Check dot-imports

* Check duplicated-imports

* Check early-return

* Check empty-block

* Check empty-lines

* Check error-naming

* Check error-return

* Check error-strings

* Check errorf

* Stop ignoring context first arg in tests

* Check exported comments

* Check flag-parameter

* Check identical branches

* Check if-return

* Check increment-decrement

* Check indent-error-flow

* Check deny list of go imports

* Check import shadowing

* Check package comments

* Check range

* Check range val in closure

* Check range val address

* Check redefines builtin id

* Check string-format

* Check struct tag

* Check superfluous else

* Check time equal

* Check var naming

* Check var declaration

* Check unconditional recursion

* Check unexported return

* Check unhandled errors

* Check unnecessary stmt

* Check unnecessary break

* Check waitgroup by value

* Exclude deep-exit check in example*_test.go files

* Move the minimum version to go 1.17 (#2917)

* Move the minimum version to go 1.17

* Update readme and changelog

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>

* Use ByteSliceToString from golang.org/x/sys/unix (#2924)

Use unix.ByteSliceToString to convert Utsname []byte fields to strings.

This also allows to drop the charsToString helper which serves the same
purpose and matches ByteSliceToString's implementation.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

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

* docs: fix typo (#2935)

* add timeout to grpc connection in otel-collector example (#2939)

* Closes: #2951 (#2952)

This PR updates the example listed in the getting started doc
so that it will compile without error.  It also makes this
example consistent with the code found in
https://github.com/open-telemetry/opentelemetry-go/blob/main/example/fib/main.go

Signed-off-by: Brad Topol <btopol@us.ibm.com>

* fix data-model link (#2955)

* Bump go.opentelemetry.io/proto/otlp from v0.16.0 to v0.18.0 (#2960)

* Move to using Instrumentation Scope (#2976)

* Move to using Instrumentation Scope

* Use type alias, not definition

* Add a changelog entry

* docs(website_docs): fix exporting_data.md and getting-started.md toc (#2930)

* docs(website_docs): fix toc

* docs(website_docs): fix toc

* update exporting_data.md for rerun check-links

* update exporting_data.md for rerun check-links

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update getting-started.md (#2984)

grammar edit for line 175 of readme

* fix typo (#2986)

* fix typo

* spell fix

* typo fix (#2991)

* added traces.txt to gitignore for fib (#2993)

* Deprecate Library and move all uses to Scope (#2977)

* Deprecate Library and move all uses to Scope

* Add PR number to changelog

* Don't change signatures in stable modules

* Revert some changes

* Rename internal struct names

* A bit more renaming

* Update sdk/trace/span.go

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

* Update based on feedback

* Revert change

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

* Feat/bridge support text map (#2911)

* feat: support TextMap

* doc: add comment

* test: support for ot.TextMap

* Retrieve lost code due to merge

* fix: retrieve lost code due to merge. test: support for ot.HTTPHeaders

* go mod tidy

* Optimized code style, add changelog

* doc: Restore comments

* wip: add test cases

* test: fix args error

* delete empty line

* Fix syntax and changelog errors

* Fix formatting errors

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Add a release template (#2863)

* Add a release template

* Update the about field

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

* Fix linting Issues

* Add ignore for template link

Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Add workflow to automate bundling dependabot PRs (#2997)

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Release prep 1.8.0 (#3001)

* Update CHANGELOG and versions.yaml for 1.8.0 release

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Update go-build-tools

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Prepare stable-v1 for version v1.8.0

* Prepare experimental-metrics for version v0.31.0

* Prepare bridge for version v0.31.0

* `make go-mod-tidy` should use `-compat=1.17` now

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Update CHANGELOG.md

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

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

* Add benchmark metric test for UpDownCounter (#2655)

* add benchmark metric test for UpDownCounter

* move counter annotation up

* fix syncFloat64 to syncInt64

* fix syncFloat64 to syncInt64

* fix go-lint err

* Add semconv/v1.11.0 (#3009)

Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>

* Add semconv/v1.12.0 (#3010)

* Add semconv/v1.12.0

* Update all semconv use to v1.12.0

Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>

* Add http.method attribute to http server metric (#3018)

* Add http.method attribute to http server metric

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

* fix lint

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

* fix lint

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

* fix for reviews

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

* add changelog entry

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

* Add tests and fix opentracing bridge defer warning (#3029)

* add tests and fix opentracing bridge defer warning

* add changelog entry

* Update CHANGELOG.md

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

* Update bridge/opentracing/bridge_test.go

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

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

* Introduce "split" metric schema transformation (#2999)

This is a new transformation type that allows to describe a change
where a metric is converted to several other metrics by eliminating
an attribute.

An example of such change that happened recently is this:
https://github.com/open-telemetry/opentelemetry-specification/pull/2617

This PR implements specification change https://github.com/open-telemetry/opentelemetry-specification/pull/2653

This PR creates package v1.1 for the new functionality. The old package v1.0
remains unchanged.

* Release v1.9.0 (#3052)

* Bump versions in versions.yaml

* Prepare stable-v1 for version v1.9.0

* Prepare experimental-schema for version v0.0.3

* Update changelog for release

* Replace ioutil with io and os (#3058)

* Make several vars into consts (#3068)

* Add support for Go 1.19 (#3077)

* Add support for Go 1.19

* Update CHANGELOG.md

Co-authored-by: Sam Xie <sam@samxie.me>

Co-authored-by: Sam Xie <sam@samxie.me>

* Update compatibility documentation (#3079)

Remove 3 month timeline for backwards support of old versions of Go.

Signed-off-by: Brad Topol <btopol@us.ibm.com>
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tobias Klauser <tobias.klauser@gmail.com>
Co-authored-by: petrie <244236866@qq.com>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Brad Topol <btopol@us.ibm.com>
Co-authored-by: Craig Pastro <pastro.craig@gmail.com>
Co-authored-by: Kshitija Murudi <kmurudi@ncsu.edu>
Co-authored-by: Petrie Liu <lpfvip2008@gmail.com>
Co-authored-by: Guangya Liu <gyliu513@gmail.com>
Co-authored-by: Craig Pastro <craig.pastro@auth0.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: ttoad <qq530901331@outlook.com>
Co-authored-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
Co-authored-by: Håvard Anda Estensen <haavard.ae@gmail.com>
Co-authored-by: Mikhail Mazurskiy <126021+ash2k@users.noreply.github.com>
Co-authored-by: Sam Xie <sam@samxie.me>

* Adds the option to ignore timestamps in metric data tests. (#3076)

* Adds the option to ignore timestamps in metric data tests

* use config over bool

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

* Adds a pipelineRegistry to manage creating aggregators. (#3044)

* Adds a pipelineRegistry to manage creating aggregators.

* Made pipeline generic
* Add aggregation filter to the registry.

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>

* Remove stale TODO (#3083)

The aggregation transform function was added in #2958.

* Add back the otlpmetric transforms (#3065)

* Add otlpmetric transforms

* Split aggregation transforms to own file

* Rename Iterator to AttrIter

* Update pkg docs

These are internal docs use developer based language.

* Document all exported funcs

* Unify metricdata type transforms into one file

* Rename metrics.go to metricdata.go

* Copy back attribute tests

* Copy back in Iterator test

* Refactor attribute tests

* Add tests for metricdata transforms

* Add multiErr support for digestible transform errs

* Test transform errors

* go mod tidy

* Use key field

* goimported

* gofmt-ed

* Fix error documentation

* go mod tidy

* Changes instruments uniqueness in pipeline. (#3071)

* Changes instruments uniquness in pipeline.

* Fix lint

* Update sdk/metric/pipeline.go

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

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

* Restore the exporters/otlp/otlpmetric/internal/otelconfig package (#3090)

* Restore otlpmetric/otlpconfig from main

* Rename otlpconfig to oconf

* Remove the empty envconfig_test.go

* Update import of otlpconfig in oconf_test

* go mod tidy

* Run make

* add internal OpenCensus metric translation library (#3099)

* reintroduce opencensus trace bridge (#3098)

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

* Document the sdk/metric/view package (#3086)

* Add package documentation for sdk/metric/view

* Refer to views not configs in WithReader docs

* Fix vanity url for view_test.go

* Add example tests for view options

* Add package example

* Fix view type docs

* Remove build constraint for doc.go

* Fix lint

* Adds async instruments and providers. (#3084)

* Adds instrument providers and instruments.

* Don't return nil instrument, return with error

* removed sync

* Added a number of tests.

Signed-off-by: GitHub <noreply@github.com>

* Address PR comments

* fix error messages

* fixes typo in test name

Signed-off-by: GitHub <noreply@github.com>

* Fix lint issues

* moved the testCallback into the TestMeterCreateInstrument

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

* Merge branch 'main' into new_sdk/main (#3111)

* Use already enabled revive linter and add depguard (#2883)

* Refactor golangci-lint conf

Order settings alphabetically.

* Add revive settings to golangci conf

* Check blank imports

* Check bool-literal-in-expr

* Check constant-logical-expr

* Check context-as-argument

* Check context-key-type

* Check deep-exit

* Check defer

* Check dot-imports

* Check duplicated-imports

* Check early-return

* Check empty-block

* Check empty-lines

* Check error-naming

* Check error-return

* Check error-strings

* Check errorf

* Stop ignoring context first arg in tests

* Check exported comments

* Check flag-parameter

* Check identical branches

* Check if-return

* Check increment-decrement

* Check indent-error-flow

* Check deny list of go imports

* Check import shadowing

* Check package comments

* Check range

* Check range val in closure

* Check range val address

* Check redefines builtin id

* Check string-format

* Check struct tag

* Check superfluous else

* Check time equal

* Check var naming

* Check var declaration

* Check unconditional recursion

* Check unexported return

* Check unhandled errors

* Check unnecessary stmt

* Check unnecessary break

* Check waitgroup by value

* Exclude deep-exit check in example*_test.go files

* Move the minimum version to go 1.17 (#2917)

* Move the minimum version to go 1.17

* Update readme and changelog

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>

* Use ByteSliceToString from golang.org/x/sys/unix (#2924)

Use unix.ByteSliceToString to convert Utsname []byte fields to strings.

This also allows to drop the charsToString helper which serves the same
purpose and matches ByteSliceToString's implementation.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

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

* docs: fix typo (#2935)

* add timeout to grpc connection in otel-collector example (#2939)

* Closes: #2951 (#2952)

This PR updates the example listed in the getting started doc
so that it will compile without error.  It also makes this
example consistent with the code found in
https://github.com/open-telemetry/opentelemetry-go/blob/main/example/fib/main.go

Signed-off-by: Brad Topol <btopol@us.ibm.com>

* fix data-model link (#2955)

* Bump go.opentelemetry.io/proto/otlp from v0.16.0 to v0.18.0 (#2960)

* Move to using Instrumentation Scope (#2976)

* Move to using Instrumentation Scope

* Use type alias, not definition

* Add a changelog entry

* docs(website_docs): fix exporting_data.md and getting-started.md toc (#2930)

* docs(website_docs): fix toc

* docs(website_docs): fix toc

* update exporting_data.md for rerun check-links

* update exporting_data.md for rerun check-links

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update getting-started.md (#2984)

grammar edit for line 175 of readme

* fix typo (#2986)

* fix typo

* spell fix

* typo fix (#2991)

* added traces.txt to gitignore for fib (#2993)

* Deprecate Library and move all uses to Scope (#2977)

* Deprecate Library and move all uses to Scope

* Add PR number to changelog

* Don't change signatures in stable modules

* Revert some changes

* Rename internal struct names

* A bit more renaming

* Update sdk/trace/span.go

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

* Update based on feedback

* Revert change

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

* Feat/bridge support text map (#2911)

* feat: support TextMap

* doc: add comment

* test: support for ot.TextMap

* Retrieve lost code due to merge

* fix: retrieve lost code due to merge. test: support for ot.HTTPHeaders

* go mod tidy

* Optimized code style, add changelog

* doc: Restore comments

* wip: add test cases

* test: fix args error

* delete empty line

* Fix syntax and changelog errors

* Fix formatting errors

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Add a release template (#2863)

* Add a release template

* Update the about field

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

* Fix linting Issues

* Add ignore for template link

Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Add workflow to automate bundling dependabot PRs (#2997)

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Release prep 1.8.0 (#3001)

* Update CHANGELOG and versions.yaml for 1.8.0 release

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Update go-build-tools

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Prepare stable-v1 for version v1.8.0

* Prepare experimental-metrics for version v0.31.0

* Prepare bridge for version v0.31.0

* `make go-mod-tidy` should use `-compat=1.17` now

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Update CHANGELOG.md

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

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

* Add benchmark metric test for UpDownCounter (#2655)

* add benchmark metric test for UpDownCounter

* move counter annotation up

* fix syncFloat64 to syncInt64

* fix syncFloat64 to syncInt64

* fix go-lint err

* Add semconv/v1.11.0 (#3009)

Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>

* Add semconv/v1.12.0 (#3010)

* Add semconv/v1.12.0

* Update all semconv use to v1.12.0

Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>

* Add http.method attribute to http server metric (#3018)

* Add http.method attribute to http server metric

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

* fix lint

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

* fix lint

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

* fix for reviews

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

* add changelog entry

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

* Add tests and fix opentracing bridge defer warning (#3029)

* add tests and fix opentracing bridge defer warning

* add changelog entry

* Update CHANGELOG.md

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

* Update bridge/opentracing/bridge_test.go

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

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

* Introduce "split" metric schema transformation (#2999)

This is a new transformation type that allows to describe a change
where a metric is converted to several other metrics by eliminating
an attribute.

An example of such change that happened recently is this:
https://github.com/open-telemetry/opentelemetry-specification/pull/2617

This PR implements specification change https://github.com/open-telemetry/opentelemetry-specification/pull/2653

This PR creates package v1.1 for the new functionality. The old package v1.0
remains unchanged.

* Release v1.9.0 (#3052)

* Bump versions in versions.yaml

* Prepare stable-v1 for version v1.9.0

* Prepare experimental-schema for version v0.0.3

* Update changelog for release

* Replace ioutil with io and os (#3058)

* Make several vars into consts (#3068)

* Add support for Go 1.19 (#3077)

* Add support for Go 1.19

* Update CHANGELOG.md

Co-authored-by: Sam Xie <sam@samxie.me>

Co-authored-by: Sam Xie <sam@samxie.me>

* Update compatibility documentation (#3079)

Remove 3 month timeline for backwards support of old versions of Go.

* Fix `opentracing.Bridge` where it miss identifying the spanKind  (#3096)

* Fix opentracing.Bridge where it was not identifying the spanKinf correctly

* fix test

* changelog

* Keeping backward comppatibillity

* Update CHANGELOG.md

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Update CHANGELOG.md

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>

* replace `required` by `requirementlevel` (#3103)

* Change the inclusivity of exponential histogram bounds (#2982)

* Use lower-inclusive boundaries

* make exponent and logarithm more symmetric

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>

* Update golangci-lint to v1.48.0 (#3105)

* Update golangci-lint to v1.48.0

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>

* Bump go.opentelemetry.io/proto/otlp from v0.18.0 to v0.19.0 (#3107)

* Bump go.opentelemetry.io/proto/otlp from v0.18.0 to v0.19.0

Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>

Signed-off-by: Brad Topol <btopol@us.ibm.com>
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tobias Klauser <tobias.klauser@gmail.com>
Co-authored-by: petrie <244236866@qq.com>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Brad Topol <btopol@us.ibm.com>
Co-authored-by: Craig Pastro <pastro.craig@gmail.com>
Co-authored-by: Kshitija Murudi <kmurudi@ncsu.edu>
Co-authored-by: Petrie Liu <lpfvip2008@gmail.com>
Co-authored-by: Guangya Liu <gyliu513@gmail.com>
Co-authored-by: Craig Pastro <craig.pastro@auth0.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: ttoad <qq530901331@outlook.com>
Co-authored-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
Co-authored-by: Håvard Anda Estensen <haavard.ae@gmail.com>
Co-authored-by: Mikhail Mazurskiy <126021+ash2k@users.noreply.github.com>
Co-authored-by: Sam Xie <sam@samxie.me>
Co-authored-by: Alan Protasio <alanprot@gmail.com>
Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>

* Add otlpmetric exporter (#3089)

* Add otlpmetric package doc

* Add Client interface

* Add the Exporter

Have the Exporter ensure synchronous access to all client methods.

* Add race detection test for Exporter

* Expand New godocs

* Fix lint

* Merge transform and upload errors

* Fix ineffectual increment

* Make pipelineRegistry non-generic (#3115)

* Make pipelineRegistry non-generic

* Add Synchronous instruments (#3124)

* Add Synchronous instruments

* remove duplicate code in instrument

* Fixes to Histogram comments

* Add back the otlpmetricgrpc exporter (#3094)

* Add otlpmetric package doc

* Add Client interface

* Add the Exporter

Have the Exporter ensure synchronous access to all client methods.

* Add race detection test for Exporter

* Expand New godocs

* Fix lint

* Add the otlpmetricgrpc Go module

* Restore otlpmetricgrpc from main

* Remove integration testing from otlpmetricgrpc

* Fix import of otlpconfig to oconf

* Update client

Add ForceFlush method to satisfy otlpmetric.Client, unexport Start, and
restructure NewClient to return a started client.

* Update otlpmetricgrpc New functions

Remove NewUnstarted and only export New.

* Remove unneeded client sync

The exporter handle the synchronization of client method calls.

* Update example_test.go

* Update client_unit_test.go

* Rename client_unit_test.go to client_test.go

* Rename options.go to config.go

* Add package doc

* Unify exporter.go and doc.go into client.go

* Unexport NewClient

* Correct option documentation

* Add env config documentation

* go mod tidy

* Restrict build to Go 1.18

* Update client.go

Fix copied UploadMetrics documentation.

* Run make

* Close client conn even if context deadline reached

* Add sdk/metric Go pkg docs and example (#3139)

* Add sdk/metric Go pkg docs

* Add example_test.go

* Add Go 1.18 build guard to example_test.go

* Merge main into new_sdk/main (#3141)

* Use already enabled revive linter and add depguard (#2883)

* Refactor golangci-lint conf

Order settings alphabetically.

* Add revive settings to golangci conf

* Check blank imports

* Check bool-literal-in-expr

* Check constant-logical-expr

* Check context-as-argument

* Check context-key-type

* Check deep-exit

* Check defer

* Check dot-imports

* Check duplicated-imports

* Check early-return

* Check empty-block

* Check empty-lines

* Check error-naming

* Check error-return

* Check error-strings

* Check errorf

* Stop ignoring context first arg in tests

* Check exported comments

* Check flag-parameter

* Check identical branches

* Check if-return

* Check increment-decrement

* Check indent-error-flow

* Check deny list of go imports

* Check import shadowing

* Check package comments

* Check range

* Check range val in closure

* Check range val address

* Check redefines builtin id

* Check string-format

* Check struct tag

* Check superfluous else

* Check time equal

* Check var naming

* Check var declaration

* Check unconditional recursion

* Check unexported return

* Check unhandled errors

* Check unnecessary stmt

* Check unnecessary break

* Check waitgroup by value

* Exclude deep-exit check in example*_test.go files

* Move the minimum version to go 1.17 (#2917)

* Move the minimum version to go 1.17

* Update readme and changelog

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>

* Use ByteSliceToString from golang.org/x/sys/unix (#2924)

Use unix.ByteSliceToString to convert Utsname []byte fields to strings.

This also allows to drop the charsToString helper which serves the same
purpose and matches ByteSliceToString's implementation.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

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

* docs: fix typo (#2935)

* add timeout to grpc connection in otel-collector example (#2939)

* Closes: #2951 (#2952)

This PR updates the example listed in the getting started doc
so that it will compile without error.  It also makes this
example consistent with the code found in
https://github.com/open-telemetry/opentelemetry-go/blob/main/example/fib/main.go

Signed-off-by: Brad Topol <btopol@us.ibm.com>

* fix data-model link (#2955)

* Bump go.opentelemetry.io/proto/otlp from v0.16.0 to v0.18.0 (#2960)

* Move to using Instrumentation Scope (#2976)

* Move to using Instrumentation Scope

* Use type alias, not definition

* Add a changelog entry

* docs(website_docs): fix exporting_data.md and getting-started.md toc (#2930)

* docs(website_docs): fix toc

* docs(website_docs): fix toc

* update exporting_data.md for rerun check-links

* update exporting_data.md for rerun check-links

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update getting-started.md (#2984)

grammar edit for line 175 of readme

* fix typo (#2986)

* fix typo

* spell fix

* typo fix (#2991)

* added traces.txt to gitignore for fib (#2993)

* Deprecate Library and move all uses to Scope (#2977)

* Deprecate Library and move all uses to Scope

* Add PR number to changelog

* Don't change signatures in stable modules

* Revert some changes

* Rename internal struct names

* A bit more renaming

* Update sdk/trace/span.go

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

* Update based on feedback

* Revert change

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

* Feat/bridge support text map (#2911)

* feat: support TextMap

* doc: add comment

* test: support for ot.TextMap

* Retrieve lost code due to merge

* fix: retrieve lost code due to merge. test: support for ot.HTTPHeaders

* go mod tidy

* Optimized code style, add changelog

* doc: Restore comments

* wip: add test cases

* test: fix args error

* delete empty line

* Fix syntax and changelog errors

* Fix formatting errors

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Add a release template (#2863)

* Add a release template

* Update the about field

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

* Fix linting Issues

* Add ignore for template link

Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Add workflow to automate bundling dependabot PRs (#2997)

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Release prep 1.8.0 (#3001)

* Update CHANGELOG and versions.yaml for 1.8.0 release

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Update go-build-tools

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Prepare stable-v1 for version v1.8.0

* Prepare experimental-metrics for version v0.31.0

* Prepare bridge for version v0.31.0

* `make go-mod-tidy` should use `-compat=1.17` now

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Update CHANGELOG.md

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

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

* Add benchmark metric test for UpDownCounter (#2655)

* add benchmark metric test for UpDownCounter

* move counter annotation up

* fix syncFloat64 to syncInt64

* fix syncFloat64 to syncInt64

* fix go-lint err

* Add semconv/v1.11.0 (#3009)

Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>

* Add semconv/v1.12.0 (#3010)

* Add semconv/v1.12.0

* Update all semconv use to v1.12.0

Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>

* Add http.method attribute to http server metric (#3018)

* Add http.method attribute to http server metric

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

* fix lint

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

* fix lint

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

* fix for reviews

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

* add changelog entry

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

* Add tests and fix opentracing bridge defer warning (#3029)

* add tests and fix opentracing bridge defer warning

* add changelog entry

* Update CHANGELOG.md

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

* Update bridge/opentracing/bridge_test.go

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

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

* Introduce "split" metric schema transformation (#2999)

This is a new transformation type that allows to describe a change
where a metric is converted to several other metrics by eliminating
an attribute.

An example of such change that happened recently is this:
https://github.com/open-telemetry/opentelemetry-specification/pull/2617

This PR implements specification change https://github.com/open-telemetry/opentelemetry-specification/pull/2653

This PR creates package v1.1 for the new functionality. The old package v1.0
remains unchanged.

* Release v1.9.0 (#3052)

* Bump versions in versions.yaml

* Prepare stable-v1 for version v1.9.0

* Prepare experimental-schema for version v0.0.3

* Update changelog for release

* Replace ioutil with io and os (#3058)

* Make several vars into consts (#3068)

* Add support for Go 1.19 (#3077)

* Add support for Go 1.19

* Update CHANGELOG.md

Co-authored-by: Sam Xie <sam@samxie.me>

Co-authored-by: Sam Xie <sam@samxie.me>

* Update compatibility documentation (#3079)

Remove 3 month timeline for backwards support of old versions of Go.

* Fix `opentracing.Bridge` where it miss identifying the spanKind  (#3096)

* Fix opentracing.Bridge where it was not identifying the spanKinf correctly

* fix test

* changelog

* Keeping backward comppatibillity

* Update CHANGELOG.md

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Update CHANGELOG.md

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>

* replace `required` by `requirementlevel` (#3103)

* Change the inclusivity of exponential histogram bounds (#2982)

* Use lower-inclusive boundaries

* make exponent and logarithm more symmetric

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>

* Update golangci-lint to v1.48.0 (#3105)

* Update golangci-lint to v1.48.0

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>

* Bump go.opentelemetry.io/proto/otlp from v0.18.0 to v0.19.0 (#3107)

* Bump go.opentelemetry.io/proto/otlp from v0.18.0 to v0.19.0

Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>

* Update tracer to guard for a nil ctx (#3110)

* Update tracer to guard for a nil ctx

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Fix sdk/instrumentation pkg docs (#3130)

* Add instrumentation scope attributes (#3131)

* Add WithScopeAttributes TracerOption to trace API

* Add Attributes field to instrumentation Scope

* Use scope attributes for new Tracer

* Fix stdouttrace expected test output

* Allow unexported Set fields in sdk/trace test

* Export instrumentation scope attrs in OTLP

* Add changes to the changelog

* Fix imports with make lint

* Add unit tests for WithScopeAttributes

* Fix English in Scope documentation

* Add WithScopeAttributes MeterOption to metric API package (#3132)

* Add WithScopeAttributes MeterOption to metric pkg

* Add MeterConfig unit tests

* Add changes to changelog

* Fix import linting

* Update MeterProvider documentation

Include information about how to use WithScopeAttributes.

* Refactor TracerProvider documentation (#3133)

* Refactor TracerProvider documentation

* Fix English article

* Grammar fixes

* consistency-of:  Changed signal names for website docs (#3137)

* Shut down all processors even on error (#3091)

* Fix stdoutmetric example test

The merged instrumentation Scope includes SchemaURL and Attributes now,
add them to the expected output.

Signed-off-by: Brad Topol <btopol@us.ibm.com>
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tobias Klauser <tobias.klauser@gmail.com>
Co-authored-by: petrie <244236866@qq.com>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Brad Topol <btopol@us.ibm.com>
Co-authored-by: Craig Pastro <pastro.craig@gmail.com>
Co-authored-by: Kshitija Murudi <kmurudi@ncsu.edu>
Co-authored-by: Petrie Liu <lpfvip2008@gmail.com>
Co-authored-by: Guangya Liu <gyliu513@gmail.com>
Co-authored-by: Craig Pastro <craig.pastro@auth0.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: ttoad <qq530901331@outlook.com>
Co-authored-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
Co-authored-by: Håvard Anda Estensen <haavard.ae@gmail.com>
Co-authored-by: Mikhail Mazurskiy <126021+ash2k@users.noreply.github.com>
Co-authored-by: Sam Xie <sam@samxie.me>
Co-authored-by: Alan Protasio <alanprot@gmail.com>
Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
Co-authored-by: Mitch Usher <cull.methi@gmail.com>
Co-authored-by: Gaurang Patel <mr.patelgaurang@gmail.com>

* Remove empty metrictest pkg (#3148)

* Add exporters/otlp/otlpmetric/internal/otest (#3125)

* Add otlpmetric package doc

* Add Client interface

* Add the Exporter

Have the Exporter ensure synchronous access to all client methods.

* Add race detection test for Exporter

* Expand New godocs

* Fix lint

* Restore otlpmetrictest from main

* Rename otlpmetrictest to otest

* Remove data.go

The functions and types it contains are no longer relevant to the SDK.

* Update client context error tests

Remove multiple shutdown tests. The Client interface states this should
never happen.

* Remove collector.go and otlptest.go

* Expand client tests with ctx and force-flush

* Add UploadMetrics tests

* Test the tests with a trivial client

* Condense all to client.go

* Example of how to run RunClientTests

* Add client integration testing

* Add GRPCCollector

* Remove GRPCCollector to limit scope of PR

* Add back the otlpmetrichttp exporter (#3097)

* Add otlpmetric package doc

* Add Client interface

* Add the Exporter

Have the Exporter ensure synchronous access to all client methods.

* Add race detection test for Exporter

* Expand New godocs

* Fix lint

* Add back the otlpmetrichttp pkg from main

* Restrict to Go 1.18 and above

* Remove integration testing

* Rename client_unit_test.go to client_test.go

* Rename options.go to config.go

* Remove the NewUnstarted func

* Remove Start method from client

* Add no-op ForceFlush method to client

* Update otlpconfig pkg name to oconf

* Rename Stop method to Shutdown

Match the otlpmetric.Client interface.

* Update creation functions to compile

* Remove name field from client

* Remove sync of methods from client

This is handled by the exporter.

* Remove unused generalCfg field from client

* Replace cfg client field with used conf vals

* Use a http request instead of url/header fields

* Remove NewClient and move New into client.go

* Rename client.client field to client.httpClient

* Update client tests

Remove test of a retry config and add functional tests of the client
methods honoring a context.

* Remove deprecated WithMaxAttempts and WithBackoff

* Update option docs

Include info on envvars.

* Fix lint

* Fix lint errors

* Revert New to accept a context

* Add example test

* Update pkg docs

* go mod tidy

* Use url.URL to form HTTP request URL

* Remove stale TODO in sdk/view (#3149)

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>

* Use unique metric testing data in reader_test (#3151)

Address unresolved TODO.

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>

* Add new metric SDK changes to changelog (#3150)

Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>

* Add integration and config testing to otlpmetricgrpc (#3126)

* Add the GRPCCollector to otest

* Use otest to test otlpmetricgrpc Client

* Add WithHeaders and WithTimeout tests

* Add integration and config testing to otlpmetrichttp (#3155)

* Add HTTPCollector to otest

* Add integration testing for otlpmetrichttp

* Fix NewHTTPCollector docs

* Add config tests

* Fix lint

* Add WithURLPath test

* Add WithTLSClientConfig test

* Ignore depguard for crypto/x509/pkix

This is a testing package that uses the package to generate a weak
testing TLS certificate.

* Add Prometheus exporter code (#3135)

* Add Prometheus exporter example (#3168)

* Add back prom exporter to README.md

* Fix removal changes from #3154 in API

* Update CHANGELOG with PR number

Signed-off-by: Brad Topol <btopol@us.ibm.com>
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
Signed-off-by: GitHub <noreply@github.com>
Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Tobias Klauser <tobias.klauser@gmail.com>
Co-authored-by: petrie <244236866@qq.com>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Brad Topol <btopol@us.ibm.com>
Co-authored-by: Craig Pastro <pastro.craig@gmail.com>
Co-authored-by: Kshitija Murudi <kmurudi@ncsu.edu>
Co-authored-by: Petrie Liu <lpfvip2008@gmail.com>
Co-authored-by: Guangya Liu <gyliu513@gmail.com>
Co-authored-by: Craig Pastro <craig.pastro@auth0.com>
Co-authored-by: ttoad <qq530901331@outlook.com>
Co-authored-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
Co-authored-by: Håvard Anda Estensen <haavard.ae@gmail.com>
Co-authored-by: Mikhail Mazurskiy <126021+ash2k@users.noreply.github.com>
Co-authored-by: Sam Xie <sam@samxie.me>
Co-authored-by: David Ashpole <dashpole@google.com>
Co-authored-by: Alan Protasio <alanprot@gmail.com>
Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
Co-authored-by: Mitch Usher <cull.methi@gmail.com>
Co-authored-by: Gaurang Patel <mr.patelgaurang@gmail.com>
Co-authored-by: Mike Dame <mikedame@google.com>
2022-09-15 18:41:24 -07:00
Aaron Clawson
0e6f9c29c1
Prerelease v1.10.0 (#3158)
* update version file

* Prepare stable-v1 for version v1.10.0

* Update changelog
2022-09-12 15:19:11 -05:00
Joshua MacDonald
49a653682f
Safely truncate over-length string attributes (#3156)
* Safely truncate over-length string attributes

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2022-09-12 09:54:58 -05:00
Aaron Clawson
7aba25d651
Revert Adding attributes to the instrumentation scope.
Revert "Add instrumentation scope attributes (#3131)" (#3154)

This reverts commit 0078faeb0e.

Revert "Add WithScopeAttributes MeterOption to metric API package (#3132)"

This reverts commit 81a9bab814.
2022-09-09 09:06:58 -05:00
Mikhail Mazurskiy
13ddf7d31e
Shut down all processors even on error (#3091) 2022-09-02 11:50:44 -05:00
Tyler Yahn
0078faeb0e
Add instrumentation scope attributes (#3131)
* Add WithScopeAttributes TracerOption to trace API

* Add Attributes field to instrumentation Scope

* Use scope attributes for new Tracer

* Fix stdouttrace expected test output

* Allow unexported Set fields in sdk/trace test

* Export instrumentation scope attrs in OTLP

* Add changes to the changelog

* Fix imports with make lint

* Add unit tests for WithScopeAttributes

* Fix English in Scope documentation
2022-08-31 15:19:50 -07:00
Tyler Yahn
454d57b720
Fix sdk/instrumentation pkg docs (#3130) 2022-08-31 12:01:02 -07:00
Mitch Usher
55b49c407e
Update tracer to guard for a nil ctx (#3110)
* Update tracer to guard for a nil ctx

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2022-08-26 08:53:33 -05:00
Aaron Clawson
8423364f5a
Update golangci-lint to v1.48.0 (#3105)
* Update golangci-lint to v1.48.0

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2022-08-24 21:42:28 -05:00
Joshua MacDonald
09bf345912
Change the inclusivity of exponential histogram bounds (#2982)
* Use lower-inclusive boundaries

* make exponent and logarithm more symmetric

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
2022-08-24 13:09:37 -05:00
Håvard Anda Estensen
eb55e60d3b
Replace ioutil with io and os (#3058) 2022-08-03 14:45:05 -07:00
Tyler Yahn
e99a0ac0b5
Release v1.9.0 (#3052)
* Bump versions in versions.yaml

* Prepare stable-v1 for version v1.9.0

* Prepare experimental-schema for version v0.0.3

* Update changelog for release
2022-08-02 08:02:33 -07:00
Tyler Yahn
5568a30723
Add semconv/v1.12.0 (#3010)
* Add semconv/v1.12.0

* Update all semconv use to v1.12.0

Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
2022-07-13 09:55:43 -04:00
Chester Cheung
f7395695b7
Add benchmark metric test for UpDownCounter (#2655)
* add benchmark metric test for UpDownCounter

* move counter annotation up

* fix syncFloat64 to syncInt64

* fix syncFloat64 to syncInt64

* fix go-lint err
2022-07-12 12:12:58 -07:00
Anthony Mirabella
08ff959fc4
Release prep 1.8.0 (#3001)
* Update CHANGELOG and versions.yaml for 1.8.0 release

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Update go-build-tools

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Prepare stable-v1 for version v1.8.0

* Prepare experimental-metrics for version v0.31.0

* Prepare bridge for version v0.31.0

* `make go-mod-tidy` should use `-compat=1.17` now

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Update CHANGELOG.md

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

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2022-07-08 14:23:16 -04:00
Craig Pastro
575e1bb270
Deprecate Library and move all uses to Scope (#2977)
* Deprecate Library and move all uses to Scope

* Add PR number to changelog

* Don't change signatures in stable modules

* Revert some changes

* Rename internal struct names

* A bit more renaming

* Update sdk/trace/span.go

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

* Update based on feedback

* Revert change

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2022-07-06 14:55:46 -04:00
Craig Pastro
5fabad69e3
Move to using Instrumentation Scope (#2976)
* Move to using Instrumentation Scope

* Use type alias, not definition

* Add a changelog entry
2022-06-24 14:17:33 -07:00
Damien Mathieu
a9ab7e0a88
fix data-model link (#2955) 2022-06-14 06:49:05 -07:00
Tobias Klauser
4155b35624
Use ByteSliceToString from golang.org/x/sys/unix (#2924)
Use unix.ByteSliceToString to convert Utsname []byte fields to strings.

This also allows to drop the charsToString helper which serves the same
purpose and matches ByteSliceToString's implementation.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2022-05-26 07:31:35 -07:00
Aaron Clawson
7458aa961b
Move the minimum version to go 1.17 (#2917)
* Move the minimum version to go 1.17

* Update readme and changelog

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2022-05-25 08:04:56 -07:00
Tyler Yahn
1f5b159161
Use already enabled revive linter and add depguard (#2883)
* Refactor golangci-lint conf

Order settings alphabetically.

* Add revive settings to golangci conf

* Check blank imports

* Check bool-literal-in-expr

* Check constant-logical-expr

* Check context-as-argument

* Check context-key-type

* Check deep-exit

* Check defer

* Check dot-imports

* Check duplicated-imports

* Check early-return

* Check empty-block

* Check empty-lines

* Check error-naming

* Check error-return

* Check error-strings

* Check errorf

* Stop ignoring context first arg in tests

* Check exported comments

* Check flag-parameter

* Check identical branches

* Check if-return

* Check increment-decrement

* Check indent-error-flow

* Check deny list of go imports

* Check import shadowing

* Check package comments

* Check range

* Check range val in closure

* Check range val address

* Check redefines builtin id

* Check string-format

* Check struct tag

* Check superfluous else

* Check time equal

* Check var naming

* Check var declaration

* Check unconditional recursion

* Check unexported return

* Check unhandled errors

* Check unnecessary stmt

* Check unnecessary break

* Check waitgroup by value

* Exclude deep-exit check in example*_test.go files
2022-05-19 15:15:07 -05:00
bryan-aguilar
b51c22123a
Integrate go-build-tools crosslink (#2886)
* Add crosslink build tool to makefile

* Execute crosslink prune

* Remove internal crosslink tool

* Add go-build-tools crosslink

* Fix crosslink target

* Execute make crosslink to clean up go.mod files

* Update CHANGELOG

* Misc go.sum update from make precommit

* Update CHANGELOG PR number

* Update crosslink target to include prune
2022-05-06 07:40:59 -07:00
dependabot[bot]
c7cf945d8e
Bump github.com/google/go-cmp from 0.5.7 to 0.5.8 (#2875)
* Bump github.com/google/go-cmp from 0.5.7 to 0.5.8

Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.5.7 to 0.5.8.
- [Release notes](https://github.com/google/go-cmp/releases)
- [Commits](https://github.com/google/go-cmp/compare/v0.5.7...v0.5.8)

---
updated-dependencies:
- dependency-name: github.com/google/go-cmp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Auto-fix go.sum changes in dependent modules

* go mod tidy

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: MrAlias <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <codingalias@gmail.com>
2022-05-02 08:19:09 -07:00
Bogdan Drutu
a9a519277a
Move metric no-op implementation to metric package (#2866)
* Move metric no-op implementation to metric package

This is to be consistent with trace package.

Fixes: https://github.com/open-telemetry/opentelemetry-go/issues/2767

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Update CHANGELOG.md

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

* Update metric/noop.go

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>

* Update noop.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2022-04-28 12:52:10 -07:00
Tyler Yahn
a50cf6aadd
Release v1.7.0 (#2869)
* Bump versions

* Prepare stable-v1 for version v1.7.0

* Prepare experimental-metrics for version v0.30.0

* Prepare bridge for version v0.30.0

* Update changelog
2022-04-28 08:51:40 -07:00
Tyler Yahn
776accd250
Remove unneeded metrictest types (#2864)
* Remove unneeded metrictest types

* Add changes to changelog

* Revert removal of NewDescriptor
2022-04-27 11:38:54 -07:00
Tyler Yahn
fdfc821bac
Add godot linter to golangci (#2845)
Comment should be complete sentences outside of lists with sentence
fragments. This adds the godot linter to check these complete sentences
end with punctuation. If they do not, running fix will append a period.
2022-04-25 13:22:49 -07:00
Aaron Clawson
8982a14707
Create an Inmemory Exporter for test (#2776)
* in memory exporter

* Add comments

* Split tests and address PR comments

* address PR comments.

* Changelog

* fix Changelog.

* Apply suggestions from code review

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

* Add numberkind

* Made the tests require.NoError

* fix the Label changing

* Update CHANGELOG.md

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
2022-04-24 07:49:09 -07:00
Tyler Yahn
c05c3e237d
Add semconv/v1.10.0 (#2842)
* Add the semconv/v1.10.0 package

* Upgrade semconv used to v1.10.0

* Add changes to changelog
2022-04-22 07:41:28 -07:00
Brad Topol
8574d43509
Add semconv/v1.9.0 package (#2792)
* Add semconv/v1.9.0 package
Closes: #2756

Signed-off-by: Brad Topol <btopol@us.ibm.com>

* Updated PR number in CHANGELOG

Signed-off-by: Brad Topol <btopol@us.ibm.com>
2022-04-18 10:38:55 -07:00
Tyler Yahn
a8ea3dbb46
Replace use of old term label with attribute (#2790)
* Replace use of old term label with attribute

The specification has unified on the term attribute to describe
key-value pairs. There exist still many hold-overs of the use of the
term label. This updates those uses or deprecates exported types and
functions in favor of renamed forms.

* fix infinite recursion

* Remove backticks from attribute set docs

* Remove LabelFilterSelector entirely

* Remove Metadata.Labels instead of deprecate

* Update changelog with public changes

* Revert OC err msg
2022-04-18 07:31:31 -07:00
Tyler Yahn
1884de2b4b
Add semconv/v1.8.0 (#2763)
* No wrap RELEASING Semantic Convention Generation section

* Initial generator

* Update template render

* Add exception and schema templates

* Add semconv/internal http unification

* Add http template

* Add licenses header

* Embed the templates

* Update static version in schema tmpl

* Add semconv-generate target to Makefile

Use this target to generate versions of the semconv packages.

* Generate semconv packages

* Update RELEASING to use make semconv-generate

* Add comments to semconvkit

* Generate semconv/v1.8.0

* Use new version of semconv

* Add changes to changelog

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2022-04-16 01:58:24 -04:00
Aaron Clawson
46a10bba88
Fix for delayed global registration (#2784)
* Fix for delayed global registration

* Changelog

* Fix license

* Fix ChangeLog
2022-04-13 19:49:06 -05:00
Anthony Mirabella
33a4673444
Release prep for metric/v0.29.0 (#2782)
* Update changelog and versions for metric/v0.29.0 release

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Prepare experimental-metrics for version v0.29.0

* Prepare bridge for version v0.29.0
2022-04-11 19:46:26 -04:00
Tyler Yahn
8c0951ea94
Release v1.6.3 (#2775)
* Update stable-v1 version in versions.yaml

* Update changelog for release

* Prepare stable-v1 for version v1.6.3
2022-04-07 13:40:14 -07:00
Anthony Mirabella
f08bac5259
Release prep v1.6.2 (#2770)
* update changelog and versions for 1.6.2 release

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Prepare stable-v1 for version v1.6.2

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2022-04-06 17:44:27 -04:00
Brad Topol
c91da4181d
Bring back the metric global package (#2764)
* This PR brings back the metric global package
Closes: 2752

Signed-off-by: Brad Topol <btopol@us.ibm.com>

* updated CHANGELOG.md

Signed-off-by: Brad Topol <btopol@us.ibm.com>

* reformatted CHANGELOG.md

Signed-off-by: Brad Topol <btopol@us.ibm.com>

* Updated change log and removed unnecessary variable declaration

Signed-off-by: Brad Topol <btopol@us.ibm.com>
2022-04-05 07:35:16 -07:00
Tyler Yahn
bbcdc75ede
Remove sdk/export/metric module (#2720)
* Remove the sdk/export/metric module

* Add change to changelog

* Update PR number

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2022-03-29 07:31:09 -07:00
Tyler Yahn
8747a29580
Release v1.6.1 (#2746)
* Upgrade stable-v1 to v1.6.1

* Prepare stable-v1 for version v1.6.1

* Update changelog
2022-03-28 09:50:10 -07:00
Tyler Yahn
0a7cf5abf1
Document Resource options that potentially leak secrets (#2727)
The WithProcess and WithProcessCommandArgs options contain command line
arguments as resource attributes. These could potentially expose user
secrets. Document this fact so users better understand the implications
of using these options.
2022-03-28 07:35:09 -07:00
Tyler Yahn
17667f5eef
Release v1.6.0/v0.28.0 (#2718)
* Update versions.yaml

* Bump version in changelog

* Prepare stable-v1 for version v1.6.0

* Prepare experimental-metrics for version v0.28.0

* Prepare bridge for version v0.28.0

* Update changelog language
2022-03-23 14:24:14 -07:00
Joshua MacDonald
07ad32dc38
Exponential Histogram mapping functions for public use (#2502)
* Exponential Histogram mapping functions for public use

* pr num

* Apply suggestions from code review

👍

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* mapping interface comments

* missed add

* Update CHANGELOG.md

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2022-03-22 12:44:10 -07:00
Vibhav Pant
fdbcf71c8f
Allow setting the Sampler via environment variables (#2517)
* Allow setting the Sampler via environment variables (#2305)

* Add changelog entry.

* Replace t.Setenv with internaltest/SetEnvVariables for Go <= 1.6.

* Handle the lack of a sampler argument without logging errors.

* Add additional test cases and error checks.

* Refactor documentation.

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>

* emitBatchOverhead should only be used for splitting spans into batches (#2512)

* emitBatchOverhead should only be used for splitting spans into batches (#2503)

* limit max packet size parameter

* Add additional errors types, simplify abstractions and error handling

* Make error comparisons less fragile.

* Fix typo in jaeger example (#2524)

* Fix some typos in docs for Go libraries (#2520)

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

* Fix getting-started.md Run function (#2527)

* Fix getting-started.md Run function, it assigns this new context to a variable shared between connections in to accept loop. Thus creating a growing chain of contexts. so every calculate fibonacci request, all spans in a trace.

* add a comment explaining the reason for that new variable

* update example fib

* Bump github.com/google/go-cmp from 0.5.6 to 0.5.7 across the project (#2545)

* update go-cmp to 0.5.7

* fixes go.sums

Co-authored-by: Aaron Clawson <MadVikingGod@users.noreply.github.com>

* Un-escape url coding when parsing baggage. (#2529)

* un-escape url coding when parsing baggage.

* Added changelog

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

* Bump go.opentelemetry.io/proto/otlp from 0.11.0 to 0.12.0 (#2546)

* Update go.opentelemetry.io/proto/otlp to v0.12.0

* Changelog

* Update CHANGELOG.md

Fix's md linting

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

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

* Remove unused sdk/internal/santize (#2549)

* Add links to code examples and docs (#2551)

* Bump github.com/prometheus/client_golang from 1.11.0 to 1.12.0 in /exporters/prometheus (#2541)

* Bump github.com/prometheus/client_golang in /exporters/prometheus

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.11.0 to 1.12.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.11.0...v1.12.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* go mod tidy

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyler Yahn <codingalias@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Optimize evictedQueue implementation and use (#2556)

* Optimize evictedQueue impl and use

Avoid unnecessary allocations in the recordingSpan by using an
evictedQueue type instead of a pointer to one.

Lazy allocate the evictedQueue queue to prevent unnecessary operations
for spans without any use of the queue.

Document the evictedQueue

* Fix grammar

* Add env support for batch span processor (#2515)

* Add env support for batch span processor

* Update changelog

* lint

* Bump golang.org/x/tools from 0.1.8 to 0.1.9 in /internal/tools (#2566)

* Bump golang.org/x/tools from 0.1.8 to 0.1.9 in /internal/tools

Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.1.8 to 0.1.9.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.1.8...v0.1.9)

---
updated-dependencies:
- dependency-name: golang.org/x/tools
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Auto-fix go.sum changes in dependent modules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: MrAlias <MrAlias@users.noreply.github.com>

* Bump github.com/golangci/golangci-lint from 1.43.0 to 1.44.0 in /internal/tools (#2567)

* Bump github.com/golangci/golangci-lint in /internal/tools

Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.43.0 to 1.44.0.
- [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.43.0...v1.44.0)

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

Signed-off-by: dependabot[bot] <support@github.com>

* Auto-fix go.sum changes in dependent modules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: MrAlias <MrAlias@users.noreply.github.com>

* Bump github.com/prometheus/client_golang from 1.12.0 to 1.12.1 in /exporters/prometheus (#2570)

* Bump github.com/prometheus/client_golang in /exporters/prometheus

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.12.0 to 1.12.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.12.0...v1.12.1)

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

Signed-off-by: dependabot[bot] <support@github.com>

* Auto-fix go.sum changes in dependent modules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: MrAlias <MrAlias@users.noreply.github.com>

* Fix TestBackoffRetry in otlp/internal/retry package (#2562)

* Fix TestBackoffRetry in otlp retry pkg

The delay of the retry is within two times a randomization factor (the
back-off time is delay * random number within [1 - factor, 1 + factor].
This means the waitFunc in TestBackoffRetry needs to check the delay is
within an appropriate delta, not equal to configure initial delay.

* Fix delta value

* Fix delta

Co-authored-by: Aaron Clawson <Aaron.Clawson@gmail.com>

* Bump google.golang.org/grpc from 1.43.0 to 1.44.0 in /exporters/otlp/otlptrace (#2568)

* Bump google.golang.org/grpc in /exporters/otlp/otlptrace

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.43.0 to 1.44.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.43.0...v1.44.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Auto-fix go.sum changes in dependent modules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: MrAlias <MrAlias@users.noreply.github.com>

* Bump google.golang.org/grpc from 1.43.0 to 1.44.0 in /example/otel-collector (#2565)

* Bump google.golang.org/grpc in /example/otel-collector

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.43.0 to 1.44.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.43.0...v1.44.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Auto-fix go.sum changes in dependent modules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: MrAlias <MrAlias@users.noreply.github.com>

* Bump google.golang.org/grpc from 1.43.0 to 1.44.0 in /exporters/otlp/otlpmetric (#2572)

* Bump google.golang.org/grpc in /exporters/otlp/otlpmetric

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.43.0 to 1.44.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.43.0...v1.44.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Auto-fix go.sum changes in dependent modules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: MrAlias <MrAlias@users.noreply.github.com>

* Change Options to accept type not pointer (#2558)

* Change trace options to accept type not pointer

Add benchmark to show allocation improvement.

* Update CONTRIBUTING.md guidelines

* Update all Option iface

* Fix grammar in CONTRIBUTING

* Do not store TracerProvider or Tracer fields in SDK recordingSpan (#2575)

* Do not store TracerProvider fields in span

Instead of keeping a reference to the span's Tracer, and therefore also
it's TracerProvider, and the associated resource and spanLimits just
keep the reference to the Tracer. Refer to the TracerProvider fields
when needed instead.

* Make span refer to the inst lib via the Tracer

Instead of holding a field in the span, refer to the field in the parent
Tracer.

* [website_docs] fix page meta-links (#2580)

Contributes to https://github.com/open-telemetry/opentelemetry.io/issues/1096

/cc @cartermp @austinlparker

* Validate members once, in `NewMember` (#2522)

* use NewMember, or specify if the member is not validated when creating new ones

* expect members to already be validated when creating a new package

* add changelog entry

* add an isEmpty field to member and property for quick validation

* rename isEmpty to hasData

So by default, an empty struct really is marked as having no data

* Update baggage/baggage_test.go

Co-authored-by: Aaron Clawson <Aaron.Clawson@gmail.com>

* don't validate the member in parseMember, we alredy ran that validation

We also don't want to use NewMember, as that runs the property
validation again, making the benchmark quite slower

* move changelog entry to the fixed section

* provide the member/property data when returning an invalid error

Co-authored-by: Aaron Clawson <Aaron.Clawson@gmail.com>

* Fix link to Zipkin exporter (#2581)

Currently it is linked to the old package that was moved.

* Unexport EnvBatchSpanProcessor* constants (#2583)

* Move BSP env support to internal

* Use pkg name

* Update env test

* Use internal/env in sdk/trace

* Avoid an extra allocation in applyTracerProviderEnvConfigs.

* Add additional errors for ratio > 1.0.

* Add test cases for ratio > 1.0.

* Update CHANGELOG.md

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
Co-authored-by: jaychung <ken8203@gmail.com>
Co-authored-by: Ben Wells <b.v.wells@gmail.com>
Co-authored-by: Jeremy Kaplan <jeremy@stytch.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: thinkgo <49174849+thinkgos@users.noreply.github.com>
Co-authored-by: Aaron Clawson <Aaron.Clawson@gmail.com>
Co-authored-by: Aaron Clawson <MadVikingGod@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyler Yahn <codingalias@gmail.com>
Co-authored-by: Chao Weng <19381524+sincejune@users.noreply.github.com>
Co-authored-by: Patrice Chalin <chalin@users.noreply.github.com>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
2022-03-21 09:39:30 -07:00
Aaron Clawson
2f8698c3b1
Update versions of dependences (#2710)
github.com/stretchr/testify v1.7.1
github.com/go-logr/logr v1.2.3
github.com/golangci/golangci-lint v1.45.0
golang.org/x/tools v0.1.10
2022-03-21 11:05:16 -04:00
Tyler Yahn
b1c1e781e6
Support general attribute limits for spans (#2677)
* Support general attribute limits for spans

When model specific limits are not set fallback to the general ones
defined by environment variables before defaults for attribute length
and count limits. This is in compliance with the specification.

* Update env pkg unit tests

Test all environment variable helper functions.

* Add changes to changelog

* Update firstInt doc
2022-03-16 14:33:59 -07:00
Tyler Yahn
2cfc5210f2
Release v1.5.0 (#2676)
* Bump stable-v1 from v1.4.1 to v1.5.0

* Remove internal/metric module from versions file

This module was removed from the project.

* Prepare stable-v1 for version v1.5.0

* Update changelog

* Update CHANGELOG.md
2022-03-16 09:13:17 -07:00
Sam Xie
f4ec95d027
Add container id support to Resource (#2418)
* Add container id support to Resource

* Fix wrong test case name

* Add WithContainer option

* Update CHANGELOG

* Fix comments

* Update CHANGELOG

* Use regex to find container id

* Add tests for reading cgroup file

* Update sdk/resource/container.go

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>

* Update format

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2022-03-03 12:13:31 -05:00
Tyler Yahn
0d0a7320e6
Update span limits to comply with specification (#2637)
* PoC for span limit refactor

* Rename config.go to span_limits.go

* Add unit tests for truncateAttr

* Add unit tests for non-string attrs

* Add span limit benchmark tests

* Fix lint

* Isolate span limit tests

* Clean span limits test

* Test limits on exported spans

* Remove duplicate test code

* Fix lint

* Add WithRawSpanLimits option

* Add test for raw and orig span limits opts

* Add changes to changelog

* Add tests for span resource disabled

* Test unlimited instead of default limit

* Update docs

* Add fix to changelog

* Fix option docs

* Do no mutate attribute

* Fix truncateAttr comment

* Remake NewSpanLimits to be newEnvSpanLimits

Update and unify documentation accordingly.

* Update truncateAttr string slice update comment

* Update CHANGELOG.md

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2022-03-03 07:56:07 -08:00
Aaron Clawson
18f4cb85ec
[API EPIC 4/4] Fix tests and examples (#2587)
* Empty All of the metrics dir

* Add instrument api with documentation

* Add a NoOp implementation.

* Updated to the new config standard

* Address PR comments

* This change moves components to sdk/metrics

The Moved components are:
- metric/metrictest
- metric/number
- metric/internal/registry
- metric/sdkapi

* The SDK changes necessary to satasify the new api

* This fixes the remaing tests.

* Update changelog

* refactor the Noop meter and instruments into one package.

* Renamed pkg.Instruments to pkg.InstrumentProvider

Co-authored-by: Aaron Clawson <MadVikingGod@users.noreply.github.com>
2022-03-02 09:50:29 -06:00
Chester Cheung
79f6bc1208
remove old prom-collector depandence (#2643) 2022-03-01 15:09:51 -05:00
Aaron Clawson
a1fff3c258
Add Marshaling implementations for exporters (#2578)
* Add Marshaling implementations for exporters

* Changelog

* Fix changelog

Co-authored-by: Aaron Clawson <MadVikingGod@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2022-02-25 10:28:28 -08:00
Aaron Clawson
8eb376615e
Update BatchSpanProcessor debug message (#2640)
* update debug message

* update changelog

Co-authored-by: Aaron Clawson <MadVikingGod@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2022-02-25 07:55:50 -08:00
Damien Mathieu
a15269a28a
change gc runtime name to go (#2560)
Per the specification: https://github.com/open-telemetry/opentelemetry-specification/pull/2262

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2022-02-23 09:27:52 -08:00
Will Li
98c2c9d96c
Add env support for span limits configuration (#2606)
* add env support for otel_span configuration

Signed-off-by: Cuichen Li <cuichli@cisco.com>

* update changelog

* update changelog and some logic based on comment

* Update CHANGELOG.md

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* add document about retrieve value from environment variable

Signed-off-by: Cuichen Li <cuichli@cisco.com>

* remove trailing whitespace

Signed-off-by: Cuichen Li <cuichli@cisco.com>

* parse environment variable before apply the options

* Update CHANGELOG.md

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

* Update sdk/trace/provider_test.go

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

* Update CHANGELOG.md

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2022-02-17 08:21:13 -08:00
Tyler Yahn
065ba75c4b
Release v1.4.1/v0.27.1 (#2619)
* Update versions.yaml

* Prepare stable-v1 for version v1.4.1

* Prepare experimental-metrics for version v0.27.1

* Prepare bridge for version v0.27.1

* Update CHANGELOG

* Revert "Prepare experimental-metrics for version v0.27.1"

This reverts commit 838743af21.

* Do not release experimental-metrics with v0.27.1
2022-02-16 09:49:05 -08:00
Bogdan Drutu
2a9cedf5fe
Fix race condition in reading the dropped spans number (#2615)
* Fix race condition in reading the dropped spans number

As any race condition this should be consider an undefined behavior, and a patch release should be done.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Update CHANGELOG.md

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

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2022-02-16 09:00:31 -08:00
Tyler Yahn
1bda06288e
Release v1.4.0/v0.27.0 (#2600)
* Update versions.yaml

* Update changelog

* Upgrade stable-v1 to version v1.4.0

* Upgrade experimental-metrics to version v0.27.0

* Upgrade bridge to version v0.27.0

* Update CHANGELOG.md
2022-02-11 08:29:27 -08:00
Tyler Yahn
98bb1056c0
Replace recordingSpan attributes implementation with slice of attributes (#2576)
* Replace recordingSpan attributes implementation

Instead of an LRU strategy for cap-ing span attributes, comply with the
specification and drop last added. To do this, the attributesmap is
replaced with a slice of attributes.

* Remove attributesmap files

* Refine addition algorithm

Unify duplicated code.

Fix deduplication algorithm.

Fix droppedAttributes to always be returned, even if the span has no
attributes.

* Unify span SetAttributes tests

* Doc fix to attr drop order in changelog

* Test span and snapshot attrs

* fix lint

* Add tests for recordingSpan method defaults

* Comment why pre-allocation is not done

* Correct grammar in recordingSpan allocation comment

* Update sdk/trace/tracer.go

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2022-02-07 12:58:05 -08:00
Tyler Yahn
b60d53d316
Unexport EnvBatchSpanProcessor* constants (#2583)
* Move BSP env support to internal

* Use pkg name

* Update env test

* Use internal/env in sdk/trace
2022-02-07 07:57:44 -08:00
Tyler Yahn
d5292e3cd1
Do not store TracerProvider or Tracer fields in SDK recordingSpan (#2575)
* Do not store TracerProvider fields in span

Instead of keeping a reference to the span's Tracer, and therefore also
it's TracerProvider, and the associated resource and spanLimits just
keep the reference to the Tracer. Refer to the TracerProvider fields
when needed instead.

* Make span refer to the inst lib via the Tracer

Instead of holding a field in the span, refer to the field in the parent
Tracer.
2022-02-01 15:20:35 -08:00
Tyler Yahn
bd817df68c
Change Options to accept type not pointer (#2558)
* Change trace options to accept type not pointer

Add benchmark to show allocation improvement.

* Update CONTRIBUTING.md guidelines

* Update all Option iface

* Fix grammar in CONTRIBUTING
2022-02-01 15:51:23 -06:00
Chao Weng
3cf35bdad6
Add env support for batch span processor (#2515)
* Add env support for batch span processor

* Update changelog

* lint
2022-01-28 10:07:21 -06:00
Tyler Yahn
d3bb03883b
Optimize evictedQueue implementation and use (#2556)
* Optimize evictedQueue impl and use

Avoid unnecessary allocations in the recordingSpan by using an
evictedQueue type instead of a pointer to one.

Lazy allocate the evictedQueue queue to prevent unnecessary operations
for spans without any use of the queue.

Document the evictedQueue

* Fix grammar
2022-01-27 13:55:21 -08:00
Tyler Yahn
6e549fe974
Remove unused sdk/internal/santize (#2549) 2022-01-26 13:27:59 -08:00
Aaron Clawson
d1b6a7d66f
Bump github.com/google/go-cmp from 0.5.6 to 0.5.7 across the project (#2545)
* update go-cmp to 0.5.7

* fixes go.sums

Co-authored-by: Aaron Clawson <MadVikingGod@users.noreply.github.com>
2022-01-24 08:35:53 -08:00
Aaron Clawson
f24f52aa06
Debug Logging for sdk/trace (#2500)
* Debug Logging for sdk/trace

* Fixes spelling, adds marshaling to attribute sets

Co-authored-by: Aaron Clawson <MadVikingGod@users.noreply.github.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2022-01-10 19:58:01 -05:00
Bogdan Drutu
9778aa328f
Remove Min/Max unused interfaces from the moved code (#2454)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-12-23 08:35:32 -08:00
Aaron Clawson
8849597744
Dependabot bump (#2477)
* Bump github.com/go-logr/stdr from 1.2.0 to 1.2.2

Bumps [github.com/go-logr/stdr](https://github.com/go-logr/stdr) from 1.2.0 to 1.2.2.
- [Release notes](https://github.com/go-logr/stdr/releases)
- [Commits](https://github.com/go-logr/stdr/compare/v1.2.0...v1.2.2)

---
updated-dependencies:
- dependency-name: github.com/go-logr/stdr
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github.com/go-logr/logr from 1.2.1 to 1.2.2

Bumps [github.com/go-logr/logr](https://github.com/go-logr/logr) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/go-logr/logr/releases)
- [Changelog](https://github.com/go-logr/logr/blob/master/CHANGELOG.md)
- [Commits](https://github.com/go-logr/logr/compare/v1.2.1...v1.2.2)

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

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github.com/go-logr/stdr from 1.2.0 to 1.2.2 in /example/namedtracer

Bumps [github.com/go-logr/stdr](https://github.com/go-logr/stdr) from 1.2.0 to 1.2.2.
- [Release notes](https://github.com/go-logr/stdr/releases)
- [Commits](https://github.com/go-logr/stdr/compare/v1.2.0...v1.2.2)

---
updated-dependencies:
- dependency-name: github.com/go-logr/stdr
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump google.golang.org/grpc in /example/otel-collector

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.42.0 to 1.43.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.42.0...v1.43.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump google.golang.org/grpc in /exporters/otlp/otlpmetric/otlpmetricgrpc

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.42.0 to 1.43.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.42.0...v1.43.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump google.golang.org/grpc in /exporters/otlp/otlptrace

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.42.0 to 1.43.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.42.0...v1.43.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump google.golang.org/grpc in /exporters/otlp/otlptrace/otlptracegrpc

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.42.0 to 1.43.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.42.0...v1.43.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump google.golang.org/grpc in /exporters/otlp/otlpmetric

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.42.0 to 1.43.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.42.0...v1.43.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  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>
Co-authored-by: Aaron Clawson <MadVikingGod@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-12-20 08:54:44 -08:00
Aaron Clawson
134a610440
Fixes because of removal of exact type. (#2459)
Co-authored-by: Aaron Clawson <MadVikingGod@users.noreply.github.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-12-16 15:22:53 -05:00
Bogdan Drutu
4654d78104
Move Aggregator interface to aggregator package (#2444)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-12-15 08:13:48 -08:00
Bogdan Drutu
4702f6fd6f
Deprecate and add warning to remove AtomicFieldOffsets, unnecessary public func (#2445)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-12-15 08:01:14 -08:00
Bogdan Drutu
6cafa6a060
Remove sdk/export/metric module, embed into the sdk/metric (#2382)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-12-13 12:13:03 -08:00
Anthony Mirabella
aedef05e95
Release prep v1.3.0 (#2441)
* Update versions.yaml for release

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Prepare stable-v1 for version v1.3.0

* Prepare experimental-metrics for version v0.26.0

* Prepare bridge for version v0.26.0

* Update CHANGELOG

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-12-10 11:44:16 -05:00
Chester Cheung
a4f183be31
Remove metric MinMaxSumCount kind aggregation (#2423)
* remove metric MinMaxSumCount kind aggregation

* remove related files

* fix unittest

* fix changelog

* remove reference the removed aggregation type

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-12-06 11:47:40 -08:00
dependabot[bot]
ae76e71024
Bump github.com/go-logr/logr from 1.2.0 to 1.2.1 (#2428)
* Bump github.com/go-logr/logr from 1.2.0 to 1.2.1

Bumps [github.com/go-logr/logr](https://github.com/go-logr/logr) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/go-logr/logr/releases)
- [Changelog](https://github.com/go-logr/logr/blob/master/CHANGELOG.md)
- [Commits](https://github.com/go-logr/logr/compare/v1.2.0...v1.2.1)

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

Signed-off-by: dependabot[bot] <support@github.com>

* Auto-fix go.sum changes in dependent modules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: MrAlias <MrAlias@users.noreply.github.com>
2021-12-06 07:59:58 -08:00
Tyler Yahn
31661dd6be
Centralize the retry package for the otlp exporters (#2427)
* Centralize the retry package for the otlp exporters

* Add dependabot config

* Use unified internal/retry module in otlp exporters

* Remove otlpmetric and otlptrace internal/retry module

* Run go mod tidy in otlp{metric,trace}
2021-12-06 07:47:49 -08:00
Aaron Clawson
7e76cd8dd3 Merge remote-tracking branch 'upstream/main' into internal_logging 2021-12-02 19:59:57 +00:00
Aaron Clawson
0f2b54b746 Minor PR fixes 2021-12-01 16:47:46 +00:00
Aaron Clawson
d467ac529a Fixes race, moved into global 2021-11-24 20:06:39 +00:00
Aaron Clawson
8901b22c4f Moved the SetLogger api into otel 2021-11-24 15:54:30 +00:00
Aaron Clawson
a14b53f9b8 Reverted the changes to the error handler. 2021-11-24 15:43:30 +00:00
Tyler Yahn
18d265c57c
Update project minimum supported Go version to 1.16 (#2412)
* Update project min supported Go ver to 1.16

* Add changes to changelog

* Make lint fixes
2021-11-23 13:38:27 -08:00
dependabot[bot]
3a8372e4c1
Bump github.com/benbjohnson/clock from 1.2.0 to 1.3.0 in /sdk/metric (#2410)
* Bump github.com/benbjohnson/clock from 1.2.0 to 1.3.0 in /sdk/metric

Bumps [github.com/benbjohnson/clock](https://github.com/benbjohnson/clock) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/benbjohnson/clock/releases)
- [Commits](https://github.com/benbjohnson/clock/compare/v1.2.0...v1.3.0)

---
updated-dependencies:
- dependency-name: github.com/benbjohnson/clock
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Auto-fix go.sum changes in dependent modules

* Update sdk/metric/go.mod

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-11-22 10:02:14 -08:00
Aaron Clawson
051227c9ed
Added Benchmarks around events (#2405)
* Added Benchmarks around events

Also fixed the attribute benchmarks to reflect the # of attributes in the test

* Fix test txt, and too new a version of time

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-11-22 07:59:41 -08:00
Aaron Clawson
0c553a4ce3 Fix lint, test, and example issues
Removed dead code.
Merged main to fix tests.
2021-11-19 15:34:11 +00:00
Aaron Clawson
0081b5ef09 Merge branch 'main' into internal_logging 2021-11-19 15:31:04 +00:00
Aaron Clawson
8b210d20d4 simplifies error handling, uses internal logger by default 2021-11-17 16:17:04 +00:00
Aaron Clawson
034956199a
Remove bound metric instruments from the API (new champion) (#2399)
* Remove bound metric instruments from the API

* Removed dead code

* Added changelog message

* Added PR number

Co-authored-by: Joshua MacDonald <jmacd@lightstep.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-11-17 07:51:04 -08:00
Tyler Yahn
3811e3449f
Handle nil testSpanProcessor (#2400)
Remove nil check on return from NewTestSpanProcessor as it can never be
nil, addressing #2396. Also, add nil checks for testSpanProcessor
methods to prevent panics.
2021-11-16 08:57:10 -08:00
Joshua MacDonald
b8ae2721ed
Remove metric aggregator Subtract interface (#2350)
* Remove metric aggregator Subtract interface

* Apply suggestions from code review

Co-authored-by: Georg Pirklbauer <georg.pirklbauer@dynatrace.com>

* Apply suggestions from code review

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

* make generate

* update changelog

Co-authored-by: Georg Pirklbauer <georg.pirklbauer@dynatrace.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-11-15 12:50:13 -08:00
Joshua MacDonald
6483b5c114
Remove exact aggregator for histogram instruments (#2348)
* remove exact aggregator

* remove exact kind, including workaround in opencensus

* generate w/ go-1.16

* Apply suggestions from code review

Co-authored-by: ET <evantorrie@users.noreply.github.com>

* cleanup

* Apply suggestions from code review

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

Co-authored-by: ET <evantorrie@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-11-15 10:05:14 -08:00
Brendan Roy
47203fa36b
Delay evaluation of resource.Default to first call (#2371)
* change resource.Default to be evaluated on first call, rather than on import

* guard defaultResource creation with sync.Once, fallback to emtpyResource

* update CHANGELOG

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-11-15 08:46:11 -08:00
Bogdan Drutu
196ccd7050
Fix TODO, use sync.Map to avoid blocking calls (#2381)
* Fix TODO, use sync.Map to avoid blocking calls

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Update sdk/metric/controller/basic/controller.go

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

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-11-13 13:27:29 -08:00
Bogdan Drutu
4d9d882c38
Fix imports in all files except generated files in jaeger exporter (#2383)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-11-13 08:35:04 -08:00
Anthony Mirabella
a65d50a4c6
Prepare for v1.2.0 release (#2377)
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-11-12 11:43:51 -05:00
Aaron Clawson
8d0b098602 Creates a internal facing logging interface
This is a simple loggin interface to be used interally for the sdk.
Included is an exmaple in `namedtracer` run:
```
cd example/namedtracer
go run . >/dev/null
```
2021-11-12 15:23:18 +00:00
Tyler Yahn
dc888a9802
Upgrade packages (#2378)
Bump github.com/golangci/golangci-lint from 1.42.1 to 1.43.0 in /internal/tools.
Bump google.golang.org/grpc from 1.41.0 to 1.42.0 in /exporters/otlp/otlpmetric.
Bump go.opentelemetry.io/proto/otlp from 0.9.0 to 0.10.0 in /exporters/otlp/otlpmetric/otlpmetrichttp.
Bump go.opentelemetry.io/proto/otlp from 0.9.0 to 0.10.0 in /exporters/otlp/otlpmetric.
Bump go.opentelemetry.io/proto/otlp from 0.9.0 to 0.10.0 in /exporters/otlp/otlptrace.
Bump google.golang.org/grpc from 1.41.0 to 1.42.0 in /exporters/otlp/otlpmetric/otlpmetricgrpc.
Bump google.golang.org/grpc from 1.41.0 to 1.42.0 in /exporters/otlp/otlptrace.
Bump go.opentelemetry.io/proto/otlp from 0.9.0 to 0.10.0 in /exporters/otlp/otlptrace/otlptracehttp.
Bump google.golang.org/grpc from 1.41.0 to 1.42.0 in /exporters/otlp/otlptrace/otlptracegrpc.
Bump go.opentelemetry.io/proto/otlp from 0.9.0 to 0.10.0 in /exporters/otlp/otlpmetric/otlpmetricgrpc.
Bump go.opentelemetry.io/proto/otlp from 0.9.0 to 0.10.0 in /exporters/otlp/otlptrace/otlptracegrpc.
Bump github.com/benbjohnson/clock from 1.1.0 to 1.2.0 in /sdk/metric.
Bump google.golang.org/grpc from 1.41.0 to 1.42.0 in /example/otel-collector.
2021-11-11 15:33:55 -08:00
Philip K. Warren
6d2aeb0dc3
Empty queued spans when ForceFlush called (#2335)
* Empty queued spans when ForceFlush called

Update the implementation of ForceFlush() to first ensure that all spans
which are queued are added to the batch before calling export spans.
Create a small ReadOnlySpan implementation which can be used as a marker
that ForceFlush has been invoked and used to notify when all spans are
ready to be exported.

Fixes #2080.

* Add a changelog entry.

* Update CHANGELOG.md

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

* Update sdk/trace/batch_span_processor.go

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

* Improve test case to verify multiple flushes.

* Refactor code to use enqueue.

* Be more defensive on waiting for queue.

Update the handling of the force flush span so we only wait on the
channel if we were able to enqueue the span to the queue.

* Fix linter.

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-11-05 11:34:57 -04:00
Pablo Baeyens
19294aab4c
Add vanity imports to internal packages (#2280)
* `porto -w --include-internal .`

* Bump `porto` to 0.4.0 and include internal files

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-10-29 09:34:37 -07:00
Tyler Yahn
4021872f57
Release stable-v1 as 1.1.0 (#2327)
* Version stable-v1 modset to be 1.0.2 for release

* Prepare stable-v1 for version v1.0.2

* Update changelog

Add new 1.0.2 section and move relevant items that the release will
contain to this section.

* Add article to CHANGELOG entry to correct grammar

* Release 1.1.0 instead of 1.0.2

* Prepare stable-v1 for version v1.1.0

* Apply suggestions from code review

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

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2021-10-27 12:18:40 -07:00
Tyler Yahn
c4ba4811a2
Add semconv/v1.7.0 package (#2320)
* Add semconv/v1.7.0 package

Generated from the v1.7.0 release of the specification using the
semconvgen tool manually. This also updates the project to use this
version of the semconv package.

This does not include the prior, and missing, v1.5.0 and v1.6.0 versions
of the semconv package. They are planned to be added in a follow-on PR.

* Update CHANGELOG.md
2021-10-22 08:43:47 -07:00
Tyler Yahn
23a33739e9
Fix flaky test TestSimpleSpanProcessorShutdownHonorsContextCancel (#2290)
* Fix flaky test TestSimpleSpanProcessorShutdownHonorsContextCancel

* Add changes to changelog

* Prioritize return of exporter error

* Update changelog description

* Fix deadlock bug
2021-10-19 08:13:37 -07:00
dependabot[bot]
e9db0473aa
Bump github.com/jcchavezs/porto from 0.2.1 to 0.3.0 in /internal/tools (#2288)
* Bump github.com/jcchavezs/porto from 0.2.1 to 0.3.0 in /internal/tools

Bumps [github.com/jcchavezs/porto](https://github.com/jcchavezs/porto) from 0.2.1 to 0.3.0.
- [Release notes](https://github.com/jcchavezs/porto/releases)
- [Commits](https://github.com/jcchavezs/porto/compare/v0.2.1...v0.3.0)

---
updated-dependencies:
- dependency-name: github.com/jcchavezs/porto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Auto-fix go.sum changes in dependent modules

* make precommit

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: MrAlias <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <codingalias@gmail.com>
2021-10-15 11:36:56 -07:00
Joshua MacDonald
6df0de12bc
Metrics: Rename sdk/export/metric.ExportKind to aggregation.Temporality (#2274)
* Rename ExportKind to aggregation.Temporality

* Changelog uhhhhhhh

* Apply suggestions from code review

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

* int->uint8

* go generate

* go.sum

* anual edit

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-10-15 11:18:36 -07:00
Tigran Najaryan
e72a235518
Add ability to parse Schema files according to OTEP 0152 (#2267)
* Add ability to parse Schema files according to OTEP 0152

The parser and parsed representation (AST) are placed in a separate
Go module so that they are can be consumed independently without
the need to bring the rest of the SDK.

Ability to use the parsed representation for schema conversions
can be added later.

* Fixes based on PR comments

* Rename "label" to "attributes"

See https://github.com/open-telemetry/oteps/pull/181

* Fixes based on PR comments

* Add README.md

* Wrap the error in Parse()

* Add docs for exporter types

* Use yaml.NewDecoder

* Verify parsed content in the test

* Fix indentation in README example

* Fix README spaces vs tabs

* Correctly space imports

* Add heading to README

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-10-15 09:44:13 -07:00
Joshua MacDonald
478dc4fe40
Metrics: Move the non-API types into sdkapi (#2271)
* move Descriptor to sdkapi, add test

* rename Descriptor to sdkapi

* precommit

* Move the rest of the sdkapi

* use alias for Observation and Measurement

* Changelog

* pr num

* comment Measurement and Observation

* swap comments

* move->moved
2021-10-14 09:06:22 -07:00
Srikanth Chekuri
8ba6da8f3e
Skip links with invalid span context (#2275)
* Skip links with invalid span context

* Add CHANGELOG entry

* Review suggestions
2021-10-12 07:45:10 -07:00
Anthony Mirabella
737275271d
Release prep v1.0.1/v0.24.0 (#2270)
* Update build tools

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Update CHANGELOG and versions.yaml

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Prepare stable-v1 for version v1.0.1

* Prepare experimental-metrics for version v0.24.0

* Prepare bridge for version v0.24.0

* Update releasing documentation and create add-tags make target

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* use multimod from the .tools directory

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* precommit

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-10-01 16:20:32 -04:00
ET
00d8ca5890
Add go-1.17-compatible build directives. (#2263)
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-09-28 09:08:14 -07:00
José Carlos Chávez
099df58e4e
chore: adds vanity import check. (#2255)
* chore: adds vanity import check.

* chore: runs vanity import check on ci.

* fix: set right target on CI.

* fix: fixes install for porto.

* fix: install right proto bin.

* chore: list all files insides the tools directory.

* fix: fixes vanity import target

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

* chore(vanity-imports): adds vanity import support.

* fix: fixes internal generation.

* chore: runs go mod tidy in tools.

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-09-27 22:37:26 -04:00
Joshua MacDonald
3c8e1853f0
Separate InstrumentationLibrary from metric.Descriptor (#2197)
* factor instrumentation library out of the instrument descriptor

* SDK tests pass

* checkpoint work

* otlp and opencensus tests passing

* prometheus

* tests pass, working on lint

* lint applied: MetricReader->Reader

* comments

* Changelog

* Apply suggestions from code review

Co-authored-by: alrex <alrex.boten@gmail.com>

* remove an interdependency

* fix build

* re-indent one

* Apply suggestions from code review

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

* Lint&feedback

* update after rename

* comment fix

* style fix for meter options

* remove libraryReader, let Controller implement the reader API directly

* rename 'impl' field to 'provider'

* remove a type assertion

* move metric/registry into internal; move registry.MeterProvider into metric controller

* add test for controller registry function

* CheckpointSet->Reader everywhere

* lint

* remove two unnecessary accessor methods; Controller implements MeterProvider and InstrumentationLibraryReader directly, no need to get these

* use a sync.Map

* ensure the initOnce is always called; handle multiple errors

* Apply suggestions from code review

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* cleanup locking in metrictest

* Revert "ensure the initOnce is always called; handle multiple errors"

This reverts commit 3356eb5ed0.

* Revert "use a sync.Map"

This reverts commit ea7bc599bd.

* restore the TODO about sync.Map

Co-authored-by: alrex <alrex.boten@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-09-27 08:51:47 -07:00
Tyler Yahn
92551d3933
Prerelease v1.0.0 (#2250)
* Update versions file for 1.0.0 release

* Prepare stable-v1 for version v1.0.0

* Update trace signal status in documentation

* Update changelog

* Update CHANGELOG.md

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

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2021-09-20 13:02:46 -07:00
Joshua MacDonald
360d13027e
Add tests for nil *Resource (#2227)
* Add tests for nil *Resource

* Update sdk/resource/resource_test.go

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

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-09-09 17:36:38 -07:00
Tyler Yahn
9e7812d1fe
Remove the deprecated oteltest package (#2234)
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-09-09 18:49:39 -04:00
Anthony Mirabella
4bfa00347d
Release prep v1.0.0-RC3 (#2218)
* Update release versions

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Prepare experimental-metrics for version v0.23.0

* Prepare bridge for version v0.23.0

* Prepare stable-v1 for version v1.0.0-RC3

* Update CHANGELOG

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-09-03 11:23:58 -04:00
Tyler Yahn
c7ae470a16
Refactor SDK span creation and implementation (#2213)
* Refactor startSpanInternal into a tracer method

The span creation and configuration process is split across the tracer
Start method and the startSpanInternal function, each living in
different files. This adds confusion when developing. It requires the
developer to remember certain parts of the configuration happen in one
place or the other.

This unifies the creation and configuration of a new span. It makes this
unification by creating a newSpan method on the tracer. This method will
do all the configuration needed for a new span other than setting the
execution task tracker. This remains a part of the Start method to
preserve any existing timing and tracing the already exists.

* Add a non-recording span to the SDK

* Assign returned context from runtime trace task

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-09-02 17:30:12 -04:00
Tyler Yahn
04de34a2d6
Update the website getting started docs (#2203)
* Update the website getting started docs

Add a new example, fib, that contains an application for the computation
of Fibonacci numbers. Use this example to update the website getting
started documentation.

* Revise docs english

* Update example/fib/go.mod

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Add a What's Next section

* Clean up intro

* Apply suggestions from code review

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Apply feedback

* Return from Poll on error

* Update website_docs/getting-started.md

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>

* Add root and parent relationship info

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
2021-09-02 08:22:41 -07:00
Joshua MacDonald
a7b9d02167
Rename metric instruments to match feature-freeze API specification (#2202)
* s/ValueRecorder/Histogram/g

* s/ValueObserver/GaugeObserver/g

* s/UpDownSumObserver/UpDownCounterObserver/g

* s/SumObserver/CounterObserver/g

* changelog

* pr num

* unstable->experimental

* Apply suggestions from code review

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

* Apply suggestions from code review

* apply feedback from @evantorrie by hand

* Apply suggestions from code review

Thanks

Co-authored-by: ET <evantorrie@users.noreply.github.com>

* Update sdk/export/metric/metric.go

* Apply suggestions from code review

Thank you @evantorrie !

Co-authored-by: ET <evantorrie@users.noreply.github.com>

* revert getting-started fix let tyler's update remove this text

* more variable name fixes

* test repair

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: ET <evantorrie@users.noreply.github.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-09-01 16:38:37 -04:00
Tyler Yahn
1f527a52ab
Update trace API config creation functions (#2212)
* Update trace API config creation funcs

Follow our style guide and return the config struct instead of pointers.

* Update changelog with changes

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-09-01 15:44:13 -04:00
Roni Lichtman
c0c5ef65eb
Fix typos in resource.go. (#2201)
* Fix typos in resource.go.

* Add a line to CHANGELOG.md with an identifier for the relevant PR.

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-08-30 14:22:06 -04:00
Bhautik Pipaliya
dfc866bd03
Support capturing stack trace (#2163)
* capturing stack trace support

* added changelog entry

* remove error package stack trace support

* modified unnecessary changes to go.sum files

* added EventOption to enable stack trace capturing

* added tests

* added runtime.Stack method and minor changes

* minor changes

* remove redundant line

* fix gihub check on linter

* fix tests

* fix tests

* Update sdk/trace/trace_test.go

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Update sdk/trace/trace_test.go

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-08-13 17:44:18 -04:00
Joshua MacDonald
4e8d667f6e
Support a single Resource per MeterProvider in the SDK (#2120)
* Remove resource from export.Record

* fix bridge/opencensus

* partial fixes in exporters/otlp/otlpmetric

* Use go-cmp to simplify exporter_test

* OTLP http/grpc

* prometheus

* fix stdout (pending PR 2015)

* oc bridge cleanups

* Lint and changelog

* pr num

* cleanup

* revert

* fix multiple

* always merge the environment

* lint

* precommit

* qualify package names in changelog
2021-08-12 15:44:58 -07:00
Tyler Yahn
a8bb0bf89f
Make the tracetest.SpanRecorder concurrent safe (#2178)
* Make the tracetest.SpanRecorder concurrent safe

The otelgrpc instrumentation in the contrib repository needs a
concurrent safe implementation as the stream testing is done in a
separate goroutine.

* Refactor concurrency tests
2021-08-12 09:12:31 -07:00
Tyler Yahn
87d09df346
Deprecate Array attribute in favor of *Slice types (#2162)
* Deprecate Array attribute in favor of *Slice types

* Use new attr types in Jaeger exporter

* Use slice attr types in otlpmetric

* Use slice attr types in otlptrace

* Use slice attr types in zipkin exporter

* Remove array attr test from deprectated oteltest func

* Use StringSlice for cmd arg resource attr

* Add changes to the changelog

* Remove use of deprecated Array func
2021-08-12 08:05:42 -07:00
Joshua MacDonald
df384a9a33
Move InstrumentKind into the new metric/sdkapi package (#2091)
* Move InstrumentKind into the new metric/sdkapi package

* remove the alias

* remove the alias (everywhere)

* Changelog

* Add a test

* merge updates

* fix changelog

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-08-11 16:02:28 -07:00
Tyler Yahn
b1d1d52959
Move OC bridge integration tests to own mod (#2165)
Use the default SDK to test the OpenCensus bridge. In order to not add
the SDK as a dependency to the bridge module and require users to depend
on it if they use the bridge these tests are moved to a new dedicated
test module.
2021-08-09 09:24:43 -07:00
Sean Schade
b8561785c0
fix(2138): add guard to constructOTResources to return an empty resource (#2139)
* fix(2138): add guard to constructOTResources to return an empty resource when attributes are not supplied

Fixes: https://github.com/open-telemetry/opentelemetry-go/issues/2138

* 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>
2021-07-29 10:09:07 -07:00
Tyler Yahn
11f62640ee
Add a SpanRecorder to the sdk/trace/tracetest (#2132)
* Add a SpanRecorder to the sdk/trace/tracetest

* Add changes to changelog

* Run make precommit

* Rename tests
2021-07-29 10:00:58 -07:00
Anthony Mirabella
7939841868
pre-release v1.0.0-RC2 (#2133)
* update versions for 1.0.0-RC2

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Prepare for versions v1.0.0-RC2

* Update CHANGELOG

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-07-26 15:09:33 -04:00
Tyler Yahn
bbe6ca40a7
Deprecate oteltest.Harness for removal (#2123)
* Deprecate oteltest.Harness for removal

* Add changes to changelog

* Alias oteltest.Harness to internaltest

* Update oteltest/tracer_test.go

remove `oteltest` import.

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-07-26 11:40:36 -04:00
Tyler Yahn
7a624ac21c
Deprecated the oteltest.TraceStateFromKeyValues function (#2122)
* Deprecated the oteltest.TraceStateFromKeyValues func

* Update changelog

* make precommit
2021-07-26 11:12:53 -04:00
Nelson Ghezzi
ece1879fae
Removed dropped link's attributes field from API package (#2118)
* Removed DroppedAttributeCount field from Link struct

* Reintroduced DroppedAttributeCount with a wrapper struct

* Added Link type in otel/sdk package and used it instead of Trace API equivalent

* Added changelog entry

* Linting fix in changelog

* Deleted duplicated changelog section added by mistake

* Expanded changelog entry and moved it under the 'Added' section

* Explicitly mentioned otel/trace library in changelog entry under 'Removed' section to avoid ambiguity
2021-07-26 11:06:41 -04:00
Tyler Yahn
03902d98bb
Rename sdk/trace/tracetest test.go -> exporter.go (#2128) 2021-07-23 13:38:26 -04:00
csuzhang
25d739b0a0
Remove resource.WithBuiltinDetectors() which has not been maintained (#2097)
* remove resource.WithBuiltinDetectors() which has not been maintained

* add changelog file

* Update CHANGELOG.md

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>

* resolved a repeated conflict

* fix unittest error

* fix unittest error

* fix the PR according to suggestion

* fix unittest fail and del repeated testcase in CI system

* Update CHANGELOG.md

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

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-07-22 06:47:09 -07:00
Joshua MacDonald
d57c5a5604
Remove several metrics test helpers (#2105)
* Remove several metrics test helpers

* Lint

* Changelog

* Lint
2021-07-21 13:06:38 -04:00
Bogdan Drutu
9b1a5f7001
Performance improvement: avoid creating multiple same read-only objects (#2104)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-07-20 08:57:22 -07:00
Anthony Mirabella
647af3a0f9
Pre release experimental metrics v0.22.0 (#2101)
* update metrics version set

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Prepare for releasing v0.22.0

* Update CHANGELOG for metrics v0.22.0 release

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Fixup CHANGELOG linking

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-07-19 16:59:45 -04:00
Nelson Ghezzi
0a56233717
Fixed OS type value for DragonFly BSD (#2092)
* Added explicit mapping between GOOS and semconv OS type attribute value

* Added tests for OS type mappings

* Added changelog entry

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-07-19 11:40:30 -04:00
Nelson Ghezzi
484258eb36
OS description attribute detector (#1840)
* Added Linux-specific detector for the os.description attribute

* Generalized OS description detector with placeholder function for unimplemented OSes

* Extended osDescription function to *nix OSes based on golang.org/x/sys/unix

* Added WithOS resource configuration function to configure all of the OS resource attributes

* Implemented osDescription funtion for Windows OS

* Improved documentation header for *nix version of the osDescription function

* Added support for reading os-release file

* Added/updated documentation headers for *nix implementation of osDescription and related functions

* Changelog update

* Added support for reading macOS version information

* Mock approach to test OS description attribute

* Extracted common function getFirstAvailableFile to read the first available file from a list of candidates

* Upgraded golang.org/x/sys

* Changelog update

* Fixed wrong function name in documentation header for WithOSDescription

* Updated documentation header for platformOSDescription function

* Renamed restoreProcessAttributesProviders test helper function

The function restoreProcessAttributesProviders was renamed to simply
restoreAttributesProviders to better reflect its broader scope, which
not only applies to process attribute's providers.

* Fixed os_linux.go overriding build tags defined inside the file

The suffix on os_linux.go was overriding the build tags already defined
in that file. The file was renamed to os_release_unix.go, reflecting
the main function defined in the file.

For consistency, os_darwin.go was renamed to os_release_darwing.go, as
its primary purpose is to also define the osRelease function.

* Removed use of discontinued function resource.WithoutBuiltin

* Added PR number to changelog entries

* Updated go.sum files after run of make lint

* Linux implementation: ignore lines with an empty key

* Linux implementation: avoid unquoting strings less than two chars

* WIP: added tests for Linux support functions

* WIP: added tests for charsToString and getFirstAvailableFile functions

* Replaced os.CreateTemp with ioutil.TempFile as the former only exists in Go 1.16

* Added unameProvider type to decouple direct reference to unix.Uname function inside Uname()

* Added tests for Uname() function

* Replaced *os.File with io.Reader in parseOSReleaseFile to ease testing

* Added tests for parseOSReleaseFile function

* Darwin implementation: added tests for buildOSRelease function

* Replaced *os.File with io.Reader in parsePlistFile to ease testing

* Darwin implementation: added tests for parsePlistFile function

* Type in documentation header for Linux osRelease function

* Extracted logic for reading specific registry values into helper functions

* Added basic tests for Windows version of platformOSDescription and helper functions

* Manually formatted uint64 to strings to have an uniform interface for test assertions

* Asserts there's no error when opening registry key for testing

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

* Simplified subtests by using a single test with multiple asserts

* go.sum update after running make

* Fix typo

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

* WIP: added placeholder implementation of platformOSDescription for unsupported OSes

* Fixed typo on osRelease documentation header

Co-authored-by: Chris Bandy <bandy.chris@gmail.com>

* Fixed typo on test case name for ParsePlistFile tests

Co-authored-by: Chris Bandy <bandy.chris@gmail.com>

* Linter fix in changelog

* go.sum updates after running make

* Used strings.Replacer instead of multiple strings.ReplaceAll calls

* Optimized implementation of charsToString

* Safer temporary file deletion with t.TempDir()

* Used t.Cleanup() for safer mocking of runtime providers in OS resource tests

* Handled optionality of DisplayVersion registry key.

For example, CI machine runs on:
Windows Server 2019 Datacenter (1809) [Version 10.0.17763.1999]

So, to not add an extra white space due to missing DisplayVersion,
this value is checked to be not empty, and only in such case a
trailing space is added for that component.

* Workaround to handle the case of DisplayVersion registry key not present

* Excluded unsupported GOOSes by negation of supported ones

* go.sum update after running make

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Chris Bandy <bandy.chris@gmail.com>
2021-07-08 13:35:27 -07:00
David Ashpole
9e8f523d75
when using WithNewRoot, don't use the parent context for sampling (#2032)
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-06-28 09:17:12 -07:00
Ali Josie
311a6396a7
fix documentation for trace.Status (#2029) 2021-06-24 12:41:08 -07:00
csuzhang
d5d4c87f6d
Add HTTP metrics exporter for OTLP (#2022)
* add HTTP support for OTLP metrics exporter

* add to changelog

* fix unit test not covered before

* add otlpmetrichttp module to .github/dependabot.yml

* add test file for client.go

* run make commit to clean repository

* fix err occurs in TestCancelledContext

* fix err in TestCancelledContext which is nil

* fix err in TestCancelledContext which is nil, occurs occasionally

* fix unittest err in TestCancelledContext which occurs occasionally

* fix ineffectual assignment to err when running lint

* Update CHANGELOG.md

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

* Update exporters/otlp/otlpmetric/otlpmetrichttp/doc.go

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

* Update exporters/otlp/otlpmetric/otlpmetrichttp/doc.go

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

* del options that not used in http exporter metrics

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-06-22 11:45:17 -07:00
Tyler Yahn
51dbe3cb41
Remove deprecated exporters (#2020)
* Remove deprecated exporters

* Remove codecov config entry for Jaeger exporter

* Remove exporters from dependabot config
2021-06-19 17:29:56 -04:00
Anthony Mirabella
ced177b795
Pre-release 1.0.0-RC1 (#2013)
* Add versions.yaml to specify module version sets
* Prepare for releasing v1.0.0-RC1
* Update experimental-metrics and bridge module sets to v0.21.0
* Prepare for releasing v0.21.0
* Fixup go.mod version references
* Update version.go
* Update CHANGELOG
* Update godoc references to "pre-GA phase" for RC1 packages
* Update website_docs for 1.0.0-RC1

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-06-18 11:22:16 -04:00
Tyler Yahn
694c9a413d
Interface stability documentation (#2012)
* Interface stability documentation

* Update versioning policy

* Update CONTRIBUTING

* Document how to extend immutable interfaces

* Markdown format VERSIONING changes
2021-06-18 07:56:11 -07:00
Anthony Mirabella
39fe8092ed
Add span.TracerProvider() (#2009)
* Ensure that no-op tracer still progates non-recording spans

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Add `TracerProvider` to the `trace.Span` interface

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Remove config from oteltest.Tracer as it can be accessed through the provider

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-06-17 12:05:44 -04:00
Anthony Mirabella
c30cd1d0fd
Split stdout exporter into stdouttrace and stdoutmetric (#2005)
* Split stdout exporter into stdouttrace and stdoutmetric

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Remove unused options from stdouttrace and stdoutmetric exporters

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Update stdout exporter references in website docs

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Update docs to include correct import paths, properly describe exporter scope

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Remove pointless options to disable signals from what are now single-signal exporters

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-06-16 11:32:42 -04:00
Tyler Yahn
3be9813d56
Deprecate the exporters in the "trace" and "metric" sub-directories (#1993)
* Rename exporters/metric/prometheus

* Rename exporters/trace/jaeger

* Rename exporters/trace/zipkin

* Fix dependabot config and make test

* Update README docs

* Deprecate exporters instead of remove them

* Update dependabot with old modules

* Run crosslink

* Add lint override for known deprecated pkg

* Update PR number
2021-06-12 11:39:22 -07:00
Gustavo Silva Paiva
b33edaa552
OTLP metrics gRPC exporter (#1991)
* OTLP metrics gRPC exporter

* add newline

* address comments
2021-06-11 13:25:56 -07:00
Anthony Mirabella
64b640cc26
Remove old OTLP exporter (#1990)
* Remove trace export support from exporters/otlp

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Update otlp exporter example test to use metric/global package

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Update CHANGELOG

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* completely excise exporters/otlp

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-06-11 11:18:17 -04:00
Anthony Mirabella
7728a52135
Remove dependency on metrics packages (#1988)
* Declare internal/metric module to version it separately

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Remove dependency on metrics module from soon-to-be-stable modules

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Add PR ID to CHANGELOG

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* rename metric/oteltest to metric/metrictest

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Fix metrictest package name in CHANGELOG

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-06-10 15:05:25 -04:00
Anthony Mirabella
cdf67ddfa3
Update semantic conventions to v1.4.0, move to versioned package (#1987)
* Update semantic conventions to v1.4.0, move to versioned package

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* precommit wants explicit import path renaming for semconv/v1.4.0

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Fix semconv import path in stdout exporter example

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-06-10 13:03:43 -04:00
Tyler Yahn
4883cb119d
Refactor exporter creation functions (#1985)
* Remove InstallNewPipeline/NewExportPipeline funcs

* Rename stdout NewExporter to New

* Rename prometheus NewExporter func to New

* Rename Jaeger exporter NewRawExporter func to New

* Rename zipkin exporter NewRawExporter func to New

* Rename otlp exporter creation funcs

* Rename processortest exporter creation funcs

* Update PR number in changelog

* Fix spelling error

* Rename remaining NewUnstartedExporter in otlp

* Remove unused testing file
2021-06-10 09:22:47 -07:00
Tyler Yahn
87cc1e1fea
Test BatchSpanProcessor export timeout directly (#1982)
Test the export timeout by waiting indefinitely for the export to
timeout instead of having a second timer, in its own goroutine, timeout.
The algorithm this replaces fails on machines that are slow and the one
meta-timer is given priority to progress over the export timer that is
being testing, resulting in a false-negative test result.

Move the testing of a BatchSpanProcessor export timeout to its own test
function. This removes the bloat this introduces to the other testing
options and allows customization that enable the testing in a
deterministic manner.
2021-06-09 14:05:10 -07:00
Anderson Queiroz
7a0cee7b3a
Replaces golint by revive and fix newly reported linter issues (#1946)
* replaces golint by revive and fix newly reported linter issues

* add pull request ID to CHANGELOG.md

* Update internal/matchers/temporal_matcher.go

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

* fix pull request issues

* explains why the linter is disabled

* Update semconv/http.go

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

* Update metric/unit/unit.go

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

* restores 'example/passthrough/go.sum' to original state

* fix after rebase

* export ErrInvalidAsyncRunner again and add nolint

* Update trace/tracestate.go

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

* Update sdk/metric/sdk.go

Co-authored-by: Aaron Clawson <Aaron.Clawson@gmail.com>

* Fix ContextWithoutBaggage comment

* Fix SpanEndOption comment

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Aaron Clawson <Aaron.Clawson@gmail.com>
Co-authored-by: Tyler Yahn <codingalias@gmail.com>
2021-06-08 10:10:01 -07:00
Tigran Najaryan
46d9687a35
Add Schema URL support to Resource (#1938)
This implements specification requirement:
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/sdk.md#resource-creation

- Changes `resource.NewWithAttributes` to require a schema URL. The old function
  is still available as `resource.NewSchemaless`. This is a breaking change.
  We want to encourage using schema URL and make it a conscious choice to have a
  resource without schema.

- Merge schema URLs acccording to the spec in resource.Merge.

- Several builtin resource detectors now correctly populate the schema URL.

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-06-08 09:46:42 -07:00
Gustavo Silva Paiva
2371bb0a09
add otlp trace http exporter (#1963)
* add otlp trace http exporter

* remove `WithTraces*` options

* address discussions

* run make precommit

* rename WithURLPath option
2021-06-07 07:57:58 -07:00
Anthony Mirabella
a75ade4edb
sdk/resource: honor OTEL_SERVICE_NAME in fromEnv resource detector (#1969)
* sdk/resource: honor OTEL_SERVICE_NAME in fromEnv resource detector

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* go fmt is still my friend, even if I forget about it occasionally

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Fix import ordering

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-06-04 11:19:15 -07:00
dependabot[bot]
435a63b3c5
Bump github.com/google/go-cmp from 0.5.5 to 0.5.6 (#1954)
* Bump github.com/google/go-cmp from 0.5.5 to 0.5.6

Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.5.5 to 0.5.6.
- [Release notes](https://github.com/google/go-cmp/releases)
- [Commits](https://github.com/google/go-cmp/compare/v0.5.5...v0.5.6)

Signed-off-by: dependabot[bot] <support@github.com>

* Auto-fix go.sum changes in dependent modules

* Auto-fix go.sum changes in dependent modules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-06-01 11:53:02 -07:00
Gustavo Silva Paiva
dfe2b6f143
OTLP trace gRPC exporter (#1922)
* draft: otlp exporter trace grpc

* address comments and improve usability

* change passthrough example to go 1.15

* code cleanups

* copy dependencies to `otlptrace`

* fix typo on makefile

* address comments

* update code with latest changes

* fix comments

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-05-27 13:47:01 -07:00
Tigran Najaryan
bd935866f4
Add schema URL support to Tracer (#1889)
This adds support for schema URL to the Tracer according to the specification:
https://github.com/open-telemetry/opentelemetry-specification/pull/1666
(Link to replaced by the link to the spec after that PR is merged)

For the future: once the proto is updated we will need to populate the
schema_url field in the messages.
2021-05-27 15:22:38 -04:00
Aaron Clawson
c1f460e097
Update API configs. (#1921)
* Added Reason to Contributing and Updated TracerConfig

* PR comment fixup

* Changed how span Options work.

* Fix Markdown linting

* Added meter configs.

* Fixes from PR comments

* fix for missing instrument

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-05-27 07:53:56 -07:00
Hu Shuai
ea1434c3d4
Fix some golint issues (#1947)
Signed-off-by: Hu Shuai <hus.fnst@cn.fujitsu.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-05-24 08:08:29 -07:00
Tyler Yahn
0eeb8f87e9
Refactor Tracestate (#1931)
* Refactor TraceState

* Update tracecontext propagator to use new TraceState

* Add TraceStateFromKeyValues to oteltest

* Use oteltest to test TraceState

* Replace IsEmpty with Len for TraceState

* Replace ParseTraceState with ParseTraceStateString

* Clean up naming

* Add immutability test for TraceState

* Add changes to changelog

* Fixes

* Document argument type change in changelog

* Address feedback

Remove circularity of TestTraceStateLen.
2021-05-24 07:53:26 -07:00
David Ashpole
d3b1280863
Add Passthrough example (#1912)
* Add passthrough example

* Update example/passthrough/handler/handler.go

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

* Update example/passthrough/README.md

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

* Apply suggestions from code review

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

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
2021-05-18 14:03:10 -07:00
Robert Pająk
d23cc61b93
Refactor configs (#1882)
* trace: Refactor sampling config

* tracer: Refactor TracerProviderConfig

* Update the changelog

* Refactor sdk/metric/controller/basic config

* Refactor sdk/metric/processor/basic config

* Refactor sdk/resource config

* Refactor oteltest config

* Refactor exporters/otlp configs

* Refactor exporters/stdout config

* Refactor exporters/trace/jaeger configs

* Refactor exporters/trace/zipkin config

* Unexport stdout.NewConfig

* Refactor zipkin.go

* Refactor provider.go
2021-05-14 13:28:28 -07:00
Tyler Yahn
b6d5442ff6
Remove the Tracer method from the Span API (#1900)
* Remove the Tracer method from the Span API

* Update CHANGELOG with changes

* Update CHANGELOG.md

* Fix misspell

* Address feedback
2021-05-12 11:19:50 -04:00
dependabot[bot]
696af78754
Bump github.com/benbjohnson/clock from 1.0.3 to 1.1.0 in /sdk/metric (#1532)
* Bump github.com/benbjohnson/clock from 1.0.3 to 1.1.0 in /sdk/metric

Bumps [github.com/benbjohnson/clock](https://github.com/benbjohnson/clock) from 1.0.3 to 1.1.0.
- [Release notes](https://github.com/benbjohnson/clock/releases)
- [Commits](https://github.com/benbjohnson/clock/compare/v1.0.3...v1.1.0)

Signed-off-by: dependabot[bot] <support@github.com>

* Auto-fix go.sum changes in dependent modules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-05-10 09:36:03 -07:00
Gábor Lipták
d20e722830
CI builds validate against last two versions of Go, dropping 1.14 and adding 1.16 (#1865)
Signed-off-by: Gábor Lipták <gliptak@gmail.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-05-06 17:14:11 -04:00
Tyler Yahn
cbcd4b1a3d
Redefine ExportSpans of SpanExporter with ReadOnlySpan (#1873)
* Remove TODO from ReadOnlySpan interface

* Remove the Tracer method from the ReadOnlySpan

This is not required by the specification nor the use of this interface.

* Remove IsRecording from the ReadOnlySpan interface

A read-only span value does not need to know if updates to it will be
recorded. It by definition cannot be updated so no point in
communicating if an update would be recorded.

* Document the ReadOnlySpan interface

* Rename messageEvent* to just event*

* Move the SpanSnapshot into its own file

* Update ReadOnlySpan interface with meta info methods

Add the DroppedAttributes, DroppedLinks, DroppedEvents, and
ChildSpanCount methods to the interface to return additional information
about the span not specified by the specification, but that we are
already providing.

* Add SpanStub to the sdk/trace/tracetest pkg

* Redefine ExportSpans of SpanExporter with ReadOnlySpan

* Rename SpanSnapshot to snapshot and purge docs

* Remove Snapshot method from snapshot type

This method is a hold-over from previous version of the ReadOnlySpan
interface is not needed.

* Update CHANGELOG with changes
2021-05-04 16:45:13 -07:00
Tyler Yahn
b7d02db147
Add Status type to SDK (#1874)
Add Status type to SDK

Use this type to encapsulate the Span status similar to the Event type
encapsulating a Span event and the Link type a span link.

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-05-03 12:00:54 -07:00
Tyler Yahn
9bc28f6bc6
Fix existing markdown lint issues (#1866)
* Remove empty sdk README

* Fix markdown lint issues

* Update markdownlint config to ignore single title header

* Remove broken link
2021-04-30 10:51:19 -07:00
Aaron Clawson
7674eebf56
Removed different types of Detectors for Resources. (#1810)
* Removed different types of Detectors for Resources.

This change simplifies different types of collectors into one list. The
order of this list determines how they are applied.  Defaults are
applied when the user does not supply any detectors.  To achieve
default behavior and additional behavior a DefaultDetectors struct has been
created

* missed prometheus test.

* Changed behavior around WithDetectors(nil)

Added examples of use of WithDetectors.

* Added NoOp example

* Changed test to reflect acutal default case

This changes because WithDetector() no longer is the same as not using WithDetector()

* Unexports the noOp detector

* Updated changelog

* Fixes to spelling mistakes.

* Added NewEmptyResouce and unexported builtin detectors

* Fix for prometheus example

* Resource has two Rs

I need to get a new R key it seems.

Co-authored-by: Sam Xie <xsambundy@gmail.com>

* Replaced NewEmptyResource() with New()

* Fix test function name

* Comment fixups.

* Apply suggestions from code review

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

Co-authored-by: Sam Xie <xsambundy@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-04-29 11:12:48 -07:00
Tyler Yahn
ec75390fc4
Fix BSP context done tests (#1863) 2021-04-29 11:01:01 -07:00
Tyler Yahn
8e55f10ad5
Move the Event type from the API to the SDK (#1846)
* Move the Event type from the API to the SDK

This type is not used in the API. It is used in the SDK and then through
the processing pipelines. Move it to the package that originates its use.

* Add changes to changelog

* Update CHANGELOG.md

Co-authored-by: Gustavo Silva Paiva <guustavo.paiva@gmail.com>

Co-authored-by: Gustavo Silva Paiva <guustavo.paiva@gmail.com>
2021-04-29 10:29:48 -07:00
Gustavo Silva Paiva
e399d355cb
drop failed to exporter batches and return error when forcing flush a span processor (#1860)
* drop failed to exporter batches and return error when forcing flush a span processor

* changelog

* changelog

* change should export condition

* cleanup
2021-04-29 09:42:11 -07:00
Tyler Yahn
f6a9279a86
Honor context deadline or cancellation in SimpleSpanProcessor.Shutdown (#1856)
* Honor context Done in SSP Shutdown

* Update PR number in changelog

* Update comment

* Add tests

* Make tests more concise

* Restructure tests for readability
2021-04-28 10:15:00 -07:00
Tyler Yahn
62cd933da5
Handle Resource env error when non-nil (#1851)
* Handle Resource env error when non-nil

* Add changes to changelog

* Update PR number
2021-04-27 09:52:48 -07:00
Tyler Yahn
24a91628f1
Document the SSP is not for production use (#1844) 2021-04-27 09:23:09 -07:00
Tyler Yahn
02d8bdd5d9
Release v0.20.0 (#1837)
* Prepare for releasing v0.20.0

* Update changelog

* Add version validation test

* lint
2021-04-23 11:19:07 -07:00
Nelson Ghezzi
aa66fe75e4
OS and Process resource detectors (#1788)
* WIP: OS and Process resource detectors

* Completed documentation headers

* Added empty test files for OS and Process resource functions

* Split long line

* Added resource.WithOS function test

* Added resource.WithProcess* functions tests

* Renamed osDetector and WithOS function to better reflect they only add the os.type attribute

* Updated changelog

* WIP: possible use of wrappers for getting attribute values

* Refined implementation of wrapper functions providing os/runtime/user information

* Added PR number to new changelog entries

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

* Fix wrong function name in documentation header

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

* Fixed wording in WithProcessOwner documentation header

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

* Updated osTypeDetector

* Replaced ToUpper with ToLower to match the current convention.
* Used runtimeOS provider to get the OS name.

* Adapted WithOSType test to mock runtime providers

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-04-23 08:28:13 -07:00
Li Zhijian
7374d67961
Fix Links documents (#1835)
Signed-off-by: Hu Shuai <hus.fnst@cn.fujitsu.com>

Co-authored-by: Hu Shuai <hus.fnst@cn.fujitsu.com>
2021-04-23 08:04:59 -07:00
Dhruv Vora
0032bd6499
Fix default merging of resource attributes from environment variable (#1785)
* updated controller to merge default resource with environment resource

* updated TracerProvider to merge default resource with environment resource

* Added Changelog entry

* Added resource.Environment(), modified resource.Default() for environment vairable and WithResource() configuration for TracerProvider and Controller

* Update CHANGELOG.md

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Moved environment detector to defaultResource initialization, added test cases

* Changes to default resource initialization

* made changes to the test cases

* added merging of resource with environment resource

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-04-21 14:53:12 -04:00
Tyler Yahn
96c5e4baac
Add SpanProcessor example for Span annotation on start (#1733)
* Add SpanProcessor example for Span annotation on start

* Remove New* func to make more concise

* Add doc for AttrsFunc

* Move overview comment to top

* Update based on feedback

* Remove AttrsFunc type

* Use OnEnd to print instead of separate exporter

* Move the tracer declaration
2021-04-21 14:40:52 -04:00
Iris Song
66389ad617
Update function docs in sdk.go (#1826)
* Made copy of attribute.KeyValue

* Add comments and test

* move test to sdk/metric

* Update CHANGELOG.md

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Add label order assertions for final results

* Update CHANGELOG PR number

* Revert code changes and update docs

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-04-20 14:29:13 -07:00
Tyler Yahn
2817c09174
Merge sdk/export/trace into sdk/trace (#1778)
* Merge sdk/export/trace into sdk/trace

* Update package move

* Add changes to changelog

* Add PR number to changelog
2021-04-07 08:03:43 -07:00
Cynthia Du
0d49b592ec
Add test to check bsp ignores OnEnd and ForceFlush post Shutdown` (#1772)
* Add test to check bsp ignores OnEnd and ForceFlush post shutdown

* Add to CHANGELOG

* Check for err return value

* Stop test execution if there's error with shutting down bsp

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

* Use assert to check there's no error calling bsp.ForceFlush()

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

* Import require

* Add error message for assertion on be.len()

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

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-04-06 14:54:26 -07:00
Tyler Yahn
e9aaa04b8f
Record links/events attribute drops independently (#1771)
* Record links/events attribute drops independently

* Update PR number

* Remove unneeded span.droppedAttributeCount
2021-04-06 07:51:15 -07:00
Matej Gera
3c7facee73
Add ExportTimeout option to batch span processor (#1755)
* Add ExportTimeout option

* Adjust tests

* Update CHANGELOG

* Beef up the exporter timeout test

* Beef up exporter test - attempt #2

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-04-05 10:38:03 -07:00
Anthony Mirabella
c6b92d5b20
Make TraceFlags spec-compliant (#1770)
* Make TraceFlags spec-compliant

* Remove `trace.FlagsDebug` and `trace.FlagsDeferred`
  * These are used only by the B3 propagator and will be handled there in the `context.Context`
* Make `trace.TraceFlags` a defined type, aliasing `byte`
* Move `IsSampled` method from `trace.SpanContext` to `trace.TraceFlags`
* Add `Sampled(bool)` method to `trace.TraceFlags`
* Implement `Stringer` and `json.Marshaler` for `trace.TraceFlags`

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Rename `TraceFlags.Sampled()` to `TraceFlags.WithSampled()` for consistency

* Restore `SpanContext.IsSampled()` method.

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2021-04-05 10:21:42 -07:00
Jack Wink
33699d242d
Adds semantic conventions for exceptions (#1492)
Adds support for the opentelemetry exceptions semantic conventions. In
short, this has RecordError produce an exception event with exception
attributes instead of using the error event and error attributes.

While golang does not have exceptions, the spec itself does not
differentiate between errors and exceptions for recording purposes.
RecordError was kept as the method name, both for backwards
compatibility and to reduce confusion (the method signature takes in a
golang error object). The spec appears to allow this, as it suggests the
method is optional and signature may reflect whatever is most appropriate
for the language implementing it.

It may seem non-intuitive to log an exception event from a method called
RecordError, but it's beneficial to have consistent behavior across all
opentelemetry SDKs. Downstream projects like the opentelemetry-collector
can build off of the published API and not special case behaviors from
individual languages.
2021-04-01 13:07:46 -07:00
humivo
928e3c38e6
Modify ForceFlush to abort after timeout/cancellation (#1757)
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-04-01 10:42:19 -07:00
bryan-aguilar
d575865b1e
Fix span IsRecording when not sampling (#1750)
* Adjust TestRecording fucntion to validate with and without sampling. correct span.isRecording logic to return false when not being sampled

* Changed to TestExectutionTracerTaskEnd to only expect 1 span to increment instead of all 3

* added changelog entry

* Updated CHANGELOG.md

* Remove newline from isRecording()

* Rewrite TestSpanIsRecording to include table based
tests and check for when span is ended immediately

* Update sdk/trace/trace_test.go

Improve readability of test name

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Update sdk/trace/trace_test.go

Improve readability of test name

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Update CHANGELOG.md

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

* Update sdk/trace_test.go test comments

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

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-03-30 13:26:42 -07:00
Tyler Yahn
20c93b01eb
Update SamplingParameters (#1749)
* Update SamplingParameters

Remove HasRemoteParent fields from SamplingParameters. The
HasRemoteParent field is a duplicate of the Remote field of the parent
span context contained in the ParentContext.

Change the `ParentContext` field from storing a `SpanContext` to a
`context.Context` that holds the parent span. This is to conform with
the OpenTelemetry specification and resolve #1727.

* Update PR number
2021-03-30 10:34:40 -07:00
Tyler Yahn
97501a3fee
Update SpanSnapshot to use parent SpanContext (#1748)
* Update SpanSnapshot to use parent SpanContext

Having only the parent span ID and a separate field to communicate if
the parent was remote does not provide a comprehensive view of the
parent span nor is it an efficient way to transmit this information.
Update the SpanSnapshot to have a `Parent` field that contains the
parent span context. This field replaces the ParentSpanID and
HasRemoteParent fields.

* Revert SamplingParameters span change

* Update CHANGELOG with PR number
2021-03-30 08:59:54 -07:00
Tyler Yahn
604b05cbcf
Store current Span instead of local and remote SpanContext in context.Context (#1731)
* Store Span instead of local/remote SpanContext in Context

Now that the SpanContext has a remote identifier, storing a Span's
SpanContext two separate ways in a Context (one for local another for
remote) is unnecessary and adds complication throughout the project when
determining heredity of a Span. This moves to storing the Span directly
in the Context uniformly (for both local and remote) as current Span. In
the process, it updates the getter/setter functionality the `trace`
package provides and replaces the distributed heredity logic throughout
the project with just using the current Span as the parent if it exists.

* Update trace/context.go

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Assert propagators context remote state

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-03-29 08:55:44 -07:00
Tyler Yahn
382c7ced31
Remove hasRemoteParent field from SDK span (#1728)
Use the newly added SpanContext.IsRemote method instead.
2021-03-25 10:51:54 -07:00
Tyler Yahn
6defcfdf45
Remove links on NewRoot spans (#1726)
* Remove links on NewRoot spans

To ensure forwards compatibility, remove the unspecified links currently
set on `NewRoot` spans.

Resolves #461

* Remove links from oteltest tracer to match
2021-03-25 10:36:39 -04:00
Tyler Yahn
5d559b4007
Remove makeSamplingDecision func (#1711)
The makeSamplingDecision function is a wrapper around the provider
sampler calling ShouldSample with a duplicate configuration struct. That
duplication and need for translation as well as the addition function
call is unnecessary, this function is called in only one place.

Resolves #1706
2021-03-20 09:19:03 -07:00
Tyler Yahn
2b4fa9681b
Release v0.19.0 (#1710)
Update project version to v0.19.0
2021-03-19 08:36:17 -07:00
Injun Song
4beb70416e
sdk/trace: removing ApplyConfig and Config (#1693)
This patch removes `ApplyConfig` method and `Config` struct from
`go.opentelemetry.io/otel/sdk/trace` package.  To ensure valid config
for TracerProvider, it adds `ensureValidTracerProviderConfig` private
function.
Jaeger and Zipkin have been used the `Config` directly across package
boundaries. Since `Config` is removed, they can't use it. This change,
thus, replaces `WithSDK` with `WithSDKOptions`.

Resolves #1636, #1705.
2021-03-18 10:48:13 -07:00
Tyler Yahn
1d42be1601
Rename WithDefaultSampler TracerProvider option to WithSampler and update docs (#1702)
* Rename WithDefaultSampler TracerProvider option to WithSampler

The term "DefaultSampler" comes from early ideas of this project where
there would be overriding samplers lower in the trace SDK. This
overriding does not exist and if it is going to be introduced in the
future the sampler associated with the TracerProvider is already scoped
based on that association (no need to scope with a name). This renames
the TracerProvider option to not include this anachronism.

* Update PR number in CHANGELOG

* Propagate rename

* Update defaults documentation for TracerProvider

* Update sdk/trace/provider.go

Co-authored-by: Steven E. Harris <seh@panix.com>

* Update sdk/trace/provider.go

Co-authored-by: Steven E. Harris <seh@panix.com>
2021-03-18 09:34:47 -07:00
Anthony Mirabella
860d5d86e7
Add flag to determine whether SpanContext is remote (#1701)
* Add remote property to SpanContext

* Set SpanContext.remote when extracting context in TraceContext propagator

* Ensure remote flag is set when inserting remote SpanContext into context

* Ensure tests are expecting remote flag in SpanContext where appropriate

* Update CHANGELOG.md

* Apply PR feedback

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

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-03-18 09:05:37 -07:00
Tyler Yahn
0fe65e6bd2
Comply with OpenTelemetry attributes specification (#1703)
* Add Valid method to KeyValue

* Use KeyValue.Valid in attribute add on Span

* Resource StringDetector errors for invalid attribute

* Ignore invalid attr in NewWithAttributes

The OpenTelemetry specification requires attributes conform to a
standard evaluated and returned by attribute.KeyValue.Valid. To comply
with the specification, Resources created from NewWithAttributes need to
only contain valid attributes. This adds a check to ensure this and
drops invalid attributes passed as arguments.

* Add changes to changelog

* Add nolint comment

The attribute.Set is (possibly overly) optimized to avoid allocations.
The returned value from the constructor is a value of a Set, not a
pointer to the Set. A Set contains a lock value and pointer methods so
passing the Set value raises the copylock go vet error. This copies the
same nolint comment from the `NewSet` method this used to use.

* Apply suggestions from code review

Co-authored-by: Sam Xie <xsambundy@gmail.com>

Co-authored-by: Sam Xie <xsambundy@gmail.com>
2021-03-17 20:48:43 -04:00
Tyler Yahn
8b1be11a54
Rename resource pkg label vars and methods (#1692)
* Rename resource pkg label vars and methods

The former `labels` package is now named `attributes` to conform with
the specification requirement. This removes the lingering `label` term
from the `resource` package.

Resolve https://github.com/open-telemetry/opentelemetry-go/issues/1691

* Update PR number in CHANGELOG

* Propagate rename to the prometheus exporter pkg
2021-03-11 11:00:12 -08:00
ET
3684191338
Remove WithRecord() option from trace.SpanOption when starting a span (#1660)
* Remove `WithRecord()` option from SpanConfig options

This brings the trace API into conformance with the specification.

* Add entry to CHANGELOG

Fixes #192

* Updated CHANGELOG with PR#

* Cleaned up CHANGELOG notes

* fixup! Merge remote-tracking branch 'upstream/main' into remove-with-record

* Use new spanContext API to set traceflags, tracestate

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-03-09 09:45:09 -08:00
Anthony Mirabella
e88a091a72
Make SpanContext Immutable (#1573)
* Make SpanContext Immutable

* Adds NewSpanContext() constructor and SpanContextConfig{} struct for
constructing a new SpanContext when all fields are known
* Adds With<field>() methods to SpanContext for deriving a SpanContext
with a single field changed.
* Updates all uses of SpanContext to use the new API

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Update CHANGELOG.md

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Add tests for new SpanContext constructor and derivation

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Address PR feedback

* Fix new uses of SpanContext from main
2021-03-09 08:17:29 -08:00
Injun Song
d75e268053
Avoid overriding configuration of tracer provider (#1633)
* sdk/trace: add missing options to tracer provider

This change adds `WithDefaultSampler` and `WithSpanLimits` to the tracer
provider and removed `WithConfig` from it.

Before this change, `WithConfig` is the only way to set sampler or
limits of a span. However, it is prone to misuse, since `WithConfig` can
override tracing configurations that are configured by `WithResource` or
`WithIDGenerator`.  Thus to fix this, it adds new functional options -
`WithDefaultSampler` and `WithSpanLimits` and removes `WithConfig`.

Resolves #1631.

* Update sdk/trace/provider.go

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

* Update sdk/trace/provider.go

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

* rebase and remove WithConfig

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-03-08 13:43:11 -08:00
dependabot[bot]
150b868d02
Bump github.com/google/go-cmp from 0.5.4 to 0.5.5 (#1667)
* Bump github.com/google/go-cmp from 0.5.4 to 0.5.5

Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.5.4 to 0.5.5.
- [Release notes](https://github.com/google/go-cmp/releases)
- [Commits](https://github.com/google/go-cmp/compare/v0.5.4...v0.5.5)

Signed-off-by: dependabot[bot] <support@github.com>

* Auto-fix go.sum changes in dependent modules

* Auto-fix go.sum changes in dependent modules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-03-08 12:15:49 -08:00
Veera Pirla
a5edd79e31
Removed setting error status while recording err as span event (#1663)
* Fix #1661 Removed setting error status while recording err as span event

* Update CHANGELOG.md

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Update RecordError method doc

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

* Fix grammatical errors in Changelog

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

* Update RecordError method doc

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-03-08 11:31:01 -08:00
Tyler Yahn
3dc91f2d76
Add ForceFlush method to TracerProvider (#1608)
* Add ForceFlush method to TracerProvider

The specification requires that a TracerProvider have a ForceFlush
method that can be set with a timeout, return any error to the caller,
and have all the registered span processors export their spans. This
updates the SpanProcessor.ForceFlush method to accept a context and
return an error and plumbs this method into a new ForceFlush method of
the SDK TracerProvider.

Additionally, this corrects the TracerProvider Shutdown method. This
method as well needs to return to the caller any failure it encounters
according to the specification. This returns an error if it cannot type
assert the spanProcessorStates or if shutting down a span processor
results in an error.

Resolves #1606

* Add changes to changelog

* Apply suggestions from code review

Co-authored-by: Steven E. Harris <seh@panix.com>

* Cancel export context when BSP stops

* Defer cancel call in BSP span processor funcs

Co-authored-by: Steven E. Harris <seh@panix.com>
2021-03-08 11:12:13 -08:00
Louis DeLosSantos
bd0bba43b5
exporter: swap pusher for exporter (#1656)
to provide consistent naming across the code base, deprecate pusher in
favor of exporter naming convention.

Signed-off-by: ldelossa <ldelossa@redhat.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-03-08 10:00:56 -08:00
Tyler Yahn
569048591c
Update the SimpleSpanProcessor (#1612)
* Update the SimpleSpanProcessor

Subsequent calls to OnStart, OnEnd, and ForceFlush should be ignored
gracefully once Shutdown has been called. This implements that behavior
by shutting down the exporter and removing it from the
SimpleSpanProcessor so subsequent calls to OnEnd will be no-ops.

* Add changes to changelog

* Lock in sync.Once of shutdown instead of Shutdown scope

* Update CHANGELOG.md

Co-authored-by: Steven E. Harris <seh@panix.com>

* Release exporterMu before shutdown exporter

* Move changes to unreleased section of changelog

* Update simple_span_processor.go

revert comment change from merge

Co-authored-by: Steven E. Harris <seh@panix.com>
2021-03-08 09:50:15 -08:00
Veera Pirla
a7f7abac65
SpanStatus description set only when status code is set to Error (#1662)
* Fix #1658 SpanStatus description set only when status code is set to error

* Update CHANGELOG.md

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

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-03-08 09:40:38 -08:00
Veera Pirla
238e7c61ba
Add non-empty string check for attribute keys (#1659)
* Fixes #1657 Add non-empty string check for attribute keys

* Update PR number in changelog

* Update CHANGELOG.md

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

* Update sdk/trace/span.go

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

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-03-08 09:24:29 -08:00
ET
e9b9aca8a6
Add tests for propagation of Sampler Tracestate changes (#1655)
* Add tests for propagation of Sampler Tracestate changes

Sampler specification indicates that SamplingResult.Tracestate
should be associated with the SpanContext of the newly created span.
See
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#sampler

* Fix SamplingResult TraceState propagation

* Add Changelog entry

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-03-08 08:05:25 -08:00
Tyler Yahn
62e2a0f766
Unexport the simple and batch SpanProcessors (#1638)
* Unexport the simple and batch SpanProcessors

* Update changes in changelog
2021-03-05 08:08:29 -08:00
Tyler Yahn
992837f195
Add TracerProvider tests to oteltest harness (#1607)
* Add TracerProvider tests to oteltest harness

* Update Tracer method docs

* Fix grammar
2021-03-03 12:09:58 -08:00
Anthony Mirabella
bb4c297eb3
Pre release v0.18.0 (#1635)
* Prepare for releasing v0.18.0

* Update CHANGELOG for v0.18.0 release

* Update CHANGELOG.md

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

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-03-03 14:40:00 -05:00
Tyler Yahn
841d2a5885
Rename local var new to not collide with builtin (#1610)
* Rename local var new to not collide with builtin

* Add missed var rename
2021-03-03 08:26:26 -08:00
Tyler Yahn
13938ab5a8
Update SpanProcessor docs (#1611)
Included all directives from the specification, clarify english, and
translate specifics for the Go language.
2021-03-02 07:20:13 -08:00
Tyler Yahn
43886e52f3
Make timestamps sequential in lastvalue agg check (#1579)
* Make timestamps sequential in lastvalue agg check

* Set PR number in changelog

* Fix location of sleep

The lastvalue timestamp is set on update. Correct the location of the
sleep to bridge the update of the two different aggregators.
2021-02-25 07:20:38 -08:00
Punya Biswal
37688ef676
revent end-users from implementing some interfaces (#1575)
"otel/exporters/otlp/otlphttp".Option
"otel/exporters/stdout".Option
"otel/oteltest".Option
"otel/trace".TracerOption
"otel/trace".SpanOption
"otel/trace".EventOption
"otel/trace".LifeCycleOption
"otel/trace".InstrumentationOption
"otel/sdk/resource".Option
"otel/sdk/trace".ParentBasedSamplerOption
"otel/sdk/trace".ReadOnlySpan
"otel/sdk/trace".ReadWriteSpan

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-02-24 10:03:35 -08:00
Punya Biswal
bd4701eb93
Stagger timestamps in exact aggregator tests (#1569)
* Stagger timestamps in exact aggregator tests

Fixes #1559.

* Missed one

* Yield while you wait

* Just sleep for a teeny tiny bit

* Oops, wrong PR in Changelog

* Make sure that *some* time passes

* Keep time comparisons relaxed
2021-02-23 14:30:47 -05:00
Punya Biswal
d7aff47338
Vendor Thrift dependency (#1551)
* Vendor Thrift dependency

* Fix build

* Changelog entry

* Ignore third_party for coverage purposes

* Re-run tests

* Re-run tests

* Re-run tests

* Re-run tests

* Relax time comparisons

Fixes #1559.

Some unit tests were flaking in CI because they expected the timestamp
to advance during a test, when it's possible for it to be unchanged
instead. This change switches the offending "<" comparisons to "<=".

* Re-run tests

* Relax more time comparisons

* Re-run tests

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-02-19 13:12:35 -05:00
Sam Xie
298c5a142f
Update span limits to conform with OpenTelemetry specification (#1535)
* Change the default span limit values to 128

* Rename and move MaxEventsPerSpan, MaxAttributesPerSpan, MaxLinksPerSpan into SpanLimits

* Add AttributePerEventCountLimit and AttributePerLinkCountLimit

* Update CHANGELOG

* Apply suggestions from code review

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

* Discard over limited attributes of links in `span.addLink`

* Change the type of droppedAttributeCount to int64

* Fix tests

* Fix label -> attribute package rename from merge

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <codingalias@gmail.com>
2021-02-18 11:31:35 -08:00
Punya Biswal
ecf65d7968
Rename otel/label -> otel/attribute (#1541)
* Rename otel/label -> otel/attr

Leave the imported name alone, to avoid a large diff and conflicts

* Better import comment

* Update CHANGELOG.md

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

* otel/attr -> otel/attribute

* Missed the changelog entry

* Get rid of import renaming

* Merge remaining conflicts

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-02-18 12:59:37 -05:00
Anthony Mirabella
1b5b662136
Remove resampling on span.SetName (#1545)
The spec makes it optional to attempt resampling when changing the name
of a span and we're not sure whether it can be done in an appropriate
manner, so it's best to not do it at all for now.  We can try again
later if we find a good way to do it.
2021-02-18 09:49:10 -08:00
Tyler Yahn
7d0e3e52b6
SDK span no modification after ended (#1543)
* Document SDK span ending stops recording

* Guard SDK span set methods with record check

* Document SDK span exported API

Make note of methods that do nothing if span is not recording.

* Document SDK span End recording check

* Document the SetName method
2021-02-17 06:41:18 -08:00
Daniil Rutskiy
7de3b58ce9
Remove extra labels types (#1314)
* Remove extra labels types

Remove the following labels types: INT32, UINT32, UINT64
and FLOAT32.

Fix all extra labels types occurrences in the project.

Signed-off-by: Daniil Rutskiy <dstdfx@gmail.com>

* Update CHANGELOG.md

Signed-off-by: Daniil Rutskiy <dstdfx@gmail.com>

* Delete unused helpers

Signed-off-by: Daniil Rutskiy <dstdfx@gmail.com>

* Convert passed values into remaining types

Signed-off-by: Daniil Rutskiy <dstdfx@gmail.com>

* Clarify func description

* Fix uint64 convertion

Signed-off-by: Daniil Rutskiy <dstdfx@gmail.com>

* Fix uint conversion

Signed-off-by: Daniil Rutskiy <dstdfx@gmail.com>

* Update OTLP exporter label types

Co-authored-by: Tyler Yahn <codingalias@gmail.com>
2021-02-16 16:23:58 -08:00