Commit Graph

53 Commits

Author SHA1 Message Date
Bogdan Drutu 0c6757ec71
Rename [Traces|Metrics|Logs]Consumer to [Traces|Metrics|Logs] (#2761)
* Rename [Traces|Metrics|Logs]Consumer to [Traces|Metrics|Logs]

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

* Update internal/testcomponents/example_exporter.go

Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>

Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
2021-03-23 08:04:44 -07:00
Paulo Janotti c7e9b68f84
Ensure Zipkin shutdown correctness (#2765)
* Fix Zipkin shutdown

* Fix zipkin shutdown

* Remove nil check for http Serve on OC and OTLP

* Switch from channel to WaitGroup for Zipkin shutdown
2021-03-22 18:11:18 -07:00
Bogdan Drutu d442d7ddcc
Remove copied code in zipkin receiver, use the source (#2484)
The problem mentioned in the comment was with the thrift version, now fixed.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-17 10:55:16 -05:00
Bogdan Drutu 0ac7a067c0
Enable unparam linter, removes unused params from not exported funcs (#2110)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-11-11 12:44:40 -05:00
Bogdan Drutu d322a4161b
Remove legacy metrics, they were marked as legacy for ~12 months (#2105)
* Remove legacy metrics, they were marked as legacy for ~12 months

Fixes https://github.com/open-telemetry/opentelemetry-collector/issues/1082

This PR removes:
- Legacy receiver/exporter metrics:
  - otelcol/receiver/received_spans
  - otelcol/receiver/dropped_spans
  - otelcol/receiver/received_timeseries
  - otelcol/receiver/dropped_timeseries
  - otelcol/exporter/received_spans
  - otelcol/exporter/dropped_spans
  - otelcol/exporter/received_timeseries
  - otelcol/exporter/dropped_timeseries
  - otelcol/exporter/received_logs
  - otelcol/exporter/dropped_logs
- For processors remove the legacy metrics (new metrics have the same data, different names):
  - e.g. "spans_dropped" -> "processor/spans_dropped"
  - e.g. "batch_send_size_bytes" -> "processor/batch/batch_send_size_bytes"

All the new metrics were enabled when using the --new-metrics flag. The PR also removes two flags:
- "--new-metrics"
- "--legacy-metrics"
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Update changelog

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

* Fix comments from review

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-11-10 13:32:27 -08:00
Chris Smith 32bb904e37
zipkin receiver: allow receiver to parse string tags (#1893)
Fixes https://github.com/open-telemetry/opentelemetry-collector/issues/1888

Previously the zipkin receiver parses string tags to other datatypes (int/bool/float), this adds the functionality back under a new configuration option `parse_string_tags` in the zipkin receiver.

To unify the behavior with the zipkin v1 I also disabled the parsing by default and check the same configuration option.
2020-10-30 14:04:27 -04:00
Bogdan Drutu 99cb5b244a
Rename consumer.TraceConsumer to consumer.TracesConsumer (#1981)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-10-20 10:56:30 -07:00
Bogdan Drutu eaaebf19f0
Bump github.com/openzipkin/zipkin-go from 0.2.2 to 0.2.3 (#1566)
Fixes #1562

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-09-01 09:21:17 -07:00
Bogdan Drutu f103d36cd7
Replace pkg/errors with native Go error wrapping (#1603)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-08-20 10:34:34 -07:00
Jay Camp 1e65674799
Update copyright (#1597)
* Update copyright

* rebase
2020-08-19 18:25:44 -07:00
Kevin Brockhoff 3857a9d2da
Convert Zipkin receiver and exporter to use OTLP and fix translation bugs (#1446)
* fixed all Jaeger translation diffs from correctness tests

* fixed Jaeger translations where Resource is missing or empty

* improve test coverage

* initial dev of otlp to zipkin translation

* initial dev of otlp to zipkin translation

* initial dev of zipkin v2 to otlp translation

* initial dev of zipkin v2 to otlp translation

* initial dev of zipkin v2 to otlp translation

* initial dev of zipkin v2 to otlp translation

* initial dev of zipkin v1 to otlp translation

* change zipkin receiver and exporter to use internal traces

* improve event/annotation translations

* fix broken zipkin tests

* convert zipken receiver/exporter to new factory signature

* fixed receiver config

* add code from master

* fix broken test

* fix PR requested changes

* translation fixes

* improve perf

* added more test coverage

* changed timestamp validations to only check to nearest millisecond

* fix new lint issues and PR comments

* improve timestamp validation

* improve timestamp validation

* fix missed timestamp validation

* added missing goldendata examples

* fix generator tests

* fix PR comments

* improve test coverage
2020-08-11 11:57:39 -07:00
Bogdan Drutu 4b5122b68d
Fix receiver to enable unparam (#1507)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-08-05 15:44:15 -07:00
Bogdan Drutu c4a38294b0
Migrate zipkin receiver/exporter to the new interfaces (#1484)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-08-03 17:32:49 -07:00
Bogdan Drutu 3d5af8c7c6
Add config for HttpServer (#1196)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-26 07:43:12 -07:00
Chris Smith 969a8d4e9a
Unify zipkin v1 and v2 annotation/tag parsing logic (#1002)
Fixes https://github.com/open-telemetry/opentelemetry-collector/issues/975

Please look at the individual commits, most of this is just moving code around.

Moves zipkin v2 trace conversion code into translator/trace/zipkin, previously it was in the receiver
Use the same tag parsing logic for both zipkin v1 and v2
2020-06-23 13:30:49 -04:00
Chris Smith 746db761d1
Zipkin Receiver: default timestamp (#1068)
Fixes https://github.com/open-telemetry/opentelemetry-collector/issues/954

#954 is being caused from the conversion of OC -> Internal -> OC span types. 

OC technically allows nil times because its a pointer, but [docs state](https://github.com/census-instrumentation/opencensus-proto/blob/master/src/opencensus/proto/trace/v1/trace.proto#L125-L135)

```go
// This field is semantically required. When not set on receive -
// receiver should set it to the value of end_time field if it was
// set. Or to the current time if neither was set. It is important to
// keep end_time > start_time for consistency.
//
// This field is required.
StartTime *timestamp.Timestamp
```

So this pr changes the zipkin receiver to set the start/end timestamps if they're not set on receive
2020-06-11 13:44:58 -04:00
Bruno Garcia 8aa2731844
Remove year from copyright (#964) 2020-05-26 12:44:22 -04:00
Bogdan Drutu a637b41c22
Change entire repo to use the new vanityurl go.opentelemetry.io/collector (#977)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-15 12:04:05 -07:00
Pavol Loffay d86bcd06e7
Make Zipkin transport metric tag more specific (#867)
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
2020-04-23 17:32:59 -07:00
Paulo Janotti 03d07a3fc6
Zipkin receiver should not error on zero IDs (#836)
While zero IDs are considered by most formats to be an error the Collector should not drop data because of that. This follows the same pattern already adopted for the Jaeger receiver.
2020-04-15 15:43:53 -07:00
Bogdan Drutu 2d1a9b7ed1
Rename componenterr to componenterrors (#783)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-04-06 12:15:13 -07:00
Bogdan Drutu 0bc0d57022
Add context to start and stop methods in the component (#790)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-04-06 10:59:17 -07:00
Bogdan Drutu 84326d92c4
Move oterr to componenterr (#771)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-04-03 20:16:17 -04:00
Tigran Najaryan c931b9875f
Refactor component and factory interface definitions (#683)
As we are preparing for Beta release we want to cleanup publicly exported
types and interfaces and do all necessary refactoring and breaking changes
now, before the Beta release. We will have a lot less leeway for breaking
changes after the Beta release.

Component related type declarations are now all in the `component` package.
This makes it possible for the interfaces to reference each other. This
was were very restricted earlier because component interfaces were in 5
different packages and many proposals were impossible to implement because
they would result in circular dependencies between packages.

(An example upcoming new capability that is enabled by this refactoring
is for components to query the Host for other components and for factories).

List of changes in this commit:

- Move all factory interfaces and component interfaces to component package.
- Rename old factories and components interfaces to use "Old" suffix for clarity.
- Eliminate forced checks that components implement factories. This is already
  enforced by the compiler when the factory is added to the Defaults() and
  was unnecessary code.
- Eliminated some unnecessary codes (removed overall over 200 lines).
- Run `go mod tidy` on testbed.

Warning: this is a breaking change to publicly exported types and function
signatures. We announced that a breaking change is comming. Once we agree
to merge this commit we will need to announce the exact list of changes
and guide component authors to modify their components accordingly.

Future changes:
- Once all components are migrated to the new internal representation,
  delete all "Old"-suffixed definitions. This will likely be done while
  we are still in Beta phase, before the Stable release.
2020-03-25 13:43:35 -04:00
Bogdan Drutu 4f385cd230
Fix propagation issues for context in the new obsreport usage (#625)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-03-12 15:26:08 -04:00
Paulo Janotti 638fe03dc8
Use obsreport package on receivers (#578)
Move receivers to use the new obsreport package instead of the observability package.
2020-02-28 09:19:47 -08:00
Tigran Najaryan 47ccdff652
Add support for CONSUMER and PRODUCER span kinds for Zipkin V2 (#529)
Previously these span kinds were not supported because OpenCensus
does not have equivalent span kinds and they were translated as
"Unspecified" span kind when received by Zipkin receiver.

An earlier fix added this support for Zipkin V1 format. This fix
extends the support to Zipkin V2 format.

Testing done:
- Added a unit test to verify translations between ZipkinV2 and OC.
2020-02-03 17:03:12 -05:00
Paulo Janotti d857771fa6 Remove unused MetricsSource() and TraceSource() methods (#514)
These methods are not being used, removing them to reduce a bit
boiler-plate code of components.
2020-01-22 16:44:58 -05:00
Owais Lone 264426a9ca Added client package to help identify RPC/HTTP clients (#326)
Client package will help identify clients connecting to different
receivers and enable usecases where processors might depend on some
information about the client. For example, a rate-limiting processor
might need some information about clients to figure out when and how to
rate-limit. Also, the upcoming kubernetes processor depends on this as
it needs the IP address of the clients to properly identify resources.

Submitting this as an independent PR as it is generic enough and not
tied to any single processor or usecase.

This PR adds support to the OC, Zipkin and Jaeger GRPC receivers. I'll implement the
same feature for older jaeger receivers in a follow up PR.
2020-01-15 17:51:40 -05:00
Tigran Najaryan 91728bc8ce
Make component interfaces uniform (#488)
This change fixes inconsistencies in component interfaces. Motivation:

- Uniformness results in reduction of code that currently has to
  deal with differences.
- Processor.Start is missing and is important for allowing processors
  to communicate with the Host.

What's changed:

- Introduced Component interface.
- Unified Host interface.
- Added a Start function to processors (via Component interface).
- Start/Shutdown is now called for Processors from service start/shutdown.
- Receivers, Exporters, Processors, Extensions now embed Component interface.
- Replaced StartTraceReception/StartMetricsReception by single Start function for receivers.
- Replaced StopTraceReception/StopMetricsReception by single Shutdown function for receivers.

Note: before merging this we need to announce the change in Gitter since it
breaks existing implementations in contrib (although the fix is easy).

Resolves #477
Resolves #262
2020-01-10 08:49:34 -05:00
Owais Lone 2a71d35691 Allow supplying a custom HTTP server to the Zipkin receiver (#473)
This allows other to import and extend the zipkin receiver for different
use cases. For example, people can now wrap the server handler and add
HTTP middlewares to it.
2020-01-08 08:11:06 -08:00
Paulo Janotti 2b17b85abb
Improve batching for Zipkin V2 spans (#414)
* Improve batching for Zipkin spans

The local end point of zipkin typically includes the ip address and that can have a very high cardinality making batching inefficient since the batch processor groups according to the node configuration. This change stops storing this information on the node and put it on the span attributes. The zipkin exporter recognize the attributes and it is capable of returning local and remote endpoint of a span to its original values.

Fixed zipkin receiver TestConversionRoundtrip: the function testutils.GenerateNormalizedJSON was not checking for errors when marshaling/unmarshaling and the TestConversionRoundtrip was passing because both JSON objects were "null" what was not intended. This changes fixes the test and the helper function so similar doesn't repeat for other tests.

Since the dependency with zipkin exporter of OpenCensus was removed 'go mod tidy' was also executed for root and testbed.

* Do not change trace data when exporting to zipkin

This keeps the internal trace data unchanged. In order to avoid redundancy on zipkin spans the data that can be represented as local or remote zipkin endpoint is removed only from zipkin spans.

* Add few comments and explain a hard coded value on make

* Simplify attribute lookup

* Add zipkin Format to TestConversionRoundtrip
2019-11-09 09:34:48 -08:00
Tigran Najaryan dc6b290e3c
Rename all github paths from opentelemtry-service to opentelemetry-collector (#371)
This is part of renaming task: https://github.com/open-telemetry/opentelemetry-service/issues/352
2019-09-27 17:17:03 -04:00
Bogdan Drutu 6e695ba8fb
Update observability tags,views,measures names (#314) 2019-09-02 22:14:01 -07:00
Yang Song d069dc1cce Refactor common errors to oterr/constants.go (#239) 2019-08-08 13:37:41 -07:00
Paulo Janotti 100a230c5c
Remove memory limiting changes (#230)
* Remove memory limiting changes

We paused on that until further design conversations, in order to avoid confusion with this incomplete feature let's remove it from the code base.

* Recover test that covered more than back presssure

* gofmt config_test.go
2019-08-07 07:06:42 -07:00
Yang Song 79957ff63e Add static check and fix all errors (#218)
* Add static check

Fixes #155.

* Fix most staticcheck errors

* More fixes

* Fix id_batcher
2019-08-02 09:11:16 -07:00
Paulo Janotti 8721e3beaf
Change Zipkin receiver behavior according to host ingestion status (#148)
* Make Zipkin receiver respond to host ingestion status

This change makes the Zipkin receiver respond to received data according to the host status regarding ingestion.

* Nit cleanup

* Use better type to handle back pressure setting
2019-07-15 15:10:13 -07:00
Paulo Janotti 4c7c3ca571
Refactoring: remove old OC Collector code (#149)
* Refactoring: remove old OC Collector code

Initial phase of removal of old OC code that is still present on the repo.

* Rename package application to service
2019-07-11 14:43:30 -07:00
Bogdan Drutu e5d25031e9
Move data to consumerdata (#115) 2019-07-03 13:20:22 -07:00
Paulo Janotti 0156385dc1 Add receiver host: 1st part of Memory Limiting (#83)
Add Receiver Host Interface

This interface allows better communication between receivers and the code hosting them. This becomes important when the host needs to request receivers to stop ingestion due to limited resources.
2019-07-02 11:55:31 -04:00
Steve Flanders 559835ceee
Change census-instrumentation to open-telemetry and update authors (#20)
* Change census-instrumentation to open-telemetry and update authors

census-instrumentation/opencensus is now open-telemetry/opentelemetry

"OpenCensus Authors" is now "OpenTelemetry Authors"

"Copyright 2018" is now "Copyright 2019"

Fix go fmt
2019-06-18 14:22:28 -07:00
Paulo Janotti 92fed7faa5
Make all receivers take "next" on creation (#477)
* Make all receivers take "next" on creation

This is required in order to move the code to use factories for the receivers. The "next" parameter will be passed to the factory and then to the receiver constructor, this way Start[Trace|Metrics]Reception doesn't need the next parameter anymore. Since typically the Start* methods launch goroutines took the opportunity to add a channel to report asynchronous errors.

Opportunistic change: renamed WrapWithSpanSink and related variables.

Remaing items from previous commit

* Improve test coverage for zipkin-scribe

Improving code coverage for zipkin-scribe that went a tad down with the initial PR.

* Improve a little code coverage  zipkin receiver

* Fix test broken during rebase
2019-03-26 18:39:17 -07:00
Bogdan Drutu f4c55919d5
Remove processor to sink. (#497) 2019-03-14 13:33:20 -07:00
Bogdan Drutu 62b0ae5be7
Rename [Trace|Metrics]DataProcessor to [Trace|Metrics]Consumer, add TraceProcessor similar to receiver,exporter. (#473)
* Rename [Trace|Metrics]DataProcessor to [Trace|Metrics]Processor

* Rename TraceProcessor to TraceConsumer as discussed.

* Add empty_test for processor.
2019-03-05 17:36:22 -08:00
Bogdan Drutu 68cae62671
Add tests for [trace|span]_id conversion from ints, and change code t… (#468)
* Add tests for [trace|span]_id conversion from ints, and change code to use this.

* Add tests for the returned errors.

* Fix comments for public functions in big_endian_convertor.

* Fix typo.
2019-03-04 16:22:53 -08:00
Bogdan Drutu d62d215ea5
Move observability, add test helper for observability and record metrics in loggingexporter. (#459) 2019-03-02 14:09:36 -08:00
Bogdan Drutu 05bcd951ef
For receivers and exporters record number of received and dropped spans. (#442)
* For receivers and exporters record number of received and dropped spans.

* Shorter tag names, unify tags between metrics/trace.

* Record when errors, add TODOs for better handling errors.
2019-02-28 16:25:50 -08:00
Bogdan Drutu baec3ed48f
Add the source name to the receiver interface. (#435) 2019-02-26 10:34:35 -08:00
Bogdan Drutu c54ee82d39
Update collector code to use [Trace|Metrics]Data. (#431) 2019-02-24 17:02:22 -08:00