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

200 Commits

Author SHA1 Message Date
wtong98
69ddc81a81 Add OTLP trace 2020-05-26 11:17:14 -05:00
Tyler Yahn
a5e9204b58
Merge branch 'master' into pre_release_v0.6.0 2020-05-21 15:45:47 -07:00
Joshua MacDonald
b17a7845df
Rename Register* to New* (#761) 2020-05-21 15:42:14 -07:00
Tyler Yahn
ad37aae65c
Prepare for releasing v0.6.0 2020-05-21 12:10:12 -07:00
Stefan Prisca
7329ccc823
Change OTLP example to use syncer (#756)
* change otlp-example to use syncer

* precommit

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
2020-05-21 11:40:11 -07:00
Anthony J Mirabella
068ad5b3a5 make precommit to cleanup otel-collector/go.sum 2020-05-20 16:42:34 -04:00
Anthony J Mirabella
923a6c8afc Replace sdktrace.WithResourceAttributes() with WithResource() 2020-05-20 16:08:43 -04:00
Joshua MacDonald
5461669733
Add a pull controller, use it for Prometheus (#751)
* Checkpoint new pull controller

* Tests pass

* Fix example

* Example fix

* Add a test

* Comment

* address MrAlias's feedback
2020-05-20 10:27:26 -07:00
Vladimir Mihailenco
244ed23e44
Rename ScheduleDelayMillis to BatchTimeout (#752)
Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
2020-05-20 10:12:57 -07:00
Stefan Prisca
3f24acf4c0 Merge branch 'master' of github.com:stefanprisca/opentelemetry-go into sp-master 2020-05-20 10:39:50 +02:00
Stefan Prisca
e1b144e775 Wait for batcher to push changes 2020-05-20 10:38:34 +02:00
Stefan Prisca
1f16b8a573 Merge branch 'master' of https://github.com/open-telemetry/opentelemetry-go into sp-master 2020-05-20 10:28:40 +02:00
Joshua MacDonald
1fab21ddbf
Support use of synchronous instruments in async callbacks (#725)
* Support use of synchronous instruments in async callbacks

* Add a test
2020-05-19 21:33:10 -07:00
Stefan Prisca
7c9f0696ca
Update Makefile 2020-05-19 07:29:52 +02:00
Joshua MacDonald
21d094af43
Refactor the api/metrics push controller; add CheckpointSet synchronization (#737)
* Checkpoint

* Finish tests

* Checkpoint

* Checkpoint (builds)

* Checkpoint + RWMutex interface

* Comments

* Remove commitLock

* Apply feedback
2020-05-18 18:37:41 -07:00
Joshua MacDonald
ee3c9ed1a5
Rename Observer to ValueObserver (#734)
* Observer -> ValueObserver

* Move wrappers into async.go
2020-05-18 11:03:43 -07:00
Stefan Prisca
8bcefd434e remove unnecessary jaeger files & add licence header 2020-05-16 12:37:47 +02:00
Stefan Prisca
c80ed298db
Update example/otel-collector/k8s/otel-collector.yaml
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-05-16 12:16:04 +02:00
Stefan Prisca
2a00038175
Update example/otel-collector/k8s/namespace.yaml
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-05-16 12:15:53 +02:00
Joshua MacDonald
6bc14ffd2c
Replace Measure instrument by ValueRecorder instrument (#732)
* Measure->Value recorder and cleanups re: measure

* More edits

* More edits

* Feedback
2020-05-15 22:11:12 -07:00
ET
0122b586b7
Ensure golang alpine image is running golang-1.14 (#733)
Older versions of go (even only as recently as 1.12.7) have problems
building outside of $GOPATH
2020-05-15 21:53:05 -07:00
Stefan Prisca
e31b09388a change api/core package to api/kv 2020-05-15 12:57:21 +02:00
Stefan Prisca
d623815dfc Update README with latest changes 2020-05-15 11:46:53 +02:00
Stefan Prisca
612e894247 fix otlp receiver endpoint 2020-05-14 18:52:38 +02:00
Stefan Prisca
2e6011db7a change collector image 2020-05-14 18:18:22 +02:00
Stefan Prisca
2c718982df Merge branch 'master' of https://github.com/open-telemetry/opentelemetry-go into sp-master 2020-05-14 11:11:55 +02:00
Stefan Prisca
e9f185c396 add k8s files 2020-05-14 11:11:51 +02:00
Tyler Yahn
ce266f9656
Prepare for releasing v0.5.0 2020-05-13 17:11:23 -07:00
Joshua MacDonald
587cde3352
Remove NewKey and update doc comment (#721)
* Update doc comment

* Remove NewKey

* NewKey->Key
2020-05-13 16:21:23 -07:00
Chen Yixiao
1301b6f3e4
Move core and key to kv package (#720)
* Move core to kv

* Move kv.Value to kv.value.Value

* Move key to kv
2020-05-13 16:06:03 -07:00
Stefan Prisca
46477e2fa4 fix precommit 2020-05-13 12:55:33 +02:00
Stefan Prisca
af27b4381a Merge branch 'master' of github.com:stefanprisca/opentelemetry-go into sp-master 2020-05-13 12:40:02 +02:00
Stefan Prisca
d69386f56c add resource attributes to provider 2020-05-13 12:38:23 +02:00
Stefan Prisca
bbb7763a84 add full collector config 2020-05-13 11:10:19 +02:00
Stefan Prisca
a09fd990c2
Update example/otel-collector/main.go
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-05-12 13:04:22 +02:00
Stefan Prisca
41ca31f31a
Update example/otel-collector/main.go
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-05-12 13:04:15 +02:00
Stefan Prisca
4c1109bee8
Update example/otel-collector/README.md
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-05-12 13:04:09 +02:00
Stefan Prisca
1e878b9564
Update example/otel-collector/README.md
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-05-12 13:04:02 +02:00
Stefan Prisca
a81fb66b04
Update example/otel-collector/README.md
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-05-12 13:03:53 +02:00
Stefan Prisca
95888a7700
Update example/otel-collector/README.md
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-05-12 13:03:44 +02:00
Stefan Prisca
9c442a0972
Update example/otel-collector/README.md
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-05-12 13:03:34 +02:00
Stefan Prisca
7db551e39e
Update example/otel-collector/README.md
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-05-12 13:03:26 +02:00
Stefan Prisca
e2e4e77624
Update example/otel-collector/README.md
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-05-12 13:03:19 +02:00
Stefan Prisca
4c7262b167
Update example/otel-collector/README.md
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-05-12 13:03:12 +02:00
Stefan Prisca
6ba581865f
Update example/otel-collector/README.md
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2020-05-12 13:03:03 +02:00
Stefan Prisca
105e0df893 precommit 2020-05-11 12:42:36 +02:00
Stefan Prisca
97f88560df fix readme 2020-05-11 12:35:11 +02:00
Stefan Prisca
be01af5ea3 small rephrasing 2020-05-11 12:21:40 +02:00
Stefan Prisca
74347efaaa Mention default config 2020-05-11 12:17:41 +02:00
Stefan Prisca
8921ddfe25 Add readme to the example 2020-05-11 12:10:12 +02:00
Stefan Prisca
a27a37ee34
Update main.go 2020-05-08 14:34:29 +02:00
Stefan Prisca
c6c841fc7c add simple demo for connecting to collector 2020-05-08 14:25:20 +02:00
Rahul Patel
1de7f68bfc
Prepare for releasing v0.4.3 (#664) 2020-04-24 15:24:00 -07:00
Andrew Hsu
6402598a1f
add Dockerfile and docker-compose.yml to run example code (#635)
* add optional server url arg to http client example

Signed-off-by: Andrew Hsu <xuzuan@gmail.com>

* add Dockerfile to build example http images

Multi-stage Dockerfile with targets for building example http server and
client.

  $ docker build --tag the-server --target example-http-server .
  $ docker build --tag the-client --target example-http-client .

Signed-off-by: Andrew Hsu <xuzuan@gmail.com>

* add docker-compose.yml file for running examples

This docker compose configuration file will help a new user to compile
and run the example code quickly. Uses the Dockerfile to build images
with compiled examples.

  $ docker-compose build http-server http-client
  $ docker-compose up http-server http-client

Signed-off-by: Andrew Hsu <xuzuan@gmail.com>

* add newline to last message of example http client

Signed-off-by: Andrew Hsu <xuzuan@gmail.com>

* add optional collector url arg to zipkin client example

Signed-off-by: Andrew Hsu <xuzuan@gmail.com>

* add Dockerfile target to build zipkin client

For building the example zipkin client:

  $ docker build --tag zipkin-client --target example-zipkin-client .

Signed-off-by: Andrew Hsu <xuzuan@gmail.com>

* add docker compose service to run zipkin examples

Services to run the zipkin client along with a zipkin collector:

  $ docker-compose build zipkin-client
  $ docker-compose up zipkin-collector zipkin-client

Since the zipkin collector takes a few seconds before it is ready to
receive traces, I added a simple retry loop to the client command.

The collector service exposes port 9411 so user can visit
http//localhost:9411/ to see the trace sent to the collector. Be sure to
search by the trace id logged by the client.

Signed-off-by: Andrew Hsu <xuzuan@gmail.com>

* Update Dockerfile with AL2 declaration

As described in https://www.apache.org/licenses/LICENSE-2.0#apply

Co-Authored-By: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update docker-compose.yml with AL2 declaration

As described in https://www.apache.org/licenses/LICENSE-2.0#apply

Co-Authored-By: Tyler Yahn <MrAlias@users.noreply.github.com>

* pass server url as flag in example http client

  $ ./client -h
  Usage of ./client:
    -server string
          server url (default "http://localhost:7777/hello")

Signed-off-by: Andrew Hsu <xuzuan@gmail.com>

* pass zipkin url as flag in example zipkin client

  $ ./zipkin -h
  Usage of ./zipkin:
    -zipkin string
          zipkin url (default "http://localhost:9411/api/v2/spans")

Signed-off-by: Andrew Hsu <xuzuan@gmail.com>

* move Dockerfile and docker-compose.yml into example dir

Signed-off-by: Andrew Hsu <xuzuan@gmail.com>

* add Dockerfile and docker-compose.yml for zipkin example

Signed-off-by: Andrew Hsu <xuzuan@gmail.com>

* update zipkin example README.md

With instructions on how to use docker-compose to run the example.

Signed-off-by: Andrew Hsu <xuzuan@gmail.com>

* add http example README.md

With instructions on how to use docker-compose to run the example.

Signed-off-by: Andrew Hsu <xuzuan@gmail.com>

* Update example/http/Dockerfile WORKDIR

Co-Authored-By: Krzesimir Nowak <qdlacz@gmail.com>

* Update example/http/Dockerfile RUN go install

Co-Authored-By: Krzesimir Nowak <qdlacz@gmail.com>

* Update example/http/Dockerfile RUN go install

Co-Authored-By: Krzesimir Nowak <qdlacz@gmail.com>

* Update example/zipkin/Dockerfile WORKDIR

Co-Authored-By: Krzesimir Nowak <qdlacz@gmail.com>

* Update example/zipkin/Dockerfile RUN go install

Co-Authored-By: Krzesimir Nowak <qdlacz@gmail.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Krzesimir Nowak <qdlacz@gmail.com>
Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
2020-04-23 13:11:24 -07:00
Paul Reichelt
6de3dab6b6
Resolve #72 - gRPC Interceptor (#621)
* Move interceptor to plugin

* Add basic net.peer info

* Ensure that grpc status match span status

See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/data-rpc.md#status

* Set rpc.service attribute

* Add StreamClientInterceptor and StreamServerInterceptor

* Fix: golint errors

* Apply automated go.mod changes from make

* Implement suggestions to improve readability
2020-04-23 13:07:14 -07:00
Krzesimir Nowak
927d9155ae
Increase the visibility of the api/key package (#650)
* Point to the convenience functions in api/key package

This is to increase the visibility of the api/key package through the
api/core package, otherwise developers often tend to miss the api/key
package altogether and write `core.Key(name).TYPE(value)` and complain
at the verbosity of such a construction. The api/key package would
allow them to write `key.TYPE(name, value)`.

* Use the api/key package where applicable

This transforms all the uses of `core.Key(name).TYPE(value)` to
`key.TYPE(name, value)`. This also should help increasing the
visibility of the api/key package for developers reading the otel-go
code.

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
2020-04-21 20:26:51 -07:00
Oleg Shatnyuk
cf7c4e5328
fix zipkin without local endpoint with service name (#644) 2020-04-18 23:02:29 -07:00
Joshua MacDonald
a8f7b3247b
Remove WithKeys() option, defaultkeys batcher (#639) 2020-04-14 16:07:11 -07:00
Rahul Patel
857e80c270
Prepare for releasing v0.4.2 (#608) 2020-03-31 12:57:37 -07:00
Liz Fong-Jones
02b6be15e0
Pre release v0.4.1 (#605)
* fix release script for ubuntu

* Prepare for releasing v0.4.1
2020-03-31 13:02:15 -04:00
Rahul Patel
57d5f55600
Prepare for releasing v0.4.0 (#603)
* Prepare for releasing v0.4.0

* update README.

* remove target date for released features.
2020-03-30 14:33:27 -07:00
Joshua MacDonald
e8546e3bc5
Remove Labelset (#595)
* Remove LabelSet frmo api/metric

* SDK tests pass

* Restore benchmarks

* All tests pass

* Remove all mentions of LabelSet

* Test RecordBatch

* Batch test

* Improves benchmark (some)

* Move the benchmark to match HEAD

* Align labels for GOARCH=386

* Add alignment test

* Disable the stress test fo GOARCH=386

* Fix bug

* Move atomic fields into their own file

* Add a TODO

* Comments

* Remove metric.Labels(...)

* FTB

Co-authored-by: Liz Fong-Jones <lizf@honeycomb.io>
2020-03-27 14:06:48 -07:00
Tyler Yahn
c97b4f726c
Update project License headers and checking (#596)
Update license header to standard format for source files missed prior.

Add license header to new source files.

Add Makefile check to test all `*.go` and `*.sh` files have a copyright
notice (or comment about them being auto-generated) within the first few
lines.
2020-03-25 14:47:17 -07:00
Tyler Yahn
a485d0ec64
Update License header for all source files (#586)
* Update License header for all source files

- Add Apache 2.0 header to source files that did not have one.
- Update all existing headers dated to 2019 to be 2020
- Remove comma from License header to comply with the Apache 2.0
  guidelines.

* Update Copyright notice

Use the standard Copyright notices outlined by the
[CNCF](https://github.com/cncf/foundation/blob/master/copyright-notices.md#copyright-notices)
2020-03-23 22:41:10 -07:00
Rahul Patel
a1c243965e
Prepare for releasing v0.3.0 (#578) 2020-03-21 14:06:39 -07:00
Joshua MacDonald
d8682c1999
Refactor the SDK helpers, create MeterImpl (#560)
* Create MeterImpl interface

* Checkpoint w/ sdk.go building

* Checkpoint working on global

* api/global builds (test fails)

* Test fix

* All tests pass

* Comments

* Add two tests

* Comments and uncomment tests

* Precommit part 1

* Still working on tests

* Lint

* Add a test and a TODO

* Cleanup

* Lint

* Interface()->Implementation()

* Apply some feedback

* From feedback

* (A)Synchronous -> (A)Sync

* Add a missing comment

* Apply suggestions from code review

Co-Authored-By: Krzesimir Nowak <qdlacz@gmail.com>

* Rename a variable

Co-authored-by: Krzesimir Nowak <qdlacz@gmail.com>
2020-03-19 12:02:46 -07:00
Rahul Patel
80b720a771
update stdout trace with resource. (#558)
* update stdout trace with resource.

* convert resource to span attributes.

* remove resource reference after converting to Span Attributes.
2020-03-16 16:48:35 -07:00
Krzesimir Nowak
d9210f5676
Zipkin exporter (#495)
* Add zipkin exporter

The zipkin exporter implements the SpanBatcher interface. It follows
the current-at-the-time-of-writing document about conversion from
OpenTelemetry span data to Zipkin spans. Which means that endpoint
information is not yet filled.

* Fix typo in docs

* Add a zipkin example

This sends span information to a locally running zipkin collector.
Currently I have a problem getting the collector to show me the spans
after accepting them with HTTP 202. Not sure if this is because of
missing endpoint information.

* Make gitignore consistent

The fixed paths should be prefixed with a slash. The "relative" paths
mean that git will ignore all the files that end with the path.

* Add tests for zipkin exporter
2020-03-11 14:49:02 -07:00
Joshua MacDonald
4047c0877a
Introduce metric constructor errors, MeterMust wrapper (#529)
* Update api for Must constructors, with SDK helpers

* Update for Must constructors, leaving TODOs about global errors

* Add tests

* Move Must methods into metric.Must

* Apply the feedback

* Remove interfaces

* Remove more interfaces

* Again...

* Remove a sentence about a dead inteface
2020-03-11 11:57:57 -07:00
Gustavo Silva Paiva
85751428a3
add shorter version for global providers (#538) 2020-03-11 08:23:32 -07:00
Joshua MacDonald
9674c81cb7
Drop the gauge instrument (#537)
* drop gauge instrument

* Restore the benchmark and stress test for lastvalue aggregator, but remove monotonic last-value support

* Rename gauge->lastvalue and remove remaining uses of the word 'gauge'

Co-authored-by: Krzesimir Nowak <krzesimir@kinvolk.io>
2020-03-10 16:00:37 -07:00
Matej Gera
fe0099fb3d
[tracing] add simplified export pipeline setup for Jaeger (#459)
* add simplified export pipeline setup for Jaeger

* add With* options to configure SDK options.

* add test for WithRegistration and WithSDK

* rename Registeration with RegisterGlobal

* rename WithRegistration to RegisterAsGlobal

Co-authored-by: rahulpa <rahulpa@google.com>
Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
2020-03-10 13:58:45 -07:00
Joshua MacDonald
3bf3927eb5
Add status message parameter (#524)
* Add status message parameter

* Cleanups around use of codes.OK

* Update for status message
2020-03-07 10:38:59 -08:00
Tyler Yahn
9459629d21
Remove the StackDriver trace exporter (#452)
Vendor exporters needed to be hosted outside this codebase.

Additionally, remove the http-stackdriver example.

Resolves #447

Partially addresses #449

Co-authored-by: Rahul Patel <rahulpa@google.com>
2020-03-06 17:53:52 -08:00
Liz Fong-Jones
ffdbc05665
update to v0.2.3 (#512)
Promote everything to v0.2.3, golang 1.14, and give everything a nice go get -u ./... and go mod tidy along the way too.
2020-03-04 16:12:25 -05:00
Tyler Yahn
52fb033e13
Rename the exporter directory to exporters (#502)
The `go.opentelemetry.io/otel/exporter/trace/jaeger` package was
mistakenly released with a `v1.0.0` tag instead of `v0.1.0`. This
resulted in all subsequent releases not becoming the default latest,
meaning that `go get`s pulled in the incompatible `v0.1.0` release of
that package when pulling in more recent packages from other otel
packages. Renaming the `exporter` directory to `exporters` fixes this
issue by consequentially renaming the package.

Additionally, this action also renames *all* exporters. This is
understood to be a disruptive action to existing users as they will need
to update any dependencies they currently have on our exporters.
However, it was decided to take this action regardless. The need to
resolve the existing issue explained above is highly important, and
given the Alpha state of this project these kinds of breaking changes
should be expected (though not without reason).

Resolves #331

Co-authored-by: Rahul Patel <rghetia@yahoo.com>
2020-03-02 13:54:57 -08:00
Krzesimir Nowak
8ebc7bbad0
Name context functions consistently (#481)
It would be nice to follow a single schema for naming context
functions. In the trace package we followed the form FooFromContext
and ContextWithFoo. Do the same in the correlation package. The schema
WithFoo is mainly used for functions following the options pattern.

Not sure about a name of the NewContext function, though. For now I
have left it alone.

Co-authored-by: Rahul Patel <rghetia@yahoo.com>
2020-02-27 09:10:52 -08:00
Junki Kaneko
4818358f94
Move dependencies of tools package to a tools directory (#466)
* Move dependencies of tools package to a tools directory

* remove TOOLS_MOD_DIR from ALL_GO_MOD_DIRS in a Makefile.
then run 'go mod tidy' on ALL_GO_MOD_DIRS and TOOLS_MOD_DIR.

Co-authored-by: Rahul Patel <rghetia@yahoo.com>
2020-02-06 10:51:00 -08:00
Krzesimir Nowak
942713a02d
Replace span relationship with a potentially remote parent context (#451)
This PR removes the non-compliant ChildOf and FollowsFrom interfaces
and the Relation type, which were inherited from OpenTracing via the
initial prototype. Instead allow adding a span context to the go
context as a remote span context and use a simple algorithm for
figuring out an actual parent of the new span, which was proposed for
the OpenTelemetry specification.

Also add a way to ignore current span and remote span context in go
context, so we can force the tracer to create a new root span - a span
with a new trace ID.

That required some moderate changes in the opentracing bridge - first
reference with ChildOfRef reference type becomes a local parent, the
rest become links. This also fixes links handling in the meantime. The
downside of the approach proposed here is that we can only set the
remote parent when creating a span through the opentracing API.

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
2020-02-04 08:55:03 -08:00
Krzesimir Nowak
6b4acf47b8 Reorganize propagation code (shrink PR 381) (#444)
* Rename distributedcontext package to correlation

Correlation is the name we agreed upon.

* Move trace propagators to api/trace

The trace propagators tests had to be moved to a testtrace subpackage
to avoid import cycles between api/trace and internal/trace.

Needed to shut up golint about stutter in trace.TraceContext -
TraceContext is a name of a W3C spec, so this stutter is
expected. It's certainly still better than golint's suggestion of
having trace.Context.

* Rename api/propagators to api/propagation

This package will not contain any propagators in the long run, just
the interface definitions.

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
2020-01-28 10:13:46 -08:00
Liz Fong-Jones
ea67a56427
go module update for release v0.2.1 (#413) 2020-01-08 09:41:58 -05:00
Liz Fong-Jones
4c9bf78ab3 s/options/config/ (#410)
Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
2020-01-03 09:48:45 -08:00
Matej Gera
067aa9e142 [metrics] standardize/simplify export pipeline setup (#395)
* Introduce simplified export pipeline setup for stdout

* Standardize dogstatsd,stdout,prometheus calling.

* Creates NewRawExporter, NewExportPipeline, InstallNewPipeline methods.
* Uses Options rather than Config throughout for options.

* fix merge conflicts.

Co-authored-by: Liz Fong-Jones <elizabeth@ctyalcove.org>
2020-01-02 10:41:21 -08:00
Joshua MacDonald
dd781560d4
Rename handle to bound instrument (@sircelsius) (#400)
* Rename metric Handle to Bound Instrument

* Rename metric Handle to Bound Instrument

* Rename metric Handle to Bound Instrument

* chore(meter): renamed from *BoundInstrument to Bound*, renamed AcquireBoundInstrument to Bind

* chore(meter): renamed Release to Unbind

* Self feedback in doc.go

* Rename confusing method name

Co-authored-by: Marc Bramaud <sircelsius@users.noreply.github.com>
2019-12-27 16:30:19 -08:00
Joshua MacDonald
1414d363de
Global meter forwarding implementation (#392)
* Initial skeleton

* Revert noop provider removal

* Checkpoint

* Checkpoint

* Implement Bound instrument and LabelSet

* Add test

* Add a benchmark

* Add a release test

* Document LabelSetDelegator

* Lint and comments

* Add a second Meter test; fix typo; add a panic

* Add a test for the builtin SDK

* Address feedback
2019-12-23 23:03:04 -08:00
Gustavo Silva Paiva
6f04903876 Change prometheus to not aggregate metrics and only export them. (#385)
* draft using stop aggregating on prometheus client (counters)

* remove prometheus client aggregations

Measures are being exported as summaries since histograms doesn't
exist on OpenTelemetry yet.

Better error handling must be done.

* make pre commit

* add simple error callback

* remove options from collector

* refactor exporter to smaller methods

* wording

* change to snapshot

* lock collection and checkpointset read

* remove histogram options and unexported fields from the Exporter

* documenting why prometheus uses a stateful batcher

* add todo for histograms

* change summaries objects to summary quantiles

* remove histogram buckets from tests

* wording

* rename 'lockedCheckpoint' to 'syncCheckpointSet'

* default summary quantiles should be defaulted to no buckets.

* add quantiles options

* refactor test.CheckpointSet and add docs

* flip aggregators merge

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
2019-12-23 09:47:51 -08:00
Tyler Yahn
99cb01b246 Correct http-stackdriver example module name (#394)
Fix misspelling of opentelemetry.
2019-12-20 11:55:31 -05:00
Vineeth Pothulapati
b863b8f6ab Rename CurrentSpan to SpanFromContext & SetCurrentSpan to ContextWithSpan (#379)
Signed-off-by: vineeth <vineethpothulapati@outlook.com>
2019-12-11 08:51:32 -08:00
Jonas-Taha El Sesiy
1ab645fedb Consistently use pointer receivers for core.Number (#375)
Change all occurrences of value to pointer receivers
Add meta sys files to .gitignore
Code cleanup e.g.
- Don't capitalize error statements
- Fix ignored errors
- Fix ambiguous variable naming
- Remove unnecessary type casting
- Use named params

Fix #306
2019-12-09 13:03:11 -08:00
rghetia
d35ea75879
go module update for release v0.2.0 (#366) 2019-12-03 00:08:30 -08:00
ferhat elmas
eb9fe13a77 Drop SetAttribute from Span (#361)
fixes #302
2019-12-03 16:58:55 +11:00
David Montoya
77543cd80e Unary gRPC tracing example (#351)
* add grpc example

* update example guide

* decouple trace provider initialization

* add source license

* update api references
2019-11-26 16:14:09 -08:00
Gustavo Silva Paiva
3d78564d2f Prometheus exporter (#334)
* Prom exporter structure

* update prometheus exporter with master and add example.

* remove distributedcontext from prometheus example

* docs and interface checker

* make precommit

* make precommit & remove "OnRegisterError"

* coerce values to float

* return register errors and maybe fix precommit?

* add option to specify a prometheus.Registry

* make exporter implement http.Handler interface

* fix map keys bugs

* remove unused const

* fix modules dependencies.

* add support for histogram

* get metrics with labels values only instead of a labels map

* make exporter implements label encoder interface

* encode labels if the encoder is different.

* split metrics on several files and encapsulate them in structs

* make pre commit

* unexport 'sanitize'

* remove 'AllValues' in favor of 'Points' and change to 'NewDefaultLabelEncoder'

* add prometheus tests

* remove newlines on struct declaration

* formatting

* rewording

* imports

* add todo on labelValues

* blame myself for todo (:

* add todos on sanitize

* add support for summaries. custom remove label encoder.

* imports

* imports

* update with upstream
2019-11-26 11:47:15 -08:00
Cheng-Lung Sung
1b08d827a4 Rename GetMeter() to Meter() (#357) 2019-11-26 09:54:05 -08:00
Cheng-Lung Sung
13cd2ac417 move /global to /api/global (#356)
implement #337
2019-11-25 20:41:24 -08:00
ferhat elmas
0f052af2f4 Rename GetTracer to Tracer (#347)
* Rename GetTracer to NewTracer

* Drop New prefix
2019-11-25 09:46:07 -08:00
Joshua MacDonald
b9706b20f9
Dogstatsd metrics exporter (#326)
* Add MetricAggregator.Merge() implementations

* Update from feedback

* Type

* Ckpt

* Ckpt

* Add push controller

* Ckpt

* Add aggregator interfaces, stdout encoder

* Modify basic main.go

* Main is working

* Batch stdout output

* Sum udpate

* Rename stdout

* Add stateless/stateful Batcher options

* Undo a for-loop in the example, remove a done TODO

* Update imports

* Add note

* Rename defaultkeys

* Support variable label encoder to speed OpenMetrics/Statsd export

* Lint

* Checkpoint

* Checkpoint

* Doc

* Precommit/lint

* Simplify Aggregator API

* Record->Identifier

* Remove export.Record a.k.a. Identifier

* Checkpoint

* Propagate errors to the SDK, remove a bunch of 'TODO warn'

* Checkpoint

* Introduce export.Labels

* Comments in export/metric.go

* Comment

* More merge

* More doc

* Complete example

* Lint fixes

* Add a testable example

* Lint

* Dogstats

* Let Export return an error

* Checkpoint

* add a basic stdout exporter test

* Add measure test; fix aggregator APIs

* Use JSON numbers, not strings

* Test stdout exporter error

* Add a test for the call to RangeTest

* Add error handler API to improve correctness test; return errors from RecordOne

* Undo the previous -- do not expose errors

* Add simple selector variations, test

* Repair examples

* Test push controller error handling

* Add SDK label encoder tests

* Add a defaultkeys batcher test

* Add an ungrouped batcher test

* Lint new tests

* Respond to krnowak's feedback

* Checkpoint

* Funciontal example using unixgram

* Tidy the example

* Add a packet-split test

* More tests

* Undo comment

* Use concrete receivers for export records and labels, since the constructors return structs not pointers

* Bug fix for stateful batchers; clone an aggregator for long term storage

* Remove TODO addressed in #318

* Add errors to all aggregator interfaces

* Handle ErrNoLastValue case in stdout exporter

* Move aggregator API into sdk/export/metric/aggregator

* Update all aggregator exported-method comments

* Document the aggregator APIs

* More aggregator comments

* Add multiple updates to the ungrouped test

* Fixes for feedback from Gustavo and Liz

* Producer->CheckpointSet; add FinishedCollection

* Process takes an export.Record

* ReadCheckpoint->CheckpointSet

* EncodeLabels->Encode

* Format a better inconsistent type error; add more aggregator API tests

* More RangeTest test coverage

* Make benbjohnson/clock a test-only dependency

* Handle ErrNoLastValue in stress_test

* Update comments; use a pipe vs a unix socket in the example test

* Update test

* Spelling

* Typo fix

* Rename DefaultLabelEncoder to NewDefaultLabelEncoder for clarity

* Rename DefaultLabelEncoder to NewDefaultLabelEncoder for clarity

* Test different adapters; add ForceEncode to statsd label encoder
2019-11-21 20:46:05 -08:00
rghetia
9d1a0d538f
go module update for release v0.1.2 (#330) 2019-11-18 11:14:49 -08:00
Gustavo Silva Paiva
3495d74971 specialize simplelru(span's lruMap) for attributes only (#328)
* copy of simplelru for attributes without excessive usage of interface{}

This also make sure we only add attributes/links if isRecording.

Move method to export the attributes list to attributeMap.

* run make precommit to update mod files.
2019-11-18 10:51:57 -08:00
Joshua MacDonald
9878f3b700 Metrics stdout export pipeline (#265)
* Add MetricAggregator.Merge() implementations

* Update from feedback

* Type

* Ckpt

* Ckpt

* Add push controller

* Ckpt

* Add aggregator interfaces, stdout encoder

* Modify basic main.go

* Main is working

* Batch stdout output

* Sum udpate

* Rename stdout

* Add stateless/stateful Batcher options

* Undo a for-loop in the example, remove a done TODO

* Update imports

* Add note

* Rename defaultkeys

* Support variable label encoder to speed OpenMetrics/Statsd export

* Lint

* Doc

* Precommit/lint

* Simplify Aggregator API

* Record->Identifier

* Remove export.Record a.k.a. Identifier

* Checkpoint

* Propagate errors to the SDK, remove a bunch of 'TODO warn'

* Checkpoint

* Introduce export.Labels

* Comments in export/metric.go

* Comment

* More merge

* More doc

* Complete example

* Lint fixes

* Add a testable example

* Lint

* Let Export return an error

* add a basic stdout exporter test

* Add measure test; fix aggregator APIs

* Use JSON numbers, not strings

* Test stdout exporter error

* Add a test for the call to RangeTest

* Add error handler API to improve correctness test; return errors from RecordOne

* Undo the previous -- do not expose errors

* Add simple selector variations, test

* Repair examples

* Test push controller error handling

* Add SDK label encoder tests

* Add a defaultkeys batcher test

* Add an ungrouped batcher test

* Lint new tests

* Respond to krnowak's feedback

* Undo comment

* Use concrete receivers for export records and labels, since the constructors return structs not pointers

* Bug fix for stateful batchers; clone an aggregator for long term storage

* Remove TODO addressed in #318

* Add errors to all aggregator interfaces

* Handle ErrNoLastValue case in stdout exporter

* Move aggregator API into sdk/export/metric/aggregator

* Update all aggregator exported-method comments

* Document the aggregator APIs

* More aggregator comments

* Add multiple updates to the ungrouped test

* Fixes for feedback from Gustavo and Liz

* Producer->CheckpointSet; add FinishedCollection

* Process takes an export.Record

* ReadCheckpoint->CheckpointSet

* EncodeLabels->Encode

* Format a better inconsistent type error; add more aggregator API tests

* More RangeTest test coverage

* Make benbjohnson/clock a test-only dependency

* Handle ErrNoLastValue in stress_test
2019-11-15 13:01:20 -08:00