1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-11-30 08:46:54 +02:00
Commit Graph

26 Commits

Author SHA1 Message Date
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
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
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
rghetia
15bfc5bb12
Namespace import path under "/otel" (#274)
Also fixes example module paths so that they use the vanity URL instead
of the github URL.

[Closes #184]
2019-11-01 11:40:29 -07:00
Joshua MacDonald
937f4ff8b0
Metrics SDK work-in-progress (#172)
Introduce the new SDK, four aggregators, and an export interface.
2019-10-29 13:27:22 -07:00
Eran Levy
79c5fd7c2b init go modules for jaeger exporter (#237)
* Jaeger exporter should be its own go module open-telemetry/opentelemetry-go#205

* fix review comments and build #205

* resolve mod conflicts #205
2019-10-24 09:13:01 -07:00
Alyson van Hardenberg
8cb3786789 init go modules for stackdriver exporter (#236)
* init go modules for stackdriver exporter

* add replace rule

* add import to stackdriver example code

* update example/namedtracer/go.sum
2019-10-23 09:48:56 -07:00
Edward Muller
0fd077287b Bump golangci-lint to v1.21.0 (#215) 2019-10-16 10:05:15 -07:00
Yoshi Yamaguchi
9ed97980e2 Add Stackdriver Trace exporter for trace. (#160)
* Add Stackdriver Trace exporter for trace.

TODOs for future work is:

* to replace bundler.Bundler

* to add proper tests for the exporter

* to move the exporter to proper repository once it will be created.

* Change to use functions for the exporter initialization instead of
passing option struct directly.
This fix is aliging the same fix for Jaeger (#146, #161)

* Change Option struct to be function type

* Change the original Option struct to be private

* Add line comments to maxMessageEventsPerSpan to leave it for future implementation

* Fix unnessesary expressions specified by `make precommit`

Left errors by `make precommit` in experimental/bridge/opentracing.

* Ran make precommit

* Add new line at EOF

* WIP: Start implementing BatchSpanExporter interfaces

* Change to use RegisterSpanProcessor to register bsp

* Change function names to fit current implementation of sdk

* Removed google.golang.org/api/support/bundler and implement ssp and bsp

* Change spanProcessor as a member of Exporter.

* Fix option names used for BatchSpanProcessor initialization.

* Change Exporter.Shutdown just to unregister spanProcessor.

* Removed copyright statements of OpenCensus.

* Fix small typo and EOF new line

* Fix interfaces of ExportSpan/ExportSpans to meet SpanSyncer/SpanBatcher

* Change to follow context.Context passed in ExportSpan/ExportSpans

* Fix Stackdriver Exporter to hold sync.Once to lock when it is registered and
unregistered.
2019-10-08 23:33:19 -07:00
rghetia
211007efb2
add binary propagation. (#155) 2019-10-02 13:54:39 -07:00
Krzesimir Nowak
339ca2d974 Initial opentracing bridge (#98)
* Allow specifying custom timestamps for events

Adding event with timestamp is not yet a part of the OpenTelemetry
specification, but this function will come in handy when implementing
the OpenTracing bridge.

* Add opentracing bridge, wrapper tracer and migration interfaces

There are some features missing - setting up links and span kind;
context propagation will only work between two OpenTracing bridges.

* Add some tests for the opentracing bridge

The tests mostly check various aspects of the cooperation between
OpenTracing and OpenTelemetry APIs.
2019-09-24 23:12:22 -07:00
stgrzeszczak
8af7978f42 Fix compilation with Golang 1.13 (#137)
* Fix compilation with Golang 1.13

* run go mod tidy again
2019-09-24 08:26:21 -07:00
rghetia
83935b2558
Add propagator interface and W3C propagator (#85)
* add propagation api.

* add http propagator interface and w3c propagator implementation.

* remove Extract api from trace.

* remove Extract interface for tracer.

* fix copyright.

* fix variable names and comments.

* move inject/extract out of trace.

* replace INVALID_SPAN_CONTEXT with EmptySpanContext function.

* fix tag.Map.

* make carrier as interface instead of http.Request.

* rename structs and update doc comments..

* add doc.go

* update doc.

* add noop propagator.

* add new propagation api with Supplier interface.
- added Default Tracer which simply propagates SpanContext.
- added CopyOfRemote option to simply create remote span.

* remove old propagator.

* rename propagator to TextFormatPropagator.

* rename default tracer/span as pass_through tracer/span.

* add test for pass through tracer.

* add missing interface to pass through tracer.

* return SpanContext instead of contex.Context from Extract interface.
- also remove PassThroughTracer

* fix review comments.

* add more test cases for traceContext extraction.

* remove tidy temporarily from circle-ci target to avoid build failure.

* allow header ending in dash '-'.

* add inject test for non-zero value other than 01 for traceoption

* add AddLink and Link interface to MockSpan

* fix running go mod tidy on every build.
2019-09-23 11:51:32 -07:00
Krzesimir Nowak
0583d26d0b Build example and ensure go mod files are tidy (#131)
* Build examples when running tests

* Run go mod tidy in precommit

That way CI can catch the case when go.mod or go.sum are outdated.
2019-09-19 09:16:09 -07:00
rghetia
9f85824979
Exporter: Initial Jaeger Trace Exporter commit. (#112)
* Exporter: Initial Jaeger Trace Exporter commit.

* remove unused methods and add TODOs.

* remove TODO.

* fix build error by exporting event struct.

* move Event from basetypes.go to export.go
2019-09-09 14:59:39 -07:00
Isobel Redelmeier
0db77910a7 Create separate go modules for examples (#26)
This prevents core code from including dependencies required only for
examples, reducing the number of dependencies that core code needs to
rely on.
2019-08-13 16:02:21 -07:00
Edward Muller
99906da7a6 Misc Makefile and README.md updates (#78)
Enabling misspell and goimports in golangci-lint allows a bit of
simplification of tools.go / Makefile.

The linters enabled locally also complained about the markdown in
README.md a little, so I fixed those complaints.

I also enabled auto-fix mode in golangci-lint so that it will just
fix any lint issues it runs across (which is how goimports/misspell)
was being used.

misspell still needs to be included in tools.go unless we decide that
we didn't want it to run on markdown files.
2019-08-05 13:58:24 -07:00
rghetia
0f32efcdaa
Trace sdk (#65)
* trace sdk initial commit.

* fix imports and comments.

* remove tracestate

* split trace.go

* add attribute over limit test.

* add comments and restructure span.go and tracer.go

* refactor MessageEvent

* defer unlock

* some more cleanup in span.go

* rename *MessageEvent* to *Event*

* cleanup comments in trace_test.go

* fix typos.

* return full string ID for traceID and spanID.
2019-08-02 13:52:55 -07:00
rghetia
0edf31e1c6
add APIs for traceoption and tracestate. (#60)
* add APIs for traceoption and tracestate.

* remove tracestate and refactor traceoptions.
2019-08-02 10:42:47 -07:00
rghetia
eed647d11f
replace import with vanity url go.opentelemetry.io. (#54) 2019-07-15 14:49:21 -07:00
rghetia
20b2f718b8
Add Circle ci (#41)
* fix compile errors.

* fix lint errors.

* add circle-ci job.

* rename IDHigh to TraceIDHigh

* rename the file.

* add go get for goimports and golangci-lint

* enable GO111MODULE and remove comments.

* remove working dir and update cache name

* Add TEST_RESULT env back.

* run go mod tidy.

* remove go mod download.

* add test coverage.

* fix TraceID.

* fix circlefi config error.

* remove install-tools.

* remove ALL_TEST_SRC from Makefile.
2019-07-02 16:21:24 -07:00
rghetia
521a6c40f1
move span, trace and event implementation to sdk. (#27)
* move event to sdk.

* move trace and span implementation to sdk.
- also added noop implementation of span and trace.

* fix review comments.
2019-06-26 22:03:09 -07:00
rghetia
3c3532fb04
Add SetStatus, SpanContext and IsRecordingEvent (#12)
* Add span apis.
- SetStatus
- SpanContext
- IsRecordingEvent

* fix formatting.

* use grpc/codes.Code

* change Option to SpanOption

* fix format errors.
2019-06-19 10:44:46 -07:00
Edward Muller
063035e9e0 Add goimports and golangci-lint (#17)
goimports for import rewritting
golangci-lint as the configurable linting swiss army knife.

These tools are recorded in [tools.go](https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module). This records
them as a dependency to make sure we're all using the same tool versions.

To make sure this project's tool's versions don't stomp over versions
from other projects, they are installed in ./.tools, which is
.gitignored.

goimports was run and fixed up a single file:
plugin/httptrace/httptrace.go

I prefer to group local packages below external packages, hence the use
of goimports -local option.

.golangci.yml contains nothing but an incomplete set of defaults ATM.
I expect those to change over time though. ;-)

To use, run:

$ make precommit

Fixes #15
2019-06-18 17:09:49 -07:00
田欧
56ada5a253 init go mod (#11) 2019-06-16 07:30:46 -07:00