Commit Graph

21 Commits

Author SHA1 Message Date
Pablo Baeyens 26c157e3bf
[component] Add MustNewType constructor for component.Type (#9414)
**Description:** 

- Adds `component.MustNewType` to create a type. This function panics if
the type has invalid characters. Add similar functions
`component.MustNewID` and `component.MustNewIDWithName`.
- Adds `component.Type.String` to recover the string
- Use `component.MustNewType`, `component.MustNewID`,
`component.MustNewIDWithName` and `component.Type.String` everywhere in
this codebase. To do this I changed `component.Type` into an opaque
struct and checked for compile-time errors.

Some notes:

1. All components currently on core and contrib follow this rule. This
is still breaking for other components.
2. A future PR will change this into a struct, to actually validate this
(right now you can just do `component.Type("anything")` to bypass
validation). I want to do this in two steps to avoid breaking contrib
tests: we first introduce this function, and after that we change into a
struct.

**Link to tracking Issue:** Updates #9208
2024-02-02 17:33:03 +01:00
Alex Boten 9c7177496f
[chore] remove unused opencensus code (#9108)
Follows
https://github.com/open-telemetry/opentelemetry-collector/pull/9102

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2024-01-30 10:19:42 -08:00
Alex Boten 834413537b
[telemetry] mark useOtelForInternalMetrics stable (#9102)
This marks the flag as stable. Leaving this as a draft until v0.92.0 is
released.

Closes https://github.com/open-telemetry/opentelemetry-collector/issues/8962
Fixes https://github.com/open-telemetry/opentelemetry-collector/issues/816

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2024-01-16 15:38:21 -08:00
Alex Boten 7f56849c0d
[service] remove _total suffix for otel generated metrics (#8965)
This ensures backwards compatibility with the metrics generated via
opencensus by default today.

Part of #7454

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-11-21 11:20:48 +01:00
Alex Boten 5c225d9c11
[chore] fix test message typo (#8761)
did "not" match

@jpkrohling found a few more typos in assertion failures

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-10-25 15:19:30 -07:00
Alex Boten 9549a14a31
deprecate processor API in obsreport (#8496)
These deprecated methods/structs have been moved to processorhelper:
- `obsreport.BuildProcessorCustomMetricName` ->
`processorhelper.BuildCustomMetricName`
  - `obsreport.Processor` -> `processorhelper.ObsReport`
  - `obsreport.ProcessorSettings` -> `processorhelper.ObsReportSettings`
  - `obsreport.NewProcessor` -> `processorhelper.NewObsReport`

Same as the change for the exporter, no functional changes just moving
code over to the
new location.

~Follows
https://github.com/open-telemetry/opentelemetry-collector/pull/8493~

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-09-20 16:51:35 -07:00
Alex Boten eaac340d0b
[chore] update otel go 1.17 (#8299)
Updating dependencies. Includes a workaround #8346, which causes the
collector to ignore instrument name errors returned from instantiating
instruments in otel.

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-09-08 09:29:31 -07:00
Alex Boten 80d704deb4
[chore] use license shortform (#7694)
* [chore] use license shortform

To remain consistent w/ contrib repo, see https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/22052

Signed-off-by: Alex Boten <aboten@lightstep.com>

* make goporto

Signed-off-by: Alex Boten <aboten@lightstep.com>

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-05-18 13:11:17 -07:00
my-git9 fc882832a9
Use http constants to replace numbers as parameters (#7216)
Signed-off-by: xin.li <xin.li@daocloud.io>
2023-02-20 09:38:36 -08:00
Bogdan Drutu 430fb80141
[chore] limit usage of the use otel feature gate, pass the bool directly to simplify usage (#6985)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2023-01-19 18:29:21 -08:00
Bogdan Drutu 76cf77605d
Remove deprecated funcs in obsereporttest and batchprocessor (#6861)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2023-01-04 08:05:30 -08:00
github-actions[bot] 40fcb05dee
[chore] dependabot updates Mon Dec 12 16:56:20 UTC 2022 (#6750)
* dependabot updates Mon Dec 12 16:56:19 UTC 2022
Bump github.com/klauspost/compress from 1.15.12 to 1.15.13
Bump github.com/prometheus/common from 0.37.0 to 0.38.0 in /processor/batchprocessor
Bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc from 0.36.4 to 0.37.0
Bump go.opentelemetry.io/contrib/zpages from 0.36.4 to 0.37.0 in /extension/zpagesextension
Bump go.opentelemetry.io/otel from 1.11.1 to 1.11.2
Bump go.opentelemetry.io/otel/exporters/prometheus from 0.33.0 to 0.34.0 in /processor/batchprocessor
Bump go.opentelemetry.io/otel/metric from 0.33.0 to 0.34.0
Bump go.opentelemetry.io/otel/metric from 0.33.0 to 0.34.0 in /component
Bump go.opentelemetry.io/otel/metric from 0.33.0 to 0.34.0 in /processor/batchprocessor
Bump go.opentelemetry.io/otel/sdk from 1.11.1 to 1.11.2 in /extension/zpagesextension
Bump go.opentelemetry.io/otel/sdk from 1.11.1 to 1.11.2 in /processor/batchprocessor
Bump go.opentelemetry.io/otel/sdk/metric from 0.33.0 to 0.34.0
Bump go.opentelemetry.io/otel/sdk/metric from 0.33.0 to 0.34.0 in /processor/batchprocessor
Bump go.opentelemetry.io/otel/trace from 1.11.1 to 1.11.2 in /component
Bump go.opentelemetry.io/otel/trace from 1.11.1 to 1.11.2 in /extension/zpagesextension
Bump golang.org/x/tools from 0.3.0 to 0.4.0 in /internal/tools

* [chore] fix deprecated calls (#6754)

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

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

* [chore] fix batchprocessor (#6755)

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

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

* [chore] fix lint (#6756)

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

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

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Co-authored-by: bogdandrutu <bogdandrutu@users.noreply.github.com>
Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-12-12 11:01:13 -08:00
Bogdan Drutu 9fc03727f5
Remove dependency on batchprocessor from service package (#6730)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-12-12 07:59:54 -08:00
Daniel Jaglowski fdef8b181a
Deprecate `Processor` related structs and functions in favor of `processor` package (#6709) 2022-12-09 08:09:27 -08:00
Bogdan Drutu d0fe772781
Deprecate component.Config.ID(), add helper for obsreporttest (#5870)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-11-29 14:35:49 -08:00
Gustavo Paiva 2da68656b8
Instrument `batch` processor with Otel Go (#6423)
- Instrument batch processor with OpenTelemetry Go.
- Also fixed a small typo on the bucket definition of the batch_send_size_bytes view of OpenCensus.
2022-11-16 15:08:28 -08:00
Bogdan Drutu e695e15f94
Remove level from all the MetricViews calls (#2149)
This is a preparation for enabling per component telemetry level:
* Views are global and they must always be installed; they are no-op if nobody records data;
* Views are global and they must always contain all the labels; In case of measurements being recorded without one of the labels (for perfomance reasons)
  the extra label defined does not have impact, because all the timeseries will have that label as "null" (missing).

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-11-16 23:11:27 -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
Bogdan Drutu e7e6693926
Expose telemetry level in the configtelemetry (#1796)
Next PR will add a config setting that can be embedded in every component config.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-09-18 16:11:27 -07:00
Jay Camp 1e65674799
Update copyright (#1597)
* Update copyright

* rebase
2020-08-19 18:25:44 -07:00
Pavol Loffay 815e760588
Add batch size bytes metric to batch processor (#1270)
* Add batch size bytes metrics

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* increase test coverage

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Fix metrics

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Fix test

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-07-22 11:14:25 -07:00