**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
This ensures backwards compatibility with the metrics generated via
opencensus by default today.
Part of #7454
Signed-off-by: Alex Boten <aboten@lightstep.com>
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>
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>
* [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>
* 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>
- Instrument batch processor with OpenTelemetry Go.
- Also fixed a small typo on the bucket definition of the batch_send_size_bytes view of OpenCensus.
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>
* 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>