Commit Graph

13 Commits

Author SHA1 Message Date
Daniel Jaglowski ea7270caba
Add "inserted" metrics to processors (#10372)
#### Link to tracking issue

Resolves #10353

#### Testing

Added equivalent testing to other processor metrics (accepted, refused,
dropped).

#### Documentation

Metric documentation is autogenerated.

#### Open Question

My initial implementation includes a breaking change to
`componenttest.TestTelemetry` which is public facing API. If we want to
avoid an immediate breaking change in this test package, I would propose
the following, which I can submit in a prerequisite PR:
1. Deprecate all `TestTelemetry.Check*` methods.
2. Replace with more granular `TestTelemetry.CheckOneSpecificMetric`
methods.
2024-06-19 12:15:42 +02:00
Alex Boten 9907ba50df
[processor] deprecate CreateSettings -> Settings (#10336)
This deprecates CreateSettings in favour of Settings.
NewNopCreateSettings is also being deprecated in favour of
NewNopSettings
    
Part of #9428

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-06-06 09:34:53 -07:00
Alex Boten 860632715e
[processorhelper] use mdatagen level and noop meter (#10235)
This cleans up the need to have a level in the ObsReport struct. Added
test to validate the change as none existed before

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-05-30 08:15:59 -07:00
Alex Boten b53ba2c2f5
[chore] remove WithOTel test wrapper (#10236)
This is no longer needed since we're not testing WithOTel and
WithOpenCensus.

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-05-28 09:08:07 -07:00
Alex Boten bc879397bb
[telemetry] emit metrics with _ instead of / (#9775)
This is addressing an issue w/ the names of the metrics generated by the
Collector for its internal metrics. Note that this change only impacts
users that emit telemetry using OTLP, which is currently still in
experimental support. The prometheus metrics already replaced `/` with
`_`.

Fixes #9774

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-04-03 14:42:27 -07:00
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 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 83d463ceba
[obsreport] deprecate test funcs/structs (#8538)
This deprecates the remaining code under the obsreport package.

Follows
bf141227c5

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2024-01-12 09:28:57 -08:00
Alex Boten a158ff3cfc
make useOtelForInternalMetrics as beta (#9037)
The metrics are now consistent with the metrics produced by OpenCensus.
We should move the featuregate forward.

Note that the OpenTelemetry generated metrics includes grpc
client/server metrics (for receivers/exporters that use grpc) and
`target_info` metrics

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

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-12-12 13:59:41 -08:00
Alex Boten 420930365a
[obsreporttest] ensure tests validate either oc or otel (#8758)
This change adds a separate prometheus registry for testing the otel vs
the oc path through the code. Previous to this change, the
otelPrometheusChecker was using the opencensus prometheus exporter which
was really confusing and could possibly hide problems.

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-10-25 13:37:10 -07:00
Alex Boten 2f72949334
remove NewCreateSettings funcs (#8508)
follow up on #8501. As per the suggestion, the code in NewCreateSettings
is pretty small and not needed as a separate function.

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-09-25 09:12:42 -07:00
Alex Boten 921b6125f0
deprecate To*CreateSettings methods in `obsreporttest.TestTelemetry` (#8501)
These methods create an import cycle when trying to move obsreporttest
to
componenttest. Deprecating these methods will allow us to remove them in
the next version and move the remaining code into componenttest

Fixes #8492

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-09-22 10:51:19 -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